vkd3d-shader/fx: Fix the matrix type class for fx_2_0.

CTAB type correctly reflects matrix majority, unlike effects
type data that does not respond to majority modifiers at all.
It doesn't transpose default values either.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-08-17 14:06:05 +02:00 committed by Henri Verbeet
parent b9e894f232
commit c8cc1b1a24
Notes: Henri Verbeet 2024-08-19 14:30:34 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1003

View File

@ -894,6 +894,13 @@ static uint32_t write_fx_2_string(const char *string, struct fx_write_context *f
return offset; return offset;
} }
static uint32_t get_fx_2_type_class(const struct hlsl_type *type)
{
if (type->class == HLSL_CLASS_MATRIX)
return D3DXPC_MATRIX_ROWS;
return hlsl_sm1_class(type);
}
static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *name, const struct hlsl_semantic *semantic, static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *name, const struct hlsl_semantic *semantic,
struct fx_write_context *fx) struct fx_write_context *fx)
{ {
@ -912,7 +919,7 @@ static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *n
semantic_offset = semantic->raw_name ? write_string(semantic->raw_name, fx) : 0; semantic_offset = semantic->raw_name ? write_string(semantic->raw_name, fx) : 0;
offset = put_u32(buffer, hlsl_sm1_base_type(type)); offset = put_u32(buffer, hlsl_sm1_base_type(type));
put_u32(buffer, hlsl_sm1_class(type)); put_u32(buffer, get_fx_2_type_class(type));
put_u32(buffer, name_offset); put_u32(buffer, name_offset);
put_u32(buffer, semantic_offset); put_u32(buffer, semantic_offset);
put_u32(buffer, elements_count); put_u32(buffer, elements_count);