From: Zebediah Figura zfigura@codeweavers.com
--- libs/vkd3d-shader/fx.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 3b5a4caf0..db1af5635 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -401,14 +401,6 @@ static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_co uint32_t name_offset, offset, size, stride, numeric_desc; uint32_t elements_count = 0; const char *name; - static const uint32_t variable_type[] = - { - [HLSL_CLASS_SCALAR] = 1, - [HLSL_CLASS_VECTOR] = 1, - [HLSL_CLASS_MATRIX] = 1, - [HLSL_CLASS_OBJECT] = 2, - [HLSL_CLASS_STRUCT] = 3, - }; struct hlsl_ctx *ctx = fx->ctx;
/* Resolve arrays to element type and number of elements. */ @@ -428,13 +420,19 @@ static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_co case HLSL_CLASS_SCALAR: case HLSL_CLASS_VECTOR: case HLSL_CLASS_MATRIX: + put_u32_unaligned(buffer, 1); + break; + case HLSL_CLASS_OBJECT: + put_u32_unaligned(buffer, 2); + break; + case HLSL_CLASS_STRUCT: - put_u32_unaligned(buffer, variable_type[type->class]); + put_u32_unaligned(buffer, 3); break; - default: - hlsl_fixme(ctx, &ctx->location, "Writing type class %u is not implemented.", type->class); - return 0; + + case HLSL_CLASS_ARRAY: + vkd3d_unreachable(); }
size = stride = type->reg_size[HLSL_REGSET_NUMERIC] * sizeof(float);