Chip Davis : wined3d: Move WINED3DFMT_FLAG_INTEGER to the attributes group.

Alexandre Julliard julliard at winehq.org
Tue May 24 15:55:01 CDT 2022


Module: wine
Branch: master
Commit: b4efd57854dd67b612c1dabdd12c92e9b806412f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b4efd57854dd67b612c1dabdd12c92e9b806412f

Author: Chip Davis <cdavis5x at gmail.com>
Date:   Sun May  8 16:37:15 2022 -0500

wined3d: Move WINED3DFMT_FLAG_INTEGER to the attributes group.

Signed-off-by: Chip Davis <cdavis5x at gmail.com>

---

 dlls/wined3d/context_gl.c      | 3 ++-
 dlls/wined3d/texture.c         | 2 +-
 dlls/wined3d/utils.c           | 6 +++---
 dlls/wined3d/view.c            | 2 +-
 dlls/wined3d/wined3d_private.h | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 0a731dc85f0..95817b74b14 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -5734,6 +5734,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
         if (element->stride)
         {
             DWORD format_flags = format_gl->f.flags[WINED3D_GL_RES_TYPE_BUFFER];
+            unsigned int format_attrs = format_gl->f.attrs;
 
             bo = wined3d_bo_gl_id(element->data.buffer_object);
             if (current_bo != bo)
@@ -5746,7 +5747,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
              * pointer. vb can point to a user pointer data blob. In that case
              * current_bo will be 0. If there is a vertex buffer but no vbo we
              * won't be load converted attributes anyway. */
-            if (vs && vs->reg_maps.shader_version.major >= 4 && (format_flags & WINED3DFMT_FLAG_INTEGER))
+            if (vs && vs->reg_maps.shader_version.major >= 4 && (format_attrs & WINED3D_FORMAT_ATTR_INTEGER))
             {
                 GL_EXTCALL(glVertexAttribIPointer(i, format_gl->vtx_format,
                         format_gl->vtx_type, element->stride, offset));
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c952f366a68..b3c7d2a9106 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -6655,7 +6655,7 @@ static void vk_blitter_clear_rendertargets(struct wined3d_context_vk *context_vk
         wined3d_rendertarget_view_vk_barrier(rtv_vk, context_vk, WINED3D_BIND_RENDER_TARGET);
 
         c = &clear_values[attachment_count].color;
-        if (view->format_flags & WINED3DFMT_FLAG_INTEGER)
+        if (view->format_attrs & WINED3D_FORMAT_ATTR_INTEGER)
         {
             c->int32[0] = colour->r;
             c->int32[1] = colour->g;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index bd909fec6b8..c7ff807d366 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2117,7 +2117,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
             if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM)
                 flags |= WINED3DFMT_FLAG_NORMALISED;
             if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT)
-                flags |= WINED3DFMT_FLAG_INTEGER;
+                attrs |= WINED3D_FORMAT_ATTR_INTEGER;
             if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT)
                 attrs |= WINED3D_FORMAT_ATTR_FLOAT;
             if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED)
@@ -2598,7 +2598,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
         if (status == GL_FRAMEBUFFER_COMPLETE
                 && ((format->f.flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)
                 || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING))
-                && !(format->f.flags[type] & WINED3DFMT_FLAG_INTEGER)
+                && !(format->f.attrs & WINED3D_FORMAT_ATTR_INTEGER)
                 && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT
                 && format->format != GL_LUMINANCE && format->format != GL_LUMINANCE_ALPHA
                 && (format->f.red_size || format->f.alpha_size))
@@ -3214,7 +3214,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
 
         /* ARB_texture_rg defines integer formats if EXT_texture_integer is also supported. */
         if (!gl_info->supported[EXT_TEXTURE_INTEGER]
-                && (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_INTEGER))
+                && (format->f.attrs & WINED3D_FORMAT_ATTR_INTEGER))
             continue;
 
         if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 8ef22ba1999..0874bd506ce 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1571,7 +1571,7 @@ void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view
             packed = wined3d_format_pack(&format_gl->f, clear_value);
             data = &packed;
         }
-        else if (resource->format_flags & WINED3DFMT_FLAG_INTEGER)
+        else if (resource->format_attrs & WINED3D_FORMAT_ATTR_INTEGER)
         {
             gl_format = GL_RGBA_INTEGER;
             gl_type = GL_UNSIGNED_INT;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 596e6c5b1f3..b44997cfce4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -6109,6 +6109,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
 
 /* Pixel format attributes */
 #define WINED3D_FORMAT_ATTR_FLOAT                   0x00000001
+#define WINED3D_FORMAT_ATTR_INTEGER                 0x00000002
 
 /* WineD3D pixel format flags */
 #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING    0x00000001
@@ -6131,7 +6132,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
 #define WINED3DFMT_FLAG_HEIGHT_SCALE                0x00040000
 #define WINED3DFMT_FLAG_TEXTURE                     0x00080000
 #define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY            0x00100000
-#define WINED3DFMT_FLAG_INTEGER                     0x00200000
 #define WINED3DFMT_FLAG_GEN_MIPMAP                  0x00400000
 #define WINED3DFMT_FLAG_NORMALISED                  0x00800000
 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE            0x01000000




More information about the wine-cvs mailing list