Signed-off-by: Chip Davis cdavis5x@gmail.com
-- v2: wined3d: Record format UAV capabilities. d3d11: Support D3D11_FEATURE_FORMAT_SUPPORT2. d3d11: Support D3D11_FEATURE_FORMAT_SUPPORT. d3d11: Reimplement ID3D11Device::CheckFormatSupport() using wined3d_device_check_format_support(). wined3d: Introduce wined3d_device_check_format_support().
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/device.c | 202 ++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 49 +++++++++ 3 files changed, 252 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c6a6de93123..9184a1155a8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4279,6 +4279,208 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, TRACE("Applied stateblock %p.\n", stateblock); }
+HRESULT CDECL wined3d_device_check_format_support(const struct wined3d_device *device, + enum wined3d_format_id format_id, unsigned int *format_support, + unsigned int *format_support_2) +{ + enum wined3d_feature_level feature_level = device->cs->c.state->feature_level; + const struct wined3d_adapter *adapter = device->adapter; + unsigned int flags = 0, flags2 = 0, rb_caps; + enum wined3d_gl_resource_type gl_type; + const struct wined3d_format *format; + + TRACE("device %p, format %s, format_support %p, format_support_2 %p.\n", + device, debug_d3dformat(format_id), format_support, format_support_2); + + + /* 10level9 exposes no support for DXGI_FORMAT_UNKNOWN. Level 10+ report BUFFER|CPU_LOCKABLE. */ + if (format_id == WINED3DFMT_UNKNOWN) + { + if (format_support_2) + *format_support_2 = 0; + if (feature_level < WINED3D_FEATURE_LEVEL_10) + { + if (format_support) + *format_support = 0; + return E_FAIL; + } + else + { + if (format_support) + *format_support = WINED3D_FORMAT_SUPPORT_SHADER_BUFFER + | WINED3D_FORMAT_SUPPORT_CPU_LOCKABLE; + return S_OK; + } + } + + format = wined3d_get_format(adapter, format_id, 0); + + /* 10level9 has no support for typeless. */ + if (feature_level < WINED3D_FEATURE_LEVEL_10 && wined3d_format_is_typeless(format)) + { + if (format_support) + *format_support = 0; + if (format_support_2) + *format_support_2 = 0; + return E_FAIL; + } + + /* Native only allows these formats for an index buffer. */ + if (format_id == WINED3DFMT_R16_UINT + || (feature_level >= WINED3D_FEATURE_LEVEL_9_2 && format_id == WINED3DFMT_R32_UINT)) + flags |= WINED3D_FORMAT_SUPPORT_IA_INDEX_BUFFER; + if (format->caps[WINED3D_GL_RES_TYPE_BUFFER] & WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE) + { + flags |= WINED3D_FORMAT_SUPPORT_IA_VERTEX_BUFFER; + if (feature_level >= WINED3D_FEATURE_LEVEL_10) + { + /* Only types that can be expressed in a stream output buffer go here. */ + switch (format_id) + { + case WINED3DFMT_R32_FLOAT: + case WINED3DFMT_R32_UINT: + case WINED3DFMT_R32_SINT: + case WINED3DFMT_R32G32_FLOAT: + case WINED3DFMT_R32G32_UINT: + case WINED3DFMT_R32G32_SINT: + case WINED3DFMT_R32G32B32_FLOAT: + case WINED3DFMT_R32G32B32_UINT: + case WINED3DFMT_R32G32B32_SINT: + case WINED3DFMT_R32G32B32A32_FLOAT: + case WINED3DFMT_R32G32B32A32_UINT: + case WINED3DFMT_R32G32B32A32_SINT: + flags |= WINED3D_FORMAT_SUPPORT_SO_BUFFER; + break; + default: + break; + } + } + } + + for (gl_type = WINED3D_GL_RES_TYPE_TEX_1D; gl_type < WINED3D_GL_RES_TYPE_COUNT; ++gl_type) + { + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_TEXTURE) + { + switch (gl_type) + { + case WINED3D_GL_RES_TYPE_TEX_1D: + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_1D | WINED3D_FORMAT_SUPPORT_MIP; + break; + case WINED3D_GL_RES_TYPE_TEX_2D: + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_2D | WINED3D_FORMAT_SUPPORT_MIP; + break; + case WINED3D_GL_RES_TYPE_TEX_RECT: + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_2D; + break; + case WINED3D_GL_RES_TYPE_TEX_3D: + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_3D | WINED3D_FORMAT_SUPPORT_MIP; + break; + case WINED3D_GL_RES_TYPE_TEX_CUBE: + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_CUBE | WINED3D_FORMAT_SUPPORT_MIP; + break; + case WINED3D_GL_RES_TYPE_BUFFER: + if (feature_level >= WINED3D_FEATURE_LEVEL_10) + flags |= WINED3D_FORMAT_SUPPORT_SHADER_BUFFER; + break; + default: + break; + } + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_GEN_MIPMAP) + flags |= WINED3D_FORMAT_SUPPORT_MIP_AUTOGEN; + /* Only typed RGBA formats can be read from a shader. */ + if (!wined3d_format_is_typeless(format) + && !(format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) + { + flags |= WINED3D_FORMAT_SUPPORT_SHADER_LOAD; + /* d3d11 requires 4 and 8 sample counts support for formats reported to support multisample. */ + if (format->multisample_types & 0x88 == 0x88) + flags |= WINED3D_FORMAT_SUPPORT_MULTISAMPLE_LOAD; + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_FILTERING) + { + flags |= WINED3D_FORMAT_SUPPORT_SHADER_SAMPLE; + if (feature_level >= WINED3D_FEATURE_LEVEL_10_1) + flags |= WINED3D_FORMAT_SUPPORT_SHADER_GATHER; + if (wined3d_format_is_depth_view(format->typeless_id, format_id)) + { + if (feature_level >= WINED3D_FEATURE_LEVEL_10) + flags |= WINED3D_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON; + if (feature_level >= WINED3D_FEATURE_LEVEL_10_1) + flags |= WINED3D_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON; + } + } + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_UNORDERED_ACCESS) + { + flags |= WINED3D_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW; + flags2 |= WINED3D_FORMAT_SUPPORT2_UAV_TYPED_STORE; + } + } + /* 10level9 doesn't allow mapping depth/stencil surfaces, but level 10+ do. */ + if (feature_level >= WINED3D_FEATURE_LEVEL_10 + || !(format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) + flags |= WINED3D_FORMAT_SUPPORT_CPU_LOCKABLE; + } + + if ((format->caps[gl_type] & WINED3D_FORMAT_CAP_RENDERTARGET) + && adapter->adapter_ops->adapter_check_format(adapter, NULL, format, NULL)) + { + flags |= WINED3D_FORMAT_SUPPORT_RENDER_TARGET; + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING) + flags |= WINED3D_FORMAT_SUPPORT_BLENDABLE; + /* d3d11 requires 4 and 8 sample counts support for formats reported to support multisample. */ + if (format->multisample_types & 0x88 == 0x88) + flags |= WINED3D_FORMAT_SUPPORT_MULTISAMPLE_RENDER_TARGET + | WINED3D_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE; + /* Only these formats are supported for display. */ + /* FIXME: This needs an adapter op using the swapchain, or a swapchain op. */ + switch (format_id) + { + case WINED3DFMT_R16G16B16A16_FLOAT: + case WINED3DFMT_R10G10B10A2_UNORM: + case WINED3DFMT_R10G10B10_XR_BIAS_A2_UNORM: + if (feature_level < WINED3D_FEATURE_LEVEL_10) + break; + /* fallthrough */ + case WINED3DFMT_R8G8B8A8_UNORM: + case WINED3DFMT_R8G8B8A8_UNORM_SRGB: + case WINED3DFMT_B8G8R8A8_UNORM: + case WINED3DFMT_B8G8R8A8_UNORM_SRGB: + flags |= WINED3D_FORMAT_SUPPORT_DISPLAY; + break; + default: + break; + } + } + + if ((format->caps[gl_type] & WINED3D_FORMAT_CAP_DEPTH_STENCIL) + && adapter->adapter_ops->adapter_check_format(adapter, NULL, NULL, format)) + { + flags |= WINED3D_FORMAT_SUPPORT_DEPTH_STENCIL; + /* No depth/stencil formats support multisample resolve. */ + if (format->multisample_types) + flags |= WINED3D_FORMAT_SUPPORT_MULTISAMPLE_RENDER_TARGET; + } + } + + rb_caps = format->caps[WINED3D_GL_RES_TYPE_TEX_2D] | format->caps[WINED3D_GL_RES_TYPE_RB]; + if (rb_caps & WINED3D_FORMAT_CAP_BLIT) + { + flags |= WINED3D_FORMAT_SUPPORT_TEXTURE_2D; + if (feature_level >= WINED3D_FEATURE_LEVEL_10 || !(rb_caps & WINED3D_FORMAT_CAP_DEPTH_STENCIL)) + flags |= WINED3D_FORMAT_SUPPORT_CPU_LOCKABLE; + } + + if (feature_level >= WINED3D_FEATURE_LEVEL_10 + && format->typeless_id != WINED3DFMT_UNKNOWN) + flags |= WINED3D_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT; + + if (format_support) + *format_support = flags; + if (format_support_2) + *format_support_2 = flags2; + + return !(flags || flags2) ? E_FAIL : S_OK; +} + HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps) { TRACE("device %p, caps %p.\n", device, caps); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 63220e1222c..8a3cd7b325f 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -51,6 +51,7 @@ @ cdecl wined3d_device_acquire_focus_window(ptr ptr) @ cdecl wined3d_device_apply_stateblock(ptr ptr) @ cdecl wined3d_device_begin_scene(ptr) +@ cdecl wined3d_device_check_format_support(ptr long ptr ptr) @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) @ cdecl wined3d_device_create(ptr ptr long ptr long long ptr long ptr ptr) @ cdecl wined3d_device_decref(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 116aea82348..c0aa59df4ee 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1335,6 +1335,52 @@ enum wined3d_memory_segment_group #define WINED3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000 #define WINED3DDEVCAPS_NPATCHES 0x01000000
+#define WINED3D_FORMAT_SUPPORT_SHADER_BUFFER 0x00000001 +#define WINED3D_FORMAT_SUPPORT_IA_VERTEX_BUFFER 0x00000002 +#define WINED3D_FORMAT_SUPPORT_IA_INDEX_BUFFER 0x00000004 +#define WINED3D_FORMAT_SUPPORT_SO_BUFFER 0x00000008 +#define WINED3D_FORMAT_SUPPORT_TEXTURE_1D 0x00000010 +#define WINED3D_FORMAT_SUPPORT_TEXTURE_2D 0x00000020 +#define WINED3D_FORMAT_SUPPORT_TEXTURE_3D 0x00000040 +#define WINED3D_FORMAT_SUPPORT_TEXTURE_CUBE 0x00000080 +#define WINED3D_FORMAT_SUPPORT_SHADER_LOAD 0x00000100 +#define WINED3D_FORMAT_SUPPORT_SHADER_SAMPLE 0x00000200 +#define WINED3D_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON 0x00000400 +#define WINED3D_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT 0x00000800 +#define WINED3D_FORMAT_SUPPORT_MIP 0x00001000 +#define WINED3D_FORMAT_SUPPORT_MIP_AUTOGEN 0x00002000 +#define WINED3D_FORMAT_SUPPORT_RENDER_TARGET 0x00004000 +#define WINED3D_FORMAT_SUPPORT_BLENDABLE 0x00008000 +#define WINED3D_FORMAT_SUPPORT_DEPTH_STENCIL 0x00010000 +#define WINED3D_FORMAT_SUPPORT_CPU_LOCKABLE 0x00020000 +#define WINED3D_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE 0x00040000 +#define WINED3D_FORMAT_SUPPORT_DISPLAY 0x00080000 +#define WINED3D_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT 0x00100000 +#define WINED3D_FORMAT_SUPPORT_MULTISAMPLE_RENDER_TARGET 0x00200000 +#define WINED3D_FORMAT_SUPPORT_MULTISAMPLE_LOAD 0x00400000 +#define WINED3D_FORMAT_SUPPORT_SHADER_GATHER 0x00800000 +#define WINED3D_FORMAT_SUPPORT_BACK_BUFFER_CAST 0x01000000 +#define WINED3D_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW 0x02000000 +#define WINED3D_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON 0x04000000 +#define WINED3D_FORMAT_SUPPORT_DECODER_OUTPUT 0x08000000 +#define WINED3D_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT 0x10000000 +#define WINED3D_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT 0x20000000 +#define WINED3D_FORMAT_SUPPORT_VIDEO_ENCODER 0x40000000 + +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_ADD 0x00000001 +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS 0x00000002 +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_XCHG 0x00000004 +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE 0x00000008 +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_MAX 0x00000010 +#define WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_MAX 0x00000020 +#define WINED3D_FORMAT_SUPPORT2_UAV_TYPED_LOAD 0x00000040 +#define WINED3D_FORMAT_SUPPORT2_UAV_TYPED_STORE 0x00000080 +#define WINED3D_FORMAT_SUPPORT2_OM_LOGIC_OP 0x00000100 +#define WINED3D_FORMAT_SUPPORT2_TILED 0x00000200 +#define WINED3D_FORMAT_SUPPORT2_SHAREABLE 0x00000400 + +#define WINED3D_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY 0x00004000 + #define WINED3D_LEGACY_DEPTH_BIAS 0x00000001 #define WINED3D_NO3D 0x00000002 #define WINED3D_VIDMEM_ACCOUNTING 0x00000004 @@ -2394,6 +2440,9 @@ ULONG __cdecl wined3d_depth_stencil_state_incref(struct wined3d_depth_stencil_st HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window); void __cdecl wined3d_device_apply_stateblock(struct wined3d_device *device, struct wined3d_stateblock *stateblock); HRESULT __cdecl wined3d_device_begin_scene(struct wined3d_device *device); +HRESULT __cdecl wined3d_device_check_format_support(const struct wined3d_device *device, + enum wined3d_format_id format_id, unsigned int *format_support, + unsigned int *format_support_2); HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float z, DWORD stencil); HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter,
On 5/26/22 01:51, Chip Davis wrote:
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com
dlls/wined3d/device.c | 202 ++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 49 +++++++++ 3 files changed, 252 insertions(+)
This doesn't seem like an improvement. I think it potentially makes sense to use wined3d format information (plus the feature level) to more accurately match the flags Windows reports—instead of reporting exactly what the backend is actually capable of—but I don't see a need to move the whole implementation to wined3d, not when it means adding a lot of new flags to the API, and not when d3d11 is the only direct user.
Separately, I think changes to the flags we report should be made in a much more granular fashion, one per commit. Applications can be rather sensitive to these flags, and I'd rather make any regressions easily bisectable.
On 5/27/22 13:11, Zebediah Figura wrote:
On 5/26/22 01:51, Chip Davis wrote:
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com
dlls/wined3d/device.c | 202 ++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 49 +++++++++ 3 files changed, 252 insertions(+)
This doesn't seem like an improvement. I think it potentially makes sense to use wined3d format information (plus the feature level) to more accurately match the flags Windows reports—instead of reporting exactly what the backend is actually capable of—but I don't see a need to move the whole implementation to wined3d, not when it means adding a lot of new flags to the API, and not when d3d11 is the only direct user.
Separately, I think changes to the flags we report should be made in a much more granular fashion, one per commit. Applications can be rather sensitive to these flags, and I'd rather make any regressions easily bisectable.
FWIW, I can see an argument for returning the format attrs and caps directly, instead of querying for one at a time—i.e. make the wined3d API more similar to the d3d11 API without introducing a 1:1 translation. I'm not sure it's *necessary*, but if it makes things simpler I'm not opposed.
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/d3d11/device.c | 93 +++------------------------------------- dlls/d3d11/tests/d3d11.c | 7 +-- 2 files changed, 11 insertions(+), 89 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 263613911f8..f1b9edc88d3 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3843,38 +3843,13 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * UINT *format_support) { struct d3d_device *device = impl_from_ID3D11Device2(iface); - struct wined3d_device_creation_parameters params; - struct wined3d_adapter *wined3d_adapter; enum wined3d_format_id wined3d_format; - D3D_FEATURE_LEVEL feature_level; - struct wined3d *wined3d; - unsigned int i; - - static const struct - { - enum wined3d_resource_type rtype; - unsigned int bind_flags; - unsigned int usage; - D3D11_FORMAT_SUPPORT flag; - } - flag_mapping[] = - { - {WINED3D_RTYPE_BUFFER, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_BUFFER}, - {WINED3D_RTYPE_BUFFER, WINED3D_BIND_VERTEX_BUFFER, 0, D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER}, - {WINED3D_RTYPE_BUFFER, WINED3D_BIND_INDEX_BUFFER, 0, D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER}, - {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE1D}, - {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE2D}, - {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE3D}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, 0, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_UNORDERED_ACCESS, 0, D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW}, - {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_WRAPANDMIP, D3D11_FORMAT_SUPPORT_MIP}, - {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_GENMIPMAP, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3D11_FORMAT_SUPPORT_BLENDABLE}, - }; HRESULT hr;
- FIXME("iface %p, format %u, format_support %p partial-stub!\n", iface, format, format_support); + TRACE("iface %p, format %u, format_support %p.\n", iface, format, format_support); + + if (!format_support) + return E_INVALIDARG;
wined3d_format = wined3dformat_from_dxgi_format(format); if (format && !wined3d_format) @@ -3884,66 +3859,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * return E_FAIL; }
- *format_support = 0; - wined3d_mutex_lock(); - feature_level = device->state->feature_level; - wined3d = wined3d_device_get_wined3d(device->wined3d_device); - wined3d_device_get_creation_parameters(device->wined3d_device, ¶ms); - wined3d_adapter = wined3d_get_adapter(wined3d, params.adapter_idx); - for (i = 0; i < ARRAY_SIZE(flag_mapping); ++i) - { - hr = wined3d_check_device_format(wined3d, wined3d_adapter, params.device_type, - WINED3DFMT_UNKNOWN, flag_mapping[i].usage, flag_mapping[i].bind_flags, flag_mapping[i].rtype, wined3d_format); - if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DOK_NOMIPGEN) - continue; - if (hr != WINED3D_OK) - { - WARN("Failed to check device format support, hr %#lx.\n", hr); - wined3d_mutex_unlock(); - return E_FAIL; - } - - *format_support |= flag_mapping[i].flag; - } + hr = wined3d_device_check_format_support(device->wined3d_device, wined3d_format, + format_support, NULL); wined3d_mutex_unlock();
- if (feature_level < D3D_FEATURE_LEVEL_10_0) - *format_support &= ~D3D11_FORMAT_SUPPORT_BUFFER; - - if (*format_support & (D3D11_FORMAT_SUPPORT_TEXTURE1D - | D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_TEXTURE3D)) - { - *format_support |= D3D11_FORMAT_SUPPORT_SHADER_LOAD; - *format_support |= D3D11_FORMAT_SUPPORT_SHADER_SAMPLE; - *format_support |= D3D11_FORMAT_SUPPORT_TEXTURECUBE; - - if (feature_level >= D3D_FEATURE_LEVEL_10_1) - *format_support |= D3D11_FORMAT_SUPPORT_SHADER_GATHER; - - if (*format_support & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL) - { - if (feature_level >= D3D_FEATURE_LEVEL_10_0) - *format_support |= D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON; - - if (feature_level >= D3D_FEATURE_LEVEL_10_1) - *format_support |= D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON; - } - } - - /* d3d11 requires 4 and 8 sample counts support for formats reported to - * support multisample. */ - if (wined3d_check_device_multisample_type(wined3d_adapter, params.device_type, wined3d_format, - TRUE, WINED3D_MULTISAMPLE_4_SAMPLES, NULL) == WINED3D_OK && - wined3d_check_device_multisample_type(wined3d_adapter, params.device_type, wined3d_format, - TRUE, WINED3D_MULTISAMPLE_8_SAMPLES, NULL) == WINED3D_OK) - { - *format_support |= D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE - | D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET - | D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD; - } - - return S_OK; + return hr; }
static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device2 *iface, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 8225237568f..29f51af680c 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -20648,7 +20648,8 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE
if (formats[i].fl_required <= feature_level) { - todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_DISPLAY) + todo_wine_if (feature_flag == D3D11_FORMAT_SUPPORT_DISPLAY + && format == DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM) ok(supported, "Format %#x - %s not supported, feature_level %#x, format support %#x.\n", format, feature_name, feature_level, format_support[format]); continue; @@ -20662,7 +20663,8 @@ static void check_format_support(const unsigned int *format_support, D3D_FEATURE continue; }
- todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_DISPLAY) + todo_wine_if (feature_flag != D3D11_FORMAT_SUPPORT_DISPLAY + && feature_flag != D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER) ok(!supported, "Format %#x - %s supported, feature level %#x, format support %#x.\n", format, feature_name, feature_level, format_support[format]); } @@ -20743,7 +20745,6 @@ static void test_format_support(const D3D_FEATURE_LEVEL feature_level)
ok(format_support[DXGI_FORMAT_R8G8B8A8_UNORM] & D3D11_FORMAT_SUPPORT_SHADER_SAMPLE, "SHADER_SAMPLE is not supported for R8G8B8A8_UNORM.\n"); - todo_wine ok(!(format_support[DXGI_FORMAT_R32G32B32A32_UINT] & D3D11_FORMAT_SUPPORT_SHADER_SAMPLE), "SHADER_SAMPLE is supported for R32G32B32A32_UINT.\n"); if (feature_level >= D3D_FEATURE_LEVEL_10_0)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115564
Your paranoid android.
=== debian11 (64 bit WoW report) ===
d3d11: d3d11.c:9829: Test failed: d3d11.c:15301: Test marked todo: Got hr 0 for WRITE_DISCARD.
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/d3d11/device.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f1b9edc88d3..10c8edb16ff 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3977,6 +3977,33 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device2 return S_OK; }
+ case D3D11_FEATURE_FORMAT_SUPPORT: + { + D3D11_FEATURE_DATA_FORMAT_SUPPORT *support = feature_support_data; + enum wined3d_format_id wined3d_format; + + if (feature_support_data_size != sizeof(*support)) + { + WARN("Invalid data size.\n"); + return E_INVALIDARG; + } + + wined3d_format = wined3dformat_from_dxgi_format(support->InFormat); + if (support->InFormat && !wined3d_format) + { + WARN("Invalid format %#x.\n", support->InFormat); + support->OutFormatSupport = 0; + return E_FAIL; + } + + wined3d_mutex_lock(); + hr = wined3d_device_check_format_support(device->wined3d_device, + wined3d_format, &support->OutFormatSupport, NULL); + wined3d_mutex_unlock(); + + return hr; + } + case D3D11_FEATURE_D3D9_OPTIONS: { D3D11_FEATURE_DATA_D3D9_OPTIONS *options = feature_support_data;
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/d3d11/device.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 10c8edb16ff..e662c93827d 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4004,6 +4004,33 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device2 return hr; }
+ case D3D11_FEATURE_FORMAT_SUPPORT2: + { + D3D11_FEATURE_DATA_FORMAT_SUPPORT2 *support = feature_support_data; + enum wined3d_format_id wined3d_format; + + if (feature_support_data_size != sizeof(*support)) + { + WARN("Invalid data size.\n"); + return E_INVALIDARG; + } + + wined3d_format = wined3dformat_from_dxgi_format(support->InFormat); + if (support->InFormat && !wined3d_format) + { + WARN("Invalid format %#x.\n", support->InFormat); + support->OutFormatSupport2 = 0; + return E_FAIL; + } + + wined3d_mutex_lock(); + hr = wined3d_device_check_format_support(device->wined3d_device, wined3d_format, NULL, + &support->OutFormatSupport2); + wined3d_mutex_unlock(); + + return hr; + } + case D3D11_FEATURE_D3D9_OPTIONS: { D3D11_FEATURE_DATA_D3D9_OPTIONS *options = feature_support_data;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=115566
Your paranoid android.
=== debian11 (64 bit WoW report) ===
d3d11: d3d11.c:9829: Test failed: d3d11.c:15301: Test marked todo: Got hr 0 for WRITE_NO_OVERWRITE. d3d11.c:9829: Test failed: d3d11.c:15210: Test marked todo: Test 60: Got unexpected colour 0xff00ffff at (1, 0). d3d11.c:9829: Test failed: Got hr 0 for WRITE_DISCARD.
From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/device.c | 18 +++++ dlls/wined3d/utils.c | 140 ++++++++++++++++++++++----------- dlls/wined3d/wined3d_private.h | 2 + 3 files changed, 116 insertions(+), 44 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9184a1155a8..012d7acbc17 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4412,6 +4412,24 @@ HRESULT CDECL wined3d_device_check_format_support(const struct wined3d_device *d { flags |= WINED3D_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW; flags2 |= WINED3D_FORMAT_SUPPORT2_UAV_TYPED_STORE; + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_UAV_LOAD) + flags2 |= WINED3D_FORMAT_SUPPORT2_UAV_TYPED_LOAD; + if (format->caps[gl_type] & WINED3D_FORMAT_CAP_UAV_ATOMICS) + { + /* The caps here depend on the format's data type. Floating-point + * formats only support a limited subset of atomic operations. + */ + flags2 |= WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE; + if (format->attrs & WINED3D_FORMAT_ATTR_INTEGER) + /* Yes, both signed and unsigned integer types support both + * signed and unsigned min/max. + */ + flags2 |= WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_ADD + | WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS + | WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_XCHG + | WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_MAX + | WINED3D_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_MAX; + } } } /* 10level9 doesn't allow mapping depth/stencil surfaces, but level 10+ do. */ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5c0f1c5e376..0a1371dc773 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1491,7 +1491,8 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32_FLOAT, GL_R32F, GL_R32F, 0, GL_RED, GL_FLOAT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_FLOAT, GL_RGB32F_ARB, GL_RGB32F_ARB, 0, GL_RGB, GL_FLOAT, 12, @@ -1499,7 +1500,8 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_FLOAT, convert_r32g32_float}, {WINED3DFMT_R32G32_FLOAT, GL_RG32F, GL_RG32F, 0, GL_RG, GL_FLOAT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32B32_FLOAT, GL_RGB32F, GL_RGB32F, 0, GL_RGB, GL_FLOAT, 0, @@ -1507,7 +1509,8 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R32G32B32A32_FLOAT, GL_RGBA32F_ARB, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_FLOAT, NULL}, /* Float */ {WINED3DFMT_R16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, @@ -1516,7 +1519,8 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_FLOAT, NULL}, {WINED3DFMT_R16_FLOAT, GL_R16F, GL_R16F, 0, GL_RED, GL_HALF_FLOAT_ARB, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_FLOAT, GL_RGB16F_ARB, GL_RGB16F_ARB, 0, GL_RGB, GL_HALF_FLOAT_ARB, 6, @@ -1524,16 +1528,18 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_TEXTURE_FLOAT, convert_r16g16}, {WINED3DFMT_R16G16_FLOAT, GL_RG16F, GL_RG16F, 0, GL_RG, GL_HALF_FLOAT_ARB, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_FLOAT, GL_RGBA16F_ARB, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET - | WINED3D_FORMAT_CAP_VTF, + | WINED3D_FORMAT_CAP_VTF | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_RENDERTARGET + | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_PACKED_FLOAT}, /* Palettized formats */ {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, @@ -1553,7 +1559,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, 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_FORMAT_CAP_VTF | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, @@ -1591,12 +1597,13 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_VTF | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, GL_RED, GL_UNSIGNED_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, @@ -1609,26 +1616,29 @@ static const struct wined3d_format_texture_info format_texture_info[] = 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, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, 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_FORMAT_CAP_VTF | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RGB10_A2UI, NULL}, {WINED3DFMT_R8G8B8A8_SINT, GL_RGBA8I, GL_RGBA8I, 0, GL_RGBA_INTEGER, GL_BYTE, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R8G8B8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 0, @@ -1641,7 +1651,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0, GL_RG, GL_UNSIGNED_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, 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, @@ -1651,73 +1661,87 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_R8G8_UNORM, GL_RG8, GL_RG8, 0, GL_RG, GL_UNSIGNED_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_UINT, GL_RG8UI, GL_RG8UI, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8G8_SINT, GL_RG8I, GL_RG8I, 0, GL_RG_INTEGER, GL_BYTE, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16B16A16_UINT, GL_RGBA16UI, GL_RGBA16UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R16G16B16A16_SINT, GL_RGBA16I, GL_RGBA16I, 0, GL_RGBA_INTEGER, GL_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32_UINT, GL_RG32UI, GL_RG32UI, 0, GL_RG_INTEGER, GL_UNSIGNED_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32G32_SINT, GL_RG32I, GL_RG32I, 0, GL_RG_INTEGER, GL_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_UINT, GL_RG16UI, GL_RG16UI, 0, GL_RG_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16G16_SINT, GL_RG16I, GL_RG16I, 0, GL_RG_INTEGER, GL_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_UINT, GL_R32UI, GL_R32UI, 0, GL_RED_INTEGER, GL_UNSIGNED_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS | WINED3D_FORMAT_CAP_UAV_ATOMICS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R32_SINT, GL_R32I, GL_R32I, 0, GL_RED_INTEGER, GL_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS | WINED3D_FORMAT_CAP_UAV_ATOMICS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UNORM, GL_R16, GL_R16, 0, GL_RED, GL_UNSIGNED_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_UINT, GL_R16UI, GL_R16UI, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R16_SINT, GL_R16I, GL_R16I, 0, GL_RED_INTEGER, GL_SHORT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_UINT, GL_R8UI, GL_R8UI, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, {WINED3DFMT_R8_SINT, GL_R8I, GL_R8I, 0, GL_RED_INTEGER, GL_BYTE, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, ARB_TEXTURE_RG, NULL}, /* Luminance */ {WINED3DFMT_L8_UNORM, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, 0, @@ -1767,7 +1791,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R8G8_SNORM, GL_RG8_SNORM, GL_RG8_SNORM, 0, GL_RG, GL_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB5, GL_RGB5, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, @@ -1800,7 +1824,7 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R8G8B8A8_SNORM, GL_RGBA8_SNORM, GL_RGBA8_SNORM, 0, GL_RGBA, GL_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16_SNORM, GL_RGB16, GL_RGB16, 0, GL_BGR, GL_UNSIGNED_SHORT, 6, @@ -1813,22 +1837,22 @@ static const struct wined3d_format_texture_info format_texture_info[] = {WINED3DFMT_R16G16_SNORM, GL_RG16_SNORM, GL_RG16_SNORM, 0, GL_RG, GL_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16G16B16A16_SNORM, GL_RGBA16_SNORM, GL_RGBA16_SNORM, 0, GL_RGBA, GL_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R16_SNORM, GL_R16_SNORM, GL_R16_SNORM, 0, GL_RED, GL_SHORT, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, {WINED3DFMT_R8_SNORM, GL_R8_SNORM, GL_R8_SNORM, 0, GL_RED, GL_BYTE, 0, WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING | WINED3D_FORMAT_CAP_FILTERING - | WINED3D_FORMAT_CAP_RENDERTARGET, + | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_SNORM, NULL}, /* Depth stencil formats */ {WINED3DFMT_D16_LOCKABLE, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, 0, @@ -1881,11 +1905,13 @@ static const struct wined3d_format_texture_info format_texture_info[] = ARB_DEPTH_BUFFER_FLOAT, convert_s8_uint_d24_float}, {WINED3DFMT_R32G32B32A32_UINT, GL_RGBA32UI, GL_RGBA32UI, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_INTEGER, NULL}, {WINED3DFMT_R32G32B32A32_SINT, GL_RGBA32I, GL_RGBA32I, 0, GL_RGBA_INTEGER, GL_INT, 0, - WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET, + WINED3D_FORMAT_CAP_TEXTURE | WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS, EXT_TEXTURE_INTEGER, NULL}, /* Vendor-specific formats */ {WINED3DFMT_ATI1N, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, @@ -3084,8 +3110,6 @@ static void query_internal_format(struct wined3d_adapter *adapter, 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) { @@ -3104,6 +3128,21 @@ static void query_internal_format(struct wined3d_adapter *adapter, else if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) format->internal = format->srgb_internal; } + + if (gl_info->supported[ARB_SHADER_IMAGE_LOAD_STORE]) + { + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_LOAD, + WINED3D_FORMAT_CAP_UAV_LOAD, "typed UAV load"); + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_STORE, + WINED3D_FORMAT_CAP_UNORDERED_ACCESS, "typed UAV store"); + query_format_cap(gl_info, format, format->internal, GL_SHADER_IMAGE_ATOMIC, + WINED3D_FORMAT_CAP_UAV_ATOMICS, "typed UAV atomic RMW"); + } + else + { + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_UAV_LOAD | WINED3D_FORMAT_CAP_UNORDERED_ACCESS + | WINED3D_FORMAT_CAP_UAV_ATOMICS); + } } else { @@ -3144,6 +3183,10 @@ static void query_internal_format(struct wined3d_adapter *adapter, format->f.caps[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3D_FORMAT_CAP_TEXTURE; }
+ if (!gl_info->supported[ARB_SHADER_IMAGE_LOAD_STORE]) + format_clear_caps(&format->f, WINED3D_FORMAT_CAP_UNORDERED_ACCESS | WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UAV_ATOMICS); + query_view_class(format);
if (format->internal && format->f.caps[WINED3D_GL_RES_TYPE_RB] @@ -4369,6 +4412,11 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, 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.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_TEXTURE; + if (properties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_UAV_LOAD + | WINED3D_FORMAT_CAP_UNORDERED_ACCESS; + if (properties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) + format->f.caps[WINED3D_GL_RES_TYPE_BUFFER] |= WINED3D_FORMAT_CAP_UAV_ATOMICS;
caps = 0; texture_flags = properties.linearTilingFeatures | properties.optimalTilingFeatures; @@ -4394,7 +4442,11 @@ static void init_vulkan_format_info(struct wined3d_format_vk *format, } if (texture_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { - caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS; + caps |= WINED3D_FORMAT_CAP_UNORDERED_ACCESS | WINED3D_FORMAT_CAP_UAV_LOAD; + } + if (texture_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) + { + caps |= WINED3D_FORMAT_CAP_UAV_ATOMICS; }
if (!(~caps & (WINED3D_FORMAT_CAP_RENDERTARGET | WINED3D_FORMAT_CAP_FILTERING))) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ce4d7384066..22778a734bf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6139,6 +6139,8 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE 0x00004000 #define WINED3D_FORMAT_CAP_BLIT 0x00008000 #define WINED3D_FORMAT_CAP_INDEX_BUFFER 0x00010000 +#define WINED3D_FORMAT_CAP_UAV_LOAD 0x00020000 +#define WINED3D_FORMAT_CAP_UAV_ATOMICS 0x00040000
struct wined3d_rational {
On Fri May 27 18:11:52 2022 +0000, **** wrote:
Zebediah Figura replied on the mailing list:
On 5/26/22 01:51, Chip Davis wrote: > From: Chip Davis <cdavis5x@gmail.com> > > Signed-off-by: Chip Davis <cdavis5x@gmail.com> > --- > dlls/wined3d/device.c | 202 ++++++++++++++++++++++++++++++++++++++ > dlls/wined3d/wined3d.spec | 1 + > include/wine/wined3d.h | 49 +++++++++ > 3 files changed, 252 insertions(+) This doesn't seem like an improvement. I think it potentially makes sense to use wined3d format information (plus the feature level) to more accurately match the flags Windows reports—instead of reporting exactly what the backend is actually capable of—but I don't see a need to move the whole implementation to wined3d, not when it means adding a lot of new flags to the API, and not when d3d11 is the only direct user. Separately, I think changes to the flags we report should be made in a much more granular fashion, one per commit. Applications can be rather sensitive to these flags, and I'd rather make any regressions easily bisectable.
For the record, I agree on the first point, to me it's unclear what the motivation is behind this move.
On Fri Jun 3 16:30:23 2022 +0000, Jan Sikorski wrote:
For the record, I agree on the first point, to me it's unclear what the motivation is behind this move.
Mostly, it's because my change to implement logic op is on top of these changes, because `D3D11_FORMAT_SUPPORT2_OM_LOGIC_OP` is in the second format support group.
This also felt cleaner, but I concede your point. But in order to do this from `d3d11`, we would need to make the format attribute and capability flags part of the API anyway. Do you have a better idea?
On 6/3/22 14:00, Chip Davis (@cdavis5e) wrote:
On Fri Jun 3 16:30:23 2022 +0000, Jan Sikorski wrote:
For the record, I agree on the first point, to me it's unclear what the motivation is behind this move.
Mostly, it's because my change to implement logic op is on top of these changes, because `D3D11_FORMAT_SUPPORT2_OM_LOGIC_OP` is in the second format support group.
This also felt cleaner, but I concede your point. But in order to do this from `d3d11`, we would need to make the format attribute and capability flags part of the API anyway. Do you have a better idea?
Probably the simplest thing to do in line with the current code is to add a new WINED3D_USAGE_QUERY_* flag. I don't know whether that's a direction we want to move in, though.
Henri, do you have any thoughts on the matter?
On Mon, 6 Jun 2022 at 21:32, Zebediah Figura zfigura@codeweavers.com wrote:
Henri, do you have any thoughts on the matter?
The direction I had planned to go in was pretty much what you suggested in an earlier mail: returning the set of supported format flags/capabilities like d3d11 does, instead of querying for a particular combination. On a certain level, that wouldn't be that different from wined3d_device_check_format_support() introduced by this series, but I'd start from wined3d_check_device_format(), and gradually convert it to the new model, instead of introducing a parallel API like this. (I.e., one of the first steps would be returning the WINED3DUSAGE_QUERY_* flags as an output variable instead of as part of the "usage" variable.) As you say, that's largely orthogonal to adding additional caps that can be queried.
Since you've started on Henri's approach, I guess there's no need for this MR anymore.
On 6/15/22 18:38, Chip Davis (@cdavis5e) wrote:
Since you've started on Henri's approach, I guess there's no need for this MR anymore.
I hadn't actually started converting anything (nor did I immediately intend to); I was just trying to fix a couple of bugs with the current implementation.
This merge request was closed by Chip Davis.