From: Zebediah Figura zfigura@codeweavers.com
WINED3D_GL_RES_TYPE_RB is not used by the Vulkan backend.
We could alternatively solve this by filling WINED3D_GL_RES_TYPE_RB for the Vulkan backend, but this makes less sense. Checking both formats is more in line with what is done elsewhere, e.g. wined3d_check_surface_format(). --- dlls/wined3d/directx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 925b2df0401..92ebbc2ba23 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1971,6 +1971,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, allowed_bind_flags = WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL | WINED3D_BIND_UNORDERED_ACCESS; + gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_2D; if (!(bind_flags & WINED3D_BIND_SHADER_RESOURCE)) { if (!wined3d_check_surface_format(format)) @@ -1978,8 +1979,6 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, TRACE("%s is not supported for plain surfaces.\n", debug_d3dformat(format->id)); return WINED3DERR_NOTAVAILABLE; } - - gl_type = gl_type_end = WINED3D_GL_RES_TYPE_RB; break; } allowed_usage |= WINED3DUSAGE_DYNAMIC @@ -1993,7 +1992,6 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, | WINED3DUSAGE_QUERY_VERTEXTEXTURE | WINED3DUSAGE_QUERY_WRAPANDMIP; allowed_bind_flags |= WINED3D_BIND_SHADER_RESOURCE; - gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_2D; if (usage & WINED3DUSAGE_LEGACY_CUBEMAP) { allowed_usage &= ~WINED3DUSAGE_QUERY_LEGACYBUMPMAP; @@ -2092,6 +2090,11 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d,
for (; gl_type <= gl_type_end; ++gl_type) { + unsigned int caps = format->caps[gl_type]; + + if (gl_type == WINED3D_GL_RES_TYPE_TEX_2D && !(bind_flags & WINED3D_BIND_SHADER_RESOURCE)) + caps |= format->caps[WINED3D_GL_RES_TYPE_RB]; + if ((format->caps[gl_type] & format_caps) != format_caps) { TRACE("Requested format caps %#x, but format %s only has %#x.\n",