libs/vkd3d-shader: Treat vicp register as regular shader input.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-07-18 12:05:42 +02:00 committed by Alexandre Julliard
parent faa1118202
commit 054b1e41dd
2 changed files with 12 additions and 4 deletions

View File

@ -1729,7 +1729,7 @@ static void vkd3d_symbol_make_register(struct vkd3d_symbol *symbol,
symbol->type = VKD3D_SYMBOL_REGISTER; symbol->type = VKD3D_SYMBOL_REGISTER;
memset(&symbol->key, 0, sizeof(symbol->key)); memset(&symbol->key, 0, sizeof(symbol->key));
symbol->key.reg.type = reg->type; 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; symbol->key.reg.idx = reg->idx[1].offset;
else if (reg->type != VKD3DSPR_IMMCONSTBUFFER) else if (reg->type != VKD3DSPR_IMMCONSTBUFFER)
symbol->key.reg.idx = reg->idx[0].offset; 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: case VKD3DSPR_INPUT:
snprintf(buffer, buffer_size, "v%u", idx); snprintf(buffer, buffer_size, "v%u", idx);
break; break;
case VKD3DSPR_INCONTROLPOINT:
snprintf(buffer, buffer_size, "vicp%u", idx);
break;
case VKD3DSPR_OUTPUT: case VKD3DSPR_OUTPUT:
case VKD3DSPR_COLOROUT: case VKD3DSPR_COLOROUT:
snprintf(buffer, buffer_size, "o%u", idx); 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; const struct vkd3d_shader_dst_param *dst = &instruction->declaration.dst;
if (dst->reg.type != VKD3DSPR_INPUT) if (vkd3d_shader_register_is_input(&dst->reg))
vkd3d_dxbc_compiler_emit_input_register(compiler, dst);
else
vkd3d_dxbc_compiler_emit_input(compiler, dst, VKD3D_SIV_NONE); 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, static void vkd3d_dxbc_compiler_emit_interpolation_decorations(struct vkd3d_dxbc_compiler *compiler,

View File

@ -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; 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 vkd3d_shader_trace(void *data) DECLSPEC_HIDDEN;
void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size,