[PATCH 02/11] wined3d: Move WINED3DFMT_FLAG_INTEGER to the base flags group.
Chip Davis
wine at gitlab.winehq.org
Mon May 16 20:26:46 CDT 2022
From: Chip Davis <cdavis5x at gmail.com>
---
dlls/wined3d/context_gl.c | 4 +++-
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/utils.c | 6 +++---
dlls/wined3d/view.c | 2 +-
dlls/wined3d/wined3d_private.h | 2 +-
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 0a731dc85f0..004a293a715 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_base_flags = format_gl->f.base_flags;
bo = wined3d_bo_gl_id(element->data.buffer_object);
if (current_bo != bo)
@@ -5746,7 +5747,8 @@ 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_base_flags & WINED3DFMT_FLAG_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 595baf07788..8e1aa6b1ad9 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -6652,7 +6652,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_base_flags & WINED3DFMT_FLAG_INTEGER)
{
c->int32[0] = colour->r;
c->int32[1] = colour->g;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 6f3a8ba3413..0fcabd59e64 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;
+ base_flags |= WINED3DFMT_FLAG_INTEGER;
if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT)
base_flags |= WINED3DFMT_FLAG_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.base_flags & WINED3DFMT_FLAG_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.base_flags & WINED3DFMT_FLAG_INTEGER))
continue;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 3866f3b4ebe..2cdd49e8b5a 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -1561,7 +1561,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_base_flags & WINED3DFMT_FLAG_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 ffad3b82b90..e5d1f93692f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -6107,6 +6107,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
/* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_FLOAT 0x00000001
+#define WINED3DFMT_FLAG_INTEGER 0x00000002
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001
#define WINED3DFMT_FLAG_FILTERING 0x00000002
@@ -6128,7 +6129,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
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/79
More information about the wine-devel
mailing list