mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/tpf: Allow passing NULL register type on hlsl_sm4_register_from_semantic().
This commit is contained in:
committed by
Alexandre Julliard
parent
8a6a620ee2
commit
fc589add49
Notes:
Alexandre Julliard
2023-08-14 20:59:59 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/281
@ -2555,6 +2555,7 @@ bool hlsl_sm4_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_sem
|
|||||||
&& output == register_table[i].output
|
&& output == register_table[i].output
|
||||||
&& ctx->profile->type == register_table[i].shader_type)
|
&& ctx->profile->type == register_table[i].shader_type)
|
||||||
{
|
{
|
||||||
|
if (type)
|
||||||
*type = register_table[i].type;
|
*type = register_table[i].type;
|
||||||
if (swizzle_type)
|
if (swizzle_type)
|
||||||
*swizzle_type = register_table[i].swizzle_type;
|
*swizzle_type = register_table[i].swizzle_type;
|
||||||
@ -2656,7 +2657,6 @@ static void write_sm4_signature(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc,
|
|||||||
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||||
{
|
{
|
||||||
unsigned int width = (1u << var->data_type->dimx) - 1, use_mask;
|
unsigned int width = (1u << var->data_type->dimx) - 1, use_mask;
|
||||||
enum vkd3d_shader_register_type type;
|
|
||||||
uint32_t usage_idx, reg_idx;
|
uint32_t usage_idx, reg_idx;
|
||||||
D3D_NAME usage;
|
D3D_NAME usage;
|
||||||
bool has_idx;
|
bool has_idx;
|
||||||
@ -2670,14 +2670,13 @@ static void write_sm4_signature(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc,
|
|||||||
continue;
|
continue;
|
||||||
usage_idx = var->semantic.index;
|
usage_idx = var->semantic.index;
|
||||||
|
|
||||||
if (hlsl_sm4_register_from_semantic(ctx, &var->semantic, output, &type, NULL, &has_idx))
|
if (hlsl_sm4_register_from_semantic(ctx, &var->semantic, output, NULL, NULL, &has_idx))
|
||||||
{
|
{
|
||||||
reg_idx = has_idx ? var->semantic.index : ~0u;
|
reg_idx = has_idx ? var->semantic.index : ~0u;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(var->regs[HLSL_REGSET_NUMERIC].allocated);
|
assert(var->regs[HLSL_REGSET_NUMERIC].allocated);
|
||||||
type = VKD3D_SM4_RT_INPUT;
|
|
||||||
reg_idx = var->regs[HLSL_REGSET_NUMERIC].id;
|
reg_idx = var->regs[HLSL_REGSET_NUMERIC].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user