d3d10/effect: Handle D3D10_SVT_UINT type when returning numeric values.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-11-01 13:51:47 +03:00 committed by Alexandre Julliard
parent 8c9418fb40
commit 150796cc07
2 changed files with 29 additions and 34 deletions

View File

@ -4865,6 +4865,7 @@ static BOOL get_value_as_bool(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_typ
{
case D3D10_SVT_FLOAT:
case D3D10_SVT_INT:
case D3D10_SVT_UINT:
case D3D10_SVT_BOOL:
if (*(DWORD *)src_data)
return -1;
@ -4885,6 +4886,7 @@ static int get_value_as_int(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_type)
return (int)(*(float *)src_data);
case D3D10_SVT_INT:
case D3D10_SVT_UINT:
return *(int *)src_data;
case D3D10_SVT_BOOL:
@ -4903,6 +4905,7 @@ static float get_value_as_float(void *src_data, D3D10_SHADER_VARIABLE_TYPE src_t
return *(float *)src_data;
case D3D10_SVT_INT:
case D3D10_SVT_UINT:
return (float)(*(int *)src_data);
case D3D10_SVT_BOOL:
@ -4933,6 +4936,7 @@ static void get_vector_as_type(BYTE *dst_data, D3D_SHADER_VARIABLE_TYPE dst_type
break;
case D3D10_SVT_INT:
case D3D10_SVT_UINT:
*(int *)dst_data_dword = get_value_as_int(src_data_dword, src_type);
break;

View File

@ -4843,43 +4843,32 @@ cbuffer cb
float f0, f_a[2];
int i0, i_a[2];
bool b0, b_a[2];
uint i1, i1_a[2];
};
#endif
static DWORD fx_test_scalar_variable[] =
{
0x43425844, 0xe4da4aa6, 0x1380ddc5, 0x445edad5,
0x08581666, 0x00000001, 0x0000020b, 0x00000001,
0x00000024, 0x30315846, 0x000001df, 0xfeff1001,
0x00000001, 0x00000006, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x000000d3,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x66006263,
0x74616f6c, 0x00000700, 0x00000100, 0x00000000,
0x00000400, 0x00001000, 0x00000400, 0x00090900,
0x00306600, 0x00000007, 0x00000001, 0x00000002,
0x00000014, 0x00000010, 0x00000008, 0x00000909,
0x00615f66, 0x00746e69, 0x0000004c, 0x00000001,
0x00000000, 0x00000004, 0x00000010, 0x00000004,
0x00000911, 0x4c003069, 0x01000000, 0x02000000,
0x14000000, 0x10000000, 0x08000000, 0x11000000,
0x69000009, 0x6200615f, 0x006c6f6f, 0x0000008f,
0x00000001, 0x00000000, 0x00000004, 0x00000010,
0x00000004, 0x00000921, 0x8f003062, 0x01000000,
0x02000000, 0x14000000, 0x10000000, 0x08000000,
0x21000000, 0x62000009, 0x0400615f, 0x70000000,
0x00000000, 0x06000000, 0xff000000, 0x00ffffff,
0x29000000, 0x0d000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x48000000,
0x2c000000, 0x00000000, 0x10000000, 0x00000000,
0x00000000, 0x00000000, 0x6c000000, 0x50000000,
0x00000000, 0x24000000, 0x00000000, 0x00000000,
0x00000000, 0x8b000000, 0x6f000000, 0x00000000,
0x30000000, 0x00000000, 0x00000000, 0x00000000,
0xb0000000, 0x94000000, 0x00000000, 0x44000000,
0x00000000, 0x00000000, 0x00000000, 0xcf000000,
0xb3000000, 0x00000000, 0x50000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x43425844, 0x7d97f44c, 0x1da4b110, 0xb710407e, 0x26750c1c, 0x00000001, 0x00000288, 0x00000001,
0x00000024, 0x30315846, 0x0000025c, 0xfeff1001, 0x00000001, 0x00000008, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000118, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66006263,
0x74616f6c, 0x00000700, 0x00000100, 0x00000000, 0x00000400, 0x00001000, 0x00000400, 0x00090900,
0x00306600, 0x00000007, 0x00000001, 0x00000002, 0x00000014, 0x00000010, 0x00000008, 0x00000909,
0x00615f66, 0x00746e69, 0x0000004c, 0x00000001, 0x00000000, 0x00000004, 0x00000010, 0x00000004,
0x00000911, 0x4c003069, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000, 0x11000000,
0x69000009, 0x6200615f, 0x006c6f6f, 0x0000008f, 0x00000001, 0x00000000, 0x00000004, 0x00000010,
0x00000004, 0x00000921, 0x8f003062, 0x01000000, 0x02000000, 0x14000000, 0x10000000, 0x08000000,
0x21000000, 0x62000009, 0x7500615f, 0x00746e69, 0x000000d3, 0x00000001, 0x00000000, 0x00000004,
0x00000010, 0x00000004, 0x00000919, 0xd3003169, 0x01000000, 0x02000000, 0x14000000, 0x10000000,
0x08000000, 0x19000000, 0x69000009, 0x00615f31, 0x00000004, 0x00000090, 0x00000000, 0x00000008,
0xffffffff, 0x00000000, 0x00000029, 0x0000000d, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000048, 0x0000002c, 0x00000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000,
0x0000006c, 0x00000050, 0x00000000, 0x00000024, 0x00000000, 0x00000000, 0x00000000, 0x0000008b,
0x0000006f, 0x00000000, 0x00000030, 0x00000000, 0x00000000, 0x00000000, 0x000000b0, 0x00000094,
0x00000000, 0x00000044, 0x00000000, 0x00000000, 0x00000000, 0x000000cf, 0x000000b3, 0x00000000,
0x00000050, 0x00000000, 0x00000000, 0x00000000, 0x000000f4, 0x000000d8, 0x00000000, 0x00000064,
0x00000000, 0x00000000, 0x00000000, 0x00000113, 0x000000f7, 0x00000000, 0x00000070, 0x00000000,
0x00000000, 0x00000000,
};
static void test_scalar_methods(ID3D10EffectScalarVariable *var, D3D10_SHADER_VARIABLE_TYPE type,
@ -5145,9 +5134,11 @@ static void test_effect_scalar_variable(void)
{
{"f0", D3D10_SVT_FLOAT},
{"i0", D3D10_SVT_INT},
{"i1", D3D10_SVT_UINT},
{"b0", D3D10_SVT_BOOL},
{"f_a", D3D10_SVT_FLOAT, TRUE},
{"i_a", D3D10_SVT_INT, TRUE},
{"i1_a", D3D10_SVT_UINT, TRUE},
{"b_a", D3D10_SVT_BOOL, TRUE},
};
ID3D10EffectScalarVariable *s_v, *s_v2;
@ -5178,7 +5169,7 @@ static void test_effect_scalar_variable(void)
effect_desc.ConstantBuffers);
ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n",
effect_desc.SharedConstantBuffers);
ok(effect_desc.GlobalVariables == 6, "Unexpected global variables count %u.\n",
ok(effect_desc.GlobalVariables == 8, "Unexpected global variables count %u.\n",
effect_desc.GlobalVariables);
ok(effect_desc.SharedGlobalVariables == 0, "Unexpected shared global variables count %u.\n",
effect_desc.SharedGlobalVariables);