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.
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. --- dlls/wined3d/adapter_gl.c | 4 +- dlls/wined3d/device.c | 3 +- dlls/wined3d/resource.c | 1 + dlls/wined3d/utils.c | 94 ++++++++++++++++++---------------- dlls/wined3d/view.c | 1 + dlls/wined3d/wined3d_private.h | 6 ++- 6 files changed, 61 insertions(+), 48 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index d72c43e48b8..547c2f67709 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->base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_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..3d4ebabcc60 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->base_flags & WINED3DFMT_FLAG_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..20b14bf7a0f 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_base_flags = format->base_flags; 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..6f3a8ba3413 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 base_flags; + 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_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, 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_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, base_flags = 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; + base_flags |= WINED3DFMT_FLAG_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->base_flags |= base_flags; 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->base_flags |= format_base_flags[i].base_flags; 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.base_flags & WINED3DFMT_FLAG_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 base_flags, 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;
+ base_flags = typeless_format->base_flags; memcpy(flags, typeless_format->flags, sizeof(flags)); copy_format(adapter, typeless_format, format); + typeless_format->base_flags = base_flags; 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->base_flags = typeless_format->base_flags; 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.base_flags & WINED3DFMT_FLAG_FLOAT) format->f.depth_bias_scale /= 1u << 24; else format->f.depth_bias_scale /= 1u << format->f.depth_size; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index f2dea8f0f9a..3866f3b4ebe 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -613,6 +613,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_base_flags = view->format->base_flags; 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 1d8bb40cec4..ffad3b82b90 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_base_flags; unsigned int format_flags; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -5337,6 +5338,7 @@ struct wined3d_rendertarget_view const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format; + unsigned int format_base_flags; unsigned int format_flags; unsigned int sub_resource_idx; unsigned int layer_count; @@ -6104,6 +6106,8 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN */
/* WineD3D pixel format flags */ +#define WINED3DFMT_FLAG_FLOAT 0x00000001 + #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 #define WINED3DFMT_FLAG_UNORDERED_ACCESS 0x00000004 @@ -6113,7 +6117,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 @@ -6186,6 +6189,7 @@ struct wined3d_format
UINT conv_byte_count; DWORD multisample_types; + unsigned int base_flags; unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; float depth_bias_scale; struct wined3d_rational height_scale;
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/context_gl.c | 4 +++- dlls/wined3d/texture.c | 2 +- dlls/wined3d/utils.c | 6 +++--- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 0a731dc85f0..004a293a715 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -5734,6 +5734,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c if (element->stride) { DWORD format_flags = format_gl->f.flags[WINED3D_GL_RES_TYPE_BUFFER]; + unsigned int format_base_flags = format_gl->f.base_flags;
bo = wined3d_bo_gl_id(element->data.buffer_object); if (current_bo != bo) @@ -5746,7 +5747,8 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c * pointer. vb can point to a user pointer data blob. In that case * current_bo will be 0. If there is a vertex buffer but no vbo we * won't be load converted attributes anyway. */ - if (vs && vs->reg_maps.shader_version.major >= 4 && (format_flags & WINED3DFMT_FLAG_INTEGER)) + if (vs && vs->reg_maps.shader_version.major >= 4 + && (format_base_flags & WINED3DFMT_FLAG_INTEGER)) { GL_EXTCALL(glVertexAttribIPointer(i, format_gl->vtx_format, format_gl->vtx_type, element->stride, offset)); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 595baf07788..8e1aa6b1ad9 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -6652,7 +6652,7 @@ static void vk_blitter_clear_rendertargets(struct wined3d_context_vk *context_vk wined3d_rendertarget_view_vk_barrier(rtv_vk, context_vk, WINED3D_BIND_RENDER_TARGET);
c = &clear_values[attachment_count].color; - if (view->format_flags & WINED3DFMT_FLAG_INTEGER) + if (view->format_base_flags & WINED3DFMT_FLAG_INTEGER) { c->int32[0] = colour->r; c->int32[1] = colour->g; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 6f3a8ba3413..0fcabd59e64 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2117,7 +2117,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) if (channel_type == WINED3D_CHANNEL_TYPE_UNORM || channel_type == WINED3D_CHANNEL_TYPE_SNORM) flags |= WINED3DFMT_FLAG_NORMALISED; if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) - flags |= WINED3DFMT_FLAG_INTEGER; + base_flags |= WINED3DFMT_FLAG_INTEGER; if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) base_flags |= WINED3DFMT_FLAG_FLOAT; if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) @@ -2598,7 +2598,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for if (status == GL_FRAMEBUFFER_COMPLETE && ((format->f.flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - && !(format->f.flags[type] & WINED3DFMT_FLAG_INTEGER) + && !(format->f.base_flags & WINED3DFMT_FLAG_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT && format->format != GL_LUMINANCE && format->format != GL_LUMINANCE_ALPHA && (format->f.red_size || format->f.alpha_size)) @@ -3214,7 +3214,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
/* ARB_texture_rg defines integer formats if EXT_texture_integer is also supported. */ if (!gl_info->supported[EXT_TEXTURE_INTEGER] - && (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_INTEGER)) + && (format->f.base_flags & WINED3DFMT_FLAG_INTEGER)) continue;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 3866f3b4ebe..2cdd49e8b5a 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1561,7 +1561,7 @@ void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view packed = wined3d_format_pack(&format_gl->f, clear_value); data = &packed; } - else if (resource->format_flags & WINED3DFMT_FLAG_INTEGER) + else if (resource->format_base_flags & WINED3DFMT_FLAG_INTEGER) { gl_format = GL_RGBA_INTEGER; gl_type = GL_UNSIGNED_INT; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ffad3b82b90..e5d1f93692f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6107,6 +6107,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_FLOAT 0x00000001 +#define WINED3DFMT_FLAG_INTEGER 0x00000002
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6128,7 +6129,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00040000 #define WINED3DFMT_FLAG_TEXTURE 0x00080000 #define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00100000 -#define WINED3DFMT_FLAG_INTEGER 0x00200000 #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_NORMALISED 0x00800000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/context_gl.c | 5 ++--- dlls/wined3d/device.c | 3 +-- dlls/wined3d/utils.c | 27 +++++++++++++-------------- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 004a293a715..0bc7d8e23ce 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -5733,8 +5733,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
if (element->stride) { - DWORD format_flags = format_gl->f.flags[WINED3D_GL_RES_TYPE_BUFFER]; - unsigned int format_base_flags = format_gl->f.base_flags; + unsigned int format_flags = format_gl->f.base_flags;
bo = wined3d_bo_gl_id(element->data.buffer_object); if (current_bo != bo) @@ -5748,7 +5747,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c * 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_base_flags & WINED3DFMT_FLAG_INTEGER)) + && (format_flags & WINED3DFMT_FLAG_INTEGER)) { GL_EXTCALL(glVertexAttribIPointer(i, format_gl->vtx_format, format_gl->vtx_type, element->stride, offset)); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3d4ebabcc60..bebd52ebb86 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->base_flags & WINED3DFMT_FLAG_FLOAT) || - (view->format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_NORMALISED))) + if (!(view->format->base_flags & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_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 0fcabd59e64..e064f2c2cc7 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, 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}, };
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, base_flags = 0; unsigned int component_count = 0; + unsigned int base_flags = 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; + base_flags |= WINED3DFMT_FLAG_NORMALISED; if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) base_flags |= WINED3DFMT_FLAG_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->base_flags |= base_flags; - 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->base_flags & WINED3DFMT_FLAG_NORMALISED) { uint32_t *ret_i = ret;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e5d1f93692f..49558ad4c8f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6108,6 +6108,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN /* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_FLOAT 0x00000001 #define WINED3DFMT_FLAG_INTEGER 0x00000002 +#define WINED3DFMT_FLAG_NORMALISED 0x00000004
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6130,7 +6131,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
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/directx.c | 11 ++- dlls/wined3d/utils.c | 167 ++++++++++++++++++++++++++++----- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 152 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index c9a62c6997a..c84a4b47f0a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1727,10 +1727,10 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id) { const struct wined3d_format *adapter_format, *format; + unsigned int format_flags = 0, format_base_flags = 0; enum wined3d_gl_resource_type gl_type, gl_type_end; 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, " @@ -1879,7 +1879,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_base_flags |= WINED3DFMT_FLAG_BUMPMAP;
if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { @@ -1887,6 +1887,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
+ if ((format->base_flags & format_base_flags) != format_base_flags) + { + TRACE("Requested format flags %#x, but format %s only has %#x.\n", + format_base_flags, debug_d3dformat(check_format_id), format->base_flags); + 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 e064f2c2cc7..1c6ace857c4 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -759,6 +759,7 @@ struct wined3d_format_texture_info GLint gl_format; GLint gl_type; unsigned int conv_byte_count; + unsigned int base_flags; unsigned int flags; enum wined3d_gl_extension extension; void (*upload)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch, @@ -1355,6 +1356,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 + base_flags flags extension upload download */ /* FourCC formats */ @@ -1366,560 +1368,674 @@ static const struct wined3d_format_texture_info format_texture_info[] = */ {WINED3DFMT_UYVY, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_UYVY, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YUY2, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YUY2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_NV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_NV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC4_UNORM, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC5_UNORM, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, /* IEEE formats */ {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RED, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, GL_RED, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RGB, GL_FLOAT, 12, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_FLOAT, convert_r32g32_float}, {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, GL_RG, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, GL_RGB, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_FLOAT, NULL}, /* Float */ {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RGB, GL_HALF_FLOAT_ARB, 6, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_FLOAT, convert_r16g16}, {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, GL_RG, GL_HALF_FLOAT_ARB, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, EXT_PACKED_FLOAT}, /* Palettized formats */ {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, + 0, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_P8_UINT, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, 0, + 0, WINED3D_GL_LEGACY_CONTEXT, NULL}, /* Standard ARGB formats */ {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 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_GL_EXT_NONE, NULL}, {WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 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_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8B8A8_UINT, GL_RGBA8UI, GL_RGBA8UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_8_8_8_8_REV, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, GL_RGBA_INTEGER, GL_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16_UNORM, GL_RGB16, GL_RGB16, GL_RGBA16, GL_RGB, GL_UNSIGNED_SHORT, 6, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16}, {WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0, GL_RG, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_UINT, GL_RG8UI, GL_RG8UI, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_SINT, GL_RG8I, GL_RG8I, 0, GL_RG_INTEGER, GL_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, 0, GL_RGBA_INTEGER, GL_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32_UINT, GL_RG32UI, GL_RG32UI, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_SINT, GL_RG32I, GL_RG32I, 0, GL_RG_INTEGER, GL_INT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_UINT, GL_RG16UI, GL_RG16UI, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_SINT, GL_RG16I, GL_RG16I, 0, GL_RG_INTEGER, GL_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_UINT, GL_R8UI, GL_R8UI, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_SINT, GL_R8I, GL_R8I, 0, GL_RED_INTEGER, GL_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L4A4_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 2, + 0, WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, convert_l4a4_unorm}, {WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 2, + 0, WINED3DFMT_FLAG_FILTERING, WINED3D_GL_LEGACY_CONTEXT, convert_l4a4_unorm}, {WINED3DFMT_L16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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 - | WINED3DFMT_FLAG_BUMPMAP, + 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_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_BUMPMAP, 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_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_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_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_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_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_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_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_BUMPMAP, 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_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_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_BUMPMAP, 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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16_SNORM, GL_R16_SNORM, GL_R16_SNORM, 0, GL_RED, GL_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, 0, GL_RED, GL_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, + 0, WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, 0, GL_RGBA_INTEGER, GL_INT, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ATI_TEXTURE_COMPRESSION_3DC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, EXT_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_INTZ, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH_STENCIL, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_NULL, 0, 0, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_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, + 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, EXT_TEXTURE_SHARED_EXPONENT, NULL}, }; @@ -3229,6 +3345,7 @@ 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.base_flags |= format_texture_info[i].base_flags; 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; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 49558ad4c8f..3c0442ffafa 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 #define WINED3DFMT_FLAG_FLOAT 0x00000001 #define WINED3DFMT_FLAG_INTEGER 0x00000002 #define WINED3DFMT_FLAG_NORMALISED 0x00000004 +#define WINED3DFMT_FLAG_BUMPMAP 0x00000008
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6119,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_BUMPMAP 0x00000400 #define WINED3DFMT_FLAG_SRGB_READ 0x00000800 #define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 #define WINED3DFMT_FLAG_VTF 0x00002000
From: 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 c84a4b47f0a..8ea7d0452c8 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1706,8 +1706,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->base_flags & WINED3DFMT_FLAG_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 1c6ace857c4..1cbb79f99a6 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, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_D32_FLOAT_S8X24_UINT, WINED3DFMT_FLAG_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, 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, 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 3c0442ffafa..e52ad04f6b9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6110,13 +6110,13 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_INTEGER 0x00000002 #define WINED3DFMT_FLAG_NORMALISED 0x00000004 #define WINED3DFMT_FLAG_BUMPMAP 0x00000008 +#define WINED3DFMT_FLAG_EXTENSION 0x00000010
#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_EXTENSION 0x00000020 #define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 #define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 #define WINED3DFMT_FLAG_DECOMPRESS 0x00000100
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/device.c | 6 +- dlls/wined3d/resource.c | 6 +- dlls/wined3d/surface.c | 10 +-- dlls/wined3d/texture.c | 8 +-- dlls/wined3d/utils.c | 111 ++++++++++++++++++++------------- dlls/wined3d/wined3d_private.h | 6 +- 6 files changed, 86 insertions(+), 61 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bebd52ebb86..a94c4697316 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_base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; } @@ -5222,7 +5222,7 @@ 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_base_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) return WINED3DERR_INVALIDCALL; }
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 20b14bf7a0f..8e3743526e8 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -174,7 +174,7 @@ 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)) + && (format->base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) == WINED3DFMT_FLAG_BLOCKS) { UINT width_mask = format->block_width - 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_base_flags & WINED3DFMT_FLAG_BLOCKS) { /* This assumes power of two block sizes, but NPOT block sizes would * be silly anyway. @@ -597,7 +597,7 @@ 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_base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_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..bb776ad0eed 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -707,12 +707,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->base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_BLOCKS ? wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, 0) : src_format; }
@@ -759,8 +759,8 @@ 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_flags = src_format->flags[src_texture->resource.gl_type]; - dst_fmt_flags = dst_format->flags[dst_texture->resource.gl_type]; + src_fmt_flags = src_format->base_flags; + dst_fmt_flags = dst_format->base_flags; flags &= ~WINED3D_BLT_RAW;
bpp = dst_format->byte_count; @@ -1188,7 +1188,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_base_flags & WINED3DFMT_FLAG_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 8e1aa6b1ad9..3958958174a 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_base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { unsigned int min_size;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 1cbb79f99a6..52aff96c36c 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, WINED3DFMT_FLAG_BROKEN_PITCH, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_ATI2N, WINED3DFMT_FLAG_BROKEN_PITCH, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_D16_LOCKABLE, 0, + WINED3DFMT_FLAG_MAPPABLE}, + {WINED3DFMT_INTZ, 0, + WINED3DFMT_FLAG_MAPPABLE}, {WINED3DFMT_R11G11B10_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_D32_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_S8_UINT_D24_FLOAT, WINED3DFMT_FLAG_FLOAT}, @@ -328,25 +332,44 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_NVDB, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_ATOC, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_RESZ, 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_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, WINED3DFMT_FLAG_NORMALISED}, {WINED3DFMT_B10G10R10A2_UNORM, WINED3DFMT_FLAG_NORMALISED}, {WINED3DFMT_B2G3R3_UNORM, WINED3DFMT_FLAG_NORMALISED}, @@ -668,28 +691,29 @@ struct wined3d_format_block_info UINT block_width; UINT block_height; UINT block_byte_count; + unsigned int base_flags; 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_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, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, + {WINED3DFMT_ATI2N, 4, 4, 16, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, {WINED3DFMT_YUY2, 2, 1, 4, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, {WINED3DFMT_UYVY, 2, 1, 4, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY}, {WINED3DFMT_R9G9B9E5_SHAREDEXP, 1, 1, 4}, @@ -2289,7 +2313,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->base_flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].base_flags; + format_set_flag(format, format_block_info[i].flags); }
return TRUE; @@ -4644,7 +4669,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->base_flags & WINED3DFMT_FLAG_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; @@ -4677,7 +4702,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->base_flags & WINED3DFMT_FLAG_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 e52ad04f6b9..2cbe78d3bd4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6111,6 +6111,9 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_NORMALISED 0x00000004 #define WINED3DFMT_FLAG_BUMPMAP 0x00000008 #define WINED3DFMT_FLAG_EXTENSION 0x00000010 +#define WINED3DFMT_FLAG_BLOCKS 0x00000020 +#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00000040 +#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00000080
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6125,11 +6128,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
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/arb_program_shader.c | 4 +-- dlls/wined3d/glsl_shader.c | 4 +-- dlls/wined3d/surface.c | 2 +- dlls/wined3d/texture.c | 24 ++++++++--------- dlls/wined3d/utils.c | 44 +++++++++++++++---------------- dlls/wined3d/wined3d_private.h | 6 ++--- 6 files changed, 40 insertions(+), 44 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 12606bbd0b0..7522b566c23 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->base_flags & WINED3DFMT_FLAG_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..4fc1307445b 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->base_flags & WINED3DFMT_FLAG_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 bb776ad0eed..90d21abd552 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) && !src_format->decompress))) { FIXME("Cannot find a conversion function from format %s to %s.\n", diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 3958958174a..fbe5ac39a08 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_base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); }
/* Front buffer coordinates are always full screen coordinates, but our GL @@ -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_base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_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->base_flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) { FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", desc->width, desc->height); @@ -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->base_flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source or destination resource is not GPU accessible.\n"); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 52aff96c36c..b91626b9f81 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -692,28 +692,27 @@ struct wined3d_format_block_info UINT block_height; UINT block_byte_count; unsigned int base_flags; - 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, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, - {WINED3DFMT_ATI2N, 4, 4, 16, WINED3DFMT_FLAG_BLOCKS_NO_VERIFY, WINED3DFMT_FLAG_COMPRESSED}, + {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_R9G9B9E5_SHAREDEXP, 1, 1, 4}, @@ -2314,7 +2313,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->base_flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].base_flags; - format_set_flag(format, format_block_info[i].flags); }
return TRUE; @@ -3062,7 +3060,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.base_flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Skipping format %s because it's a compressed format.\n", debug_d3dformat(format->f.id)); @@ -3782,13 +3780,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.base_flags |= WINED3DFMT_FLAG_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.base_flags |= WINED3DFMT_FLAG_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); @@ -4684,7 +4682,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->base_flags & WINED3DFMT_FLAG_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 2cbe78d3bd4..22009db8811 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6113,7 +6113,9 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_EXTENSION 0x00000010 #define WINED3DFMT_FLAG_BLOCKS 0x00000020 #define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY 0x00000040 -#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00000080 +#define WINED3DFMT_FLAG_COMPRESSED 0x00000080 +#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00000100 +#define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00000200
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6127,8 +6129,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
From: 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 8e3743526e8..f00e741ae25 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_base_flags & WINED3DFMT_FLAG_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 b91626b9f81..64bc2d8b2ba 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, WINED3DFMT_FLAG_BROKEN_PITCH, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_ATI2N, WINED3DFMT_FLAG_BROKEN_PITCH, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_D16_LOCKABLE, 0, - WINED3DFMT_FLAG_MAPPABLE}, - {WINED3DFMT_INTZ, 0, - WINED3DFMT_FLAG_MAPPABLE}, + {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}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 22009db8811..71a77484a22 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6116,6 +6116,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_COMPRESSED 0x00000080 #define WINED3DFMT_FLAG_BROKEN_PITCH 0x00000100 #define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00000200 +#define WINED3DFMT_FLAG_MAPPABLE 0x00000400
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6133,7 +6134,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
From: 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 a94c4697316..48ad375b890 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_base_flags & WINED3DFMT_FLAG_BLOCKS) - && (dst_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) + && (dst_resource->format_base_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) + if ((src_resource->format_base_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) && (dst_resource->format_base_flags & WINED3DFMT_FLAG_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 64bc2d8b2ba..7bfe7cd44af 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, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_ATOC, WINED3DFMT_FLAG_EXTENSION}, {WINED3DFMT_RESZ, 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_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, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3DFMT_FLAG_NORMALISED}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 71a77484a22..c8a96a4a938 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6117,6 +6117,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_BROKEN_PITCH 0x00000100 #define WINED3DFMT_FLAG_HEIGHT_SCALE 0x00000200 #define WINED3DFMT_FLAG_MAPPABLE 0x00000400 +#define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x00000800
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 #define WINED3DFMT_FLAG_FILTERING 0x00000002 @@ -6134,7 +6135,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
From: 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 | 24 +- dlls/wined3d/utils.c | 606 +++++++++++++++---------------- dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 47 +-- 13 files changed, 385 insertions(+), 382 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 0bc7d8e23ce..aeda3019c5e 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 & WINED3DFMT_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..232a03ef213 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 & WINED3DFMT_CAP_SRGB_WRITE; + curr_srgb_write = view && view->format_caps & WINED3DFMT_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 & WINED3DFMT_CAP_SHADOW) != (old_fmt_caps & WINED3DFMT_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 48ad375b890..2a4e361a070 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 & WINED3DFMT_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 8ea7d0452c8..5f772eed600 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1624,12 +1624,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] & WINED3DFMT_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] & WINED3DFMT_CAP_DEPTH_STENCIL)) { WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format->id)); return WINED3DERR_NOTAVAILABLE; @@ -1703,11 +1703,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]) + & WINED3DFMT_CAP_BLIT) return TRUE;
if ((format->base_flags & WINED3DFMT_FLAG_EXTENSION) - && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) + && (format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_CAP_TEXTURE)) return TRUE;
return FALSE; @@ -1727,7 +1728,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id) { const struct wined3d_format *adapter_format, *format; - unsigned int format_flags = 0, format_base_flags = 0; + unsigned int format_caps = 0, format_base_flags = 0; enum wined3d_gl_resource_type gl_type, gl_type_end; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; @@ -1856,32 +1857,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 |= WINED3DFMT_CAP_TEXTURE; if (bind_flags & WINED3D_BIND_RENDER_TARGET) - format_flags |= WINED3DFMT_FLAG_RENDERTARGET; + format_caps |= WINED3DFMT_CAP_RENDERTARGET; if (bind_flags & WINED3D_BIND_DEPTH_STENCIL) - format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + format_caps |= WINED3DFMT_CAP_DEPTH_STENCIL; if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS) - format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + format_caps |= WINED3DFMT_CAP_UNORDERED_ACCESS; if (bind_flags & WINED3D_BIND_VERTEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format_flags |= WINED3DFMT_CAP_VERTEX_ATTRIBUTE; if (bind_flags & WINED3D_BIND_INDEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_INDEX_BUFFER; + format_flags |= WINED3DFMT_CAP_INDEX_BUFFER;
if (usage & WINED3DUSAGE_QUERY_FILTER) - format_flags |= WINED3DFMT_FLAG_FILTERING; + format_caps |= WINED3DFMT_CAP_FILTERING; if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING) - format_flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format_caps |= WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING; if (usage & WINED3DUSAGE_QUERY_SRGBREAD) - format_flags |= WINED3DFMT_FLAG_SRGB_READ; + format_caps |= WINED3DFMT_CAP_SRGB_READ; if (usage & WINED3DUSAGE_QUERY_SRGBWRITE) - format_flags |= WINED3DFMT_FLAG_SRGB_WRITE; + format_caps |= WINED3DFMT_CAP_SRGB_WRITE; if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) - format_flags |= WINED3DFMT_FLAG_VTF; + format_caps |= WINED3DFMT_CAP_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) format_base_flags |= WINED3DFMT_FLAG_BUMPMAP;
- if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) + if ((format_caps & WINED3DFMT_CAP_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n"); return WINED3DERR_NOTAVAILABLE; @@ -1896,6 +1897,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)) { @@ -1923,14 +1931,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] & WINED3DFMT_CAP_GEN_MIPMAP)) mipmap_gen_supported = FALSE; }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 4fc1307445b..b7d73a7271d 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] & WINED3DFMT_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 f00e741ae25..47e75f73cf9 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] & WINED3DFMT_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] & WINED3DFMT_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] & WINED3DFMT_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_base_flags = format->base_flags; 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 & (WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_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..7dd42ddd856 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 & WINED3DFMT_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..e298d95a093 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 & WINED3DFMT_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 & WINED3DFMT_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 & WINED3DFMT_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 fbe5ac39a08..a674c55e05a 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] & WINED3DFMT_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] & WINED3DFMT_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] & WINED3DFMT_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] & WINED3DFMT_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 & WINED3DFMT_CAP_DECOMPRESS) { - TRACE("WINED3DFMT_FLAG_DECOMPRESS set.\n"); + TRACE("WINED3DFMT_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 & WINED3DFMT_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 & WINED3DFMT_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 & WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB))) { DWORD src_location = sub_resource->locations & WINED3D_LOCATION_RB_RESOLVED ? WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; @@ -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] & WINED3DFMT_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 & WINED3DFMT_CAP_GEN_MIPMAP)) WARN("Format doesn't support mipmaps generation, " "ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n"); else @@ -6056,7 +6056,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 & WINED3DFMT_CAP_FBO_ATTACHABLE)))) { next_flags |= WINED3DCLEAR_TARGET; flags &= ~WINED3DCLEAR_TARGET; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 7bfe7cd44af..ed8728186ee 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 base_flags; - 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, 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_CAP_INDEX_BUFFER}, {WINED3DFMT_R32_SINT, WINED3DFMT_FLAG_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, - WINED3DFMT_FLAG_INDEX_BUFFER}, + WINED3DFMT_CAP_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3DFMT_FLAG_NORMALISED}, {WINED3DFMT_B10G10R10A2_UNORM, WINED3DFMT_FLAG_NORMALISED}, {WINED3DFMT_B2G3R3_UNORM, WINED3DFMT_FLAG_NORMALISED}, @@ -762,7 +762,7 @@ struct wined3d_format_texture_info GLint gl_type; unsigned int conv_byte_count; unsigned int base_flags; - 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, @@ -1331,7 +1331,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 WINED3DFMT_CAP_TEXTURE set: * * These are never supported on native. * WINED3DFMT_B8G8R8_UNORM @@ -1359,7 +1359,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 base_flags - 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 @@ -1371,205 +1371,205 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_UYVY, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_UYVY, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YUY2, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YUY2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_NV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_NV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, /* IEEE formats */ {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RED, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, GL_RED, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RGB, GL_FLOAT, 12, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r32g32_float}, {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, GL_RG, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, GL_RGB, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, /* Float */ {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RGB, GL_HALF_FLOAT_ARB, 6, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r16g16}, {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, GL_RG, GL_HALF_FLOAT_ARB, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET - | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_RENDERTARGET + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_RENDERTARGET, EXT_PACKED_FLOAT}, /* Palettized formats */ {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, @@ -1586,459 +1586,459 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING | WINED3DFMT_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, 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, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_CAP_SRGB_WRITE + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 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, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_CAP_SRGB_WRITE + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, GL_RGBA_INTEGER, GL_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16_UNORM, GL_RGB16, GL_RGB16, GL_RGBA16, GL_RGB, GL_UNSIGNED_SHORT, 6, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16}, {WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0, GL_RG, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_UINT, GL_RG8UI, GL_RG8UI, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_SINT, GL_RG8I, GL_RG8I, 0, GL_RG_INTEGER, GL_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, 0, GL_RGBA_INTEGER, GL_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32_UINT, GL_RG32UI, GL_RG32UI, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_SINT, GL_RG32I, GL_RG32I, 0, GL_RG_INTEGER, GL_INT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_UINT, GL_RG16UI, GL_RG16UI, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_SINT, GL_RG16I, GL_RG16I, 0, GL_RG_INTEGER, GL_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_UINT, GL_R8UI, GL_R8UI, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_SINT, GL_R8I, GL_R8I, 0, GL_RED_INTEGER, GL_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L4A4_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 2, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, convert_l4a4_unorm}, {WINED3DFMT_L16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, 0, GL_RG, GL_BYTE, 0, WINED3DFMT_FLAG_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, 0, GL_RGBA, GL_BYTE, 0, WINED3DFMT_FLAG_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RGB16, GL_RGB16, 0, GL_BGR, GL_UNSIGNED_SHORT, 6, WINED3DFMT_FLAG_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RG16_SNORM, GL_RG16_SNORM, 0, GL_RG, GL_SHORT, 0, WINED3DFMT_FLAG_BUMPMAP, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16B16A16_SNORM, GL_RGBA16_SNORM, GL_RGBA16_SNORM, 0, GL_RGBA, GL_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16_SNORM, GL_R16_SNORM, GL_R16_SNORM, 0, GL_RED, GL_SHORT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, 0, GL_RED, GL_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_CAP_SHADOW, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_DEPTH_STENCIL | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, 0, GL_RGBA_INTEGER, GL_INT, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING + | WINED3DFMT_CAP_DEPTH_STENCIL, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_NULL, 0, 0, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_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, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING | WINED3DFMT_CAP_FILTERING, EXT_TEXTURE_SHARED_EXPONENT, NULL}, };
@@ -2128,20 +2128,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) @@ -2272,7 +2272,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) return FALSE;
format->base_flags |= format_base_flags[i].base_flags; - format_set_flag(format, format_base_flags[i].flags); + format_set_caps(format, format_base_flags[i].caps); }
return TRUE; @@ -2318,7 +2318,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] |= WINED3DFMT_CAP_DECOMPRESS; format->decompress = format_decompress_info[i].decompress; }
@@ -2485,9 +2485,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 WINED3DFMT_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 WINED3DFMT_CAP_TEXTURE set. Instead, swallow GL * errors generated by invalid formats. */ while (gl_info->gl_ops.gl.p_glGetError()); } @@ -2631,7 +2631,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";
@@ -2640,7 +2640,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] & WINED3DFMT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glGenRenderbuffers(1, &color_rb); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, color_rb); @@ -2662,7 +2662,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] |= WINED3DFMT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE; } @@ -2670,11 +2670,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] & (WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_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] &= ~(WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_DEPTH_STENCIL); } else { @@ -2707,13 +2707,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] &= ~(WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_DEPTH_STENCIL); } } }
if (status == GL_FRAMEBUFFER_COMPLETE - && ((format->f.flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) + && ((format->f.caps[type] & WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) && !(format->f.base_flags & WINED3DFMT_FLAG_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT @@ -2746,7 +2746,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] &= ~WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING; } else { @@ -2820,14 +2820,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] &= ~WINED3DFMT_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] |= WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING; } }
@@ -2852,7 +2852,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] |= WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -2860,13 +2860,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, WINED3DFMT_CAP_SRGB_WRITE); } } else if (status == GL_FRAMEBUFFER_COMPLETE) - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB;
- if (format->f.flags[type] & WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->f.caps[type] & WINED3DFMT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); gl_info->fbo_ops.glDeleteRenderbuffers(1, &color_rb); @@ -2880,30 +2880,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, WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_DEPTH_STENCIL + | WINED3DFMT_CAP_FBO_ATTACHABLE | WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB + | WINED3DFMT_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; } } } @@ -2928,7 +2928,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); @@ -2936,7 +2936,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] |= WINED3DFMT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE;
@@ -2946,25 +2946,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] |= WINED3DFMT_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] &= ~WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING; } } else { if (!rt_internal) { - if (format->f.flags[type] & WINED3DFMT_FLAG_RENDERTARGET) + if (format->f.caps[type] & WINED3DFMT_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] &= ~WINED3DFMT_CAP_RENDERTARGET; } else TRACE("Format %s is not supported as FBO color attachment," @@ -2985,7 +2985,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] &= ~WINED3DFMT_CAP_RENDERTARGET; } } } @@ -2998,7 +2998,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] |= WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -3006,19 +3006,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, WINED3DFMT_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] & WINED3DFMT_CAP_FBO_ATTACHABLE) + format->f.caps[type] |= WINED3DFMT_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, WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_FBO_ATTACHABLE + | WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB | WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING); } } return; @@ -3202,26 +3202,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, + WINED3DFMT_CAP_VTF, "vertex texture usage"); + query_format_cap(gl_info, format, format->internal, GL_FILTER, + WINED3DFMT_CAP_FILTERING, "filtering"); + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, + WINED3DFMT_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, + WINED3DFMT_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, + WINED3DFMT_CAP_SRGB_WRITE, "sRGB write"); else - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3DFMT_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] + & (WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_CAP_SRGB_WRITE))) format->srgb_internal = format->internal; else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; @@ -3230,12 +3230,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, WINED3DFMT_CAP_VTF);
if (!(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3DFMT_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, WINED3DFMT_CAP_VTF);
if (srgb_format || format->srgb_internal != format->internal) { @@ -3243,7 +3243,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, WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_CAP_SRGB_WRITE); } else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) { @@ -3251,25 +3251,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] & WINED3DFMT_CAP_SRGB_WRITE) && !srgb_write_supported) + format_clear_caps(&format->f, WINED3DFMT_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] &= ~WINED3DFMT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3DFMT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3DFMT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3DFMT_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] + & (WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_DEPTH_STENCIL) && (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] || gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE]) && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -3348,33 +3348,33 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win format->f.height_scale.denominator = 1;
format->f.base_flags |= format_texture_info[i].base_flags; - 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 | WINED3DFMT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].caps | WINED3DFMT_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 & WINED3DFMT_CAP_DEPTH_STENCIL)) + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].caps | WINED3DFMT_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 | WINED3DFMT_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 | WINED3DFMT_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 | WINED3DFMT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_RB] &= ~WINED3DFMT_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, WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_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] & WINED3DFMT_CAP_SHADOW)) + format_clear_caps(&format->f, WINED3DFMT_CAP_TEXTURE);
query_internal_format(adapter, format, &format_texture_info[i], gl_info, srgb_write, FALSE);
@@ -3403,7 +3403,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, WINED3DFMT_CAP_SRGB_READ | WINED3DFMT_CAP_SRGB_WRITE); query_internal_format(adapter, srgb_format, &format_texture_info[i], gl_info, srgb_write, TRUE); } } @@ -3568,7 +3568,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, WINED3DFMT_CAP_FILTERING); } } return; @@ -3584,7 +3584,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, WINED3DFMT_CAP_FILTERING); } else { @@ -3747,11 +3747,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, WINED3DFMT_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, WINED3DFMT_CAP_BLIT); format->internal = 0; }
@@ -3773,11 +3773,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, WINED3DFMT_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, WINED3DFMT_CAP_BLIT); format->internal = 0; }
@@ -3790,19 +3790,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, WINED3DFMT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3DFMT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16B16A16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3DFMT_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, WINED3DFMT_CAP_TEXTURE); }
/* ATI instancing hack: Although ATI cards do not support Shader Model @@ -3821,7 +3821,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, WINED3DFMT_CAP_TEXTURE); }
/* Depth bound test. To query if the card supports it CheckDeviceFormat() @@ -3833,13 +3833,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, WINED3DFMT_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, WINED3DFMT_CAP_TEXTURE); }
/* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ @@ -3848,14 +3848,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, WINED3DFMT_CAP_TEXTURE | WINED3DFMT_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] & WINED3DFMT_CAP_TEXTURE)) continue;
if (is_identity_fixup(format->f.color_fixup)) @@ -3867,7 +3867,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, WINED3DFMT_CAP_TEXTURE); } else { @@ -3876,17 +3876,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. */ + * WINED3DFMT_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] &= ~WINED3DFMT_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] &= ~WINED3DFMT_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] &= ~WINED3DFMT_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] &= ~WINED3DFMT_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] &= ~WINED3DFMT_CAP_TEXTURE; }
static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, @@ -3906,7 +3906,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] |= WINED3DFMT_CAP_VERTEX_ATTRIBUTE; }
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) @@ -3920,7 +3920,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 base_flags, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) @@ -3933,11 +3933,11 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) return FALSE;
base_flags = typeless_format->base_flags; - memcpy(flags, typeless_format->flags, sizeof(flags)); + memcpy(caps, typeless_format->caps, sizeof(caps)); copy_format(adapter, typeless_format, format); typeless_format->base_flags = base_flags; - 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) @@ -3955,10 +3955,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->base_flags = typeless_format->base_flags; - 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] &= ~WINED3DFMT_CAP_DEPTH_STENCIL; }
if ((format_id = typeless_depth_stencil_formats[i].depth_view_id) @@ -3997,9 +3997,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] & (WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_FILTERING))) + format->caps[j] |= WINED3DFMT_CAP_GEN_MIPMAP; } }
@@ -4248,7 +4248,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] & WINED3DFMT_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); @@ -4329,8 +4329,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] |= WINED3DFMT_CAP_BLIT; + format->caps[WINED3D_GL_RES_TYPE_RB] |= WINED3DFMT_CAP_BLIT; }
return TRUE; @@ -4448,7 +4448,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; @@ -4489,44 +4489,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] |= WINED3DFMT_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] |= WINED3DFMT_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 |= WINED3DFMT_CAP_TEXTURE | WINED3DFMT_CAP_VTF; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_RENDERTARGET; + caps |= WINED3DFMT_CAP_RENDERTARGET; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { - flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + caps |= WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING; } if (texture_flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + caps |= WINED3DFMT_CAP_DEPTH_STENCIL; } if (texture_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { - flags |= WINED3DFMT_FLAG_FILTERING; + caps |= WINED3DFMT_CAP_FILTERING; } if (texture_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { - flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + caps |= WINED3DFMT_CAP_UNORDERED_ACCESS; }
- if (!(~flags & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - flags |= WINED3DFMT_FLAG_GEN_MIPMAP; + if (!(~caps & (WINED3DFMT_CAP_RENDERTARGET | WINED3DFMT_CAP_FILTERING))) + caps |= WINED3DFMT_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..1708f4175ee 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] & WINED3DFMT_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 2cdd49e8b5a..748d1810634 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -614,7 +614,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_base_flags = view->format->base_flags; - 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 c8a96a4a938..4db66611669 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_base_flags; - unsigned int format_flags; + unsigned int format_caps; enum wined3d_multisample_type multisample_type; UINT multisample_quality; DWORD usage; @@ -5339,7 +5339,7 @@ struct wined3d_rendertarget_view
const struct wined3d_format *format; unsigned int format_base_flags; - unsigned int format_flags; + unsigned int format_caps; unsigned int sub_resource_idx; unsigned int layer_count;
@@ -6119,23 +6119,24 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_MAPPABLE 0x00000400 #define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x00000800
-#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 WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING 0x00000001 +#define WINED3DFMT_CAP_FILTERING 0x00000002 +#define WINED3DFMT_CAP_UNORDERED_ACCESS 0x00000004 +#define WINED3DFMT_CAP_DEPTH_STENCIL 0x00000008 +#define WINED3DFMT_CAP_RENDERTARGET 0x00000010 +#define WINED3DFMT_CAP_FBO_ATTACHABLE 0x00000020 +#define WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB 0x00000040 +#define WINED3DFMT_CAP_DECOMPRESS 0x00000080 +#define WINED3DFMT_CAP_SRGB_READ 0x00000100 +#define WINED3DFMT_CAP_SRGB_WRITE 0x00000200 +#define WINED3DFMT_CAP_VTF 0x00000400 +#define WINED3DFMT_CAP_SHADOW 0x00000800 +#define WINED3DFMT_CAP_TEXTURE 0x00001000 +#define WINED3DFMT_CAP_GEN_MIPMAP 0x00002000 +#define WINED3DFMT_CAP_VERTEX_ATTRIBUTE 0x00004000 +#define WINED3DFMT_CAP_BLIT 0x00008000 +#define WINED3DFMT_CAP_INDEX_BUFFER 0x00010000
struct wined3d_rational { @@ -6190,7 +6191,7 @@ struct wined3d_format UINT conv_byte_count; DWORD multisample_types; unsigned int base_flags; - 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; @@ -6320,12 +6321,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 & WINED3DFMT_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 & WINED3DFMT_CAP_SRGB_WRITE)) return TRUE;
return FALSE; @@ -6336,7 +6337,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 & WINED3DFMT_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=114865
Your paranoid android.
=== debian11 (build log) ===
../wine/dlls/wined3d/directx.c:1868:9: error: ‘format_flags’ undeclared (first use in this function); did you mean ‘format_caps’? Task: The win32 Wine build failed
=== debian11 (build log) ===
../wine/dlls/wined3d/directx.c:1868:9: error: ‘format_flags’ undeclared (first use in this function); did you mean ‘format_caps’? Task: The wow64 Wine build failed
From: Chip Davis cdavis5x@gmail.com
--- dlls/wined3d/adapter_gl.c | 4 +-- dlls/wined3d/arb_program_shader.c | 4 +-- dlls/wined3d/context_gl.c | 2 +- dlls/wined3d/device.c | 12 +++---- dlls/wined3d/directx.c | 10 +++--- dlls/wined3d/glsl_shader.c | 4 +-- dlls/wined3d/resource.c | 10 +++--- dlls/wined3d/surface.c | 12 +++---- dlls/wined3d/texture.c | 32 +++++++++--------- dlls/wined3d/utils.c | 56 +++++++++++++++---------------- dlls/wined3d/view.c | 4 +-- dlls/wined3d/wined3d_private.h | 6 ++-- 12 files changed, 77 insertions(+), 79 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 547c2f67709..6124e8aab92 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->base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->flags & WINED3DFMT_FLAG_FLOAT) return FALSE;
if ((format->id == WINED3DFMT_D16_LOCKABLE) || (format->id == WINED3DFMT_D32_FLOAT)) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 7522b566c23..fec5270c055 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) return FALSE;
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index aeda3019c5e..d9f4520b00b 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -5733,7 +5733,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
if (element->stride) { - unsigned int format_flags = format_gl->f.base_flags; + unsigned int format_flags = format_gl->f.flags;
bo = wined3d_bo_gl_id(element->data.buffer_object); if (current_bo != bo) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2a4e361a070..f557445e12c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4723,11 +4723,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_base_flags & WINED3DFMT_FLAG_BLOCKS) - && (dst_resource->format_base_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) + if ((src_resource->format_flags & WINED3DFMT_FLAG_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_base_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) - && (dst_resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS)) + if ((src_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) + && (dst_resource->format_flags & WINED3DFMT_FLAG_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; } @@ -5121,7 +5121,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->base_flags & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED))) + if (!(view->format->flags & (WINED3DFMT_FLAG_FLOAT | WINED3DFMT_FLAG_NORMALISED))) { WARN("Not supported for view format %s.\n", debug_d3dformat(view->format->id)); return; @@ -5223,7 +5223,7 @@ 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_base_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) + if ((resource->format_flags & WINED3DFMT_FLAG_BLOCKS) && !(resource->access & WINED3D_RESOURCE_ACCESS_CPU)) return WINED3DERR_INVALIDCALL; }
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 5f772eed600..ab3ed79a455 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1707,7 +1707,7 @@ static BOOL wined3d_check_surface_format(const struct wined3d_format *format) & WINED3DFMT_CAP_BLIT) return TRUE;
- if ((format->base_flags & WINED3DFMT_FLAG_EXTENSION) + if ((format->flags & WINED3DFMT_FLAG_EXTENSION) && (format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_CAP_TEXTURE)) return TRUE;
@@ -1728,7 +1728,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id) { const struct wined3d_format *adapter_format, *format; - unsigned int format_caps = 0, format_base_flags = 0; + unsigned int format_caps = 0, format_flags = 0; enum wined3d_gl_resource_type gl_type, gl_type_end; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; @@ -1880,7 +1880,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) format_caps |= WINED3DFMT_CAP_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) - format_base_flags |= WINED3DFMT_FLAG_BUMPMAP; + format_flags |= WINED3DFMT_FLAG_BUMPMAP;
if ((format_caps & WINED3DFMT_CAP_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { @@ -1888,10 +1888,10 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
- if ((format->base_flags & format_base_flags) != format_base_flags) + if ((format->flags & format_flags) != format_flags) { TRACE("Requested format flags %#x, but format %s only has %#x.\n", - format_base_flags, debug_d3dformat(check_format_id), format->base_flags); + format_flags, debug_d3dformat(check_format_id), format->flags); return WINED3DERR_NOTAVAILABLE; }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b7d73a7271d..0bf4daeaf47 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source resource does not have GPU access.\n"); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 47e75f73cf9..21c28604faf 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -174,7 +174,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * }
if (base_type != WINED3D_GL_RES_TYPE_COUNT - && (format->base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) + && (format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BLOCKS_NO_VERIFY)) == WINED3DFMT_FLAG_BLOCKS) { UINT width_mask = format->block_width - 1; @@ -188,14 +188,14 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->type = type; resource->gl_type = gl_type; resource->format = format; - resource->format_base_flags = format->base_flags; + resource->format_flags = format->flags; if (gl_type < WINED3D_GL_RES_TYPE_COUNT) resource->format_caps = format->caps[gl_type]; resource->multisample_type = multisample_type; resource->multisample_quality = multisample_quality; resource->usage = usage; resource->bind_flags = bind_flags; - if (resource->format_base_flags & WINED3DFMT_FLAG_MAPPABLE) + if (resource->format_flags & WINED3DFMT_FLAG_MAPPABLE) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W; resource->access = access; resource->width = width; @@ -520,7 +520,7 @@ HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, return WINEDDERR_INVALIDRECT; }
- if (resource->format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (resource->format_flags & WINED3DFMT_FLAG_BLOCKS) { /* This assumes power of two block sizes, but NPOT block sizes would * be silly anyway. @@ -597,7 +597,7 @@ 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_base_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + if ((resource->format_flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_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 90d21abd552..4e3f660d415 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->base_flags & WINED3DFMT_FLAG_COMPRESSED) + || ((src_format->flags & WINED3DFMT_FLAG_COMPRESSED) && !src_format->decompress))) { FIXME("Cannot find a conversion function from format %s to %s.\n", @@ -707,12 +707,12 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int else { same_sub_resource = FALSE; - upload = dst_format->base_flags & WINED3DFMT_FLAG_BLOCKS + upload = dst_format->flags & WINED3DFMT_FLAG_BLOCKS && (dst_width != src_width || dst_height != src_height);
if (upload) { - dst_format = src_format->base_flags & WINED3DFMT_FLAG_BLOCKS + dst_format = src_format->flags & WINED3DFMT_FLAG_BLOCKS ? wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, 0) : src_format; }
@@ -759,8 +759,8 @@ 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_flags = src_format->base_flags; - dst_fmt_flags = dst_format->base_flags; + src_fmt_flags = src_format->flags; + dst_fmt_flags = dst_format->flags; flags &= ~WINED3D_BLT_RAW;
bpp = dst_format->byte_count; @@ -1188,7 +1188,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_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (view->format_flags & WINED3DFMT_FLAG_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 a674c55e05a..b873f919dbf 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_base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); + && !(texture->resource.format_flags & WINED3DFMT_FLAG_HEIGHT_SCALE); }
/* Front buffer coordinates are always full screen coordinates, but our GL @@ -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_base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_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->base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) { GLenum internal = wined3d_gl_get_internal_format(&dst_texture->resource, format_gl, srgb); unsigned int dst_row_pitch, dst_slice_pitch; @@ -2411,7 +2411,7 @@ static enum wined3d_format_id wined3d_get_alpha_fixup_format(enum wined3d_format { unsigned int i;
- if (!(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED) && !dst_format->alpha_size) + if (!(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED) && !dst_format->alpha_size) return WINED3DFMT_UNKNOWN;
for (i = 0; i < ARRAY_SIZE(formats_src_alpha_fixup); ++i) @@ -2509,7 +2509,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, dst_texture->resource.pin_sysmem = 1; }
- if (src_format->base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (src_format->flags & WINED3DFMT_FLAG_HEIGHT_SCALE) { update_h *= src_format->height_scale.numerator; update_h /= src_format->height_scale.denominator; @@ -2536,7 +2536,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_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_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; @@ -2572,7 +2572,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, } else { - if (dst_texture->resource.format_base_flags & WINED3DFMT_FLAG_BLOCKS) + if (dst_texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ERR("Converting a block-based format.\n");
f = *wined3d_format_gl(src_format); @@ -2722,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_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) ERR("Unexpected compressed format for NP2 emulated texture.\n"); }
@@ -2770,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_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_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); @@ -2986,7 +2986,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context, checkGLcall("glBindBuffer"); }
- if (src_texture->resource.format_base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (src_texture->resource.format_flags & WINED3DFMT_FLAG_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); @@ -3634,7 +3634,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_base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (resource->format_flags & WINED3DFMT_FLAG_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); @@ -3861,7 +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->base_flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) + if (format->flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) { FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", desc->width, desc->height); @@ -3925,7 +3925,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->base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) { unsigned int min_size;
@@ -5712,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->base_flags & WINED3DFMT_FLAG_COMPRESSED) - && !(dst_format->base_flags & WINED3DFMT_FLAG_COMPRESSED); + decompress = (src_format->flags & WINED3DFMT_FLAG_COMPRESSED) + && !(dst_format->flags & WINED3DFMT_FLAG_COMPRESSED); if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) { TRACE("Source or destination resource is not GPU accessible.\n"); @@ -6650,7 +6650,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_base_flags & WINED3DFMT_FLAG_INTEGER) + if (view->format_flags & WINED3DFMT_FLAG_INTEGER) { c->int32[0] = colour->r; c->int32[1] = colour->g; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index ed8728186ee..df5c4a65ec8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -306,7 +306,7 @@ static const struct wined3d_format_ddi_info ddi_formats[] = struct wined3d_format_base_flags { enum wined3d_format_id id; - unsigned int base_flags; + unsigned int flags; unsigned int caps; };
@@ -670,7 +670,7 @@ struct wined3d_format_block_info UINT block_width; UINT block_height; UINT block_byte_count; - unsigned int base_flags; + unsigned int flags; };
static const struct wined3d_format_block_info format_block_info[] = @@ -761,7 +761,7 @@ struct wined3d_format_texture_info GLint gl_format; GLint gl_type; unsigned int conv_byte_count; - unsigned int base_flags; + 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, @@ -1358,7 +1358,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 - base_flags + flags caps extension upload download */ /* FourCC formats */ @@ -2201,7 +2201,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) { struct wined3d_format *typeless_format; unsigned int component_count = 0; - unsigned int base_flags = 0; + unsigned int flags = 0;
if (!(format = get_format_internal(adapter, typed_formats[i].id))) return FALSE; @@ -2233,11 +2233,11 @@ 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) - base_flags |= WINED3DFMT_FLAG_NORMALISED; + flags |= WINED3DFMT_FLAG_NORMALISED; if (channel_type == WINED3D_CHANNEL_TYPE_UINT || channel_type == WINED3D_CHANNEL_TYPE_SINT) - base_flags |= WINED3DFMT_FLAG_INTEGER; + flags |= WINED3DFMT_FLAG_INTEGER; if (channel_type == WINED3D_CHANNEL_TYPE_FLOAT) - base_flags |= WINED3DFMT_FLAG_FLOAT; + flags |= WINED3DFMT_FLAG_FLOAT; if (channel_type != WINED3D_CHANNEL_TYPE_UNUSED) ++component_count;
@@ -2255,7 +2255,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) }
format->component_count = component_count; - format->base_flags |= base_flags; + format->flags |= flags; }
for (i = 0; i < ARRAY_SIZE(ddi_formats); ++i) @@ -2271,7 +2271,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->base_flags |= format_base_flags[i].base_flags; + format->flags |= format_base_flags[i].flags; format_set_caps(format, format_base_flags[i].caps); }
@@ -2291,7 +2291,7 @@ 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->base_flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].base_flags; + format->flags |= WINED3DFMT_FLAG_BLOCKS | format_block_info[i].flags; }
return TRUE; @@ -2715,7 +2715,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for if (status == GL_FRAMEBUFFER_COMPLETE && ((format->f.caps[type] & WINED3DFMT_CAP_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - && !(format->f.base_flags & WINED3DFMT_FLAG_INTEGER) + && !(format->f.flags & WINED3DFMT_FLAG_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT && format->format != GL_LUMINANCE && format->format != GL_LUMINANCE_ALPHA && (format->f.red_size || format->f.alpha_size)) @@ -3039,7 +3039,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, if (!format->internal) continue;
- if (format->f.base_flags & WINED3DFMT_FLAG_COMPRESSED) + if (format->f.flags & WINED3DFMT_FLAG_COMPRESSED) { TRACE("Skipping format %s because it's a compressed format.\n", debug_d3dformat(format->f.id)); @@ -3325,13 +3325,11 @@ 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.base_flags & WINED3DFMT_FLAG_FLOAT)) + if (!gl_info->supported[ARB_TEXTURE_FLOAT] && (format->f.flags & WINED3DFMT_FLAG_FLOAT)) continue;
/* ARB_texture_rg defines integer formats if EXT_texture_integer is also supported. */ - if (!gl_info->supported[EXT_TEXTURE_INTEGER] - && (format->f.base_flags & WINED3DFMT_FLAG_INTEGER)) + if (!gl_info->supported[EXT_TEXTURE_INTEGER] && (format->f.flags & WINED3DFMT_FLAG_INTEGER)) continue;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO @@ -3347,7 +3345,7 @@ 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.base_flags |= format_texture_info[i].base_flags; + format->f.flags |= format_texture_info[i].flags; format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].caps | WINED3DFMT_CAP_BLIT; @@ -3759,13 +3757,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->f.base_flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; + format->f.flags |= WINED3DFMT_FLAG_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->f.base_flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; + format->f.flags |= WINED3DFMT_FLAG_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); @@ -3921,7 +3919,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) { unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; - unsigned int base_flags, i, j; + unsigned int flags, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) { @@ -3932,10 +3930,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;
- base_flags = typeless_format->base_flags; + flags = typeless_format->flags; memcpy(caps, typeless_format->caps, sizeof(caps)); copy_format(adapter, typeless_format, format); - typeless_format->base_flags = base_flags; + typeless_format->flags = flags; for (j = 0; j < ARRAY_SIZE(typeless_format->caps); ++j) typeless_format->caps[j] |= caps[j]; } @@ -3954,7 +3952,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->base_flags = typeless_format->base_flags; + typeless_ds_format->flags = typeless_format->flags; for (j = 0; j < ARRAY_SIZE(typeless_ds_format->caps); ++j) { typeless_ds_format->caps[j] = typeless_format->caps[j]; @@ -4258,7 +4256,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.base_flags & WINED3DFMT_FLAG_FLOAT) + if (format->f.flags & WINED3DFMT_FLAG_FLOAT) format->f.depth_bias_scale /= 1u << 24; else format->f.depth_bias_scale /= 1u << format->f.depth_size; @@ -4646,7 +4644,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->base_flags & WINED3DFMT_FLAG_BLOCKS) + if (format->flags & WINED3DFMT_FLAG_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; @@ -4661,7 +4659,7 @@ void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigne *slice_pitch = *row_pitch * height; }
- if (format->base_flags & WINED3DFMT_FLAG_HEIGHT_SCALE) + if (format->flags & WINED3DFMT_FLAG_HEIGHT_SCALE) { /* The D3D format requirements make sure that the resulting format is an integer again */ *slice_pitch *= format->height_scale.numerator; @@ -4679,7 +4677,7 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT ali if (format->id == WINED3DFMT_UNKNOWN) return 0;
- if (format->base_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) return width * height * depth * format->byte_count;
wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch); @@ -6235,7 +6233,7 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; }
- if (format->base_flags & WINED3DFMT_FLAG_NORMALISED) + if (format->flags & WINED3DFMT_FLAG_NORMALISED) { uint32_t *ret_i = ret;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 748d1810634..82a62591a9d 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -613,7 +613,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_base_flags = view->format->base_flags; + view->format_flags = view->format->flags; view->format_caps = view->format->caps[resource->gl_type]; view->desc = *desc;
@@ -1561,7 +1561,7 @@ void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view packed = wined3d_format_pack(&format_gl->f, clear_value); data = &packed; } - else if (resource->format_base_flags & WINED3DFMT_FLAG_INTEGER) + else if (resource->format_flags & WINED3DFMT_FLAG_INTEGER) { gl_format = GL_RGBA_INTEGER; gl_type = GL_UNSIGNED_INT; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4db66611669..a444dc6620e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4353,7 +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_base_flags; + unsigned int format_flags; unsigned int format_caps; enum wined3d_multisample_type multisample_type; UINT multisample_quality; @@ -5338,7 +5338,7 @@ struct wined3d_rendertarget_view const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format; - unsigned int format_base_flags; + unsigned int format_flags; unsigned int format_caps; unsigned int sub_resource_idx; unsigned int layer_count; @@ -6190,7 +6190,7 @@ struct wined3d_format
UINT conv_byte_count; DWORD multisample_types; - unsigned int base_flags; + unsigned int flags; unsigned int caps[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=114866
Your paranoid android.
=== debian11 (build log) ===
../wine/dlls/wined3d/utils.c:6258:23: error: subscripted value is neither array nor pointer nor vector ../wine/dlls/wined3d/utils.c:6278:23: error: subscripted value is neither array nor pointer nor vector ../wine/dlls/wined3d/texture.c:3346:51: error: ‘WINED3DFMT_FLAG_FBO_ATTACHABLE’ undeclared (first use in this function); did you mean ‘WINED3DFMT_CAP_FBO_ATTACHABLE’? ../wine/dlls/wined3d/texture.c:3349:51: error: ‘WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB’ undeclared (first use in this function); did you mean ‘WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB’? Task: The win32 Wine build failed
=== debian11 (build log) ===
../wine/dlls/wined3d/utils.c:6258:23: error: subscripted value is neither array nor pointer nor vector ../wine/dlls/wined3d/utils.c:6278:23: error: subscripted value is neither array nor pointer nor vector ../wine/dlls/wined3d/texture.c:3346:51: error: ‘WINED3DFMT_FLAG_FBO_ATTACHABLE’ undeclared (first use in this function); did you mean ‘WINED3DFMT_CAP_FBO_ATTACHABLE’? ../wine/dlls/wined3d/texture.c:3349:51: error: ‘WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB’ undeclared (first use in this function); did you mean ‘WINED3DFMT_CAP_FBO_ATTACHABLE_SRGB’? Task: The wow64 Wine build failed
On 5/16/22 20:26, Chip Davis (@cdavis5e) wrote:
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.
Here are some thoughts, some of which are from Henri:
* Personally, I think this makes sense on its own merits, as a means of clarifying. It's weird to me that flags like FLOAT are stored per resource type when conceptually they're independent of resource type.
* On the other hand, it's not clear that it's worthwhile. It's a lot of churn, when it'd be easy enough to free up space by extending to 64 bits, or even getting rid of some obsolete flags.
* Patches 10 and 11 in particular are an awful lot of churn, and the naming isn't clearly an improvement. Maybe instead of "base_flags" we could say "attributes"?
* If we're moving things around, I believe we also want to move DECOMPRESS to the "base flags" group.
* I don't think BUMPMAP belongs in the format_texture_info array, but rather format_base_flags.
* There's some flags left in "caps" that are logically capabilities, but arguably don't need to be per resource type, e.g. UNORDERED_ACCESS, VERTEX_ATTRIBUTE, RENDERTARGET, DEPTH_STENCIL, SHADOW, INDEX_BUFFER. Maybe it's better to leave them where they are, though...
* Maybe instead of flags we could use bitfields, which would give us a bit more freedom in general and probably help naming. On the other hand it makes it harder to copy the flags field around as a whole...