vkd3d-shader/hlsl: A couple of type refactors.
1 unresolved thread
1 unresolved thread
Compare changes
+ 57
− 51
@@ -192,18 +192,20 @@ bool hlsl_type_is_row_major(const struct hlsl_type *type)
@@ -211,7 +213,7 @@ unsigned int hlsl_type_element_count(const struct hlsl_type *type)
@@ -355,14 +357,24 @@ static void hlsl_type_calculate_reg_size(struct hlsl_ctx *ctx, struct hlsl_type
@@ -387,7 +399,6 @@ static void hlsl_type_calculate_reg_size(struct hlsl_ctx *ctx, struct hlsl_type
@@ -399,8 +410,6 @@ static void hlsl_type_calculate_reg_size(struct hlsl_ctx *ctx, struct hlsl_type
@@ -483,8 +492,8 @@ static struct hlsl_type *hlsl_new_type(struct hlsl_ctx *ctx, const char *name, e
- Comment on lines 492 to +494
Oh, it is a preexisting issue but I think we should not be initializing these fields if the type class is not numeric. Albeit the only instance of this happening is the
ctx->builtin_types.null = hlsl_new_type(ctx, "NULL", HLSL_CLASS_NULL, HLSL_TYPE_UINT, 1, 1);
we do in declare_predefined_types().
@@ -552,18 +561,19 @@ static unsigned int traverse_path_from_component_index(struct hlsl_ctx *ctx,
@@ -861,9 +871,9 @@ struct hlsl_type *hlsl_get_element_type_from_path_index(struct hlsl_ctx *ctx, co
@@ -892,8 +902,6 @@ struct hlsl_type *hlsl_new_array_type(struct hlsl_ctx *ctx, struct hlsl_type *ba
@@ -927,7 +935,6 @@ struct hlsl_type *hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name,
@@ -945,8 +952,6 @@ struct hlsl_type *hlsl_new_texture_type(struct hlsl_ctx *ctx, enum hlsl_sampler_
@@ -963,8 +968,6 @@ struct hlsl_type *hlsl_new_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim
@@ -980,7 +983,6 @@ struct hlsl_type *hlsl_new_cb_type(struct hlsl_ctx *ctx, struct hlsl_type *forma
@@ -1066,7 +1068,7 @@ unsigned int hlsl_type_component_count(const struct hlsl_type *type)
@@ -1131,9 +1133,9 @@ bool hlsl_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2
@@ -1224,8 +1226,6 @@ struct hlsl_type *hlsl_type_clone(struct hlsl_ctx *ctx, struct hlsl_type *old,
@@ -1238,6 +1238,8 @@ struct hlsl_type *hlsl_type_clone(struct hlsl_ctx *ctx, struct hlsl_type *old,
@@ -1497,7 +1499,7 @@ struct hlsl_ir_node *hlsl_new_store_index(struct hlsl_ctx *ctx, const struct hls
@@ -1524,7 +1526,7 @@ bool hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl_block *block,
@@ -2064,7 +2066,7 @@ struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *v
@@ -2355,10 +2357,10 @@ static struct hlsl_ir_node *clone_swizzle(struct hlsl_ctx *ctx,
@@ -2778,12 +2780,13 @@ static void hlsl_dump_type(struct vkd3d_string_buffer *buffer, const struct hlsl
@@ -3176,9 +3179,9 @@ static void dump_ir_constant(struct vkd3d_string_buffer *buffer, const struct hl
@@ -3204,12 +3207,9 @@ static void dump_ir_constant(struct vkd3d_string_buffer *buffer, const struct hl
@@ -3435,16 +3435,17 @@ static void dump_ir_swizzle(struct vkd3d_string_buffer *buffer, const struct hls
@@ -3658,10 +3659,15 @@ void hlsl_dump_var_default_values(const struct hlsl_ir_var *var)
@@ -4331,7 +4337,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx)