From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 11 +++++++---- libs/vkd3d-shader/vkd3d_shader_private.h | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 1755c254cfa4..3260b2847dfd 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1729,7 +1729,7 @@ static void vkd3d_symbol_make_register(struct vkd3d_symbol *symbol, symbol->type = VKD3D_SYMBOL_REGISTER; memset(&symbol->key, 0, sizeof(symbol->key)); symbol->key.reg.type = reg->type; - if (reg->type == VKD3DSPR_INPUT && reg->idx[1].offset != ~0u) + if (vkd3d_shader_register_is_input(reg) && reg->idx[1].offset != ~0u) symbol->key.reg.idx = reg->idx[1].offset; else if (reg->type != VKD3DSPR_IMMCONSTBUFFER) symbol->key.reg.idx = reg->idx[0].offset; @@ -2150,6 +2150,9 @@ static bool vkd3d_dxbc_compiler_get_register_name(char *buffer, unsigned int buf case VKD3DSPR_INPUT: snprintf(buffer, buffer_size, "v%u", idx); break; + case VKD3DSPR_INCONTROLPOINT: + snprintf(buffer, buffer_size, "vicp%u", idx); + break; case VKD3DSPR_OUTPUT: case VKD3DSPR_COLOROUT: snprintf(buffer, buffer_size, "o%u", idx); @@ -3755,10 +3758,10 @@ static void vkd3d_dxbc_compiler_emit_dcl_input(struct vkd3d_dxbc_compiler *compi { const struct vkd3d_shader_dst_param *dst = &instruction->declaration.dst;
- if (dst->reg.type != VKD3DSPR_INPUT) - vkd3d_dxbc_compiler_emit_input_register(compiler, dst); - else + if (vkd3d_shader_register_is_input(&dst->reg)) vkd3d_dxbc_compiler_emit_input(compiler, dst, VKD3D_SIV_NONE); + else + vkd3d_dxbc_compiler_emit_input_register(compiler, dst); }
static void vkd3d_dxbc_compiler_emit_interpolation_decorations(struct vkd3d_dxbc_compiler *compiler, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 9eb2c126332d..b1eadde08017 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -778,6 +778,11 @@ static inline BOOL vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_ return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w; }
+static inline bool vkd3d_shader_register_is_input(const struct vkd3d_shader_register *reg) +{ + return reg->type == VKD3DSPR_INPUT || reg->type == VKD3DSPR_INCONTROLPOINT; +} + void vkd3d_shader_trace(void *data) DECLSPEC_HIDDEN;
void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size,