[PATCH vkd3d 26/41] vkd3d: Add DXIL test for constant buffers (root const/desc).

Hans-Kristian Arntzen post at arntzen-software.no
Wed Jan 29 05:51:57 CST 2020


Signed-off-by: Hans-Kristian Arntzen <post at arntzen-software.no>
---
 tests/d3d12.c | 161 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 125 insertions(+), 36 deletions(-)

diff --git a/tests/d3d12.c b/tests/d3d12.c
index e0cbf45..b59c97a 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -35626,7 +35626,7 @@ static void test_register_space_dxil(void)
     test_register_space(true);
 }
 
-static void test_constant_buffer_sm51(void)
+static void test_constant_buffers(bool use_dxil)
 {
     ID3D12DescriptorHeap *heap;
 
@@ -35648,47 +35648,47 @@ static void test_constant_buffer_sm51(void)
     HRESULT hr;
     unsigned int counter_value;
 
-    static const DWORD cs_code[] = {
 #if 0
-        cbuffer DescriptorTableCBV : register(b2, space1)
-        {
-            float4 table_data[8];
-        };
+    cbuffer DescriptorTableCBV : register(b2, space1)
+    {
+        float4 table_data[8];
+    };
 
-        cbuffer RootCBV : register(b3, space2)
-        {
-            float4 root_data[8];
-        };
+    cbuffer RootCBV : register(b3, space2)
+    {
+        float4 root_data[8];
+    };
 
-        cbuffer RootConstant1 : register(b4, space3)
-        {
-            float4 c1;
-            float4 c2;
-        };
+    cbuffer RootConstant1 : register(b4, space3)
+    {
+        float4 c1;
+        float4 c2;
+    };
 
-        cbuffer RootConstant2 : register(b5, space4)
-        {
-            float4 c3;
-            float4 c4;
-        };
+    cbuffer RootConstant2 : register(b5, space4)
+    {
+        float4 c3;
+        float4 c4;
+    };
 
-        RWStructuredBuffer<float4> RWStructuredBuf : register(u6, space5);
+    RWStructuredBuffer<float4> RWStructuredBuf : register(u6, space5);
 
-        [numthreads(1, 1, 1)]
-        void main()
-        {
-            float4 res = float4(35, 40, 50, 60);
-            res += table_data[1];
-            res += table_data[6];
-            res += root_data[2];
-            res += root_data[7];
-            res += c1;
-            res += c2;
-            res += c3;
-            res += c4;
-            RWStructuredBuf[0] = res;
-        }
+    [numthreads(1, 1, 1)]
+    void main()
+    {
+        float4 res = float4(35, 40, 50, 60);
+        res += table_data[1];
+        res += table_data[6];
+        res += root_data[2];
+        res += root_data[7];
+        res += c1;
+        res += c2;
+        res += c3;
+        res += c4;
+        RWStructuredBuf[0] = res;
+    }
 #endif
+    static const DWORD cs_code_dxbc[] = {
         0x43425844, 0xb9b08cff, 0xb39daa33, 0x3d0264dc, 0x7c5a0155, 0x00000001, 0x0000025c, 0x00000003,
         0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
         0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000208, 0x00050051, 0x00000082, 0x0100086a,
@@ -35710,6 +35710,76 @@ static void test_constant_buffer_sm51(void)
         0x00004001, 0x00000000, 0x00004001, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e,
     };
 
+    static const BYTE cs_code_dxil[] = {
+        0x44, 0x58, 0x42, 0x43, 0xe2, 0xef, 0xf2, 0x44, 0x1b, 0x9d, 0x18, 0x11, 0x11, 0x82, 0x9a, 0x86, 0x7c, 0x13, 0xe2, 0x58, 0x01, 0x00, 0x00, 0x00, 0x54, 0x08, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
+        0x34, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x31, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x08, 0x00, 0x00, 0x00, 0x50, 0x53, 0x56, 0x30, 0x8c, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+        0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+        0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+        0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x54, 0x07, 0x00, 0x00,
+        0x60, 0x00, 0x05, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3c, 0x07, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
+        0xcc, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c,
+        0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20,
+        0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
+        0x06, 0x00, 0x00, 0x00, 0x1b, 0x8c, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0x02, 0xaa, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0x00, 0x00, 0x00, 0x49, 0x18, 0x00, 0x00,
+        0x02, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84,
+        0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x78, 0x23, 0x00, 0x25, 0x00, 0x14, 0x66, 0x00, 0x8e, 0x1a, 0x2e, 0x7f, 0xc2, 0x1e, 0x42,
+        0xf2, 0xb9, 0x8d, 0x2a, 0x56, 0x62, 0xf2, 0x8b, 0xdb, 0x46, 0xc4, 0x18, 0x63, 0xcc, 0x11, 0x80, 0xc1, 0x1c, 0x01, 0x42, 0xe6, 0x9e, 0xe1, 0xf2, 0x27, 0xec, 0x21, 0x24, 0x3f, 0x04, 0x9a, 0x61,
+        0x21, 0x50, 0x70, 0x0a, 0x41, 0x0a, 0x2a, 0x94, 0xe6, 0x08, 0x82, 0x62, 0xa0, 0x62, 0x4a, 0x59, 0xc4, 0x8a, 0x02, 0x0a, 0x2a, 0x65, 0x8c, 0x31, 0x0c, 0xb9, 0x81, 0x80, 0x61, 0x04, 0x62, 0x98,
+        0x69, 0x0d, 0xc6, 0x81, 0x1d, 0xc2, 0x61, 0x1e, 0xe6, 0xc1, 0x0d, 0x64, 0xe1, 0x16, 0x66, 0x81, 0x1e, 0xe4, 0xa1, 0x1e, 0xc6, 0x81, 0x1e, 0xea, 0x41, 0x1e, 0xca, 0x81, 0x1c, 0x44, 0xa1, 0x1e,
+        0xcc, 0xc1, 0x1c, 0xca, 0x41, 0x1e, 0xf8, 0xc0, 0x1e, 0xca, 0x61, 0x1c, 0xe8, 0xe1, 0x1d, 0xe4, 0x81, 0x0f, 0xcc, 0x81, 0x1d, 0xde, 0x21, 0x1c, 0xe8, 0x81, 0x0d, 0xc0, 0x80, 0x0e, 0xfc, 0x00,
+        0x0c, 0xfc, 0x00, 0x05, 0x91, 0x64, 0x22, 0xc4, 0x93, 0x3a, 0x42, 0x12, 0x22, 0xe4, 0x99, 0x9c, 0xa8, 0x05, 0x82, 0x85, 0xe0, 0xb6, 0x17, 0x05, 0x94, 0xea, 0x1d, 0xab, 0xe3, 0x4c, 0xdc, 0xf6,
+        0xa2, 0x80, 0xd2, 0xbd, 0x66, 0x75, 0x9c, 0x89, 0x73, 0x1a, 0x69, 0x02, 0x9a, 0xa9, 0x46, 0x42, 0x8c, 0x94, 0xaf, 0x59, 0x1d, 0x67, 0xe2, 0x9c, 0x46, 0x9a, 0x80, 0x66, 0xb2, 0x91, 0x10, 0x23,
+        0xed, 0x39, 0x02, 0x50, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
+        0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
+        0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
+        0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
+        0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x43, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86,
+        0x3c, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x79, 0x18, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf2, 0x38, 0x40, 0x00, 0x08, 0x00,
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x05, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x2a,
+        0x25, 0x30, 0x02, 0x50, 0x08, 0xc5, 0x50, 0x0a, 0x85, 0x51, 0x20, 0x45, 0x50, 0x80, 0x02, 0x65, 0x50, 0x40, 0xb4, 0x46, 0x00, 0xa8, 0x17, 0x08, 0xd9, 0x19, 0x00, 0xc2, 0x33, 0x00, 0xa4, 0x67,
+        0x00, 0x88, 0xcf, 0x00, 0xd0, 0x9c, 0x01, 0x00, 0x79, 0x18, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0xc4, 0x88, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x44,
+        0x06, 0x26, 0x26, 0xc7, 0x05, 0xa6, 0xc6, 0x05, 0x06, 0x66, 0x43, 0x10, 0x4c, 0x10, 0x0a, 0x62, 0x82, 0x50, 0x14, 0x1b, 0x84, 0x81, 0x98, 0x20, 0x14, 0xc6, 0x06, 0x61, 0x30, 0x28, 0x8c, 0xcd,
+        0x4d, 0x10, 0x8a, 0x63, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0x61, 0xaa, 0x08, 0x4c, 0x10, 0x0a, 0x64, 0x82, 0x50, 0x24, 0x13, 0x84, 0xe5, 0x99, 0x20, 0x14, 0xca, 0x06, 0x61, 0x80, 0x36, 0x2c, 0xc4,
+        0xc2, 0x34, 0xc9, 0xe0, 0x3c, 0xcf, 0x13, 0x6d, 0x08, 0xa4, 0x09, 0x82, 0x15, 0x4d, 0x10, 0x8a, 0x65, 0x82, 0x50, 0x30, 0x1b, 0x10, 0x82, 0x62, 0x86, 0x6a, 0xb0, 0x80, 0x09, 0x02, 0x26, 0x4d,
+        0x10, 0x8a, 0x66, 0x03, 0x32, 0x60, 0x4c, 0x95, 0x0d, 0x16, 0x30, 0x41, 0xd0, 0xa6, 0x09, 0x42, 0xe1, 0x6c, 0x40, 0xaa, 0x8d, 0xc9, 0x8c, 0x81, 0x03, 0x26, 0x08, 0x1c, 0xb5, 0x01, 0xc9, 0x3c,
+        0xc6, 0x68, 0x06, 0x0e, 0xd8, 0x40, 0x5c, 0x5a, 0xf7, 0x6d, 0x20, 0x80, 0x09, 0x0c, 0x80, 0x09, 0x82, 0x00, 0x6c, 0x00, 0x36, 0x0c, 0xc3, 0x18, 0x8c, 0xc1, 0x86, 0x80, 0x0c, 0x36, 0x0c, 0x83,
+        0x18, 0x94, 0x01, 0x89, 0xb6, 0xb0, 0x34, 0xb7, 0x09, 0x42, 0x07, 0x6d, 0x18, 0x86, 0x61, 0xd8, 0x40, 0x10, 0x68, 0x60, 0xa4, 0xc1, 0x86, 0x42, 0x0c, 0xce, 0x00, 0x08, 0x03, 0x35, 0xa8, 0xc2,
+        0xc6, 0x66, 0xd7, 0xe6, 0x92, 0x46, 0x56, 0xe6, 0x46, 0x37, 0x25, 0x08, 0xaa, 0x90, 0xe1, 0xb9, 0xd8, 0x95, 0xc9, 0xcd, 0xa5, 0xbd, 0xb9, 0x4d, 0x09, 0x88, 0x26, 0x64, 0x78, 0x2e, 0x76, 0x61,
+        0x6c, 0x76, 0x65, 0x72, 0x53, 0x02, 0xa3, 0x0e, 0x19, 0x9e, 0xcb, 0x1c, 0x5a, 0x18, 0x59, 0x99, 0x5c, 0xd3, 0x1b, 0x59, 0x19, 0xdb, 0x94, 0x20, 0x29, 0x43, 0x86, 0xe7, 0x22, 0x57, 0x36, 0xf7,
+        0x56, 0x27, 0x37, 0x56, 0x36, 0x37, 0x25, 0x00, 0x83, 0x4a, 0x64, 0x78, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x82, 0x32, 0xa8,
+        0x43, 0x86, 0xe7, 0x52, 0xe6, 0x46, 0x27, 0x97, 0x07, 0xf5, 0x96, 0xe6, 0x46, 0x37, 0x37, 0x25, 0x50, 0x03, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c,
+        0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
+        0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
+        0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e,
+        0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
+        0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
+        0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5,
+        0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
+        0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
+        0xb0, 0xc3, 0x8c, 0xcc, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x74, 0x60, 0x07, 0x37, 0x90, 0x87, 0x72, 0x98, 0x87, 0x77, 0xa8, 0x07, 0x79, 0x18, 0x87, 0x72, 0x70, 0x83, 0x70, 0xa0, 0x07, 0x7a, 0x90,
+        0x87, 0x74, 0x10, 0x87, 0x7a, 0xa0, 0x87, 0x72, 0x00, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x36, 0x50, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x40, 0x15, 0x05, 0x11, 0xb1,
+        0x93, 0x13, 0x11, 0x7e, 0x71, 0xdb, 0x16, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xbe, 0x10, 0x50, 0x45, 0x41, 0x44, 0xa5, 0x03, 0x0c, 0x25, 0x61, 0x00, 0x02, 0xe6, 0x17, 0xb7, 0x6d, 0x02, 0xd2, 0x70,
+        0xf9, 0xce, 0xe3, 0x0b, 0x11, 0x01, 0x4c, 0x44, 0x08, 0x34, 0xc3, 0x42, 0x18, 0x00, 0xc1, 0x00, 0x48, 0x03, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
+        0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x64, 0xca, 0xa3, 0x04, 0x8a, 0x80, 0x4a, 0x29, 0x06, 0x94, 0x5d, 0xc9, 0x95, 0x03, 0x8d, 0x31, 0x02, 0x10, 0x04, 0xc1, 0x33, 0x0c, 0xc6, 0x08,
+        0x40, 0x10, 0x84, 0xc9, 0x30, 0x18, 0x23, 0x00, 0x41, 0x10, 0x14, 0xc3, 0x60, 0x8c, 0x00, 0x04, 0x41, 0x1c, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0xc0, 0x7c,
+        0x86, 0xc2, 0x69, 0xd2, 0x88, 0x41, 0x02, 0x80, 0x20, 0x18, 0x30, 0x60, 0x70, 0x28, 0x95, 0x36, 0x8d, 0x18, 0x24, 0x00, 0x08, 0x82, 0x01, 0x13, 0x06, 0xc8, 0x82, 0x75, 0xd4, 0x88, 0x41, 0x02,
+        0x80, 0x20, 0x18, 0x30, 0x62, 0x90, 0x30, 0x60, 0x70, 0x55, 0x23, 0x06, 0x09, 0x00, 0x82, 0x60, 0xc0, 0x8c, 0x81, 0xd2, 0x80, 0x81, 0x66, 0x8d, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x41, 0x52, 0x06,
+        0x4c, 0x20, 0x06, 0xa3, 0x09, 0x01, 0x30, 0x9a, 0x20, 0x04, 0xa3, 0x09, 0x83, 0x30, 0x9a, 0x40, 0x0c, 0x46, 0x2c, 0xf0, 0x31, 0xa2, 0x81, 0x8f, 0x11, 0x0f, 0x7c, 0x8c, 0x88, 0xe0, 0x33, 0x62,
+        0x70, 0x00, 0x20, 0x08, 0x06, 0x89, 0x1b, 0x54, 0x0a, 0x1a, 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, 0x8c, 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0x58, 0x42, 0xc0, 0xc7, 0x12, 0x02, 0x3e, 0x96,
+        0x10, 0xf0, 0xb1, 0x84, 0x80, 0xcf, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x24, 0x77, 0xe0, 0x51, 0x6d, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42, 0x30, 0x9a, 0x30, 0x08, 0xa3, 0x09, 0xc4, 0x60,
+        0x09, 0x01, 0x1f, 0x4b, 0x08, 0xf8, 0x58, 0x42, 0xc0, 0xc7, 0x12, 0x02, 0x3e, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0x90, 0x80, 0xc2, 0x19, 0x74, 0x65, 0x30, 0x9a, 0x10, 0x00, 0xa3, 0x09, 0x42,
+        0x30, 0x9a, 0x30, 0x08, 0xa3, 0x09, 0xc4, 0x60, 0x09, 0x01, 0x1f, 0x4b, 0x08, 0xf8, 0x58, 0x42, 0xc0, 0xc7, 0x12, 0x02, 0x3e, 0x23, 0x06, 0x07, 0x00, 0x82, 0x60, 0x90, 0xa4, 0x02, 0x1c, 0x9c,
+        0x41, 0x29, 0x8c, 0x26, 0x04, 0xc0, 0x68, 0x82, 0x10, 0x8c, 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0x58, 0x42, 0xc0, 0xc7, 0x12, 0x02, 0x3e, 0x96, 0x10, 0xf0, 0xb1, 0x84, 0x80, 0xcf, 0x88, 0xc1,
+        0x01, 0x80, 0x20, 0x18, 0x24, 0xb2, 0x90, 0x07, 0x70, 0xf0, 0x0a, 0xa3, 0x09, 0x01, 0x30, 0x9a, 0x20, 0x04, 0xa3, 0x09, 0x83, 0x30, 0x9a, 0x40, 0x0c, 0x96, 0x10, 0xf0, 0xb1, 0x84, 0x80, 0x8f,
+        0x25, 0x04, 0x7c, 0x2c, 0x21, 0xe0, 0x33, 0x62, 0x70, 0x00, 0x20, 0x08, 0x06, 0xc9, 0x2e, 0x88, 0x82, 0x1e, 0xdc, 0xc2, 0x68, 0x42, 0x00, 0x8c, 0x26, 0x08, 0xc1, 0x68, 0xc2, 0x20, 0x8c, 0x26,
+        0x10, 0x83, 0x25, 0x04, 0x7c, 0x2c, 0x21, 0xe0, 0x63, 0x09, 0x01, 0x1f, 0x4b, 0x08, 0xf8, 0x8c, 0x18, 0x1c, 0x00, 0x08, 0x82, 0x41, 0x42, 0x0e, 0xab, 0x30, 0x0a, 0xe1, 0x30, 0x9a, 0x10, 0x00,
+        0xa3, 0x09, 0x42, 0x30, 0x9a, 0x30, 0x08, 0xa3, 0x09, 0xc4, 0x60, 0x09, 0x01, 0x1f, 0x4b, 0x08, 0xf8, 0x58, 0x42, 0xc0, 0xc7, 0x12, 0x02, 0x3e, 0x23, 0x06, 0x0d, 0x00, 0x82, 0x60, 0xe0, 0xac,
+        0x43, 0x2d, 0xb4, 0x42, 0x3a, 0xa4, 0x03, 0x31, 0x08, 0x01, 0x2e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    };
+
     static const float buffer_data[D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT / 4] = {
         1, 2, 3, 4,
         5, 6, 7, 8,
@@ -35719,6 +35789,13 @@ static void test_constant_buffer_sm51(void)
 
     if (!init_compute_test_context(&context))
         return;
+
+    if (use_dxil && !context_supports_dxil(&context))
+    {
+        destroy_test_context(&context);
+        return;
+    }
+
     command_list = context.list;
     queue = context.queue;
 
@@ -35766,7 +35843,8 @@ static void test_constant_buffer_sm51(void)
 
     context.pipeline_state = create_compute_pipeline_state(context.device,
                                                            context.root_signature,
-                                                           shader_bytecode(cs_code, sizeof(cs_code)));
+                                                           shader_bytecode(use_dxil ? (const void*)cs_code_dxil : (const void*)cs_code_dxbc,
+                                                                           use_dxil ? sizeof(cs_code_dxil) : sizeof(cs_code_dxbc)));
 
     heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 1);
 
@@ -35812,6 +35890,16 @@ static void test_constant_buffer_sm51(void)
     destroy_test_context(&context);
 }
 
+static void test_constant_buffer_sm51(void)
+{
+    test_constant_buffers(false);
+}
+
+static void test_constant_buffer_dxil(void)
+{
+    test_constant_buffers(true);
+}
+
 START_TEST(d3d12)
 {
     pfn_D3D12CreateDevice = get_d3d12_pfn(D3D12CreateDevice);
@@ -35991,4 +36079,5 @@ START_TEST(d3d12)
     run_test(test_register_space_sm51);
     run_test(test_register_space_dxil);
     run_test(test_constant_buffer_sm51);
+    run_test(test_constant_buffer_dxil);
 }
-- 
2.25.0




More information about the wine-devel mailing list