Signed-off-by: Francisco Casas fcasas@codeweavers.com
March 22, 2022 7:17 PM, "Zebediah Figura" zfigura@codeweavers.com wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
libs/vkd3d-shader/hlsl_sm4.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c index 95ea299cf..bc7d966c2 100644 --- a/libs/vkd3d-shader/hlsl_sm4.c +++ b/libs/vkd3d-shader/hlsl_sm4.c @@ -25,6 +25,20 @@
static void write_sm4_block(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer, const struct hlsl_block *block);
+static bool type_is_integer(const struct hlsl_type *type) +{
- switch (type->base_type)
- {
- case HLSL_TYPE_BOOL:
- case HLSL_TYPE_INT:
- case HLSL_TYPE_UINT:
- return true;
- default:
- return false;
- }
+}
bool hlsl_sm4_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic, bool output, enum vkd3d_sm4_register_type *type, enum vkd3d_sm4_swizzle_type *swizzle_type, bool *has_idx) { @@ -1206,7 +1220,7 @@ static void write_sm4_dcl_semantic(struct hlsl_ctx *ctx, struct vkd3d_bytecode_b { enum vkd3d_shader_interpolation_mode mode = VKD3DSIM_LINEAR;
- if (var->modifiers & HLSL_STORAGE_NOINTERPOLATION)
- if ((var->modifiers & HLSL_STORAGE_NOINTERPOLATION) || type_is_integer(var->data_type))
mode = VKD3DSIM_CONSTANT;
instr.opcode |= mode << VKD3D_SM4_INTERPOLATION_MODE_SHIFT; @@ -1419,20 +1433,6 @@ static void write_sm4_sample(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer write_sm4_instruction(buffer, &instr); }
-static bool type_is_integer(const struct hlsl_type *type) -{
- switch (type->base_type)
- {
- case HLSL_TYPE_BOOL:
- case HLSL_TYPE_INT:
- case HLSL_TYPE_UINT:
- return true;
- default:
- return false;
- }
-}
static bool type_is_float(const struct hlsl_type *type) { return type->base_type == HLSL_TYPE_FLOAT || type->base_type == HLSL_TYPE_HALF; -- 2.35.1