From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/context_gl.c | 2 +- dlls/wined3d/cs.c | 10 +- dlls/wined3d/device.c | 3 +- dlls/wined3d/directx.c | 51 +-- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/resource.c | 10 +- dlls/wined3d/shader.c | 2 +- dlls/wined3d/state.c | 6 +- dlls/wined3d/texture.c | 28 +- dlls/wined3d/utils.c | 606 +++++++++++++++---------------- dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 48 +-- 13 files changed, 387 insertions(+), 385 deletions(-)
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 628b3ffe145..8da17c9aa94 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -4448,7 +4448,7 @@ static void wined3d_context_gl_setup_target(struct wined3d_context_gl *context_g { /* Disable blending when the alpha mask has changed and when a format doesn't support blending. */ if ((old->alpha_size && !new->alpha_size) || (!old->alpha_size && new->alpha_size) - || !(texture->resource.format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) + || !(texture->resource.format_caps & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING)) context_invalidate_state(&context_gl->c, STATE_BLEND); }
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 6cbc9e2e2a6..9fd67cf0045 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1206,8 +1206,8 @@ static void wined3d_cs_exec_set_rendertarget_views(struct wined3d_cs *cs, const if (!(device->adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) || cs->state.render_states[WINED3D_RS_SRGBWRITEENABLE]) { - prev_srgb_write = prev && prev->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; - curr_srgb_write = view && view->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; + prev_srgb_write = prev && prev->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; + curr_srgb_write = view && view->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; if (prev_srgb_write != curr_srgb_write) device_invalidate_state(device, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE)); } @@ -1450,8 +1450,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) { const struct wined3d_format *new_format = op->texture->resource.format; const struct wined3d_format *old_format = prev ? prev->resource.format : NULL; - unsigned int old_fmt_flags = prev ? prev->resource.format_flags : 0; - unsigned int new_fmt_flags = op->texture->resource.format_flags; + unsigned int old_fmt_caps = prev ? prev->resource.format_caps : 0; + unsigned int new_fmt_caps = op->texture->resource.format_caps;
if (InterlockedIncrement(&op->texture->resource.bind_count) == 1) op->texture->sampler = op->stage; @@ -1459,7 +1459,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (!prev || wined3d_texture_gl(op->texture)->target != wined3d_texture_gl(prev)->target || (!is_same_fixup(new_format->color_fixup, old_format->color_fixup) && !(can_use_texture_swizzle(d3d_info, new_format) && can_use_texture_swizzle(d3d_info, old_format))) - || (new_fmt_flags & WINED3DFMT_FLAG_SHADOW) != (old_fmt_flags & WINED3DFMT_FLAG_SHADOW)) + || (new_fmt_caps & WINED3D_FORMAT_CAP_SHADOW) != (old_fmt_caps & WINED3D_FORMAT_CAP_SHADOW)) device_invalidate_state(cs->c.device, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL));
if (!prev && op->stage < d3d_info->limits.ffp_blend_stages) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 33ae584f817..c6a6de93123 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4585,7 +4585,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device }
texture = state->textures[i]; - if (!texture || texture->resource.format_flags & WINED3DFMT_FLAG_FILTERING) continue; + if (!texture || texture->resource.format_caps & WINED3D_FORMAT_CAP_FILTERING) + continue;
if (state->sampler_states[i][WINED3D_SAMP_MAG_FILTER] != WINED3D_TEXF_POINT) { diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index c0e722c3bc0..925b2df0401 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1819,12 +1819,12 @@ HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d_adapter *ad rt_format = wined3d_get_format(adapter, render_target_format_id, WINED3D_BIND_RENDER_TARGET); ds_format = wined3d_get_format(adapter, depth_stencil_format_id, WINED3D_BIND_DEPTH_STENCIL);
- if (!(rt_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_RENDERTARGET)) + if (!(rt_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_RENDERTARGET)) { WARN("Format %s is not render target format.\n", debug_d3dformat(rt_format->id)); return WINED3DERR_NOTAVAILABLE; } - if (!(ds_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(ds_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format->id)); return WINED3DERR_NOTAVAILABLE; @@ -1898,11 +1898,12 @@ static BOOL wined3d_check_depth_stencil_format(const struct wined3d_adapter *ada
static BOOL wined3d_check_surface_format(const struct wined3d_format *format) { - if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] | format->flags[WINED3D_GL_RES_TYPE_RB]) & WINED3DFMT_FLAG_BLIT) + if ((format->caps[WINED3D_GL_RES_TYPE_TEX_2D] | format->caps[WINED3D_GL_RES_TYPE_RB]) + & WINED3D_FORMAT_CAP_BLIT) return TRUE;
if ((format->attrs & WINED3D_FORMAT_ATTR_EXTENSION) - && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) + && (format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE)) return TRUE;
return FALSE; @@ -1923,7 +1924,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, { const struct wined3d_format *adapter_format, *format; enum wined3d_gl_resource_type gl_type, gl_type_end; - unsigned int format_flags = 0, format_attrs = 0; + unsigned int format_caps = 0, format_attrs = 0; BOOL mipmap_gen_supported = TRUE; unsigned int allowed_bind_flags; DWORD allowed_usage; @@ -2051,32 +2052,32 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, }
if (bind_flags & WINED3D_BIND_SHADER_RESOURCE) - format_flags |= WINED3DFMT_FLAG_TEXTURE; + format_caps |= WINED3D_FORMAT_CAP_TEXTURE; if (bind_flags & WINED3D_BIND_RENDER_TARGET) - format_flags |= WINED3DFMT_FLAG_RENDERTARGET; + format_caps |= WINED3D_FORMAT_CAP_RENDERTARGET; if (bind_flags & WINED3D_BIND_DEPTH_STENCIL) - format_flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + format_caps |= WINED3D_FORMAT_CAP_DEPTH_STENCIL; if (bind_flags & WINED3D_BIND_UNORDERED_ACCESS) - format_flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + format_caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS; if (bind_flags & WINED3D_BIND_VERTEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format_caps |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; if (bind_flags & WINED3D_BIND_INDEX_BUFFER) - format_flags |= WINED3DFMT_FLAG_INDEX_BUFFER; + format_caps |= WINED3D_FORMAT_CAP_INDEX_BUFFER;
if (usage & WINED3DUSAGE_QUERY_FILTER) - format_flags |= WINED3DFMT_FLAG_FILTERING; + format_caps |= WINED3D_FORMAT_CAP_FILTERING; if (usage & WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING) - format_flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format_caps |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; if (usage & WINED3DUSAGE_QUERY_SRGBREAD) - format_flags |= WINED3DFMT_FLAG_SRGB_READ; + format_caps |= WINED3D_FORMAT_CAP_SRGB_READ; if (usage & WINED3DUSAGE_QUERY_SRGBWRITE) - format_flags |= WINED3DFMT_FLAG_SRGB_WRITE; + format_caps |= WINED3D_FORMAT_CAP_SRGB_WRITE; if (usage & WINED3DUSAGE_QUERY_VERTEXTEXTURE) - format_flags |= WINED3DFMT_FLAG_VTF; + format_caps |= WINED3D_FORMAT_CAP_VTF; if (usage & WINED3DUSAGE_QUERY_LEGACYBUMPMAP) format_attrs |= WINED3D_FORMAT_ATTR_BUMPMAP;
- if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) + if ((format_caps & WINED3D_FORMAT_CAP_TEXTURE) && (wined3d->flags & WINED3D_NO3D)) { TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n"); return WINED3DERR_NOTAVAILABLE; @@ -2091,6 +2092,13 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
for (; gl_type <= gl_type_end; ++gl_type) { + if ((format->caps[gl_type] & format_caps) != format_caps) + { + TRACE("Requested format caps %#x, but format %s only has %#x.\n", + format_caps, debug_d3dformat(check_format_id), format->caps[gl_type]); + return WINED3DERR_NOTAVAILABLE; + } + if ((bind_flags & WINED3D_BIND_RENDER_TARGET) && !adapter->adapter_ops->adapter_check_format(adapter, adapter_format, format, NULL)) { @@ -2118,14 +2126,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, return WINED3DERR_NOTAVAILABLE; }
- if ((format->flags[gl_type] & format_flags) != format_flags) - { - TRACE("Requested format flags %#x, but format %s only has %#x.\n", - format_flags, debug_d3dformat(check_format_id), format->flags[gl_type]); - return WINED3DERR_NOTAVAILABLE; - } - - if (!(format->flags[gl_type] & WINED3DFMT_FLAG_GEN_MIPMAP)) + if (!(format->caps[gl_type] & WINED3D_FORMAT_CAP_GEN_MIPMAP)) mipmap_gen_supported = FALSE; }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5a5ca859108..0c9822a95aa 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13076,7 +13076,7 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi }
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && !((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + && !((dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) { TRACE("Destination texture is not FBO attachable.\n"); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 72a0914026f..aeece1ab512 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -123,19 +123,19 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * break;
if ((bind_flags & WINED3D_BIND_RENDER_TARGET) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_RENDERTARGET)) { WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id)); continue; } if ((bind_flags & WINED3D_BIND_DEPTH_STENCIL) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id)); continue; } if ((bind_flags & WINED3D_BIND_SHADER_RESOURCE) - && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE)) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_TEXTURE)) { WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id)); continue; @@ -190,7 +190,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->format = format; resource->format_attrs = format->attrs; if (gl_type < WINED3D_GL_RES_TYPE_COUNT) - resource->format_flags = format->flags[gl_type]; + resource->format_caps = format->caps[gl_type]; resource->multisample_type = multisample_type; resource->multisample_quality = multisample_quality; resource->usage = usage; @@ -465,7 +465,7 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) const struct wined3d_format *wined3d_resource_get_decompress_format(const struct wined3d_resource *resource) { const struct wined3d_adapter *adapter = resource->device->adapter; - if (resource->format_flags & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE) + if (resource->format_caps & (WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE) && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)) return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM_SRGB, resource->bind_flags); return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM, resource->bind_flags); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index a296e34bc9f..c02f82b4d7b 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -4123,7 +4123,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 else args->color_fixup[i] = texture->resource.format->color_fixup;
- if (texture->resource.format_flags & WINED3DFMT_FLAG_SHADOW) + if (texture->resource.format_caps & WINED3D_FORMAT_CAP_SHADOW) args->shadow |= 1u << i;
/* Flag samplers that need NP2 texcoord fixup. */ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index ef153e5dd5f..56fd759e5e2 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -563,7 +563,7 @@ static BOOL is_blend_enabled(struct wined3d_context *context, const struct wined * With blending on we could face a big performance penalty. * The d3d9 visual test confirms the behavior. */ if (context->render_offscreen - && !(state->fb.render_targets[index]->format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) + && !(state->fb.render_targets[index]->format_caps & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING)) return FALSE;
return TRUE; @@ -3709,11 +3709,11 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc && sampler_states[WINED3D_SAMP_MIP_FILTER] != WINED3D_TEXF_ANISOTROPIC) || (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2)) desc->max_anisotropy = 1; - desc->compare = texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_SHADOW; + desc->compare = texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_SHADOW; desc->comparison_func = WINED3D_CMP_LESSEQUAL; desc->srgb_decode = is_srgb_enabled(sampler_states);
- if (!(texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FILTERING)) + if (!(texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FILTERING)) { desc->mag_filter = WINED3D_TEXF_POINT; desc->min_filter = WINED3D_TEXF_POINT; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 77826a72c61..11472e28304 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -302,10 +302,10 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win switch (blit_op) { case WINED3D_BLIT_OP_COLOR_BLIT: - if (!((src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + if (!((src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (src_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) return false; - if (!((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + if (!((dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) return false; if ((src_format->id != dst_format->id || dst_location == WINED3D_LOCATION_DRAWABLE) @@ -314,9 +314,9 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win break;
case WINED3D_BLIT_OP_DEPTH_BLIT: - if (!(src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) return false; - if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (!(dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) return false; /* Accept pure swizzle fixups for depth formats. In general we * ignore the stencil component (if present) at the moment and the @@ -2115,9 +2115,9 @@ void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl, if (texture_gl->t.flags & alloc_flag) return;
- if (resource->format_flags & WINED3DFMT_FLAG_DECOMPRESS) + if (resource->format_caps & WINED3D_FORMAT_CAP_DECOMPRESS) { - TRACE("WINED3DFMT_FLAG_DECOMPRESS set.\n"); + TRACE("WINED3D_FORMAT_CAP_DECOMPRESS set.\n"); texture_gl->t.flags |= WINED3D_TEXTURE_CONVERTED; format = wined3d_resource_get_decompress_format(resource); } @@ -2547,7 +2547,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context, bo.addr += src_box->left * src_format->byte_count; }
- decompress = (dst_texture->resource.format_flags & WINED3DFMT_FLAG_DECOMPRESS) + decompress = (dst_texture->resource.format_caps & WINED3D_FORMAT_CAP_DECOMPRESS) || (src_format->decompress && src_format->id != dst_texture->resource.format->id);
if (src_format->upload || decompress @@ -3170,7 +3170,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g wined3d_texture_get_level_box(&texture_gl->t, level, &src_box);
if (!depth && sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) - && (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + && (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB) && fbo_blitter_supported(WINED3D_BLIT_OP_COLOR_BLIT, gl_info, &texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_RGB, &texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_SRGB)) @@ -3191,7 +3191,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g }
if (!depth && sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) - && (!srgb || (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))) + && (!srgb || (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB))) { DWORD src_location = sub_resource->locations & WINED3D_LOCATION_RB_RESOLVED ? WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE; @@ -3343,10 +3343,10 @@ static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int lo return false;
if (location == WINED3D_LOCATION_TEXTURE_RGB - && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)) + && !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)) return false; if (location == WINED3D_LOCATION_TEXTURE_SRGB - && !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + && !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB)) return false;
return location & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED @@ -3944,7 +3944,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc /* DXTn 3D textures are not supported. Do not write the ERR for them. */ if ((desc->format == WINED3DFMT_DXT1 || desc->format == WINED3DFMT_DXT2 || desc->format == WINED3DFMT_DXT3 || desc->format == WINED3DFMT_DXT4 || desc->format == WINED3DFMT_DXT5) - && !(format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE) + && !(format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE) && desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++) ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n");
@@ -3971,7 +3971,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->flags |= WINED3D_TEXTURE_DISCARD; if (flags & WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS) { - if (!(texture->resource.format_flags & WINED3DFMT_FLAG_GEN_MIPMAP)) + if (!(texture->resource.format_caps & WINED3D_FORMAT_CAP_GEN_MIPMAP)) WARN("Format doesn't support mipmaps generation, " "ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n"); else @@ -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 & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)))) { next_flags |= WINED3DCLEAR_TARGET; flags &= ~WINED3DCLEAR_TARGET; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5b62ae0f542..5c0f1c5e376 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -307,7 +307,7 @@ struct wined3d_format_base_flags { enum wined3d_format_id id; unsigned int attrs; - unsigned int flags; + unsigned int caps; };
/* The ATI2N format behaves like an uncompressed format in LockRect(), but @@ -345,10 +345,10 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_R32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK, - WINED3DFMT_FLAG_INDEX_BUFFER}, + WINED3D_FORMAT_CAP_INDEX_BUFFER}, {WINED3DFMT_R32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, - WINED3DFMT_FLAG_INDEX_BUFFER}, + WINED3D_FORMAT_CAP_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B10G10R10A2_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, {WINED3DFMT_B2G3R3_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, @@ -766,7 +766,7 @@ struct wined3d_format_texture_info GLint gl_format; GLint gl_type; unsigned int conv_byte_count; - unsigned int flags; + unsigned int caps; enum wined3d_gl_extension extension; void (*upload)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch, unsigned int dst_row_pitch, unsigned int dst_slice_pitch, @@ -1335,7 +1335,7 @@ const struct wined3d_color_key_conversion * wined3d_format_get_color_key_convers /* We intentionally don't support WINED3DFMT_D32_UNORM. No hardware driver * supports it, and applications get confused when we do. * - * The following formats explicitly don't have WINED3DFMT_FLAG_TEXTURE set: + * The following formats explicitly don't have WINED3D_FORMAT_CAP_TEXTURE set: * * These are never supported on native. * WINED3DFMT_B8G8R8_UNORM @@ -1362,7 +1362,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = { /* format id gl_internal gl_srgb_internal gl_rt_internal gl_format gl_type conv_byte_count - flags + caps extension upload download */ /* FourCC formats */ /* GL_APPLE_ycbcr_422 claims that its '2YUV' format, which is supported via the UNSIGNED_SHORT_8_8_REV_APPLE type @@ -1373,167 +1373,167 @@ static const struct wined3d_format_texture_info format_texture_info[] = */ {WINED3DFMT_UYVY, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_UYVY, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_UYVY, GL_RGB_RAW_422_APPLE, GL_RGB_RAW_422_APPLE, 0, GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YUY2, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YUY2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE8_ALPHA8, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_YUY2, GL_RGB_RAW_422_APPLE, GL_RGB_RAW_422_APPLE, 0, GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, APPLE_RGB_422, NULL}, {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_FILTERING, APPLE_YCBCR_422, NULL}, {WINED3DFMT_YV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_NV12, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_NV12, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT2, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT4, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC1_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC2_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC3_UNORM, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_S3TC, NULL}, {WINED3DFMT_BC4_UNORM, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC4_SNORM, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_COMPRESSED_SIGNED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC5_UNORM, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC5_SNORM, GL_COMPRESSED_SIGNED_RG_RGTC2, GL_COMPRESSED_SIGNED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_BC6H_UF16, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, {WINED3DFMT_BC6H_SF16, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, 0, GL_RGB, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, {WINED3DFMT_BC7_UNORM, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_BPTC, NULL}, /* IEEE formats */ {WINED3DFMT_R32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RED, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, GL_RED, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RGB, GL_FLOAT, 12, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r32g32_float}, {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, GL_RG, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, GL_RGB, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, /* Float */ {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RGB, GL_HALF_FLOAT_ARB, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, convert_r16g16}, {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, GL_RG, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET + | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R11G11B10_FLOAT, GL_R11F_G11F_B10F, GL_R11F_G11F_B10F, 0, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_PACKED_FLOAT}, /* Palettized formats */ {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, @@ -1547,376 +1547,376 @@ static const struct wined3d_format_texture_info format_texture_info[] = /* Standard ARGB formats */ {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B8G8R8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE + | WINED3D_FORMAT_CAP_VTF, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B8G8R8X8_UNORM, GL_RGB8, GL_SRGB8_EXT, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G6R5_UNORM, GL_RGB5, GL_SRGB8_EXT, GL_RGB8, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G6R5_UNORM, GL_RGB565, GL_SRGB8_EXT, GL_RGB8, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ, ARB_ES2_COMPATIBILITY, NULL}, {WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B5G5R5A1_UNORM, GL_RGB5_A1, GL_RGB5_A1, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B4G4R4A4_UNORM, GL_RGBA4, GL_SRGB8_ALPHA8_EXT, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_B2G3R3_UNORM, GL_R3_G3_B2, GL_R3_G3_B2, 0, GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 0, - WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_B4G4R4X4_UNORM, GL_RGB4, GL_RGB4, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R10G10B10A2_UINT, GL_RGB10_A2UI, GL_RGB10_A2UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R10G10B10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8B8A8_UNORM, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE - | WINED3DFMT_FLAG_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE + | WINED3D_FORMAT_CAP_VTF, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8B8A8_UINT, GL_RGBA8UI, GL_RGBA8UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, GL_RGBA_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16_UNORM, GL_RGB16, GL_RGB16, GL_RGBA16, GL_RGB, GL_UNSIGNED_SHORT, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16}, {WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0, GL_RG, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_UINT, GL_RG8UI, GL_RG8UI, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_SINT, GL_RG8I, GL_RG8I, 0, GL_RG_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, 0, GL_RGBA_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32_UINT, GL_RG32UI, GL_RG32UI, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_SINT, GL_RG32I, GL_RG32I, 0, GL_RG_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_UINT, GL_RG16UI, GL_RG16UI, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_SINT, GL_RG16I, GL_RG16I, 0, GL_RG_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_UINT, GL_R8UI, GL_R8UI, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_SINT, GL_R8I, GL_R8I, 0, GL_RED_INTEGER, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_SRGB_READ, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_SRGB_READ, WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_L4A4_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 2, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, convert_l4a4_unorm}, {WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 2, - WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, convert_l4a4_unorm}, {WINED3DFMT_L16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_LEGACY_CONTEXT, NULL}, /* Bump mapping stuff */ {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm}, {WINED3DFMT_R8G8_SNORM, GL_DSDT8_NV, GL_DSDT8_NV, 0, GL_DSDT_NV, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, 0, GL_RG, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r5g5_snorm_l6_unorm}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_DSDT8_MAG8_NV, GL_DSDT8_MAG8_NV, 0, GL_DSDT_MAG_NV, GL_BYTE, 3, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, convert_r5g5_snorm_l6_unorm_nv}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB8_SNORM, GL_RGB8_SNORM, 0, GL_RGBA, GL_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_SNORM, convert_r5g5_snorm_l6_unorm_ext}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8_snorm_l8x8_unorm}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_DSDT8_MAG8_INTENSITY8_NV, GL_DSDT8_MAG8_INTENSITY8_NV, 0, GL_DSDT_MAG_VIB_NV, GL_UNSIGNED_INT_8_8_S8_S8_REV_NV, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, convert_r8g8_snorm_l8x8_unorm_nv}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8, GL_RGBA8, 0, GL_BGRA, GL_UNSIGNED_BYTE, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r8g8b8a8_snorm}, {WINED3DFMT_R8G8B8A8_SNORM, GL_SIGNED_RGBA8_NV, GL_SIGNED_RGBA8_NV, 0, GL_RGBA, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, 0, GL_RGBA, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RGB16, GL_RGB16, 0, GL_BGR, GL_UNSIGNED_SHORT, 6, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, WINED3D_GL_EXT_NONE, convert_r16g16_snorm}, {WINED3DFMT_R16G16_SNORM, GL_SIGNED_HILO16_NV, GL_SIGNED_HILO16_NV, 0, GL_HILO_NV, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, NV_TEXTURE_SHADER, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RG16_SNORM, GL_RG16_SNORM, 0, GL_RG, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16B16A16_SNORM, GL_RGBA16_SNORM, GL_RGBA16_SNORM, 0, GL_RGBA, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16_SNORM, GL_R16_SNORM, GL_R16_SNORM, 0, GL_RED, GL_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, 0, GL_RED, GL_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_SNORM, NULL}, /* Depth stencil formats */ {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D24_UNORM_S8_UINT, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, x8_d24_unorm_upload, x8_d24_unorm_download}, {WINED3DFMT_X8D24_UNORM, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT24_ARB, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 4, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, x8_d24_unorm_upload, x8_d24_unorm_download}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_DEPTH_STENCIL, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_TEXTURE, NULL}, {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, NULL}, {WINED3DFMT_D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, NULL}, {WINED3DFMT_S8_UINT_D24_FLOAT, GL_DEPTH32F_STENCIL8, GL_DEPTH32F_STENCIL8, 0, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 8, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH_STENCIL | WINED3DFMT_FLAG_SHADOW, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_DEPTH_STENCIL | WINED3D_FORMAT_CAP_SHADOW, ARB_DEPTH_BUFFER_FLOAT, convert_s8_uint_d24_float}, {WINED3DFMT_R32G32B32A32_UINT, GL_RGBA32UI, GL_RGBA32UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, 0, GL_RGBA_INTEGER, GL_INT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, EXT_TEXTURE_INTEGER, NULL}, /* Vendor-specific formats */ {WINED3DFMT_ATI1N, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, GL_RED, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ATI_TEXTURE_COMPRESSION_3DC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_RG_RGTC2, 0, GL_RG, GL_UNSIGNED_BYTE, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_INTZ, GL_DEPTH24_STENCIL8, GL_DEPTH24_STENCIL8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING - | WINED3DFMT_FLAG_DEPTH_STENCIL, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING + | WINED3D_FORMAT_CAP_DEPTH_STENCIL, EXT_PACKED_DEPTH_STENCIL, NULL}, {WINED3DFMT_NULL, 0, 0, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FBO_ATTACHABLE, ARB_FRAMEBUFFER_OBJECT, NULL}, /* DirectX 10 HDR formats */ {WINED3DFMT_R9G9B9E5_SHAREDEXP, GL_RGB9_E5_EXT, GL_RGB9_E5_EXT, 0, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV_EXT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING, EXT_TEXTURE_SHARED_EXPONENT, NULL}, };
@@ -2006,20 +2006,20 @@ static void copy_format(const struct wined3d_adapter *adapter, dst_format->id = id; }
-static void format_set_flag(struct wined3d_format *format, unsigned int flag) +static void format_set_caps(struct wined3d_format *format, unsigned int caps) { unsigned int i;
- for (i = 0; i < ARRAY_SIZE(format->flags); ++i) - format->flags[i] |= flag; + for (i = 0; i < ARRAY_SIZE(format->caps); ++i) + format->caps[i] |= caps; }
-static void format_clear_flag(struct wined3d_format *format, unsigned int flag) +static void format_clear_caps(struct wined3d_format *format, unsigned int caps) { unsigned int i;
- for (i = 0; i < ARRAY_SIZE(format->flags); ++i) - format->flags[i] &= ~flag; + for (i = 0; i < ARRAY_SIZE(format->caps); ++i) + format->caps[i] &= ~caps; }
static enum wined3d_channel_type map_channel_type(char t) @@ -2150,7 +2150,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter) return FALSE;
format->attrs |= format_base_flags[i].attrs; - format_set_flag(format, format_base_flags[i].flags); + format_set_caps(format, format_base_flags[i].caps); }
return TRUE; @@ -2196,7 +2196,7 @@ static BOOL init_format_decompress_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, format_decompress_info[i].id))) return FALSE;
- format->flags[WINED3D_GL_RES_TYPE_TEX_3D] |= WINED3DFMT_FLAG_DECOMPRESS; + format->caps[WINED3D_GL_RES_TYPE_TEX_3D] |= WINED3D_FORMAT_CAP_DECOMPRESS; format->decompress = format_decompress_info[i].decompress; }
@@ -2363,9 +2363,9 @@ static void create_and_bind_fbo_attachment(const struct wined3d_gl_info *gl_info }
/* Ideally we'd skip all formats already known not to work on textures - * by checking for WINED3DFMT_FLAG_TEXTURE here. However, we want to + * by checking for WINED3D_FORMAT_CAP_TEXTURE here. However, we want to * know if we can attach WINED3DFMT_P8_UINT textures to FBOs, and this - * format never has WINED3DFMT_FLAG_TEXTURE set. Instead, swallow GL + * format never has WINED3D_FORMAT_CAP_TEXTURE set. Instead, swallow GL * errors generated by invalid formats. */ while (gl_info->gl_ops.gl.p_glGetError()); } @@ -2509,7 +2509,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { const char *type_string = "color";
@@ -2518,7 +2518,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for
create_and_bind_fbo_attachment(gl_info, format, type, &object, format->internal);
- if (format->f.flags[type] & WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glGenRenderbuffers(1, &color_rb); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, color_rb); @@ -2540,7 +2540,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { TRACE("Format %s is supported as FBO %s attachment, type %u.\n", debug_d3dformat(format->f.id), type_string, type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE; } @@ -2548,11 +2548,11 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { if (!rt_internal) { - if (format->f.flags[type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (format->f.caps[type] & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { WARN("Format %s with rendertarget flag is not supported as FBO color attachment (type %u)," " and no fallback specified.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL); + format->f.caps[type] &= ~(WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL); } else { @@ -2585,13 +2585,13 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { WARN("Format %s rtInternal format is not supported as FBO %s attachment, type %u.\n", debug_d3dformat(format->f.id), type_string, type); - format->f.flags[type] &= ~(WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL); + format->f.caps[type] &= ~(WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL); } } }
if (status == GL_FRAMEBUFFER_COMPLETE - && ((format->f.flags[type] & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING) + && ((format->f.caps[type] & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING) || !(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) && !(format->f.attrs & WINED3D_FORMAT_ATTR_INTEGER) && format->f.id != WINED3DFMT_NULL && format->f.id != WINED3DFMT_P8_UINT @@ -2624,7 +2624,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for while (gl_info->gl_ops.gl.p_glGetError()); TRACE("Format %s doesn't support post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { @@ -2698,14 +2698,14 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for TRACE("Format %s doesn't support post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); TRACE("Color output: %#x\n", color); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { TRACE("Format %s supports post-pixelshader blending, type %u.\n", debug_d3dformat(format->f.id), type); TRACE("Color output: %#x\n", color); - format->f.flags[type] |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } }
@@ -2730,7 +2730,7 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { TRACE("Format %s's sRGB format is FBO attachable, type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -2738,13 +2738,13 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { WARN("Format %s's sRGB format is not FBO attachable, type %u.\n", debug_d3dformat(format->f.id), type); - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); } } else if (status == GL_FRAMEBUFFER_COMPLETE) - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB;
- if (format->f.flags[type] & WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL) { gl_info->fbo_ops.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0); gl_info->fbo_ops.glDeleteRenderbuffers(1, &color_rb); @@ -2758,30 +2758,30 @@ static void check_fbo_compat(struct wined3d_caps_gl_ctx *ctx, struct wined3d_for { FIXME("Format %s needs different render target formats for different resource types.\n", debug_d3dformat(format->f.id)); - format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL - | WINED3DFMT_FLAG_FBO_ATTACHABLE | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB - | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL + | WINED3D_FORMAT_CAP_FBO_ATTACHABLE | WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB + | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING); } }
-static void query_format_flag(struct wined3d_gl_info *gl_info, struct wined3d_format_gl *format, - GLint internal, GLenum pname, DWORD flag, const char *string) +static void query_format_cap(struct wined3d_gl_info *gl_info, struct wined3d_format_gl *format, + GLint internal, GLenum pname, unsigned int cap, const char *string) { GLint value; enum wined3d_gl_resource_type type;
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { gl_info->gl_ops.ext.p_glGetInternalformativ(wined3d_gl_type_to_enum(type), internal, pname, 1, &value); if (value == GL_FULL_SUPPORT) { TRACE("Format %s supports %s, resource type %u.\n", debug_d3dformat(format->f.id), string, type); - format->f.flags[type] |= flag; + format->f.caps[type] |= cap; } else { TRACE("Format %s doesn't support %s, resource type %u.\n", debug_d3dformat(format->f.id), string, type); - format->f.flags[type] &= ~flag; + format->f.caps[type] &= ~cap; } } } @@ -2806,7 +2806,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, if (!format->internal) continue;
- for (type = 0; type < ARRAY_SIZE(format->f.flags); ++type) + for (type = 0; type < ARRAY_SIZE(format->f.caps); ++type) { gl_info->gl_ops.ext.p_glGetInternalformativ(wined3d_gl_type_to_enum(type), format->internal, GL_FRAMEBUFFER_RENDERABLE, 1, &value); @@ -2814,7 +2814,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s is supported as FBO color attachment, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE; format->rt_internal = format->internal; regular_fmt_used = TRUE;
@@ -2824,25 +2824,25 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s supports post-pixelshader blending, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } else { TRACE("Format %s doesn't support post-pixelshader blending, resource typed %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } } else { if (!rt_internal) { - if (format->f.flags[type] & WINED3DFMT_FLAG_RENDERTARGET) + if (format->f.caps[type] & WINED3D_FORMAT_CAP_RENDERTARGET) { WARN("Format %s with rendertarget flag is not supported as FBO color attachment" " and no fallback specified, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_RENDERTARGET; } else TRACE("Format %s is not supported as FBO color attachment," @@ -2863,7 +2863,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { WARN("Format %s rtInternal format is not supported as FBO color attachment," " resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] &= ~WINED3DFMT_FLAG_RENDERTARGET; + format->f.caps[type] &= ~WINED3D_FORMAT_CAP_RENDERTARGET; } } } @@ -2876,7 +2876,7 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { TRACE("Format %s's sRGB format is FBO attachable, resource type %u.\n", debug_d3dformat(format->f.id), type); - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } @@ -2884,19 +2884,19 @@ static void init_format_fbo_compat_info(const struct wined3d_adapter *adapter, { WARN("Format %s's sRGB format is not FBO attachable, resource type %u.\n", debug_d3dformat(format->f.id), type); - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); } } - else if (format->f.flags[type] & WINED3DFMT_FLAG_FBO_ATTACHABLE) - format->f.flags[type] |= WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB; + else if (format->f.caps[type] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE) + format->f.caps[type] |= WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB; }
if (fallback_fmt_used && regular_fmt_used) { FIXME("Format %s needs different render target formats for different resource types.\n", debug_d3dformat(format->f.id)); - format_clear_flag(&format->f, WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FBO_ATTACHABLE - | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FBO_ATTACHABLE + | WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING); } } return; @@ -3080,26 +3080,26 @@ static void query_internal_format(struct wined3d_adapter *adapter,
if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2]) { - query_format_flag(gl_info, format, format->internal, GL_VERTEX_TEXTURE, - WINED3DFMT_FLAG_VTF, "vertex texture usage"); - query_format_flag(gl_info, format, format->internal, GL_FILTER, - WINED3DFMT_FLAG_FILTERING, "filtering"); - query_format_flag(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, - WINED3DFMT_FLAG_UNORDERED_ACCESS, "unordered access"); + query_format_cap(gl_info, format, format->internal, GL_VERTEX_TEXTURE, + WINED3D_FORMAT_CAP_VTF, "vertex texture usage"); + query_format_cap(gl_info, format, format->internal, GL_FILTER, + WINED3D_FORMAT_CAP_FILTERING, "filtering"); + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, + WINED3D_FORMAT_CAP_UNORDERED_ACCESS, "unordered access");
if (srgb_format || format->srgb_internal != format->internal) { - query_format_flag(gl_info, format, format->srgb_internal, GL_SRGB_READ, - WINED3DFMT_FLAG_SRGB_READ, "sRGB read"); + query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_READ, + WINED3D_FORMAT_CAP_SRGB_READ, "sRGB read");
if (srgb_write_supported) - query_format_flag(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, - WINED3DFMT_FLAG_SRGB_WRITE, "sRGB write"); + query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, + WINED3D_FORMAT_CAP_SRGB_WRITE, "sRGB write"); else - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE);
- if (!(format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] - & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE))) + if (!(format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] + & (WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE))) format->srgb_internal = format->internal; else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; @@ -3108,12 +3108,12 @@ static void query_internal_format(struct wined3d_adapter *adapter, else { if (!gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX]) - format_clear_flag(&format->f, WINED3DFMT_FLAG_VTF); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_VTF);
if (!(gl_info->quirks & WINED3D_QUIRK_LIMITED_TEX_FILTERING)) - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); else if (format->f.id != WINED3DFMT_R32G32B32A32_FLOAT && format->f.id != WINED3DFMT_R32_FLOAT) - format_clear_flag(&format->f, WINED3DFMT_FLAG_VTF); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_VTF);
if (srgb_format || format->srgb_internal != format->internal) { @@ -3121,7 +3121,7 @@ static void query_internal_format(struct wined3d_adapter *adapter, if (!gl_info->supported[EXT_TEXTURE_SRGB]) { format->srgb_internal = format->internal; - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); } else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) { @@ -3129,25 +3129,25 @@ static void query_internal_format(struct wined3d_adapter *adapter, } }
- if ((format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SRGB_WRITE) && !srgb_write_supported) - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + if ((format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SRGB_WRITE) && !srgb_write_supported) + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); }
if ((!gl_info->supported[ARB_DEPTH_TEXTURE] || wined3d_settings.offscreen_rendering_mode != ORM_FBO) && (format->f.depth_size || format->f.stencil_size)) { TRACE("Disabling texturing support for depth / stencil format %s.\n", debug_d3dformat(format->f.id)); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3D_FORMAT_CAP_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3D_FORMAT_CAP_TEXTURE; }
query_view_class(format);
- if (format->internal && format->f.flags[WINED3D_GL_RES_TYPE_RB] - & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_DEPTH_STENCIL) + if (format->internal && format->f.caps[WINED3D_GL_RES_TYPE_RB] + & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_DEPTH_STENCIL) && (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] || gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE]) && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { @@ -3225,33 +3225,33 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win format->f.height_scale.numerator = 1; format->f.height_scale.denominator = 1;
- format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
/* GL_ARB_depth_texture does not support 3D textures. It also says "cube textures are * problematic", but doesn't explicitly mandate that an error is generated. */ - if (gl_info->supported[EXT_TEXTURE3D] && !(format_texture_info[i].flags & WINED3DFMT_FLAG_DEPTH_STENCIL)) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + if (gl_info->supported[EXT_TEXTURE3D] && !(format_texture_info[i].caps & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) - format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT;
- format->f.flags[WINED3D_GL_RES_TYPE_RB] |= format_texture_info[i].flags | WINED3DFMT_FLAG_BLIT; - format->f.flags[WINED3D_GL_RES_TYPE_RB] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_RB] |= format_texture_info[i].caps | WINED3D_FORMAT_CAP_BLIT; + format->f.caps[WINED3D_GL_RES_TYPE_RB] &= ~WINED3D_FORMAT_CAP_TEXTURE;
if (format->srgb_internal != format->internal && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)) { format->srgb_internal = format->internal; - format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); }
- if (!gl_info->supported[ARB_SHADOW] && (format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SHADOW)) - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + if (!gl_info->supported[ARB_SHADOW] && (format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SHADOW)) + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
query_internal_format(adapter, format, &format_texture_info[i], gl_info, srgb_write, FALSE);
@@ -3280,7 +3280,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win { srgb_format->internal = format_texture_info[i].gl_srgb_internal; srgb_format->srgb_internal = format_texture_info[i].gl_srgb_internal; - format_set_flag(&srgb_format->f, WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE); + format_set_caps(&srgb_format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); query_internal_format(adapter, srgb_format, &format_texture_info[i], gl_info, srgb_write, TRUE); } } @@ -3445,7 +3445,7 @@ static void init_format_filter_info(struct wined3d_adapter *adapter, for (i = 0; i < ARRAY_SIZE(fmts16); ++i) { format = get_format_gl_internal(adapter, fmts16[i]); - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); } } return; @@ -3461,7 +3461,7 @@ static void init_format_filter_info(struct wined3d_adapter *adapter, if (filtered) { TRACE("Format %s supports filtering.\n", debug_d3dformat(format->f.id)); - format_set_flag(&format->f, WINED3DFMT_FLAG_FILTERING); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_FILTERING); } else { @@ -3624,11 +3624,11 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ && (!gl_info->supported[ARB_FRAGMENT_SHADER] || !gl_info->supported[ARB_VERTEX_SHADER]))) { format = get_format_gl_internal(adapter, WINED3DFMT_YUY2); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0;
format = get_format_gl_internal(adapter, WINED3DFMT_UYVY); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0; }
@@ -3650,11 +3650,11 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ else { format = get_format_gl_internal(adapter, WINED3DFMT_YV12); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0;
format = get_format_gl_internal(adapter, WINED3DFMT_NV12); - format_clear_flag(&format->f, WINED3DFMT_FLAG_BLIT); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_BLIT); format->internal = 0; }
@@ -3667,19 +3667,19 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (!gl_info->supported[ARB_HALF_FLOAT_PIXEL]) { format = get_format_gl_internal(adapter, WINED3DFMT_R16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
format = get_format_gl_internal(adapter, WINED3DFMT_R16G16B16A16_FLOAT); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
if (gl_info->quirks & WINED3D_QUIRK_BROKEN_RGBA16) { format = get_format_gl_internal(adapter, WINED3DFMT_R16G16B16A16_UNORM); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* ATI instancing hack: Although ATI cards do not support Shader Model @@ -3698,7 +3698,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[ARB_VERTEX_PROGRAM] || gl_info->supported[ARB_VERTEX_SHADER]) { format = get_format_gl_internal(adapter, WINED3DFMT_INST); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* Depth bound test. To query if the card supports it CheckDeviceFormat() @@ -3710,13 +3710,13 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[EXT_DEPTH_BOUNDS_TEST]) { format = get_format_gl_internal(adapter, WINED3DFMT_NVDB); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
if (gl_info->supported[ARB_MULTISAMPLE]) { format = get_format_gl_internal(adapter, WINED3DFMT_ATOC); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); }
/* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ @@ -3725,14 +3725,14 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]) { format = get_format_gl_internal(adapter, WINED3DFMT_RESZ); - format_set_flag(&format->f, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_RENDERTARGET); + format_set_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET); }
for (i = 0; i < WINED3D_FORMAT_COUNT; ++i) { format = get_format_gl_by_idx(adapter, i);
- if (!(format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)) + if (!(format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE)) continue;
if (is_identity_fixup(format->f.color_fixup)) @@ -3744,7 +3744,7 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ || !adapter->fragment_pipe->color_fixup_supported(format->f.color_fixup)) { TRACE("[FAILED]\n"); - format_clear_flag(&format->f, WINED3DFMT_FLAG_TEXTURE); + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE); } else { @@ -3753,17 +3753,17 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ }
/* These formats are not supported for 3D textures. See also - * WINED3DFMT_FLAG_DECOMPRESS. */ + * WINED3D_FORMAT_CAP_DECOMPRESS. */ format = get_format_gl_internal(adapter, WINED3DFMT_ATI1N); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_ATI2N); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC4_SNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC5_UNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; format = get_format_gl_internal(adapter, WINED3DFMT_BC5_SNORM); - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3D_FORMAT_CAP_TEXTURE; }
static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, @@ -3783,7 +3783,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter, format->f.emit_idx = format_vertex_info[i].emit_idx; format->vtx_type = format_vertex_info[i].gl_vtx_type; format->vtx_format = format->f.component_count; - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; }
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) @@ -3797,7 +3797,7 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter,
static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) { - unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; + unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; unsigned int attrs, i, j;
for (i = 0; i < ARRAY_SIZE(typed_formats); ++i) @@ -3810,11 +3810,11 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) return FALSE;
attrs = typeless_format->attrs; - memcpy(flags, typeless_format->flags, sizeof(flags)); + memcpy(caps, typeless_format->caps, sizeof(caps)); copy_format(adapter, typeless_format, format); typeless_format->attrs |= attrs; - for (j = 0; j < ARRAY_SIZE(typeless_format->flags); ++j) - typeless_format->flags[j] |= flags[j]; + for (j = 0; j < ARRAY_SIZE(typeless_format->caps); ++j) + typeless_format->caps[j] |= caps[j]; }
for (i = 0; i < ARRAY_SIZE(typeless_depth_stencil_formats); ++i) @@ -3832,10 +3832,10 @@ static BOOL init_typeless_formats(const struct wined3d_adapter *adapter) typeless_ds_format->id = typeless_depth_stencil_formats[i].typeless_id; copy_format(adapter, typeless_ds_format, ds_format); typeless_ds_format->attrs = typeless_format->attrs; - for (j = 0; j < ARRAY_SIZE(typeless_ds_format->flags); ++j) + for (j = 0; j < ARRAY_SIZE(typeless_ds_format->caps); ++j) { - typeless_ds_format->flags[j] = typeless_format->flags[j]; - typeless_format->flags[j] &= ~WINED3DFMT_FLAG_DEPTH_STENCIL; + typeless_ds_format->caps[j] = typeless_format->caps[j]; + typeless_format->caps[j] &= ~WINED3D_FORMAT_CAP_DEPTH_STENCIL; }
if ((format_id = typeless_depth_stencil_formats[i].depth_view_id) @@ -3874,9 +3874,9 @@ static void init_format_gen_mipmap_info(const struct wined3d_adapter *adapter, { struct wined3d_format *format = get_format_by_idx(adapter, i);
- for (j = 0; j < ARRAY_SIZE(format->flags); ++j) - if (!(~format->flags[j] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - format->flags[j] |= WINED3DFMT_FLAG_GEN_MIPMAP; + for (j = 0; j < ARRAY_SIZE(format->caps); ++j) + if (!(~format->caps[j] & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FILTERING))) + format->caps[j] |= WINED3D_FORMAT_CAP_GEN_MIPMAP; } }
@@ -4125,7 +4125,7 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter, { struct wined3d_format_gl *format = get_format_gl_by_idx(adapter, i);
- if (format->f.depth_size && (format->f.flags[WINED3D_GL_RES_TYPE_RB] & WINED3DFMT_FLAG_DEPTH_STENCIL)) + if (format->f.depth_size && (format->f.caps[WINED3D_GL_RES_TYPE_RB] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) { TRACE("Testing depth bias scale for format %s.\n", debug_d3dformat(format->f.id)); format->f.depth_bias_scale = wined3d_adapter_find_polyoffset_scale(ctx, format->internal); @@ -4206,8 +4206,8 @@ BOOL wined3d_adapter_no3d_init_format_info(struct wined3d_adapter *adapter) if (!(format = get_format_internal(adapter, blit_formats[i]))) return FALSE;
- format->flags[WINED3D_GL_RES_TYPE_TEX_2D] |= WINED3DFMT_FLAG_BLIT; - format->flags[WINED3D_GL_RES_TYPE_RB] |= WINED3DFMT_FLAG_BLIT; + format->caps[WINED3D_GL_RES_TYPE_TEX_2D] |= WINED3D_FORMAT_CAP_BLIT; + format->caps[WINED3D_GL_RES_TYPE_RB] |= WINED3D_FORMAT_CAP_BLIT; }
return TRUE; @@ -4325,7 +4325,7 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, VkFormatFeatureFlags texture_flags; VkFormatProperties properties; VkImageUsageFlags vk_usage; - unsigned int flags; + unsigned int caps; const char *fixup; unsigned int i; uint32_t mask; @@ -4366,44 +4366,44 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, }
if (properties.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_VERTEX_ATTRIBUTE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE; if (properties.bufferFeatures & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) - format->f.flags[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3DFMT_FLAG_TEXTURE; + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_TEXTURE;
- flags = 0; + caps = 0; texture_flags = properties.linearTilingFeatures | properties.optimalTilingFeatures; if (texture_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { - flags |= WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_VTF; + caps |= WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_VTF; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_RENDERTARGET; + caps |= WINED3D_FORMAT_CAP_RENDERTARGET; } if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { - flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING; + caps |= WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING; } if (texture_flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { - flags |= WINED3DFMT_FLAG_DEPTH_STENCIL; + caps |= WINED3D_FORMAT_CAP_DEPTH_STENCIL; } if (texture_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { - flags |= WINED3DFMT_FLAG_FILTERING; + caps |= WINED3D_FORMAT_CAP_FILTERING; } if (texture_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { - flags |= WINED3DFMT_FLAG_UNORDERED_ACCESS; + caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS; }
- if (!(~flags & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - flags |= WINED3DFMT_FLAG_GEN_MIPMAP; + if (!(~caps & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FILTERING))) + caps |= WINED3D_FORMAT_CAP_GEN_MIPMAP;
- format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] |= flags; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] |= flags; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_1D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_3D] |= caps; + format->f.caps[WINED3D_GL_RES_TYPE_TEX_CUBE] |= caps;
vk_usage = 0; if (texture_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index dbb78806c3e..67a6417534c 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -226,7 +226,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara if (e->input_slot >= WINED3D_MAX_STREAMS) continue;
- if (!(e->format->flags[WINED3D_GL_RES_TYPE_BUFFER] & WINED3DFMT_FLAG_VERTEX_ATTRIBUTE)) + if (!(e->format->caps[WINED3D_GL_RES_TYPE_BUFFER] & WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE)) { FIXME("The application tries to use an unsupported format (%s).\n", debug_d3dformat(elements[i].format)); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 69b5403b639..1154e6f7853 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_attrs = view->format->attrs; - view->format_flags = view->format->flags[resource->gl_type]; + view->format_caps = view->format->caps[resource->gl_type]; view->desc = *desc;
if (resource->type == WINED3D_RTYPE_BUFFER) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1c7eb9bf6f0..699bd332e94 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4354,7 +4354,7 @@ struct wined3d_resource enum wined3d_gl_resource_type gl_type; const struct wined3d_format *format; unsigned int format_attrs; - unsigned int format_flags; + unsigned int format_caps; enum wined3d_multisample_type multisample_type; UINT multisample_quality; DWORD usage; @@ -5339,7 +5339,7 @@ struct wined3d_rendertarget_view
const struct wined3d_format *format; unsigned int format_attrs; - unsigned int format_flags; + unsigned int format_caps; unsigned int sub_resource_idx; unsigned int layer_count;
@@ -6119,24 +6119,24 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400 #define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
-/* WineD3D pixel format flags */ -#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 -#define WINED3DFMT_FLAG_FILTERING 0x00000002 -#define WINED3DFMT_FLAG_UNORDERED_ACCESS 0x00000004 -#define WINED3DFMT_FLAG_DEPTH_STENCIL 0x00000008 -#define WINED3DFMT_FLAG_RENDERTARGET 0x00000010 -#define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040 -#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080 -#define WINED3DFMT_FLAG_DECOMPRESS 0x00000100 -#define WINED3DFMT_FLAG_SRGB_READ 0x00000800 -#define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000 -#define WINED3DFMT_FLAG_VTF 0x00002000 -#define WINED3DFMT_FLAG_SHADOW 0x00004000 -#define WINED3DFMT_FLAG_TEXTURE 0x00080000 -#define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 -#define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 -#define WINED3DFMT_FLAG_BLIT 0x02000000 -#define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000 +/* Pixel format capabilities */ +#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING 0x00000001 +#define WINED3D_FORMAT_CAP_FILTERING 0x00000002 +#define WINED3D_FORMAT_CAP_UNORDERED_ACCESS 0x00000004 +#define WINED3D_FORMAT_CAP_DEPTH_STENCIL 0x00000008 +#define WINED3D_FORMAT_CAP_RENDERTARGET 0x00000010 +#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE 0x00000020 +#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB 0x00000040 +#define WINED3D_FORMAT_CAP_DECOMPRESS 0x00000080 +#define WINED3D_FORMAT_CAP_SRGB_READ 0x00000100 +#define WINED3D_FORMAT_CAP_SRGB_WRITE 0x00000200 +#define WINED3D_FORMAT_CAP_VTF 0x00000400 +#define WINED3D_FORMAT_CAP_SHADOW 0x00000800 +#define WINED3D_FORMAT_CAP_TEXTURE 0x00001000 +#define WINED3D_FORMAT_CAP_GEN_MIPMAP 0x00002000 +#define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE 0x00004000 +#define WINED3D_FORMAT_CAP_BLIT 0x00008000 +#define WINED3D_FORMAT_CAP_INDEX_BUFFER 0x00010000
struct wined3d_rational { @@ -6191,7 +6191,7 @@ struct wined3d_format UINT conv_byte_count; DWORD multisample_types; unsigned int attrs; - unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]; + unsigned int caps[WINED3D_GL_RES_TYPE_COUNT]; float depth_bias_scale; struct wined3d_rational height_scale; struct color_fixup_desc color_fixup; @@ -6321,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 & WINED3D_FORMAT_CAP_SRGB_READ)) return TRUE;
if (!context->d3d_info->srgb_write_control && (texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET) - && (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE)) + && (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE)) return TRUE;
return FALSE; @@ -6337,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 & WINED3D_FORMAT_CAP_SRGB_WRITE; }
static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl,