Commit 06b19322 authored by Chip Davis's avatar Chip Davis Committed by Alexandre Julliard

wined3d: Rename format flags to caps.

parent ea4de99f
......@@ -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);
}
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -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);
......
......@@ -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. */
......
......@@ -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;
......
......@@ -302,10 +302,10 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win
switch (blit_op)
{
case WINED3D_BLIT_OP_COLOR_BLIT:
if (!((src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE)
if (!((src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)
|| (src_resource->bind_flags & WINED3D_BIND_RENDER_TARGET)))
return false;
if (!((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE)
if (!((dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_FBO_ATTACHABLE)
|| (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET)))
return false;
if ((src_format->id != dst_format->id || dst_location == WINED3D_LOCATION_DRAWABLE)
......@@ -314,9 +314,9 @@ static bool fbo_blitter_supported(enum wined3d_blit_op blit_op, const struct win
break;
case WINED3D_BLIT_OP_DEPTH_BLIT:
if (!(src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
if (!(src_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL))
return false;
if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_DEPTH_STENCIL))
if (!(dst_format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_DEPTH_STENCIL))
return false;
/* Accept pure swizzle fixups for depth formats. In general we
* ignore the stencil component (if present) at the moment and the
......@@ -2115,9 +2115,9 @@ void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl,
if (texture_gl->t.flags & alloc_flag)
return;
if (resource->format_flags & WINED3DFMT_FLAG_DECOMPRESS)
if (resource->format_caps & WINED3D_FORMAT_CAP_DECOMPRESS)
{
TRACE("WINED3DFMT_FLAG_DECOMPRESS set.\n");
TRACE("WINED3D_FORMAT_CAP_DECOMPRESS set.\n");
texture_gl->t.flags |= WINED3D_TEXTURE_CONVERTED;
format = wined3d_resource_get_decompress_format(resource);
}
......@@ -2547,7 +2547,7 @@ static void wined3d_texture_gl_upload_data(struct wined3d_context *context,
bo.addr += src_box->left * src_format->byte_count;
}
decompress = (dst_texture->resource.format_flags & WINED3DFMT_FLAG_DECOMPRESS)
decompress = (dst_texture->resource.format_caps & WINED3D_FORMAT_CAP_DECOMPRESS)
|| (src_format->decompress && src_format->id != dst_texture->resource.format->id);
if (src_format->upload || decompress
......@@ -3170,7 +3170,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g
wined3d_texture_get_level_box(&texture_gl->t, level, &src_box);
if (!depth && sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB)
&& (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)
&& (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB)
&& fbo_blitter_supported(WINED3D_BLIT_OP_COLOR_BLIT, gl_info,
&texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_RGB,
&texture_gl->t.resource, WINED3D_LOCATION_TEXTURE_SRGB))
......@@ -3191,7 +3191,7 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g
}
if (!depth && sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)
&& (!srgb || (texture_gl->t.resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)))
&& (!srgb || (texture_gl->t.resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB)))
{
DWORD src_location = sub_resource->locations & WINED3D_LOCATION_RB_RESOLVED ?
WINED3D_LOCATION_RB_RESOLVED : WINED3D_LOCATION_RB_MULTISAMPLE;
......@@ -3343,10 +3343,10 @@ static bool use_ffp_clear(const struct wined3d_texture *texture, unsigned int lo
return false;
if (location == WINED3D_LOCATION_TEXTURE_RGB
&& !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE))
&& !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE))
return false;
if (location == WINED3D_LOCATION_TEXTURE_SRGB
&& !(texture->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB))
&& !(texture->resource.format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB))
return false;
return location & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED
......@@ -3944,7 +3944,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
/* DXTn 3D textures are not supported. Do not write the ERR for them. */
if ((desc->format == WINED3DFMT_DXT1 || desc->format == WINED3DFMT_DXT2 || desc->format == WINED3DFMT_DXT3
|| desc->format == WINED3DFMT_DXT4 || desc->format == WINED3DFMT_DXT5)
&& !(format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_TEXTURE)
&& !(format->caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_TEXTURE)
&& desc->resource_type != WINED3D_RTYPE_TEXTURE_3D && !once++)
ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n");
......@@ -3971,7 +3971,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->flags |= WINED3D_TEXTURE_DISCARD;
if (flags & WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS)
{
if (!(texture->resource.format_flags & WINED3DFMT_FLAG_GEN_MIPMAP))
if (!(texture->resource.format_caps & WINED3D_FORMAT_CAP_GEN_MIPMAP))
WARN("Format doesn't support mipmaps generation, "
"ignoring WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS flag.\n");
else
......@@ -6059,7 +6059,7 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
if (blitter_use_cpu_clear(view)
|| (!(view->resource->bind_flags & WINED3D_BIND_RENDER_TARGET)
&& (wined3d_settings.offscreen_rendering_mode != ORM_FBO
|| !(view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE))))
|| !(view->format_caps & WINED3D_FORMAT_CAP_FBO_ATTACHABLE))))
{
next_flags |= WINED3DCLEAR_TARGET;
flags &= ~WINED3DCLEAR_TARGET;
......
......@@ -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));
......
......@@ -623,7 +623,7 @@ static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *
if (!(view->format = validate_resource_view(desc, resource, TRUE, allow_srgb_toggle)))
return E_INVALIDARG;
view->format_attrs = view->format->attrs;
view->format_flags = view->format->flags[resource->gl_type];
view->format_caps = view->format->caps[resource->gl_type];
view->desc = *desc;
if (resource->type == WINED3D_RTYPE_BUFFER)
......
......@@ -4354,7 +4354,7 @@ struct wined3d_resource
enum wined3d_gl_resource_type gl_type;
const struct wined3d_format *format;
unsigned int format_attrs;
unsigned int format_flags;
unsigned int format_caps;
enum wined3d_multisample_type multisample_type;
UINT multisample_quality;
DWORD usage;
......@@ -5341,7 +5341,7 @@ struct wined3d_rendertarget_view
const struct wined3d_format *format;
unsigned int format_attrs;
unsigned int format_flags;
unsigned int format_caps;
unsigned int sub_resource_idx;
unsigned int layer_count;
......@@ -6121,24 +6121,24 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
#define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400
#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
/* WineD3D pixel format flags */
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001
#define WINED3DFMT_FLAG_FILTERING 0x00000002
#define WINED3DFMT_FLAG_UNORDERED_ACCESS 0x00000004
#define WINED3DFMT_FLAG_DEPTH_STENCIL 0x00000008
#define WINED3DFMT_FLAG_RENDERTARGET 0x00000010
#define WINED3DFMT_FLAG_FBO_ATTACHABLE 0x00000040
#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB 0x00000080
#define WINED3DFMT_FLAG_DECOMPRESS 0x00000100
#define WINED3DFMT_FLAG_SRGB_READ 0x00000800
#define WINED3DFMT_FLAG_SRGB_WRITE 0x00001000
#define WINED3DFMT_FLAG_VTF 0x00002000
#define WINED3DFMT_FLAG_SHADOW 0x00004000
#define WINED3DFMT_FLAG_TEXTURE 0x00080000
#define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000
#define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000
#define WINED3DFMT_FLAG_BLIT 0x02000000
#define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000
/* Pixel format capabilities */
#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING 0x00000001
#define WINED3D_FORMAT_CAP_FILTERING 0x00000002
#define WINED3D_FORMAT_CAP_UNORDERED_ACCESS 0x00000004
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL 0x00000008
#define WINED3D_FORMAT_CAP_RENDERTARGET 0x00000010
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE 0x00000020
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB 0x00000040
#define WINED3D_FORMAT_CAP_DECOMPRESS 0x00000080
#define WINED3D_FORMAT_CAP_SRGB_READ 0x00000100
#define WINED3D_FORMAT_CAP_SRGB_WRITE 0x00000200
#define WINED3D_FORMAT_CAP_VTF 0x00000400
#define WINED3D_FORMAT_CAP_SHADOW 0x00000800
#define WINED3D_FORMAT_CAP_TEXTURE 0x00001000
#define WINED3D_FORMAT_CAP_GEN_MIPMAP 0x00002000
#define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE 0x00004000
#define WINED3D_FORMAT_CAP_BLIT 0x00008000
#define WINED3D_FORMAT_CAP_INDEX_BUFFER 0x00010000
struct wined3d_rational
{
......@@ -6193,7 +6193,7 @@ struct wined3d_format
UINT conv_byte_count;
DWORD multisample_types;
unsigned int attrs;
unsigned int flags[WINED3D_GL_RES_TYPE_COUNT];
unsigned int caps[WINED3D_GL_RES_TYPE_COUNT];
float depth_bias_scale;
struct wined3d_rational height_scale;
struct color_fixup_desc color_fixup;
......@@ -6323,12 +6323,12 @@ static inline BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *
if (!context->d3d_info->srgb_read_control
&& (texture->resource.bind_flags & WINED3D_BIND_SHADER_RESOURCE)
&& (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_READ))
&& (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_READ))
return TRUE;
if (!context->d3d_info->srgb_write_control
&& (texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET)
&& (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE))
&& (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE))
return TRUE;
return FALSE;
......@@ -6339,7 +6339,7 @@ static inline BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info,
{
return (!(d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
|| state->render_states[WINED3D_RS_SRGBWRITEENABLE])
&& fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE;
&& fb->render_targets[0] && fb->render_targets[0]->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE;
}
static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment