vkd3d-shader/hlsl: Validate and record InputPatch/OutputPatch types.

This commit is contained in:
Shaun Ren
2025-01-20 15:39:31 -05:00
committed by Henri Verbeet
parent f4d5e05d96
commit f064a4022a
Notes: Henri Verbeet 2025-01-29 18:04:29 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Elizabeth Figura (@zfigura)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1355
4 changed files with 141 additions and 5 deletions

View File

@@ -1155,11 +1155,30 @@ struct hlsl_ctx
* compute shader profiles. It is set using the numthreads() attribute in the entry point. */
uint32_t thread_count[3];
/* Declared information in tessellation shaders.
*
* The following fields are specific to hull shaders: output_control_point_count,
* output_control_point_type, output_primitive, partitioning, and patch_constant_func.
*
* The output_control_point_count and output_control_point_type fields correspond to the return
* type and the "outputcontrolpoints" attribute of a hull shader's control point function,
* respectively. Moreover, if an OutputPatch parameter is declared in the hull shader's patch
* constant function, its type and element count must match these fields.
*
* The input_control_point_count and input_control_point_type fields are specified by the
* InputPatch parameter in hull shaders, or by the _OutputPatch_ parameter in domain
* shaders.
*
* For input_ and output_control_point_count, the value UINT_MAX indicates that the value is
* unknown or not set by the shader. */
enum vkd3d_tessellator_domain domain;
unsigned int output_control_point_count;
struct hlsl_type *output_control_point_type;
enum vkd3d_shader_tessellator_output_primitive output_primitive;
enum vkd3d_shader_tessellator_partitioning partitioning;
struct hlsl_ir_function_decl *patch_constant_func;
unsigned int input_control_point_count;
struct hlsl_type *input_control_point_type;
/* In some cases we generate opcodes by parsing an HLSL function and then
* invoking it. If not NULL, this field is the name of the function that we