[PATCH 2/2] d3dcompiler: Allow cs5.1 shaders on earlier d3dcompiler versions.

Paul Gofman pgofman at codeweavers.com
Tue Mar 8 04:56:43 CST 2022


Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/d3dcompiler_43/reflection.c       | 4 ++--
 dlls/d3dcompiler_43/tests/reflection.c | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 1080b4dc6c8..b547791017f 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -1503,9 +1503,9 @@ static HRESULT d3dcompiler_parse_rdef(struct d3dcompiler_shader_reflection *r, c
     TRACE("Target: %#x.\n", r->target);
 
     target_version = r->target & D3DCOMPILER_SHADER_TARGET_VERSION_MASK;
-
 #if D3D_COMPILER_VERSION < 47
-    if (target_version >= 0x501)
+    if (target_version >= 0x501 && (!D3D_COMPILER_VERSION || ((r->target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK)
+            >> D3DCOMPILER_SHADER_TARGET_SHADERTYPE_SHIFT) != 0x4353 /* CS */))
     {
         WARN("Target version %#x is not supported in d3dcompiler %u.\n", target_version, D3D_COMPILER_VERSION);
         return E_INVALIDARG;
diff --git a/dlls/d3dcompiler_43/tests/reflection.c b/dlls/d3dcompiler_43/tests/reflection.c
index 9781f91ab2b..3aab4b09d25 100644
--- a/dlls/d3dcompiler_43/tests/reflection.c
+++ b/dlls/d3dcompiler_43/tests/reflection.c
@@ -1228,7 +1228,6 @@ void main( uint3 DTid : SV_DispatchThreadID )
     HRESULT hr;
 
     hr = call_reflect(test_blob, test_blob[6], &IID_ID3D11ShaderReflection, (void **)&ref11);
-    todo_wine_if(D3D_COMPILER_VERSION < 47)
     ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
     if (FAILED(hr))
         return;
-- 
2.35.1




More information about the wine-devel mailing list