Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/buffer.c | 2 +- dlls/wined3d/context.c | 14 +++++++------- dlls/wined3d/directx.c | 14 +++++++------- dlls/wined3d/resource.c | 4 ++-- dlls/wined3d/surface.c | 2 +- dlls/wined3d/swapchain.c | 4 ++-- dlls/wined3d/texture.c | 8 ++++---- dlls/wined3d/utils.c | 4 ++-- dlls/wined3d/view.c | 6 +++--- dlls/wined3d/wined3d_private.h | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 4c90d820a89..020116da7f6 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1354,7 +1354,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops) { - const struct wined3d_format *format = wined3d_get_format(device->adapter, WINED3DFMT_UNKNOWN, desc->usage); + const struct wined3d_format *format = wined3d_get_format(device->adapter, WINED3DFMT_UNKNOWN, desc->bind_flags); const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct wined3d_resource *resource = &buffer->resource; BOOL dynamic_buffer_ok; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 3446c8df9e9..9784f38c10b 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2005,9 +2005,9 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, const struct wined3d_format *color_format; const struct wined3d_d3d_info *d3d_info; const struct wined3d_gl_info *gl_info; + unsigned int target_bind_flags; BOOL aux_buffers = FALSE; HGLRC ctx, share_ctx; - DWORD target_usage; unsigned int i;
gl_info = context->gl_info; @@ -2052,7 +2052,7 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, return FALSE;
color_format = target->resource.format; - target_usage = target->resource.usage; + target_bind_flags = target->resource.bind_flags;
/* In case of ORM_BACKBUFFER, make sure to request an alpha component for * X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */ @@ -2061,9 +2061,9 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, aux_buffers = TRUE;
if (color_format->id == WINED3DFMT_B4G4R4X4_UNORM) - color_format = wined3d_get_format(device->adapter, WINED3DFMT_B4G4R4A4_UNORM, target_usage); + color_format = wined3d_get_format(device->adapter, WINED3DFMT_B4G4R4A4_UNORM, target_bind_flags); else if (color_format->id == WINED3DFMT_B8G8R8X8_UNORM) - color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_usage); + color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_bind_flags); }
/* DirectDraw supports 8bit paletted render targets and these are used by @@ -2073,7 +2073,7 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, * For this reason we require a format with 8bit alpha, so request * A8R8G8B8. */ if (color_format->id == WINED3DFMT_P8_UINT) - color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_usage); + color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_bind_flags);
/* When using FBOs for off-screen rendering, we only use the drawable for * presentation blits, and don't do any rendering to it. That means we @@ -2085,8 +2085,8 @@ BOOL wined3d_adapter_gl_create_context(struct wined3d_context *context, * conflicting pixel formats. */ if (wined3d_settings.offscreen_rendering_mode != ORM_BACKBUFFER) { - color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_usage); - ds_format = wined3d_get_format(device->adapter, WINED3DFMT_UNKNOWN, WINED3DUSAGE_DEPTHSTENCIL); + color_format = wined3d_get_format(device->adapter, WINED3DFMT_B8G8R8A8_UNORM, target_bind_flags); + ds_format = wined3d_get_format(device->adapter, WINED3DFMT_UNKNOWN, WINED3D_BIND_DEPTH_STENCIL); }
/* Try to find a pixel format which matches our requirements. */ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 00bc737d3fe..a03465f8077 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -763,7 +763,7 @@ UINT CDECL wined3d_get_adapter_mode_count(const struct wined3d *wined3d, UINT ad return 0;
adapter = &wined3d->adapters[adapter_idx]; - format = wined3d_get_format(adapter, format_id, WINED3DUSAGE_RENDERTARGET); + format = wined3d_get_format(adapter, format_id, WINED3D_BIND_RENDER_TARGET); format_bits = format->byte_count * CHAR_BIT;
memset(&mode, 0, sizeof(mode)); @@ -817,7 +817,7 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada return WINED3DERR_INVALIDCALL;
adapter = &wined3d->adapters[adapter_idx]; - format = wined3d_get_format(adapter, format_id, WINED3DUSAGE_RENDERTARGET); + format = wined3d_get_format(adapter, format_id, WINED3D_BIND_RENDER_TARGET); format_bits = format->byte_count * CHAR_BIT;
memset(&m, 0, sizeof(m)); @@ -1076,7 +1076,7 @@ HRESULT CDECL wined3d_set_adapter_display_mode(struct wined3d *wined3d, TRACE("mode %ux%u@%u %s %#x.\n", mode->width, mode->height, mode->refresh_rate, debug_d3dformat(mode->format_id), mode->scanline_ordering);
- format = wined3d_get_format(adapter, mode->format_id, WINED3DUSAGE_RENDERTARGET); + format = wined3d_get_format(adapter, mode->format_id, WINED3D_BIND_RENDER_TARGET);
new_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; new_mode.dmBitsPerPel = format->byte_count * CHAR_BIT; @@ -1318,8 +1318,8 @@ HRESULT CDECL wined3d_check_depth_stencil_match(const struct wined3d *wined3d, return WINED3DERR_INVALIDCALL;
adapter = &wined3d->adapters[adapter_idx]; - rt_format = wined3d_get_format(adapter, render_target_format_id, WINED3DUSAGE_RENDERTARGET); - ds_format = wined3d_get_format(adapter, depth_stencil_format_id, WINED3DUSAGE_DEPTHSTENCIL); + 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 (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if ((rt_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_RENDERTARGET) @@ -1538,8 +1538,8 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad return WINED3DERR_INVALIDCALL;
adapter = &wined3d->adapters[adapter_idx]; - adapter_format = wined3d_get_format(adapter, adapter_format_id, WINED3DUSAGE_RENDERTARGET); - format = wined3d_get_format(adapter, check_format_id, usage); + adapter_format = wined3d_get_format(adapter, adapter_format_id, WINED3D_BIND_RENDER_TARGET); + format = wined3d_get_format(adapter, check_format_id, bind_flags);
if (usage & WINED3DUSAGE_RENDERTARGET) bind_flags |= WINED3D_BIND_RENDER_TARGET; diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 320d54c731d..512546d699b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -487,6 +487,6 @@ const struct wined3d_format *wined3d_resource_get_decompress_format(const struct const struct wined3d_adapter *adapter = resource->device->adapter; if (resource->format_flags & (WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_SRGB_WRITE) && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)) - return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM_SRGB, resource->usage); - return wined3d_get_format(adapter, WINED3DFMT_B8G8R8A8_UNORM, resource->usage); + 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/surface.c b/dlls/wined3d/surface.c index 122c643150f..40d8974672e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1614,7 +1614,7 @@ BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_re
format = texture->resource.format; if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) - format = wined3d_get_format(device->adapter, conversion->dst_format, texture->resource.usage); + format = wined3d_get_format(device->adapter, conversion->dst_format, texture->resource.bind_flags);
/* Don't use PBOs for converted surfaces. During PBO conversion we look at * WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 91f96a47a03..4ab1594f063 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -669,7 +669,7 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
adapter = swapchain->device->adapter; gl_info = &adapter->gl_info; - if (!(format = wined3d_get_format(adapter, format_id, WINED3DUSAGE_RENDERTARGET))) + if (!(format = wined3d_get_format(adapter, format_id, WINED3D_BIND_RENDER_TARGET))) return;
if ((t = min(wined3d_settings.sample_count, gl_info->limits.samples))) @@ -726,7 +726,7 @@ static void wined3d_swapchain_cs_init(void *object) * request a depth/stencil buffer in the likely case it's needed later. */ for (i = 0; i < ARRAY_SIZE(formats); ++i) { - swapchain->ds_format = wined3d_get_format(adapter, formats[i], WINED3DUSAGE_DEPTHSTENCIL); + swapchain->ds_format = wined3d_get_format(adapter, formats[i], WINED3D_BIND_DEPTH_STENCIL); if ((swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format))) break; TRACE("Depth stencil format %s is not supported, trying next format.\n", debug_d3dformat(formats[i])); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index a98c0af231b..45de4a10d1a 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1575,7 +1575,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT device = texture->resource.device; gl_info = &device->adapter->gl_info; d3d_info = &device->adapter->d3d_info; - format = wined3d_get_format(device->adapter, format_id, texture->resource.usage); + format = wined3d_get_format(device->adapter, format_id, texture->resource.bind_flags); resource_size = wined3d_format_calculate_size(format, device->surface_alignment, width, height, 1);
if (!resource_size) @@ -1774,7 +1774,7 @@ void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct win else if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE))) { texture->flags |= WINED3D_TEXTURE_CONVERTED; - format = wined3d_get_format(device->adapter, conversion->dst_format, resource->usage); + format = wined3d_get_format(device->adapter, conversion->dst_format, resource->bind_flags); TRACE("Using format %s for color key conversion.\n", debug_d3dformat(format->id)); } format_gl = wined3d_format_gl(format); @@ -2896,7 +2896,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc WARN("Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n"); return WINED3DERR_INVALIDCALL; } - format = wined3d_get_format(device->adapter, desc->format, desc->usage); + format = wined3d_get_format(device->adapter, desc->format, desc->bind_flags);
if (desc->usage & WINED3DUSAGE_DYNAMIC && (wined3d_resource_access_is_managed(desc->access) || desc->usage & WINED3DUSAGE_SCRATCH)) @@ -3645,7 +3645,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
if (desc->multisample_type != WINED3D_MULTISAMPLE_NONE) { - const struct wined3d_format *format = wined3d_get_format(device->adapter, desc->format, desc->usage); + const struct wined3d_format *format = wined3d_get_format(device->adapter, desc->format, desc->bind_flags);
if (desc->multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE && desc->multisample_quality >= wined3d_popcount(format->multisample_types)) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 0bc4a37df45..73e8cf25f78 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4060,7 +4060,7 @@ fail: }
const struct wined3d_format *wined3d_get_format(const struct wined3d_adapter *adapter, - enum wined3d_format_id format_id, unsigned int resource_usage) + enum wined3d_format_id format_id, unsigned int bind_flags) { const struct wined3d_format *format; int idx = get_format_idx(format_id); @@ -4075,7 +4075,7 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_adapter *ad
format = get_format_by_idx(adapter, idx);
- if (resource_usage & WINED3DUSAGE_DEPTHSTENCIL && wined3d_format_is_typeless(format)) + if (bind_flags & WINED3D_BIND_DEPTH_STENCIL && wined3d_format_is_typeless(format)) { for (i = 0; i < ARRAY_SIZE(typeless_depth_stencil_formats); ++i) { diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 59a30eadf53..1e0f49ffd07 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -87,7 +87,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ const struct wined3d_adapter *adapter = resource->device->adapter; const struct wined3d_format *format;
- format = wined3d_get_format(adapter, desc->format_id, resource->usage); + format = wined3d_get_format(adapter, desc->format_id, resource->bind_flags); if (resource->type == WINED3D_RTYPE_BUFFER && (desc->flags & WINED3D_VIEW_BUFFER_RAW)) { if (format->id != WINED3DFMT_R32_TYPELESS) @@ -96,7 +96,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ return NULL; }
- format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->usage); + format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->bind_flags); }
if (wined3d_format_is_typeless(format)) @@ -118,7 +118,7 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_ return NULL; }
- format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->usage); + format = wined3d_get_format(adapter, WINED3DFMT_R32_UINT, resource->bind_flags); element_size = buffer->structure_byte_stride; } else diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9a01ed29ff9..5b7ddfce10d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4425,7 +4425,7 @@ struct wined3d_format };
const struct wined3d_format *wined3d_get_format(const struct wined3d_adapter *adapter, - enum wined3d_format_id format_id, unsigned int resource_usage) DECLSPEC_HIDDEN; + enum wined3d_format_id format_id, unsigned int bind_flags) DECLSPEC_HIDDEN; void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment, unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch) DECLSPEC_HIDDEN; UINT wined3d_format_calculate_size(const struct wined3d_format *format,