mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/fx: Handle the 'half' type in fx_4+.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
parent
2626dcc55d
commit
da0469f190
Notes:
Henri Verbeet
2024-09-30 21:05:32 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1120
@ -467,6 +467,7 @@ static uint32_t get_fx_4_type_size(const struct hlsl_type *type)
|
||||
|
||||
static const uint32_t fx_4_numeric_base_type[] =
|
||||
{
|
||||
[HLSL_TYPE_HALF] = 1,
|
||||
[HLSL_TYPE_FLOAT] = 1,
|
||||
[HLSL_TYPE_INT ] = 2,
|
||||
[HLSL_TYPE_UINT ] = 3,
|
||||
@ -503,6 +504,7 @@ static uint32_t get_fx_4_numeric_type_description(const struct hlsl_type *type,
|
||||
switch (type->e.numeric.type)
|
||||
{
|
||||
case HLSL_TYPE_FLOAT:
|
||||
case HLSL_TYPE_HALF:
|
||||
case HLSL_TYPE_INT:
|
||||
case HLSL_TYPE_UINT:
|
||||
case HLSL_TYPE_BOOL:
|
||||
@ -579,6 +581,12 @@ static const char * get_fx_4_type_name(const struct hlsl_type *type)
|
||||
case HLSL_CLASS_STRING:
|
||||
return "String";
|
||||
|
||||
case HLSL_CLASS_SCALAR:
|
||||
case HLSL_CLASS_VECTOR:
|
||||
case HLSL_CLASS_MATRIX:
|
||||
if (type->e.numeric.type == HLSL_TYPE_HALF)
|
||||
return "float";
|
||||
/* fall-through */
|
||||
default:
|
||||
return type->name;
|
||||
}
|
||||
@ -1267,6 +1275,7 @@ static uint32_t write_fx_4_default_value(struct hlsl_type *value_type, struct hl
|
||||
switch (type->e.numeric.type)
|
||||
{
|
||||
case HLSL_TYPE_FLOAT:
|
||||
case HLSL_TYPE_HALF:
|
||||
case HLSL_TYPE_INT:
|
||||
case HLSL_TYPE_UINT:
|
||||
case HLSL_TYPE_BOOL:
|
||||
|
@ -2,7 +2,7 @@
|
||||
shader model >= 4.0
|
||||
shader model < 6.0
|
||||
|
||||
[effect todo]
|
||||
[effect]
|
||||
float var1 = 0.1f;
|
||||
float2 var2 = {0.2f,0.3f};
|
||||
float2x4 var3 = {1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0};
|
||||
|
Loading…
x
Reference in New Issue
Block a user