mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/tpf: Write the patch constant function in hull shaders.
We use a single hs_fork_phase here for the patch constant function.
This commit is contained in:
Notes:
Henri Verbeet
2024-10-16 21:47:54 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1187
@@ -6281,29 +6281,24 @@ void hlsl_run_const_passes(struct hlsl_ctx *ctx, struct hlsl_block *body)
|
||||
} while (progress);
|
||||
}
|
||||
|
||||
static void generate_vsir_signature_entry(struct hlsl_ctx *ctx,
|
||||
struct vsir_program *program, bool output, struct hlsl_ir_var *var)
|
||||
static void generate_vsir_signature_entry(struct hlsl_ctx *ctx, struct vsir_program *program,
|
||||
struct shader_signature *signature, bool output, struct hlsl_ir_var *var)
|
||||
{
|
||||
enum vkd3d_shader_sysval_semantic sysval = VKD3D_SHADER_SV_NONE;
|
||||
enum vkd3d_shader_component_type component_type;
|
||||
unsigned int register_index, mask, use_mask;
|
||||
const char *name = var->semantic.name;
|
||||
enum vkd3d_shader_register_type type;
|
||||
struct shader_signature *signature;
|
||||
struct signature_element *element;
|
||||
|
||||
if (output)
|
||||
signature = &program->output_signature;
|
||||
else
|
||||
signature = &program->input_signature;
|
||||
|
||||
if (hlsl_version_ge(ctx, 4, 0))
|
||||
{
|
||||
struct vkd3d_string_buffer *string;
|
||||
bool has_idx, ret;
|
||||
|
||||
ret = sm4_sysval_semantic_from_semantic_name(&sysval, &program->shader_version,
|
||||
ctx->semantic_compat_mapping, ctx->domain, var->semantic.name, var->semantic.index, output, false);
|
||||
ctx->semantic_compat_mapping, ctx->domain, var->semantic.name, var->semantic.index,
|
||||
output, signature == &program->patch_constant_signature);
|
||||
VKD3D_ASSERT(ret);
|
||||
if (sysval == ~0u)
|
||||
return;
|
||||
@@ -6419,10 +6414,18 @@ static void generate_vsir_signature(struct hlsl_ctx *ctx,
|
||||
|
||||
LIST_FOR_EACH_ENTRY(var, &func->extern_vars, struct hlsl_ir_var, extern_entry)
|
||||
{
|
||||
if (var->is_input_semantic)
|
||||
generate_vsir_signature_entry(ctx, program, false, var);
|
||||
if (var->is_output_semantic)
|
||||
generate_vsir_signature_entry(ctx, program, true, var);
|
||||
if (func == ctx->patch_constant_func)
|
||||
{
|
||||
generate_vsir_signature_entry(ctx, program,
|
||||
&program->patch_constant_signature, var->is_output_semantic, var);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (var->is_input_semantic)
|
||||
generate_vsir_signature_entry(ctx, program, &program->input_signature, false, var);
|
||||
if (var->is_output_semantic)
|
||||
generate_vsir_signature_entry(ctx, program, &program->output_signature, true, var);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7408,6 +7411,8 @@ static void sm4_generate_vsir(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl
|
||||
}
|
||||
|
||||
generate_vsir_signature(ctx, program, entry_func);
|
||||
if (version.type == VKD3D_SHADER_TYPE_HULL)
|
||||
generate_vsir_signature(ctx, program, ctx->patch_constant_func);
|
||||
}
|
||||
|
||||
static struct hlsl_ir_jump *loop_unrolling_find_jump(struct hlsl_block *block, struct hlsl_ir_node *stop_point,
|
||||
|
Reference in New Issue
Block a user