There are only three unused format flags left. I will soon submit changes which add four more format flags.
I've noticed that format flags generally fall into two groups:
* The first group consists of flags describing the content of a pixel format, e.g. whether or not this is a depth format, or whether this is a blocked format. These flags are the same for all resource types. * The second group consists of flags describing capabilities of the implementation with this format. These can and do vary by resource type.
Only the second group needs to be stored per-resource-type.
-- v7: wined3d: Rename format flags to caps. wined3d: Move WINED3DFMT_FLAG_CAST_TO_BLOCK to the attributes group. wined3d: Move WINED3DFMT_FLAG_MAPPABLE to the attributes group. wined3d: Move WINED3DFMT_FLAG_COMPRESSED and HEIGHT_SCALE to the attributes group. wined3d: Move WINED3DFMT_FLAG_BLOCKS, BROKEN_PITCH, and BLOCKS_NO_VERIFY to the attributes group. wined3d: Move WINED3DFMT_FLAG_EXTENSION to the attributes group. wined3d: Move WINED3DFMT_FLAG_BUMPMAP to the attributes group. wined3d: Move WINED3DFMT_FLAG_NORMALISED to the attributes group. wined3d: Move WINED3DFMT_FLAG_INTEGER to the attributes group. wined3d: Move WINED3DFMT_FLAG_FLOAT to a separate group.
From: Chip Davis cdavis5x@gmail.com
There are only three unused format flags left. I will soon submit changes which add four more format flags.
I've noticed that format flags generally fall into two groups:
* The first group consists of flags describing the content of a pixel format, e.g. whether or not this is a depth format, or whether this is a blocked format. These flags are the same for all resource types. * The second group consists of flags describing capabilities of the implementation with this format. These can and do vary by resource type.
Only the second group needs to be stored per-resource-type.
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/adapter_gl.c | 4 +- dlls/wined3d/device.c | 3 +- dlls/wined3d/resource.c | 1 + dlls/wined3d/utils.c | 106 +++++++++++++++++---------------- dlls/wined3d/view.c | 1 + dlls/wined3d/wined3d_private.h | 7 ++- 6 files changed, 68 insertions(+), 54 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index d72c43e48b8..0d9f6953de3 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -4474,7 +4474,7 @@ static BOOL wined3d_check_pixel_format_color(const struct wined3d_pixel_format * const struct wined3d_format *format) { /* Float formats need FBOs. If FBOs are used this function isn't called */ - if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) + if (format->attrs & WINED3D_FORMAT_ATTR_FLOAT) return FALSE;
/* Probably a RGBA_float or color index mode. */ @@ -4496,7 +4496,7 @@ static BOOL wined3d_check_pixel_format_depth(const struct wined3d_pixel_format * BOOL lockable = FALSE;
/* Float formats need FBOs. If FBOs are used this function isn't called */ - if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) + if (format->attrs & WINED3D_FORMAT_ATTR_FLOAT) return FALSE;
if ((format->id == WINED3DFMT_D16_LOCKABLE) || (format->id == WINED3DFMT_D32_FLOAT)) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d39634c49fc..a7227f4f444 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5120,7 +5120,8 @@ void CDECL wined3d_device_context_clear_uav_float(struct wined3d_device_context { TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_vec4(clear_value));
- if (!(view->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED))) + if (!((view->format->attrs & WINED3D_FORMAT_ATTR_FLOAT) || + (view->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_NORMALISED))) { WARN("Not supported for view format %s.\n", debug_d3dformat(view->format->id)); return; diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 7fefd516908..7feaec04676 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -188,6 +188,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->type = type; resource->gl_type = gl_type; resource->format = format; + resource->format_attrs = format->attrs; if (gl_type < WINED3D_GL_RES_TYPE_COUNT) resource->format_flags = format->flags[gl_type]; resource->multisample_type = multisample_type; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 088a904ffeb..bd909fec6b8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -306,7 +306,8 @@ static const struct wined3d_format_ddi_info ddi_formats[] = struct wined3d_format_base_flags { enum wined3d_format_id id; - DWORD flags; + unsigned int attrs; + unsigned int flags; };
/* The ATI2N format behaves like an uncompressed format in LockRect(), but @@ -314,48 +315,48 @@ struct wined3d_format_base_flags * resource size. */ static const struct wined3d_format_base_flags format_base_flags[] = { - {WINED3DFMT_ATI1N, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, - {WINED3DFMT_ATI2N, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, - {WINED3DFMT_D16_LOCKABLE, WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_INTZ, WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_R11G11B10_FLOAT, WINED3DFMT_FLAG_FLOAT}, - {WINED3DFMT_D32_FLOAT, WINED3DFMT_FLAG_FLOAT}, - {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3DFMT_FLAG_FLOAT}, - {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3DFMT_FLAG_FLOAT}, - {WINED3DFMT_INST, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_NULL, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_NVDB, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_ATOC, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_RESZ, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_R32G32B32A32_TYPELESS, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_FLOAT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_TYPELESS, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_FLOAT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UNORM, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SNORM, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_TYPELESS, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_FLOAT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_TYPELESS, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_FLOAT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_UINT, WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_R32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16_UINT, WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_A8_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B10G10R10A2_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B2G3R3_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B4G4R4A4_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B4G4R4X4_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G5R5A1_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G5R5X1_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G6R5_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B8G8R8_UNORM, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_R10G10B10A2_UNORM, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_ATI1N, 0, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, + {WINED3DFMT_ATI2N, 0, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, + {WINED3DFMT_D16_LOCKABLE, 0, WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_INTZ, 0, WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_R11G11B10_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, + {WINED3DFMT_D32_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, + {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, + {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3D_FORMAT_ATTR_FLOAT}, + {WINED3DFMT_INST, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_NULL, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_NVDB, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_ATOC, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_RESZ, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_R32G32B32A32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UNORM, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SNORM, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_R32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16_UINT, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_A8_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B10G10R10A2_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B2G3R3_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B4G4R4A4_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B4G4R4X4_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B5G5R5A1_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B5G5R5X1_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B5G6R5_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_B8G8R8_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_R10G10B10A2_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, };
static void rgb888_from_rgb565(WORD rgb565, BYTE *r, BYTE *g, BYTE *b) @@ -2081,8 +2082,8 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { struct wined3d_format *typeless_format; + unsigned int flags = 0, attrs = 0; unsigned int component_count = 0; - DWORD flags = 0;
if (!(format = get_format_internal(adapter, typed_formats[i].id))) return FALSE; @@ -2118,7 +2119,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) flags |= WINED3DFMT_FLAG_INTEGER; if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) - flags |= WINED3DFMT_FLAG_FLOAT; + attrs |= WINED3D_FORMAT_ATTR_FLOAT; if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) ++component_count;
@@ -2136,6 +2137,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) }
format->component_count = component_count; + format->attrs |= attrs; format_set_flag(format, flags); }
@@ -2152,6 +2154,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, format_base_flags[i].id))) return FALSE;
+ format->attrs |= format_base_flags[i].attrs; format_set_flag(format, format_base_flags[i].flags); }
@@ -3206,7 +3209,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win /* ARB_texture_rg defines floating point formats, but only if * ARB_texture_float is also supported. */ if (!gl_info->supported[ARB_TEXTURE_FLOAT] - && (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT)) + && (format->f.attrs & WINED3D_FORMAT_ATTR_FLOAT)) continue;
/* ARB_texture_rg defines integer formats if EXT_texture_integer is also supported. */ @@ -3800,7 +3803,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) { unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; - unsigned int i, j; + unsigned int attrs, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { @@ -3811,8 +3814,10 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) if (!(typeless_format = get_format_internal(adapter, typed_formats[i].typeless_id))) return FALSE;
+ attrs = typeless_format->attrs; memcpy(flags, typeless_format->flags, sizeof(flags)); copy_format(adapter, typeless_format, format); + typeless_format->attrs |= attrs; for (j = 0; j < ARRAY_SIZE(typeless_format->flags); ++j) typeless_format->flags[j] |= flags[j]; } @@ -3831,6 +3836,7 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) typeless_ds_format = get_format_by_idx(adapter, WINED3D_FORMAT_COUNT + i); typeless_ds_format->id = typeless_depth_stencil_formats[i].typeless_id; copy_format(adapter, typeless_ds_format, ds_format); + typeless_ds_format->attrs = typeless_format->attrs; for (j = 0; j < ARRAY_SIZE(typeless_ds_format->flags); ++j) { typeless_ds_format->flags[j] = typeless_format->flags[j]; @@ -4134,7 +4140,7 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter, /* The single-precision binary floating-point format has * a significand precision of 24 bits. */ - if (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) + if (format->f.attrs & WINED3D_FORMAT_ATTR_FLOAT) format->f.depth_bias_scale /= 1u << 24; else format->f.depth_bias_scale /= 1u << format->f.depth_size; @@ -6133,7 +6139,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, }
/* 32 bit float formats. We don't handle D32_FLOAT and D32_FLOAT_S8X24_UINT for now. */ - if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) && format->red_size == 32) + if ((format->attrs & WINED3D_FORMAT_ATTR_FLOAT) && format->red_size == 32) { float *ret_f = ret;
@@ -6153,7 +6159,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; }
- if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) && format->red_size == 16) + if ((format->attrs & WINED3D_FORMAT_ATTR_FLOAT) && format->red_size == 16) { uint16_t *ret_s = ret;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index c502fcba992..8ef22ba1999 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -622,6 +622,7 @@ static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view * } if (!(view->format = validate_resource_view(desc, resource, TRUE, allow_srgb_toggle))) return E_INVALIDARG; + view->format_attrs = view->format->attrs; view->format_flags = view->format->flags[resource->gl_type]; view->desc = *desc;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4d208260fbf..596e6c5b1f3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4353,6 +4353,7 @@ struct wined3d_resource enum wined3d_resource_type type; enum wined3d_gl_resource_type gl_type; const struct wined3d_format *format; + unsigned int format_attrs; unsigned int format_flags; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -5339,6 +5340,7 @@ struct wined3d_rendertarget_view const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format; + unsigned int format_attrs; unsigned int format_flags; unsigned int sub_resource_idx; unsigned int layer_count; @@ -6105,6 +6107,9 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN * Pixel format management */
+/* Pixel format attributes */ +#define WINED3D_FORMAT_ATTR_FLOAT 0x00000001 + /* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6115,7 +6120,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 #define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 #define WINED3DFMT_FLAG_DECOMPRESS 0x00000100 -#define WINED3DFMT_FLAG_FLOAT 0x00000200 #define WINED3DFMT_FLAG_BUMPMAP 0x00000400 #define WINED3DFMT_FLAG_SRGB_READ 0x00000800 #define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 @@ -6188,6 +6192,7 @@ struct wined3d_format
UINT conv_byte_count; DWORD multisample_types; + unsigned int attrs; unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; float depth_bias_scale; struct wined3d_rational height_scale;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115390
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@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
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115391
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 Task: Patch failed to apply
This merge request was approved by Alexandre Julliard.
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/context_gl.c | 3 +-- dlls/wined3d/device.c | 3 +-- dlls/wined3d/utils.c | 27 +++++++++++++-------------- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 95817b74b14..628b3ffe145 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -5733,7 +5733,6 @@ 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); @@ -5755,7 +5754,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c else { GL_EXTCALL(glVertexAttribPointer(i, format_gl->vtx_format, format_gl->vtx_type, - !!(format_flags & WINED3DFMT_FLAG_NORMALISED), element->stride, offset)); + !!(format_attrs & WINED3D_FORMAT_ATTR_NORMALISED), element->stride, offset)); }
if (!(context->numbered_array_mask & (1u << i))) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a7227f4f444..baf30fa86ba 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5120,8 +5120,7 @@ void CDECL wined3d_device_context_clear_uav_float(struct wined3d_device_context { TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_vec4(clear_value));
- if (!((view->format->attrs & WINED3D_FORMAT_ATTR_FLOAT) || - (view->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_NORMALISED))) + if (!(view->format->attrs & (WINED3D_FORMAT_ATTR_FLOAT | WINED3D_FORMAT_ATTR_NORMALISED))) { WARN("Not supported for view format %s.\n", debug_d3dformat(view->format->id)); return; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index c7ff807d366..39010ab5269 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -347,16 +347,16 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_R32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_R32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_A8_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B10G10R10A2_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B2G3R3_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B4G4R4A4_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B4G4R4X4_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G5R5A1_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G5R5X1_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B5G6R5_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_B8G8R8_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, - {WINED3DFMT_R10G10B10A2_UNORM, 0, WINED3DFMT_FLAG_NORMALISED}, + {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B10G10R10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B2G3R3_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B4G4R4A4_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B4G4R4X4_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B5G5R5A1_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B5G5R5X1_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B5G6R5_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_B8G8R8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_R10G10B10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, };
static void rgb888_from_rgb565(WORD rgb565, BYTE *r, BYTE *g, BYTE *b) @@ -2082,8 +2082,8 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { struct wined3d_format *typeless_format; - unsigned int flags = 0, attrs = 0; unsigned int component_count = 0; + unsigned int attrs = 0;
if (!(format = get_format_internal(adapter, typed_formats[i].id))) return FALSE; @@ -2115,7 +2115,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) enum wined3d_channel_type channel_type = map_channel_type(typed_formats[i].channels[j]);
if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM) - flags |= WINED3DFMT_FLAG_NORMALISED; + attrs |= WINED3D_FORMAT_ATTR_NORMALISED; if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) attrs |= WINED3D_FORMAT_ATTR_INTEGER; if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) @@ -2138,7 +2138,6 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
format->component_count = component_count; format->attrs |= attrs; - format_set_flag(format, flags); }
for (i = 0; i < ARRAY_SIZE(ddi_formats); ++i) @@ -6117,7 +6116,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; }
- if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_NORMALISED) + if (format->attrs & WINED3D_FORMAT_ATTR_NORMALISED) { uint32_t *ret_i = ret;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b44997cfce4..9f03f0a3925 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6110,6 +6110,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 +#define WINED3D_FORMAT_ATTR_NORMALISED 0x00000004
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6133,7 +6134,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_TEXTURE 0x00080000 #define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00100000 #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 -#define WINED3DFMT_FLAG_NORMALISED 0x00800000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 #define WINED3DFMT_FLAG_BLIT 0x02000000 #define WINED3DFMT_FLAG_MAPPABLE 0x04000000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115392
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Move initialization of the flag itself to `wined3d_format_base_flags`.
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/directx.c | 11 +++++++-- dlls/wined3d/utils.c | 44 +++++++++++++++------------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index fb588b88098..f315d590607 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1923,9 +1923,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, { const struct wined3d_format *adapter_format, *format; enum wined3d_gl_resource_type gl_type, gl_type_end; + unsigned int format_flags = 0, format_attrs = 0; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; - DWORD format_flags = 0; DWORD allowed_usage;
TRACE("wined3d %p, adapter %p, device_type %s, adapter_format %s, usage %s, " @@ -2074,7 +2074,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) format_flags |= WINED3DFMT_FLAG_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) - format_flags |= WINED3DFMT_FLAG_BUMPMAP; + format_attrs |= WINED3D_FORMAT_ATTR_BUMPMAP;
if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { @@ -2082,6 +2082,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
+ if ((format->attrs & format_attrs) != format_attrs) + { + TRACE("Requested format attributes %#x, but format %s only has %#x.\n", + format_attrs, debug_d3dformat(check_format_id), format->attrs); + return WINED3DERR_NOTAVAILABLE; + } + for (; gl_type <= gl_type_end; ++gl_type) { if ((bind_flags & WINED3D_BIND_RENDER_TARGET) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 39010ab5269..9783b464d06 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -357,6 +357,11 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_B5G6R5_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B8G8R8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_R10G10B10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, + {WINED3DFMT_R8G8_SNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, + {WINED3DFMT_R5G5_SNORM_L6_UNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, + {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, + {WINED3DFMT_R8G8B8A8_SNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, + {WINED3DFMT_R16G16_SNORM, WINED3D_FORMAT_ATTR_BUMPMAP}, };
static void rgb888_from_rgb565(WORD rgb565, BYTE *r, BYTE *g, BYTE *b) @@ -1751,73 +1756,62 @@ static const struct wined3d_format_texture_info format_texture_info[] = /* Bump mapping stuff */ {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm}, {WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0, GL_DSDT_NV, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, 0, GL_RG, GL_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_BUMPMAP, + | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r5g5_snorm_l6_unorm}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0, GL_DSDT_MAG_NV, GL_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, NV_TEXTURE_SHADER, convert_r5g5_snorm_l6_unorm_nv}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB8_SNORM, GL_RGB8_SNORM, 0, GL_RGBA, GL_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, EXT_TEXTURE_SNORM, convert_r5g5_snorm_l6_unorm_ext}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm_l8x8_unorm}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0, GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, NV_TEXTURE_SHADER, convert_r8g8_snorm_l8x8_unorm_nv}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0, GL_BGRA, GL_UNSIGNED_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8b8a8_snorm}, {WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0, GL_RGBA, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, 0, GL_RGBA, GL_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_BUMPMAP, + | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RGB16, GL_RGB16, 0, GL_BGR, GL_UNSIGNED_SHORT, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16_snorm}, {WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0, GL_HILO_NV, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_BUMPMAP, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RG16_SNORM, GL_RG16_SNORM, 0, GL_RG, GL_SHORT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_BUMPMAP, + | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16B16A16_SNORM, GL_RGBA16_SNORM, GL_RGBA16_SNORM, 0, GL_RGBA, GL_SHORT, 0, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9f03f0a3925..55ad4adf2f4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6111,6 +6111,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_FLOAT 0x00000001 #define WINED3D_FORMAT_ATTR_INTEGER 0x00000002 #define WINED3D_FORMAT_ATTR_NORMALISED 0x00000004 +#define WINED3D_FORMAT_ATTR_BUMPMAP 0x00000008
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6122,7 +6123,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 #define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 #define WINED3DFMT_FLAG_DECOMPRESS 0x00000100 -#define WINED3DFMT_FLAG_BUMPMAP 0x00000400 #define WINED3DFMT_FLAG_SRGB_READ 0x00000800 #define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 #define WINED3DFMT_FLAG_VTF 0x00002000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115393
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/directx.c | 4 ++-- dlls/wined3d/utils.c | 10 +++++----- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index f315d590607..c0e722c3bc0 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1901,8 +1901,8 @@ static BOOL wined3d_check_surface_format(const struct wined3d_format *format) if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] | format->flags[WINED3D_GL_RES_TYPE_RB]) & WINED3DFMT_FLAG_BLIT) return TRUE;
- if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_EXTENSION | WINED3DFMT_FLAG_TEXTURE)) - == (WINED3DFMT_FLAG_EXTENSION | WINED3DFMT_FLAG_TEXTURE)) + if ((format->attrs & WINED3D_FORMAT_ATTR_EXTENSION) + && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) return TRUE;
return FALSE; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9783b464d06..085e4947f22 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -323,11 +323,11 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_D32_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3D_FORMAT_ATTR_FLOAT}, - {WINED3DFMT_INST, 0, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_NULL, 0, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_NVDB, 0, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_ATOC, 0, WINED3DFMT_FLAG_EXTENSION}, - {WINED3DFMT_RESZ, 0, WINED3DFMT_FLAG_EXTENSION}, + {WINED3DFMT_INST, WINED3D_FORMAT_ATTR_EXTENSION}, + {WINED3DFMT_NULL, WINED3D_FORMAT_ATTR_EXTENSION}, + {WINED3DFMT_NVDB, WINED3D_FORMAT_ATTR_EXTENSION}, + {WINED3DFMT_ATOC, WINED3D_FORMAT_ATTR_EXTENSION}, + {WINED3DFMT_RESZ, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_R32G32B32A32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R32G32B32A32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R32G32B32A32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 55ad4adf2f4..81d4ec919e9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6112,6 +6112,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_INTEGER 0x00000002 #define WINED3D_FORMAT_ATTR_NORMALISED 0x00000004 #define WINED3D_FORMAT_ATTR_BUMPMAP 0x00000008 +#define WINED3D_FORMAT_ATTR_EXTENSION 0x00000010
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6119,7 +6120,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_UNORDERED_ACCESS 0x00000004 #define WINED3DFMT_FLAG_DEPTH_STENCIL 0x00000008 #define WINED3DFMT_FLAG_RENDERTARGET 0x00000010 -#define WINED3DFMT_FLAG_EXTENSION 0x00000020 #define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 #define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 #define WINED3DFMT_FLAG_DECOMPRESS 0x00000100
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115394
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/device.c | 7 +- dlls/wined3d/resource.c | 9 +-- dlls/wined3d/surface.c | 11 ++-- dlls/wined3d/texture.c | 8 +-- dlls/wined3d/utils.c | 115 ++++++++++++++++++++------------- dlls/wined3d/wined3d_private.h | 6 +- 6 files changed, 93 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index baf30fa86ba..72c5167131a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4722,11 +4722,11 @@ static bool resources_format_compatible(const struct wined3d_resource *src_resou return true; if (src_resource->device->cs->c.state->feature_level < WINED3D_FEATURE_LEVEL_10_1) return false; - if ((src_resource->format_flags & WINED3DFMT_FLAG_BLOCKS) + if ((src_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) && (dst_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) return src_resource->format->block_byte_count == dst_resource->format->byte_count; if ((src_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) - && (dst_resource->format_flags & WINED3DFMT_FLAG_BLOCKS)) + && (dst_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; } @@ -5222,7 +5222,8 @@ HRESULT CDECL wined3d_device_context_map(struct wined3d_device_context *context, if (resource->type != WINED3D_RTYPE_BUFFER && resource->type != WINED3D_RTYPE_TEXTURE_2D) return WINED3DERR_INVALIDCALL;
- if ((resource->format_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) + if ((resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) && + !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) return WINED3DERR_INVALIDCALL; }
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 7feaec04676..4ad8745f109 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -174,8 +174,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * }
if (base_type != WINED3D_GL_RES_TYPE_COUNT - && (format->flags[base_type] & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) - == WINED3DFMT_FLAG_BLOCKS) + && (format->attrs & (WINED3D_FORMAT_ATTR_BLOCKS | WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY)) + == WINED3D_FORMAT_ATTR_BLOCKS) { UINT width_mask = format->block_width - 1; UINT height_mask = format->block_height - 1; @@ -520,7 +520,7 @@ HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, return WINEDDERR_INVALIDRECT; }
- if (resource->format_flags & WINED3DFMT_FLAG_BLOCKS) + if (resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) { /* This assumes power of two block sizes, but NPOT block sizes would * be silly anyway. @@ -597,7 +597,8 @@ void *resource_offset_map_pointer(struct wined3d_resource *resource, unsigned in
wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
- if ((resource->format_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + if ((resource->format_attrs & (WINED3D_FORMAT_ATTR_BLOCKS | WINED3D_FORMAT_ATTR_BROKEN_PITCH)) + == WINED3D_FORMAT_ATTR_BLOCKS) { /* Compressed textures are block based, so calculate the offset of * the block that contains the top-left pixel of the mapped box. */ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 29bdef9844f..747a25d5fe5 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -652,6 +652,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int const struct wined3d_format *src_format, *dst_format; struct wined3d_texture *converted_texture = NULL; struct wined3d_bo_address src_data, dst_data; + unsigned int src_fmt_attrs, dst_fmt_attrs; unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_map_desc dst_map, src_map; unsigned int x, sx, xinc, y, sy, yinc; @@ -707,12 +708,12 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int else { same_sub_resource = FALSE; - upload = dst_format->flags[dst_texture->resource.gl_type] & WINED3DFMT_FLAG_BLOCKS + upload = dst_format->attrs & WINED3D_FORMAT_ATTR_BLOCKS && (dst_width != src_width || dst_height != src_height);
if (upload) { - dst_format = src_format->flags[dst_texture->resource.gl_type] & WINED3DFMT_FLAG_BLOCKS + dst_format = src_format->attrs & WINED3D_FORMAT_ATTR_BLOCKS ? wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, 0) : src_format; }
@@ -759,7 +760,9 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int dst_texture->sub_resources[dst_sub_resource_idx].size, WINED3D_MAP_WRITE); } } + src_fmt_attrs = src_format->attrs; src_fmt_flags = src_format->flags[src_texture->resource.gl_type]; + dst_fmt_attrs = dst_format->attrs; dst_fmt_flags = dst_format->flags[dst_texture->resource.gl_type]; flags &= ~WINED3D_BLT_RAW;
@@ -773,7 +776,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int + ((dst_box->top / dst_format->block_height) * dst_map.row_pitch) + ((dst_box->left / dst_format->block_width) * dst_format->block_byte_count);
- if (src_fmt_flags & dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) + if (src_fmt_attrs & dst_fmt_attrs & WINED3D_FORMAT_ATTR_BLOCKS) { TRACE("%s -> %s copy.\n", debug_d3dformat(src_format->id), debug_d3dformat(dst_format->id));
@@ -1188,7 +1191,7 @@ static void surface_cpu_blt_colour_fill(struct wined3d_rendertarget_view *view,
TRACE("view %p, box %s, colour %s.\n", view, debug_box(box), debug_color(colour));
- if (view->format_flags & WINED3DFMT_FLAG_BLOCKS) + if (view->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) { FIXME("Not implemented for format %s.\n", debug_d3dformat(view->format->id)); return; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index b3c7d2a9106..9a80f54cf96 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2537,7 +2537,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
bo.buffer_object = src_bo_addr->buffer_object; bo.addr = (BYTE *)src_bo_addr->addr + src_box->front * src_slice_pitch; - if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) { bo.addr += (src_box->top / src_format->block_height) * src_row_pitch; bo.addr += (src_box->left / src_format->block_width) * src_format->block_byte_count; @@ -2573,7 +2573,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, } else { - if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) ERR("Converting a block-based format.\n");
f = *wined3d_format_gl(src_format); @@ -3635,7 +3635,7 @@ static void texture_resource_sub_resource_get_map_pitch(struct wined3d_resource const struct wined3d_texture *texture = texture_from_resource(resource); unsigned int level = sub_resource_idx % texture->level_count;
- if (resource->format_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (resource->format_attrs & WINED3D_FORMAT_ATTR_BROKEN_PITCH) { *row_pitch = wined3d_texture_get_level_width(texture, level) * resource->format->byte_count; *slice_pitch = wined3d_texture_get_level_height(texture, level) * (*row_pitch); @@ -3927,7 +3927,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc * compressed block. It is questionable how useful these mip-levels are to * the application with "broken pitch" formats, but we want to avoid * memory corruption when loading textures into WINED3D_LOCATION_SYSMEM. */ - if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->attrs & WINED3D_FORMAT_ATTR_BROKEN_PITCH) { unsigned int min_size;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 085e4947f22..50ccde057f0 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -315,10 +315,14 @@ struct wined3d_format_base_flags * resource size. */ static const struct wined3d_format_base_flags format_base_flags[] = { - {WINED3DFMT_ATI1N, 0, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, - {WINED3DFMT_ATI2N, 0, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH}, - {WINED3DFMT_D16_LOCKABLE, 0, WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_INTZ, 0, WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_ATI1N, WINED3D_FORMAT_ATTR_BROKEN_PITCH, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_ATI2N, WINED3D_FORMAT_ATTR_BROKEN_PITCH, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_D16_LOCKABLE, 0, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_INTZ, 0, + WINED3DFMT_FLAG_MAPPABLE}, {WINED3DFMT_R11G11B10_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_D32_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, @@ -328,25 +332,44 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_NVDB, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_ATOC, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_RESZ, WINED3D_FORMAT_ATTR_EXTENSION}, - {WINED3DFMT_R32G32B32A32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UNORM, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SNORM, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_TYPELESS, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_FLOAT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_UINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_R32_SINT, 0, WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16_UINT, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_R32G32B32A32_TYPELESS, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_FLOAT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_UINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_SINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_TYPELESS, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_FLOAT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UNORM, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SNORM, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_TYPELESS, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_FLOAT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_UINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_SINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_TYPELESS, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_FLOAT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32_UINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_R32_SINT, 0, + WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R16_UINT, 0, + WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B10G10R10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B2G3R3_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, @@ -673,30 +696,31 @@ struct wined3d_format_block_info UINT block_width; UINT block_height; UINT block_byte_count; + unsigned int attrs; unsigned int flags; };
static const struct wined3d_format_block_info format_block_info[] = { - {WINED3DFMT_DXT1, 4, 4, 8, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT2, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT3, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT4, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT5, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC1_UNORM, 4, 4, 8, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC2_UNORM, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC3_UNORM, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC4_UNORM, 4, 4, 8, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC4_SNORM, 4, 4, 8, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC5_UNORM, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC5_SNORM, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC6H_UF16, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC6H_SF16, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC7_UNORM, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_ATI1N, 4, 4, 8, WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, - {WINED3DFMT_ATI2N, 4, 4, 16, WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, - {WINED3DFMT_YUY2, 2, 1, 4, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, - {WINED3DFMT_UYVY, 2, 1, 4, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, + {WINED3DFMT_DXT1, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_DXT2, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_DXT3, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_DXT4, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_DXT5, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC1_UNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC2_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC3_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC4_UNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC4_SNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC5_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC5_SNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC6H_UF16, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC6H_SF16, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_BC7_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_ATI1N, 4, 4, 8, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_ATI2N, 4, 4, 16, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_YUY2, 2, 1, 4, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, + {WINED3DFMT_UYVY, 2, 1, 4, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, {WINED3DFMT_R9G9B9E5_SHAREDEXP, 1, 1, 4}, };
@@ -2167,7 +2191,8 @@ static BOOL init_format_block_info(struct wined3d_adapter *adapter) format->block_width = format_block_info[i].block_width; format->block_height = format_block_info[i].block_height; format->block_byte_count = format_block_info[i].block_byte_count; - format_set_flag(format, WINED3DFMT_FLAG_BLOCKS | format_block_info[i].flags); + format->attrs |= WINED3D_FORMAT_ATTR_BLOCKS | format_block_info[i].attrs; + format_set_flag(format, format_block_info[i].flags); }
return TRUE; @@ -4521,7 +4546,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne { /* For block based formats, pitch means the amount of bytes to the next * row of blocks rather than the next row of pixels. */ - if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BLOCKS) + if (format->attrs & WINED3D_FORMAT_ATTR_BLOCKS) { unsigned int row_block_count = (width + format->block_width - 1) / format->block_width; unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height; @@ -4554,7 +4579,7 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT ali if (format->id == WINED3DFMT_UNKNOWN) return 0;
- if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->attrs & WINED3D_FORMAT_ATTR_BROKEN_PITCH) return width * height * depth * format->byte_count;
wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 81d4ec919e9..35179830664 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6113,6 +6113,9 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_NORMALISED 0x00000004 #define WINED3D_FORMAT_ATTR_BUMPMAP 0x00000008 #define WINED3D_FORMAT_ATTR_EXTENSION 0x00000010 +#define WINED3D_FORMAT_ATTR_BLOCKS 0x00000020 +#define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY 0x00000040 +#define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000080
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6128,11 +6131,8 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_VTF 0x00002000 #define WINED3DFMT_FLAG_SHADOW 0x00004000 #define WINED3DFMT_FLAG_COMPRESSED 0x00008000 -#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00010000 -#define WINED3DFMT_FLAG_BLOCKS 0x00020000 #define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00040000 #define WINED3DFMT_FLAG_TEXTURE 0x00080000 -#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00100000 #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 #define WINED3DFMT_FLAG_BLIT 0x02000000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115395
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/arb_program_shader.c | 4 +-- dlls/wined3d/glsl_shader.c | 4 +-- dlls/wined3d/surface.c | 7 ++--- dlls/wined3d/texture.c | 31 +++++++++++----------- dlls/wined3d/utils.c | 44 +++++++++++++++---------------- dlls/wined3d/wined3d_private.h | 6 ++--- 6 files changed, 45 insertions(+), 51 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 12606bbd0b0..5c45df8e6fa 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7744,8 +7744,8 @@ static BOOL arbfp_blit_supported(enum wined3d_blit_op blit_op, const struct wine return FALSE; }
- decompress = (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) + && !(dst_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) return FALSE;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 82c022e4ba7..5a5ca859108 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13060,8 +13060,8 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi /* We don't necessarily want to blit from resources without * WINED3D_RESOURCE_ACCESS_GPU, but that may be the only way to decompress * compressed textures. */ - decompress = (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) + && !(dst_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED); if (!decompress && !(src_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source resource does not have GPU access.\n"); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 747a25d5fe5..20a06b32d03 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -255,7 +255,7 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr if (!(conv = find_converter(src_format->id, dst_format->id)) && ((device->wined3d->flags & WINED3D_NO3D) || !is_identity_fixup(src_format->color_fixup) || src_format->conv_byte_count || !is_identity_fixup(dst_format->color_fixup) || dst_format->conv_byte_count - || ((src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) + || ((src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) && !src_format->decompress))) { FIXME("Cannot find a conversion function from format %s to %s.\n", @@ -653,7 +653,6 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int struct wined3d_texture *converted_texture = NULL; struct wined3d_bo_address src_data, dst_data; unsigned int src_fmt_attrs, dst_fmt_attrs; - unsigned int src_fmt_flags, dst_fmt_flags; struct wined3d_map_desc dst_map, src_map; unsigned int x, sx, xinc, y, sy, yinc; struct wined3d_context *context; @@ -761,9 +760,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int } } src_fmt_attrs = src_format->attrs; - src_fmt_flags = src_format->flags[src_texture->resource.gl_type]; dst_fmt_attrs = dst_format->attrs; - dst_fmt_flags = dst_format->flags[dst_texture->resource.gl_type]; flags &= ~WINED3D_BLT_RAW;
bpp = dst_format->byte_count; @@ -793,7 +790,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int goto release; }
- if ((src_fmt_flags | dst_fmt_flags) & WINED3DFMT_FLAG_HEIGHT_SCALE) + if ((src_fmt_attrs | dst_fmt_attrs) & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) { FIXME("Unsupported blit between height-scaled formats (src %s, dst %s).\n", debug_d3dformat(src_format->id), debug_d3dformat(dst_format->id)); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 9a80f54cf96..68dafc81073 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -71,7 +71,7 @@ static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture * /* We don't expect to create texture views for textures with height-scaled formats. * Besides, ARB_texture_storage doesn't allow specifying exact sizes for all levels. */ return gl_info->supported[ARB_TEXTURE_STORAGE] - && !(texture->resource.format_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); + && !(texture->resource.format_attrs & WINED3D_FORMAT_ATTR_HEIGHT_SCALE); }
/* Front buffer coordinates are always full screen coordinates, but our GL @@ -279,7 +279,7 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win if ((wined3d_settings.offscreen_rendering_mode != ORM_FBO) || !gl_info->fbo_ops.glBlitFramebuffer) return false;
- if ((src_resource->format_flags | dst_resource->format_flags) & WINED3DFMT_FLAG_HEIGHT_SCALE) + if ((src_resource->format_attrs | dst_resource->format_attrs) & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) return false;
/* Source and/or destination need to be on the GL side. */ @@ -978,7 +978,7 @@ static void wined3d_texture_gl_allocate_mutable_storage(struct wined3d_texture_g { width = wined3d_texture_get_level_pow2_width(&texture_gl->t, level); height = wined3d_texture_get_level_pow2_height(&texture_gl->t, level); - if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (texture_gl->t.resource.format_attrs & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) { height *= format->f.height_scale.numerator; height /= format->f.height_scale.denominator; @@ -2268,7 +2268,7 @@ static void wined3d_texture_gl_upload_bo(const struct wined3d_format *src_format { const struct wined3d_format_gl *format_gl = wined3d_format_gl(src_format);
- if (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) + if (src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) { GLenum internal = wined3d_gl_get_internal_format(&dst_texture->resource, format_gl, srgb); unsigned int dst_row_pitch, dst_slice_pitch; @@ -2411,8 +2411,7 @@ static enum wined3d_format_id wined3d_get_alpha_fixup_format(enum wined3d_format { unsigned int i;
- if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) - && !dst_format->alpha_size) + if (!(dst_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) && !dst_format->alpha_size) return WINED3DFMT_UNKNOWN;
for (i = 0; i < ARRAY_SIZE(formats_src_alpha_fixup); ++i) @@ -2510,7 +2509,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, dst_texture->resource.pin_sysmem = 1; }
- if (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (src_format->attrs & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) { update_h *= src_format->height_scale.numerator; update_h /= src_format->height_scale.denominator; @@ -2723,7 +2722,7 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl
if (bo) ERR("NP2 emulated texture uses PBO unexpectedly.\n"); - if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_attrs & WINED3D_FORMAT_ATTR_COMPRESSED) ERR("Unexpected compressed format for NP2 emulated texture.\n"); }
@@ -2771,7 +2770,7 @@ static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl mem = data->addr; }
- if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_attrs & WINED3D_FORMAT_ATTR_COMPRESSED) { TRACE("Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n", texture_gl, sub_resource_idx, level, format_gl->format, format_gl->type, mem); @@ -2987,7 +2986,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, checkGLcall("glBindBuffer"); }
- if (src_texture->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) + if (src_texture->resource.format_attrs & WINED3D_FORMAT_ATTR_COMPRESSED) { TRACE("Downloading compressed texture %p, %u, level %u, format %#x, type %#x, data %p.\n", src_texture, src_sub_resource_idx, src_level, format_gl->format, format_gl->type, offset); @@ -3862,8 +3861,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !d3d_info->texture_npot_conditional) { /* TODO: Add support for non-power-of-two compressed textures. */ - if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] - & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) + if (format->attrs & (WINED3D_FORMAT_ATTR_COMPRESSED | WINED3D_FORMAT_ATTR_HEIGHT_SCALE)) { FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", desc->width, desc->height); @@ -5280,7 +5278,7 @@ static bool wined3d_texture_vk_clear(struct wined3d_texture_vk *texture_vk, VkImageAspectFlags aspect_mask; VkImage vk_image;
- if (texture_vk->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_vk->t.resource.format_attrs & WINED3D_FORMAT_ATTR_COMPRESSED) { struct wined3d_bo_address addr;
@@ -5714,8 +5712,8 @@ static bool ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3 if (src_resource->type != WINED3D_RTYPE_TEXTURE_2D) return false;
- decompress = (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED) + && !(dst_format->attrs & WINED3D_FORMAT_ATTR_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source or destination resource is not GPU accessible.\n"); @@ -6489,7 +6487,8 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit * We also can't copy between depth/stencil and colour resources, since * the formats are considered incompatible in OpenGL. */ if (op != WINED3D_BLIT_OP_RAW_BLIT || !gl_formats_compatible(src_texture, src_location, dst_texture, dst_location) - || ((src_texture->resource.format_flags | dst_texture->resource.format_flags) & WINED3DFMT_FLAG_HEIGHT_SCALE) + || ((src_texture->resource.format_attrs | dst_texture->resource.format_attrs) + & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) || (src_texture->resource.format->id == dst_texture->resource.format->id && (!(src_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) || !(dst_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))))) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 50ccde057f0..9c472f94160 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -697,28 +697,27 @@ struct wined3d_format_block_info UINT block_height; UINT block_byte_count; unsigned int attrs; - unsigned int flags; };
static const struct wined3d_format_block_info format_block_info[] = { - {WINED3DFMT_DXT1, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT2, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT3, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT4, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_DXT5, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC1_UNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC2_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC3_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC4_UNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC4_SNORM, 4, 4, 8, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC5_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC5_SNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC6H_UF16, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC6H_SF16, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_BC7_UNORM, 4, 4, 16, 0, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_ATI1N, 4, 4, 8, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_ATI2N, 4, 4, 16, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_DXT1, 4, 4, 8, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_DXT2, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_DXT3, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_DXT4, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_DXT5, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC1_UNORM, 4, 4, 8, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC2_UNORM, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC3_UNORM, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC4_UNORM, 4, 4, 8, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC4_SNORM, 4, 4, 8, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC5_UNORM, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC5_SNORM, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC6H_UF16, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC6H_SF16, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_BC7_UNORM, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED}, + {WINED3DFMT_ATI1N, 4, 4, 8, WINED3D_FORMAT_ATTR_COMPRESSED | WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, + {WINED3DFMT_ATI2N, 4, 4, 16, WINED3D_FORMAT_ATTR_COMPRESSED | WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, {WINED3DFMT_YUY2, 2, 1, 4, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, {WINED3DFMT_UYVY, 2, 1, 4, WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY}, {WINED3DFMT_R9G9B9E5_SHAREDEXP, 1, 1, 4}, @@ -2192,7 +2191,6 @@ static BOOL init_format_block_info(struct wined3d_adapter *adapter) format->block_height = format_block_info[i].block_height; format->block_byte_count = format_block_info[i].block_byte_count; format->attrs |= WINED3D_FORMAT_ATTR_BLOCKS | format_block_info[i].attrs; - format_set_flag(format, format_block_info[i].flags); }
return TRUE; @@ -2940,7 +2938,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, if (!format->internal) continue;
- if (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED) + if (format->f.attrs & WINED3D_FORMAT_ATTR_COMPRESSED) { TRACE("Skipping format %s because it's a compressed format.\n", debug_d3dformat(format->f.id)); @@ -3659,13 +3657,13 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ || (gl_info->supported[ARB_FRAGMENT_SHADER] && gl_info->supported[ARB_VERTEX_SHADER])) { format = get_format_gl_internal(adapter, WINED3DFMT_YV12); - format_set_flag(&format->f, WINED3DFMT_FLAG_HEIGHT_SCALE); + format->f.attrs |= WINED3D_FORMAT_ATTR_HEIGHT_SCALE; format->f.height_scale.numerator = 3; format->f.height_scale.denominator = 2; format->f.color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12);
format = get_format_gl_internal(adapter, WINED3DFMT_NV12); - format_set_flag(&format->f, WINED3DFMT_FLAG_HEIGHT_SCALE); + format->f.attrs |= WINED3D_FORMAT_ATTR_HEIGHT_SCALE; format->f.height_scale.numerator = 3; format->f.height_scale.denominator = 2; format->f.color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12); @@ -4561,7 +4559,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne *slice_pitch = *row_pitch * height; }
- if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (format->attrs & WINED3D_FORMAT_ATTR_HEIGHT_SCALE) { /* The D3D format requirements make sure that the resulting format is an integer again */ *slice_pitch *= format->height_scale.numerator; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 35179830664..6a5e718950a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6115,7 +6115,9 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_EXTENSION 0x00000010 #define WINED3D_FORMAT_ATTR_BLOCKS 0x00000020 #define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY 0x00000040 -#define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000080 +#define WINED3D_FORMAT_ATTR_COMPRESSED 0x00000080 +#define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000100 +#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE 0x00000200
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6130,8 +6132,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 #define WINED3DFMT_FLAG_VTF 0x00002000 #define WINED3DFMT_FLAG_SHADOW 0x00004000 -#define WINED3DFMT_FLAG_COMPRESSED 0x00008000 -#define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00040000 #define WINED3DFMT_FLAG_TEXTURE 0x00080000 #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115396
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/resource.c | 2 +- dlls/wined3d/utils.c | 12 ++++-------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 4ad8745f109..72a0914026f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -195,7 +195,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->multisample_quality = multisample_quality; resource->usage = usage; resource->bind_flags = bind_flags; - if (resource->format_flags & WINED3DFMT_FLAG_MAPPABLE) + if (resource->format_attrs & WINED3D_FORMAT_ATTR_MAPPABLE) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W; resource->access = access; resource->width = width; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9c472f94160..9308848ce97 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -315,14 +315,10 @@ struct wined3d_format_base_flags * resource size. */ static const struct wined3d_format_base_flags format_base_flags[] = { - {WINED3DFMT_ATI1N, WINED3D_FORMAT_ATTR_BROKEN_PITCH, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_ATI2N, WINED3D_FORMAT_ATTR_BROKEN_PITCH, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_D16_LOCKABLE, 0, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_INTZ, 0, - WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_ATI1N, WINED3D_FORMAT_ATTR_MAPPABLE | WINED3D_FORMAT_ATTR_BROKEN_PITCH}, + {WINED3DFMT_ATI2N, WINED3D_FORMAT_ATTR_MAPPABLE | WINED3D_FORMAT_ATTR_BROKEN_PITCH}, + {WINED3DFMT_D16_LOCKABLE, WINED3D_FORMAT_ATTR_MAPPABLE}, + {WINED3DFMT_INTZ, WINED3D_FORMAT_ATTR_MAPPABLE}, {WINED3DFMT_R11G11B10_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_D32_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3D_FORMAT_ATTR_FLOAT}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6a5e718950a..7145c0ca64b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6118,6 +6118,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_COMPRESSED 0x00000080 #define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000100 #define WINED3D_FORMAT_ATTR_HEIGHT_SCALE 0x00000200 +#define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6136,7 +6137,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 #define WINED3DFMT_FLAG_BLIT 0x02000000 -#define WINED3DFMT_FLAG_MAPPABLE 0x04000000 #define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x08000000 #define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115397
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/device.c | 4 +-- dlls/wined3d/utils.c | 55 ++++++++++++---------------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 22 insertions(+), 39 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 72c5167131a..33ae584f817 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4723,9 +4723,9 @@ static bool resources_format_compatible(const struct wined3d_resource *src_resou if (src_resource->device->cs->c.state->feature_level < WINED3D_FEATURE_LEVEL_10_1) return false; if ((src_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) - && (dst_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) + && (dst_resource->format_attrs & WINED3D_FORMAT_ATTR_CAST_TO_BLOCK)) return src_resource->format->block_byte_count == dst_resource->format->byte_count; - if ((src_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) + if ((src_resource->format_attrs & WINED3D_FORMAT_ATTR_CAST_TO_BLOCK) && (dst_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9308848ce97..5b62ae0f542 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -328,42 +328,25 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_NVDB, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_ATOC, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_RESZ, WINED3D_FORMAT_ATTR_EXTENSION}, - {WINED3DFMT_R32G32B32A32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UNORM, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SNORM, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_R32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UNORM, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SNORM, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK, + WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_R32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7145c0ca64b..3d9d19dd880 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6119,6 +6119,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000100 #define WINED3D_FORMAT_ATTR_HEIGHT_SCALE 0x00000200 #define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400 +#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6137,7 +6138,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 #define WINED3DFMT_FLAG_BLIT 0x02000000 -#define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x08000000 #define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000
struct wined3d_rational
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115398
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 error: patch failed: dlls/wined3d/device.c:4723 error: patch failed: dlls/wined3d/utils.c:328 error: patch failed: dlls/wined3d/wined3d_private.h:6119 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 error: patch failed: dlls/wined3d/device.c:4723 error: patch failed: dlls/wined3d/utils.c:328 error: patch failed: dlls/wined3d/wined3d_private.h:6119 Task: Patch failed to apply
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/context_gl.c | 2 +- dlls/wined3d/cs.c | 10 +- dlls/wined3d/device.c | 3 +- dlls/wined3d/directx.c | 51 +-- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/resource.c | 10 +- dlls/wined3d/shader.c | 2 +- dlls/wined3d/state.c | 6 +- dlls/wined3d/texture.c | 28 +- dlls/wined3d/utils.c | 606 +++++++++++++++---------------- dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 48 +-- 13 files changed, 387 insertions(+), 385 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 628b3ffe145..8da17c9aa94 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4448,7 +4448,7 @@ static void wined3d_context_gl_setup_target(struct wined3d_context_gl *context_g { /* Disable blending when the alpha mask has changed and when a format doesn't support blending. */ if ((old->alpha_size && !new->alpha_size) || (!old->alpha_size && new->alpha_size) - || !(texture->resource.format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) + || !(texture->resource.format_caps & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING)) context_invalidate_state(&context_gl->c, STATE_BLEND); }
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 6cbc9e2e2a6..9fd67cf0045 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1206,8 +1206,8 @@ static void wined3d_cs_exec_set_rendertarget_views(struct wined3d_cs *cs, const if (!(device->adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) || cs->state.render_states[WINED3D_RS_SRGBWRITEENABLE]) { - prev_srgb_write = prev && prev->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; - curr_srgb_write = view && view->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; + prev_srgb_write = prev && prev->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; + curr_srgb_write = view && view->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; if (prev_srgb_write != curr_srgb_write) device_invalidate_state(device, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE)); } @@ -1450,8 +1450,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) { const struct wined3d_format *new_format = op->texture->resource.format; const struct wined3d_format *old_format = prev ? prev->resource.format : NULL; - unsigned int old_fmt_flags = prev ? prev->resource.format_flags : 0; - unsigned int new_fmt_flags = op->texture->resource.format_flags; + unsigned int old_fmt_caps = prev ? prev->resource.format_caps : 0; + unsigned int new_fmt_caps = op->texture->resource.format_caps;
if (InterlockedIncrement(&op->texture->resource.bind_count) == 1) op->texture->sampler = op->stage; @@ -1459,7 +1459,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (!prev || wined3d_texture_gl(op->texture)->target != wined3d_texture_gl(prev)->target || (!is_same_fixup(new_format->color_fixup, old_format->color_fixup) && !(can_use_texture_swizzle(d3d_info, new_format) && can_use_texture_swizzle(d3d_info, old_format))) - || (new_fmt_flags & WINED3DFMT_FLAG_SHADOW) != (old_fmt_flags & WINED3DFMT_FLAG_SHADOW)) + || (new_fmt_caps & WINED3D_FORMAT_CAP_SHADOW) != (old_fmt_caps & WINED3D_FORMAT_CAP_SHADOW)) device_invalidate_state(cs->c.device, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL));
if (!prev && op->stage < d3d_info->limits.ffp_blend_stages) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 33ae584f817..c6a6de93123 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4585,7 +4585,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device }
texture = state->textures[i]; - if (!texture || texture->resource.format_flags & WINED3DFMT_FLAG_FILTERING) continue; + if (!texture || texture->resource.format_caps & WINED3D_FORMAT_CAP_FILTERING) + continue;
if (state->sampler_states[i][WINED3D_SAMP_MAG_FILTER] != WINED3D_TEXF_POINT) { diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index c0e722c3bc0..925b2df0401 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1819,12 +1819,12 @@ HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d_adapter *ad rt_format = wined3d_get_format(adapter, render_target_format_id, WINED3D_BIND_RENDER_TARGET); ds_format = wined3d_get_format(adapter, depth_stencil_format_id, WINED3D_BIND_DEPTH_STENCIL);
- if (!(rt_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_RENDERTARGET)) + if (!(rt_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_RENDERTARGET)) { WARN("Format %s is not render target format.\n", debug_d3dformat(rt_format->id)); return WINED3DERR_NOTAVAILABLE; } - if (!(ds_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(ds_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format->id)); return WINED3DERR_NOTAVAILABLE; @@ -1898,11 +1898,12 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
static BOOL wined3d_check_surface_format(const struct wined3d_format *format) { - if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] | format->flags[WINED3D_GL_RES_TYPE_RB]) & WINED3DFMT_FLAG_BLIT) + if ((format->caps[WINED3D_GL_RES_TYPE_TEX_2D] | format->caps[WINED3D_GL_RES_TYPE_RB]) + & WINED3D_FORMAT_CAP_BLIT) return TRUE;
if ((format->attrs & WINED3D_FORMAT_ATTR_EXTENSION) - && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) + && (format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE)) return TRUE;
return FALSE; @@ -1923,7 +1924,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, { const struct wined3d_format *adapter_format, *format; enum wined3d_gl_resource_type gl_type, gl_type_end; - unsigned int format_flags = 0, format_attrs = 0; + unsigned int format_caps = 0, format_attrs = 0; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; DWORD allowed_usage; @@ -2051,32 +2052,32 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, }
if (bind_flags & WINED3D_BIND_SHADER_RESOURCE) - format_flags |= WINED3DFMT_FLAG_TEXTURE; + format_caps |= WINED3D_FORMAT_CAP_TEXTURE; if (bind_flags & WINED3D_BIND_RENDER_TARGET) - format_flags |= WINED3DFMT_FLAG_RENDERTARGET; + format_caps |= WINED3D_FORMAT_CAP_RENDERTARGET; if (bind_flags & WINED3D_BIND_DEPTH_STENCIL) - format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + format_caps |= WINED3D_FORMAT_CAP_DEPTH_STENCIL; if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS) - format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + format_caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS; if (bind_flags & WINED3D_BIND_VERTEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format_caps |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; if (bind_flags & WINED3D_BIND_INDEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_INDEX_BUFFER; + format_caps |= WINED3D_FORMAT_CAP_INDEX_BUFFER;
if (usage & WINED3DUSAGE_QUERY_FILTER) - format_flags |= WINED3DFMT_FLAG_FILTERING; + format_caps |= WINED3D_FORMAT_CAP_FILTERING; if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING) - format_flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format_caps |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; if (usage & WINED3DUSAGE_QUERY_SRGBREAD) - format_flags |= WINED3DFMT_FLAG_SRGB_READ; + format_caps |= WINED3D_FORMAT_CAP_SRGB_READ; if (usage & WINED3DUSAGE_QUERY_SRGBWRITE) - format_flags |= WINED3DFMT_FLAG_SRGB_WRITE; + format_caps |= WINED3D_FORMAT_CAP_SRGB_WRITE; if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) - format_flags |= WINED3DFMT_FLAG_VTF; + format_caps |= WINED3D_FORMAT_CAP_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) format_attrs |= WINED3D_FORMAT_ATTR_BUMPMAP;
- if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) + if ((format_caps & WINED3D_FORMAT_CAP_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n"); return WINED3DERR_NOTAVAILABLE; @@ -2091,6 +2092,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
for (; gl_type <= gl_type_end; ++gl_type) { + if ((format->caps[gl_type] & format_caps) != format_caps) + { + TRACE("Requested format caps %#x, but format %s only has %#x.\n", + format_caps, debug_d3dformat(check_format_id), format->caps[gl_type]); + return WINED3DERR_NOTAVAILABLE; + } + if ((bind_flags & WINED3D_BIND_RENDER_TARGET) && !adapter->adapter_ops->adapter_check_format(adapter, adapter_format, format, NULL)) { @@ -2118,14 +2126,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
- if ((format->flags[gl_type] & format_flags) != format_flags) - { - TRACE("Requested format flags %#x, but format %s only has %#x.\n", - format_flags, debug_d3dformat(check_format_id), format->flags[gl_type]); - return WINED3DERR_NOTAVAILABLE; - } - - if (!(format->flags[gl_type] & WINED3DFMT_FLAG_GEN_MIPMAP)) + if (!(format->caps[gl_type] & WINED3D_FORMAT_CAP_GEN_MIPMAP)) mipmap_gen_supported = FALSE; }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5a5ca859108..0c9822a95aa 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13076,7 +13076,7 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi }
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && !((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + && !((dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) { TRACE("Destination texture is not FBO attachable.\n"); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 72a0914026f..aeece1ab512 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -123,19 +123,19 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * break;
if ((bind_flags & WINED3D_BIND_RENDER_TARGET) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_RENDERTARGET)) { WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); continue; } if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); continue; } if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_TEXTURE)) { WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; @@ -190,7 +190,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->format = format; resource->format_attrs = format->attrs; if (gl_type < WINED3D_GL_RES_TYPE_COUNT) - resource->format_flags = format->flags[gl_type]; + resource->format_caps = format->caps[gl_type]; resource->multisample_type = multisample_type; resource->multisample_quality = multisample_quality; resource->usage = usage; @@ -465,7 +465,7 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) const struct wined3d_format *wined3d_resource_get_decompress_format(const struct wined3d_resource *resource) { const struct wined3d_adapter *adapter = resource->device->adapter; - if (resource->format_flags & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE) + if (resource->format_caps & (WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE) && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)) return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM_SRGB, resource->bind_flags); return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM, resource->bind_flags); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index a296e34bc9f..c02f82b4d7b 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -4123,7 +4123,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 else args->color_fixup[i] = texture->resource.format->color_fixup;
- if (texture->resource.format_flags & WINED3DFMT_FLAG_SHADOW) + if (texture->resource.format_caps & WINED3D_FORMAT_CAP_SHADOW) args->shadow |= 1u << i;
/* Flag samplers that need NP2 texcoord fixup. */ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index ef153e5dd5f..56fd759e5e2 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -563,7 +563,7 @@ static BOOL is_blend_enabled(struct wined3d_context *context, const struct wined * With blending on we could face a big performance penalty. * The d3d9 visual test confirms the behavior. */ if (context->render_offscreen - && !(state->fb.render_targets[index]->format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) + && !(state->fb.render_targets[index]->format_caps & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING)) return FALSE;
return TRUE; @@ -3709,11 +3709,11 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc && sampler_states[WINED3D_SAMP_MIP_FILTER] != WINED3D_TEXF_ANISOTROPIC) || (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2)) desc->max_anisotropy = 1; - desc->compare = texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_SHADOW; + desc->compare = texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_SHADOW; desc->comparison_func = WINED3D_CMP_LESSEQUAL; desc->srgb_decode = is_srgb_enabled(sampler_states);
- if (!(texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FILTERING)) + if (!(texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FILTERING)) { desc->mag_filter = WINED3D_TEXF_POINT; desc->min_filter = WINED3D_TEXF_POINT; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 68dafc81073..99cb7101aed 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -302,10 +302,10 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win switch (blit_op) { case WINED3D_BLIT_OP_COLOR_BLIT: - if (!((src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + if (!((src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (src_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) return false; - if (!((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + if (!((dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) return false; if ((src_format->id != dst_format->id || dst_location == WINED3D_LOCATION_DRAWABLE) @@ -314,9 +314,9 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win break;
case WINED3D_BLIT_OP_DEPTH_BLIT: - if (!(src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) return false; - if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) return false; /* Accept pure swizzle fixups for depth formats. In general we * ignore the stencil component (if present) at the moment and the @@ -2115,9 +2115,9 @@ void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl, if (texture_gl->t.flags & alloc_flag) return;
- if (resource->format_flags & WINED3DFMT_FLAG_DECOMPRESS) + if (resource->format_caps & WINED3D_FORMAT_CAP_DECOMPRESS) { - TRACE("WINED3DFMT_FLAG_DECOMPRESS set.\n"); + TRACE("WINED3D_FORMAT_CAP_DECOMPRESS set.\n"); texture_gl->t.flags |= WINED3D_TEXTURE_CONVERTED; format = wined3d_resource_get_decompress_format(resource); } @@ -2547,7 +2547,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, bo.addr += src_box->left * src_format->byte_count; }
- decompress = (dst_texture->resource.format_flags & WINED3DFMT_FLAG_DECOMPRESS) + decompress = (dst_texture->resource.format_caps & WINED3D_FORMAT_CAP_DECOMPRESS) || (src_format->decompress && src_format->id != dst_texture->resource.format->id);
if (src_format->upload || decompress @@ -3170,7 +3170,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g wined3d_texture_get_level_box(&texture_gl->t, level, &src_box);
if (!depth && sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) - && (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + && (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB) && fbo_blitter_supported(WINED3D_BLIT_OP_COLOR_BLIT, gl_info, &texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_RGB, &texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_SRGB)) @@ -3191,7 +3191,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g }
if (!depth && sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) - && (!srgb || (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))) + && (!srgb || (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB))) { DWORD src_location = sub_resource->locations & WINED3D_LOCATION_RB_RESOLVED ? WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; @@ -3343,10 +3343,10 @@ static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int lo return false;
if (location == WINED3D_LOCATION_TEXTURE_RGB - && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)) + && !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)) return false; if (location == WINED3D_LOCATION_TEXTURE_SRGB - && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + && !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB)) return false;
return location & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED @@ -3944,7 +3944,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc /* DXTn 3D textures are not supported. Do not write the ERR for them. */ if ((desc->format == WINED3DFMT_DXT1 || desc->format == WINED3DFMT_DXT2 || desc->format == WINED3DFMT_DXT3 || desc->format == WINED3DFMT_DXT4 || desc->format == WINED3DFMT_DXT5) - && !(format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE) + && !(format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE) && desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++) ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n");
@@ -3971,7 +3971,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->flags |= WINED3D_TEXTURE_DISCARD; if (flags & WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS) { - if (!(texture->resource.format_flags & WINED3DFMT_FLAG_GEN_MIPMAP)) + if (!(texture->resource.format_caps & WINED3D_FORMAT_CAP_GEN_MIPMAP)) WARN("Format doesn't support mipmaps generation, " "ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n"); else @@ -6059,7 +6059,7 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de if (blitter_use_cpu_clear(view) || (!(view->resource->bind_flags & WINED3D_BIND_RENDER_TARGET) && (wined3d_settings.offscreen_rendering_mode != ORM_FBO - || !(view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)))) + || !(view->format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)))) { next_flags |= WINED3DCLEAR_TARGET; flags &= ~WINED3DCLEAR_TARGET; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5b62ae0f542..5c0f1c5e376 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -307,7 +307,7 @@ struct wined3d_format_base_flags { enum wined3d_format_id id; unsigned int attrs; - unsigned int flags; + unsigned int caps; };
/* The ATI2N format behaves like an uncompressed format in LockRect(), but @@ -345,10 +345,10 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_R32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK, - WINED3DFMT_FLAG_INDEX_BUFFER}, + WINED3D_FORMAT_CAP_INDEX_BUFFER}, {WINED3DFMT_R32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, - WINED3DFMT_FLAG_INDEX_BUFFER}, + WINED3D_FORMAT_CAP_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B10G10R10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B2G3R3_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, @@ -766,7 +766,7 @@ struct wined3d_format_texture_info GLint gl_format; GLint gl_type; unsigned int conv_byte_count; - unsigned int flags; + unsigned int caps; enum wined3d_gl_extension extension; void (*upload)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch, unsigned int dst_row_pitch, unsigned int dst_slice_pitch, @@ -1335,7 +1335,7 @@ const struct wined3d_color_key_conversion * wined3d_format_get_color_key_convers /* We intentionally don't support WINED3DFMT_D32_UNORM. No hardware driver * supports it, and applications get confused when we do. * - * The following formats explicitly don't have WINED3DFMT_FLAG_TEXTURE set: + * The following formats explicitly don't have WINED3D_FORMAT_CAP_TEXTURE set: * * These are never supported on native. * WINED3DFMT_B8G8R8_UNORM @@ -1362,7 +1362,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = { /* format id gl_internal gl_srgb_internal gl_rt_internal gl_format gl_type conv_byte_count - flags + caps extension upload download */ /* FourCC formats */ /* GL_APPLE_ycbcr_422 claims that its '2YUV' format, which is supported via the UNSIGNED_SHORT_8_8_REV_APPLE type @@ -1373,167 +1373,167 @@ static const struct wined3d_format_texture_info format_texture_info[] = */ {WINED3DFMT_UYVY, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_UYVY, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_UYVY, GL_RGB_RAW_422_APPLE, GL_RGB_RAW_422_APPLE, 0, GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YUY2, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YUY2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_YUY2, GL_RGB_RAW_422_APPLE, GL_RGB_RAW_422_APPLE, 0, GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_NV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_NV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC1_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC2_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC3_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC4_UNORM, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC4_SNORM, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_COMPRESSED_SIGNED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC5_UNORM, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC5_SNORM, GL_COMPRESSED_SIGNED_RG_RGTC2, GL_COMPRESSED_SIGNED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC6H_UF16, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, {WINED3DFMT_BC6H_SF16, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, {WINED3DFMT_BC7_UNORM, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, /* IEEE formats */ {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RED, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, GL_RED, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RGB, GL_FLOAT, 12, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r32g32_float}, {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, GL_RG, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, GL_RGB, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, /* Float */ {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RGB, GL_HALF_FLOAT_ARB, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r16g16}, {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, GL_RG, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET + | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R11G11B10_FLOAT, GL_R11F_G11F_B10F, GL_R11F_G11F_B10F, 0, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_PACKED_FLOAT}, /* Palettized formats */ {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, @@ -1547,376 +1547,376 @@ static const struct wined3d_format_texture_info format_texture_info[] = /* Standard ARGB formats */ {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE + | WINED3D_FORMAT_CAP_VTF, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G6R5_UNORM, GL_RGB5, GL_SRGB8_EXT, GL_RGB8, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G6R5_UNORM, GL_RGB565, GL_SRGB8_EXT, GL_RGB8, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ, ARB_ES2_COMPATIBILITY, NULL}, {WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G5R5A1_UNORM, GL_RGB5_A1, GL_RGB5_A1, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B4G4R4A4_UNORM, GL_RGBA4, GL_SRGB8_ALPHA8_EXT, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B2G3R3_UNORM, GL_R3_G3_B2, GL_R3_G3_B2, 0, GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_B4G4R4X4_UNORM, GL_RGB4, GL_RGB4, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R10G10B10A2_UINT, GL_RGB10_A2UI, GL_RGB10_A2UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE + | WINED3D_FORMAT_CAP_VTF, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8B8A8_UINT, GL_RGBA8UI, GL_RGBA8UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, GL_RGBA_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16_UNORM, GL_RGB16, GL_RGB16, GL_RGBA16, GL_RGB, GL_UNSIGNED_SHORT, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16}, {WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0, GL_RG, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_UINT, GL_RG8UI, GL_RG8UI, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_SINT, GL_RG8I, GL_RG8I, 0, GL_RG_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, 0, GL_RGBA_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32_UINT, GL_RG32UI, GL_RG32UI, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_SINT, GL_RG32I, GL_RG32I, 0, GL_RG_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_UINT, GL_RG16UI, GL_RG16UI, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_SINT, GL_RG16I, GL_RG16I, 0, GL_RG_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_UINT, GL_R8UI, GL_R8UI, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_SINT, GL_R8I, GL_R8I, 0, GL_RED_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L4A4_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 2, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, convert_l4a4_unorm}, {WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 2, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, convert_l4a4_unorm}, {WINED3DFMT_L16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, /* Bump mapping stuff */ {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm}, {WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0, GL_DSDT_NV, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, 0, GL_RG, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r5g5_snorm_l6_unorm}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0, GL_DSDT_MAG_NV, GL_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, convert_r5g5_snorm_l6_unorm_nv}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB8_SNORM, GL_RGB8_SNORM, 0, GL_RGBA, GL_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_SNORM, convert_r5g5_snorm_l6_unorm_ext}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm_l8x8_unorm}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0, GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, convert_r8g8_snorm_l8x8_unorm_nv}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0, GL_BGRA, GL_UNSIGNED_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8b8a8_snorm}, {WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0, GL_RGBA, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, 0, GL_RGBA, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RGB16, GL_RGB16, 0, GL_BGR, GL_UNSIGNED_SHORT, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16_snorm}, {WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0, GL_HILO_NV, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RG16_SNORM, GL_RG16_SNORM, 0, GL_RG, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16B16A16_SNORM, GL_RGBA16_SNORM, GL_RGBA16_SNORM, 0, GL_RGBA, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16_SNORM, GL_R16_SNORM, GL_R16_SNORM, 0, GL_RED, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, 0, GL_RED, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, /* Depth stencil formats */ {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, x8_d24_unorm_upload, x8_d24_unorm_download}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, x8_d24_unorm_upload, x8_d24_unorm_download}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, NULL}, {WINED3DFMT_D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, NULL}, {WINED3DFMT_S8_UINT_D24_FLOAT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 8, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, convert_s8_uint_d24_float}, {WINED3DFMT_R32G32B32A32_UINT, GL_RGBA32UI, GL_RGBA32UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, 0, GL_RGBA_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, /* Vendor-specific formats */ {WINED3DFMT_ATI1N, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ATI_TEXTURE_COMPRESSION_3DC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_INTZ, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_NULL, 0, 0, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FBO_ATTACHABLE, ARB_FRAMEBUFFER_OBJECT, NULL}, /* DirectX 10 HDR formats */ {WINED3DFMT_R9G9B9E5_SHAREDEXP, GL_RGB9_E5_EXT, GL_RGB9_E5_EXT, 0, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV_EXT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_SHARED_EXPONENT, NULL}, };
@@ -2006,20 +2006,20 @@ static void copy_format(const struct wined3d_adapter *adapter, dst_format->id = id; }
-static void format_set_flag(struct wined3d_format *format, unsigned int flag) +static void format_set_caps(struct wined3d_format *format, unsigned int caps) { unsigned int i;
- for (i = 0; i < ARRAY_SIZE(format->flags); ++i) - format->flags[i] |= flag; + for (i = 0; i < ARRAY_SIZE(format->caps); ++i) + format->caps[i] |= caps; }
-static void format_clear_flag(struct wined3d_format *format, unsigned int flag) +static void format_clear_caps(struct wined3d_format *format, unsigned int caps) { unsigned int i;
- for (i = 0; i < ARRAY_SIZE(format->flags); ++i) - format->flags[i] &= ~flag; + for (i = 0; i < ARRAY_SIZE(format->caps); ++i) + format->caps[i] &= ~caps; }
static enum wined3d_channel_type map_channel_type(char t) @@ -2150,7 +2150,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) return FALSE;
format->attrs |= format_base_flags[i].attrs; - format_set_flag(format, format_base_flags[i].flags); + format_set_caps(format, format_base_flags[i].caps); }
return TRUE; @@ -2196,7 +2196,7 @@ static BOOL init_format_decompress_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, format_decompress_info[i].id))) return FALSE;
- format->flags[WINED3D_GL_RES_TYPE_TEX_3D] |= WINED3DFMT_FLAG_DECOMPRESS; + format->caps[WINED3D_GL_RES_TYPE_TEX_3D] |= WINED3D_FORMAT_CAP_DECOMPRESS; format->decompress = format_decompress_info[i].decompress; }
@@ -2363,9 +2363,9 @@ static void create_and_bind_fbo_attachment(const struct wined3d_gl_info *gl_info }
/* Ideally we'd skip all formats already known not to work on textures - * by checking for WINED3DFMT_FLAG_TEXTURE here. However, we want to + * by checking for WINED3D_FORMAT_CAP_TEXTURE here. However, we want to * know if we can attach WINED3DFMT_P8_UINT textures to FBOs, and this - * format never has WINED3DFMT_FLAG_TEXTURE set. Instead, swallow GL + * format never has WINED3D_FORMAT_CAP_TEXTURE set. Instead, swallow GL * errors generated by invalid formats. */ while (gl_info->gl_ops.gl.p_glGetError()); } @@ -2509,7 +2509,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { const char *type_string = "color";
@@ -2518,7 +2518,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
create_and_bind_fbo_attachment(gl_info, format, type, &object, format->internal);
- if (format->f.flags[type] & WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glGenRenderbuffers(1, &color_rb); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, color_rb); @@ -2540,7 +2540,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { TRACE("Format %s is supported as FBO %s attachment, type %u.\n", debug_d3dformat(format->f.id), type_string, type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE; } @@ -2548,11 +2548,11 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { if (!rt_internal) { - if (format->f.flags[type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (format->f.caps[type] & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s with rendertarget flag is not supported as FBO color attachment (type %u)," " and no fallback specified.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL); + format->f.caps[type] &= ~(WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL); } else { @@ -2585,13 +2585,13 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { WARN("Format %s rtInternal format is not supported as FBO %s attachment, type %u.\n", debug_d3dformat(format->f.id), type_string, type); - format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL); + format->f.caps[type] &= ~(WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL); } } }
if (status == GL_FRAMEBUFFER_COMPLETE - && ((format->f.flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) + && ((format->f.caps[type] & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) && !(format->f.attrs & WINED3D_FORMAT_ATTR_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT @@ -2624,7 +2624,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for while (gl_info->gl_ops.gl.p_glGetError()); TRACE("Format %s doesn't support post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { @@ -2698,14 +2698,14 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for TRACE("Format %s doesn't support post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); TRACE("Color output: %#x\n", color); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { TRACE("Format %s supports post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); TRACE("Color output: %#x\n", color); - format->f.flags[type] |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } }
@@ -2730,7 +2730,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { TRACE("Format %s's sRGB format is FBO attachable, type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -2738,13 +2738,13 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { WARN("Format %s's sRGB format is not FBO attachable, type %u.\n", debug_d3dformat(format->f.id), type); - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); } } else if (status == GL_FRAMEBUFFER_COMPLETE) - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB;
- if (format->f.flags[type] & WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); gl_info->fbo_ops.glDeleteRenderbuffers(1, &color_rb); @@ -2758,30 +2758,30 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { FIXME("Format %s needs different render target formats for different resource types.\n", debug_d3dformat(format->f.id)); - format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL - | WINED3DFMT_FLAG_FBO_ATTACHABLE | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB - | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL + | WINED3D_FORMAT_CAP_FBO_ATTACHABLE | WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB + | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING); } }
-static void query_format_flag(struct wined3d_gl_info *gl_info, struct wined3d_format_gl *format, - GLint internal, GLenum pname, DWORD flag, const char *string) +static void query_format_cap(struct wined3d_gl_info *gl_info, struct wined3d_format_gl *format, + GLint internal, GLenum pname, unsigned int cap, const char *string) { GLint value; enum wined3d_gl_resource_type type;
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { gl_info->gl_ops.ext.p_glGetInternalformativ(wined3d_gl_type_to_enum(type), internal, pname, 1, &value); if (value == GL_FULL_SUPPORT) { TRACE("Format %s supports %s, resource type %u.\n", debug_d3dformat(format->f.id), string, type); - format->f.flags[type] |= flag; + format->f.caps[type] |= cap; } else { TRACE("Format %s doesn't support %s, resource type %u.\n", debug_d3dformat(format->f.id), string, type); - format->f.flags[type] &= ~flag; + format->f.caps[type] &= ~cap; } } } @@ -2806,7 +2806,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, if (!format->internal) continue;
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { gl_info->gl_ops.ext.p_glGetInternalformativ(wined3d_gl_type_to_enum(type), format->internal, GL_FRAMEBUFFER_RENDERABLE, 1, &value); @@ -2814,7 +2814,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s is supported as FBO color attachment, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE;
@@ -2824,25 +2824,25 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s supports post-pixelshader blending, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { TRACE("Format %s doesn't support post-pixelshader blending, resource typed %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } } else { if (!rt_internal) { - if (format->f.flags[type] & WINED3DFMT_FLAG_RENDERTARGET) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_RENDERTARGET) { WARN("Format %s with rendertarget flag is not supported as FBO color attachment" " and no fallback specified, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_RENDERTARGET; } else TRACE("Format %s is not supported as FBO color attachment," @@ -2863,7 +2863,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { WARN("Format %s rtInternal format is not supported as FBO color attachment," " resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_RENDERTARGET; } } } @@ -2876,7 +2876,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s's sRGB format is FBO attachable, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -2884,19 +2884,19 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { WARN("Format %s's sRGB format is not FBO attachable, resource type %u.\n", debug_d3dformat(format->f.id), type); - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); } } - else if (format->f.flags[type] & WINED3DFMT_FLAG_FBO_ATTACHABLE) - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + else if (format->f.caps[type] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; }
if (fallback_fmt_used && regular_fmt_used) { FIXME("Format %s needs different render target formats for different resource types.\n", debug_d3dformat(format->f.id)); - format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE - | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FBO_ATTACHABLE + | WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING); } } return; @@ -3080,26 +3080,26 @@ static void query_internal_format(struct wined3d_adapter *adapter,
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2]) { - query_format_flag(gl_info, format, format->internal, GL_VERTEX_TEXTURE, - WINED3DFMT_FLAG_VTF, "vertex texture usage"); - query_format_flag(gl_info, format, format->internal, GL_FILTER, - WINED3DFMT_FLAG_FILTERING, "filtering"); - query_format_flag(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, - WINED3DFMT_FLAG_UNORDERED_ACCESS, "unordered access"); + query_format_cap(gl_info, format, format->internal, GL_VERTEX_TEXTURE, + WINED3D_FORMAT_CAP_VTF, "vertex texture usage"); + query_format_cap(gl_info, format, format->internal, GL_FILTER, + WINED3D_FORMAT_CAP_FILTERING, "filtering"); + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, + WINED3D_FORMAT_CAP_UNORDERED_ACCESS, "unordered access");
if (srgb_format || format->srgb_internal != format->internal) { - query_format_flag(gl_info, format, format->srgb_internal, GL_SRGB_READ, - WINED3DFMT_FLAG_SRGB_READ, "sRGB read"); + query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_READ, + WINED3D_FORMAT_CAP_SRGB_READ, "sRGB read");
if (srgb_write_supported) - query_format_flag(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, - WINED3DFMT_FLAG_SRGB_WRITE, "sRGB write"); + query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, + WINED3D_FORMAT_CAP_SRGB_WRITE, "sRGB write"); else - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE);
- if (!(format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] - & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE))) + if (!(format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] + & (WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE))) format->srgb_internal = format->internal; else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; @@ -3108,12 +3108,12 @@ static void query_internal_format(struct wined3d_adapter *adapter, else { if (!gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX]) - format_clear_flag(&format->f, WINED3DFMT_FLAG_VTF); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_VTF);
if (!(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); else if (format->f.id != WINED3DFMT_R32G32B32A32_FLOAT && format->f.id != WINED3DFMT_R32_FLOAT) - format_clear_flag(&format->f, WINED3DFMT_FLAG_VTF); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_VTF);
if (srgb_format || format->srgb_internal != format->internal) { @@ -3121,7 +3121,7 @@ static void query_internal_format(struct wined3d_adapter *adapter, if (!gl_info->supported[EXT_TEXTURE_SRGB]) { format->srgb_internal = format->internal; - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); } else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) { @@ -3129,25 +3129,25 @@ static void query_internal_format(struct wined3d_adapter *adapter, } }
- if ((format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SRGB_WRITE) && !srgb_write_supported) - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + if ((format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SRGB_WRITE) && !srgb_write_supported) + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); }
if ((!gl_info->supported[ARB_DEPTH_TEXTURE] || wined3d_settings.offscreen_rendering_mode != ORM_FBO) && (format->f.depth_size || format->f.stencil_size)) { TRACE("Disabling texturing support for depth / stencil format %s.\n", debug_d3dformat(format->f.id)); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3D_FORMAT_CAP_TEXTURE; }
query_view_class(format);
- if (format->internal && format->f.flags[WINED3D_GL_RES_TYPE_RB] - & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->internal && format->f.caps[WINED3D_GL_RES_TYPE_RB] + & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL) && (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] || gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE]) && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -3225,33 +3225,33 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win format->f.height_scale.numerator = 1; format->f.height_scale.denominator = 1;
- format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
/* GL_ARB_depth_texture does not support 3D textures. It also says "cube textures are * problematic", but doesn't explicitly mandate that an error is generated. */ - if (gl_info->supported[EXT_TEXTURE3D] && !(format_texture_info[i].flags & WINED3DFMT_FLAG_DEPTH_STENCIL)) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + if (gl_info->supported[EXT_TEXTURE3D] && !(format_texture_info[i].caps & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
- format->f.flags[WINED3D_GL_RES_TYPE_RB] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_RB] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_RB] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_RB] &= ~WINED3D_FORMAT_CAP_TEXTURE;
if (format->srgb_internal != format->internal && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)) { format->srgb_internal = format->internal; - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); }
- if (!gl_info->supported[ARB_SHADOW] && (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SHADOW)) - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + if (!gl_info->supported[ARB_SHADOW] && (format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SHADOW)) + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
query_internal_format(adapter, format, &format_texture_info[i], gl_info, srgb_write, FALSE);
@@ -3280,7 +3280,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win { srgb_format->internal = format_texture_info[i].gl_srgb_internal; srgb_format->srgb_internal = format_texture_info[i].gl_srgb_internal; - format_set_flag(&srgb_format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_set_caps(&srgb_format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); query_internal_format(adapter, srgb_format, &format_texture_info[i], gl_info, srgb_write, TRUE); } } @@ -3445,7 +3445,7 @@ static void init_format_filter_info(struct wined3d_adapter *adapter, for (i = 0; i < ARRAY_SIZE(fmts16); ++i) { format = get_format_gl_internal(adapter, fmts16[i]); - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); } } return; @@ -3461,7 +3461,7 @@ static void init_format_filter_info(struct wined3d_adapter *adapter, if (filtered) { TRACE("Format %s supports filtering.\n", debug_d3dformat(format->f.id)); - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); } else { @@ -3624,11 +3624,11 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ && (!gl_info->supported[ARB_FRAGMENT_SHADER] || !gl_info->supported[ARB_VERTEX_SHADER]))) { format = get_format_gl_internal(adapter, WINED3DFMT_YUY2); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0;
format = get_format_gl_internal(adapter, WINED3DFMT_UYVY); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0; }
@@ -3650,11 +3650,11 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ else { format = get_format_gl_internal(adapter, WINED3DFMT_YV12); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0;
format = get_format_gl_internal(adapter, WINED3DFMT_NV12); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0; }
@@ -3667,19 +3667,19 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (!gl_info->supported[ARB_HALF_FLOAT_PIXEL]) { format = get_format_gl_internal(adapter, WINED3DFMT_R16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16B16A16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
if (gl_info->quirks & WINED3D_QUIRK_BROKEN_RGBA16) { format = get_format_gl_internal(adapter, WINED3DFMT_R16G16B16A16_UNORM); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* ATI instancing hack: Although ATI cards do not support Shader Model @@ -3698,7 +3698,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[ARB_VERTEX_PROGRAM] || gl_info->supported[ARB_VERTEX_SHADER]) { format = get_format_gl_internal(adapter, WINED3DFMT_INST); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* Depth bound test. To query if the card supports it CheckDeviceFormat() @@ -3710,13 +3710,13 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[EXT_DEPTH_BOUNDS_TEST]) { format = get_format_gl_internal(adapter, WINED3DFMT_NVDB); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
if (gl_info->supported[ARB_MULTISAMPLE]) { format = get_format_gl_internal(adapter, WINED3DFMT_ATOC); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ @@ -3725,14 +3725,14 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]) { format = get_format_gl_internal(adapter, WINED3DFMT_RESZ); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET); }
for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { format = get_format_gl_by_idx(adapter, i);
- if (!(format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) + if (!(format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE)) continue;
if (is_identity_fixup(format->f.color_fixup)) @@ -3744,7 +3744,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ || !adapter->fragment_pipe->color_fixup_supported(format->f.color_fixup)) { TRACE("[FAILED]\n"); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); } else { @@ -3753,17 +3753,17 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ }
/* These formats are not supported for 3D textures. See also - * WINED3DFMT_FLAG_DECOMPRESS. */ + * WINED3D_FORMAT_CAP_DECOMPRESS. */ format = get_format_gl_internal(adapter, WINED3DFMT_ATI1N); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_ATI2N); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC4_SNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC5_UNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC5_SNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; }
static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, @@ -3783,7 +3783,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, format->f.emit_idx = format_vertex_info[i].emit_idx; format->vtx_type = format_vertex_info[i].gl_vtx_type; format->vtx_format = format->f.component_count; - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; }
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) @@ -3797,7 +3797,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter,
static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) { - unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; + unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; unsigned int attrs, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) @@ -3810,11 +3810,11 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) return FALSE;
attrs = typeless_format->attrs; - memcpy(flags, typeless_format->flags, sizeof(flags)); + memcpy(caps, typeless_format->caps, sizeof(caps)); copy_format(adapter, typeless_format, format); typeless_format->attrs |= attrs; - for (j = 0; j < ARRAY_SIZE(typeless_format->flags); ++j) - typeless_format->flags[j] |= flags[j]; + for (j = 0; j < ARRAY_SIZE(typeless_format->caps); ++j) + typeless_format->caps[j] |= caps[j]; }
for (i = 0; i < ARRAY_SIZE(typeless_depth_stencil_formats); ++i) @@ -3832,10 +3832,10 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) typeless_ds_format->id = typeless_depth_stencil_formats[i].typeless_id; copy_format(adapter, typeless_ds_format, ds_format); typeless_ds_format->attrs = typeless_format->attrs; - for (j = 0; j < ARRAY_SIZE(typeless_ds_format->flags); ++j) + for (j = 0; j < ARRAY_SIZE(typeless_ds_format->caps); ++j) { - typeless_ds_format->flags[j] = typeless_format->flags[j]; - typeless_format->flags[j] &= ~WINED3DFMT_FLAG_DEPTH_STENCIL; + typeless_ds_format->caps[j] = typeless_format->caps[j]; + typeless_format->caps[j] &= ~WINED3D_FORMAT_CAP_DEPTH_STENCIL; }
if ((format_id = typeless_depth_stencil_formats[i].depth_view_id) @@ -3874,9 +3874,9 @@ static void init_format_gen_mipmap_info(const struct wined3d_adapter *adapter, { struct wined3d_format *format = get_format_by_idx(adapter, i);
- for (j = 0; j < ARRAY_SIZE(format->flags); ++j) - if (!(~format->flags[j] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - format->flags[j] |= WINED3DFMT_FLAG_GEN_MIPMAP; + for (j = 0; j < ARRAY_SIZE(format->caps); ++j) + if (!(~format->caps[j] & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FILTERING))) + format->caps[j] |= WINED3D_FORMAT_CAP_GEN_MIPMAP; } }
@@ -4125,7 +4125,7 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter, { struct wined3d_format_gl *format = get_format_gl_by_idx(adapter, i);
- if (format->f.depth_size && (format->f.flags[WINED3D_GL_RES_TYPE_RB] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (format->f.depth_size && (format->f.caps[WINED3D_GL_RES_TYPE_RB] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { TRACE("Testing depth bias scale for format %s.\n", debug_d3dformat(format->f.id)); format->f.depth_bias_scale = wined3d_adapter_find_polyoffset_scale(ctx, format->internal); @@ -4206,8 +4206,8 @@ BOOL wined3d_adapter_no3d_init_format_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, blit_formats[i]))) return FALSE;
- format->flags[WINED3D_GL_RES_TYPE_TEX_2D] |= WINED3DFMT_FLAG_BLIT; - format->flags[WINED3D_GL_RES_TYPE_RB] |= WINED3DFMT_FLAG_BLIT; + format->caps[WINED3D_GL_RES_TYPE_TEX_2D] |= WINED3D_FORMAT_CAP_BLIT; + format->caps[WINED3D_GL_RES_TYPE_RB] |= WINED3D_FORMAT_CAP_BLIT; }
return TRUE; @@ -4325,7 +4325,7 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, VkFormatFeatureFlags texture_flags; VkFormatProperties properties; VkImageUsageFlags vk_usage; - unsigned int flags; + unsigned int caps; const char *fixup; unsigned int i; uint32_t mask; @@ -4366,44 +4366,44 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, }
if (properties.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; if (properties.bufferFeatures & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_TEXTURE;
- flags = 0; + caps = 0; texture_flags = properties.linearTilingFeatures | properties.optimalTilingFeatures; if (texture_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { - flags |= WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_VTF; + caps |= WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_VTF; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_RENDERTARGET; + caps |= WINED3D_FORMAT_CAP_RENDERTARGET; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { - flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + caps |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } if (texture_flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + caps |= WINED3D_FORMAT_CAP_DEPTH_STENCIL; } if (texture_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { - flags |= WINED3DFMT_FLAG_FILTERING; + caps |= WINED3D_FORMAT_CAP_FILTERING; } if (texture_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { - flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS; }
- if (!(~flags & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - flags |= WINED3DFMT_FLAG_GEN_MIPMAP; + if (!(~caps & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FILTERING))) + caps |= WINED3D_FORMAT_CAP_GEN_MIPMAP;
- format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= flags; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] |= caps;
vk_usage = 0; if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index dbb78806c3e..67a6417534c 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -226,7 +226,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara if (e->input_slot >= WINED3D_MAX_STREAMS) continue;
- if (!(e->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_VERTEX_ATTRIBUTE)) + if (!(e->format->caps[WINED3D_GL_RES_TYPE_BUFFER] & WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE)) { FIXME("The application tries to use an unsupported format (%s).\n", debug_d3dformat(elements[i].format)); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 0874bd506ce..c4b65921ea7 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -623,7 +623,7 @@ static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view * if (!(view->format = validate_resource_view(desc, resource, TRUE, allow_srgb_toggle))) return E_INVALIDARG; view->format_attrs = view->format->attrs; - view->format_flags = view->format->flags[resource->gl_type]; + view->format_caps = view->format->caps[resource->gl_type]; view->desc = *desc;
if (resource->type == WINED3D_RTYPE_BUFFER) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3d9d19dd880..ce4d7384066 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4354,7 +4354,7 @@ struct wined3d_resource enum wined3d_gl_resource_type gl_type; const struct wined3d_format *format; unsigned int format_attrs; - unsigned int format_flags; + unsigned int format_caps; enum wined3d_multisample_type multisample_type; UINT multisample_quality; DWORD usage; @@ -5341,7 +5341,7 @@ struct wined3d_rendertarget_view
const struct wined3d_format *format; unsigned int format_attrs; - unsigned int format_flags; + unsigned int format_caps; unsigned int sub_resource_idx; unsigned int layer_count;
@@ -6121,24 +6121,24 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400 #define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
-/* WineD3D pixel format flags */ -#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 -#define WINED3DFMT_FLAG_FILTERING 0x00000002 -#define WINED3DFMT_FLAG_UNORDERED_ACCESS 0x00000004 -#define WINED3DFMT_FLAG_DEPTH_STENCIL 0x00000008 -#define WINED3DFMT_FLAG_RENDERTARGET 0x00000010 -#define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 -#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 -#define WINED3DFMT_FLAG_DECOMPRESS 0x00000100 -#define WINED3DFMT_FLAG_SRGB_READ 0x00000800 -#define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 -#define WINED3DFMT_FLAG_VTF 0x00002000 -#define WINED3DFMT_FLAG_SHADOW 0x00004000 -#define WINED3DFMT_FLAG_TEXTURE 0x00080000 -#define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 -#define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 -#define WINED3DFMT_FLAG_BLIT 0x02000000 -#define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000 +/* Pixel format capabilities */ +#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING 0x00000001 +#define WINED3D_FORMAT_CAP_FILTERING 0x00000002 +#define WINED3D_FORMAT_CAP_UNORDERED_ACCESS 0x00000004 +#define WINED3D_FORMAT_CAP_DEPTH_STENCIL 0x00000008 +#define WINED3D_FORMAT_CAP_RENDERTARGET 0x00000010 +#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE 0x00000020 +#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB 0x00000040 +#define WINED3D_FORMAT_CAP_DECOMPRESS 0x00000080 +#define WINED3D_FORMAT_CAP_SRGB_READ 0x00000100 +#define WINED3D_FORMAT_CAP_SRGB_WRITE 0x00000200 +#define WINED3D_FORMAT_CAP_VTF 0x00000400 +#define WINED3D_FORMAT_CAP_SHADOW 0x00000800 +#define WINED3D_FORMAT_CAP_TEXTURE 0x00001000 +#define WINED3D_FORMAT_CAP_GEN_MIPMAP 0x00002000 +#define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE 0x00004000 +#define WINED3D_FORMAT_CAP_BLIT 0x00008000 +#define WINED3D_FORMAT_CAP_INDEX_BUFFER 0x00010000
struct wined3d_rational { @@ -6193,7 +6193,7 @@ struct wined3d_format UINT conv_byte_count; DWORD multisample_types; unsigned int attrs; - unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; + unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; float depth_bias_scale; struct wined3d_rational height_scale; struct color_fixup_desc color_fixup; @@ -6323,12 +6323,12 @@ static inline BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *
if (!context->d3d_info->srgb_read_control && (texture->resource.bind_flags & WINED3D_BIND_SHADER_RESOURCE) - && (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_READ)) + && (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_READ)) return TRUE;
if (!context->d3d_info->srgb_write_control && (texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET) - && (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE)) + && (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE)) return TRUE;
return FALSE; @@ -6339,7 +6339,7 @@ static inline BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info, { return (!(d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) || state->render_states[WINED3D_RS_SRGBWRITEENABLE]) - && fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; + && fb->render_targets[0] && fb->render_targets[0]->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; }
static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115399
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 error: patch failed: dlls/wined3d/device.c:4723 error: patch failed: dlls/wined3d/utils.c:328 error: patch failed: dlls/wined3d/wined3d_private.h:6119 error: patch failed: dlls/wined3d/context_gl.c:4448 error: patch failed: dlls/wined3d/cs.c:1206 error: patch failed: dlls/wined3d/device.c:4585 error: patch failed: dlls/wined3d/directx.c:1819 error: patch failed: dlls/wined3d/glsl_shader.c:13076 error: patch failed: dlls/wined3d/resource.c:123 error: patch failed: dlls/wined3d/shader.c:4123 error: patch failed: dlls/wined3d/state.c:563 error: patch failed: dlls/wined3d/texture.c:302 error: patch failed: dlls/wined3d/utils.c:307 error: patch failed: dlls/wined3d/vertexdeclaration.c:226 error: patch failed: dlls/wined3d/view.c:623 error: patch failed: dlls/wined3d/wined3d_private.h:4354 Task: Patch failed to apply
=== debian11 (build log) ===
error: patch failed: dlls/wined3d/adapter_gl.c:4474 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/resource.c:188 error: patch failed: dlls/wined3d/utils.c:306 error: patch failed: dlls/wined3d/view.c:622 error: patch failed: dlls/wined3d/wined3d_private.h:4353 error: patch failed: dlls/wined3d/context_gl.c:5734 error: patch failed: dlls/wined3d/texture.c:6655 error: patch failed: dlls/wined3d/utils.c:2117 error: patch failed: dlls/wined3d/view.c:1571 error: patch failed: dlls/wined3d/wined3d_private.h:6109 error: patch failed: dlls/wined3d/context_gl.c:5733 error: patch failed: dlls/wined3d/device.c:5120 error: patch failed: dlls/wined3d/utils.c:347 error: patch failed: dlls/wined3d/wined3d_private.h:6110 error: patch failed: dlls/wined3d/directx.c:1923 error: patch failed: dlls/wined3d/utils.c:357 error: patch failed: dlls/wined3d/wined3d_private.h:6111 error: patch failed: dlls/wined3d/directx.c:1901 error: patch failed: dlls/wined3d/utils.c:323 error: patch failed: dlls/wined3d/wined3d_private.h:6112 error: patch failed: dlls/wined3d/device.c:4722 error: patch failed: dlls/wined3d/resource.c:174 error: patch failed: dlls/wined3d/surface.c:652 error: patch failed: dlls/wined3d/texture.c:2537 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6113 error: patch failed: dlls/wined3d/arb_program_shader.c:7744 error: patch failed: dlls/wined3d/glsl_shader.c:13060 error: patch failed: dlls/wined3d/surface.c:255 error: patch failed: dlls/wined3d/texture.c:71 error: patch failed: dlls/wined3d/utils.c:697 error: patch failed: dlls/wined3d/wined3d_private.h:6115 error: patch failed: dlls/wined3d/resource.c:195 error: patch failed: dlls/wined3d/utils.c:315 error: patch failed: dlls/wined3d/wined3d_private.h:6118 error: patch failed: dlls/wined3d/device.c:4723 error: patch failed: dlls/wined3d/utils.c:328 error: patch failed: dlls/wined3d/wined3d_private.h:6119 error: patch failed: dlls/wined3d/context_gl.c:4448 error: patch failed: dlls/wined3d/cs.c:1206 error: patch failed: dlls/wined3d/device.c:4585 error: patch failed: dlls/wined3d/directx.c:1819 error: patch failed: dlls/wined3d/glsl_shader.c:13076 error: patch failed: dlls/wined3d/resource.c:123 error: patch failed: dlls/wined3d/shader.c:4123 error: patch failed: dlls/wined3d/state.c:563 error: patch failed: dlls/wined3d/texture.c:302 error: patch failed: dlls/wined3d/utils.c:307 error: patch failed: dlls/wined3d/vertexdeclaration.c:226 error: patch failed: dlls/wined3d/view.c:623 error: patch failed: dlls/wined3d/wined3d_private.h:4354 Task: Patch failed to apply