vkd3d-shader/hlsl: Support void pass-through hull shader control point functions.

This commit is contained in:
Shaun Ren
2025-05-15 16:23:15 -04:00
committed by Henri Verbeet
parent e7b2ca28ab
commit a4e43402e5
Notes: Henri Verbeet 2025-05-24 21:48:08 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1509
3 changed files with 23 additions and 3 deletions

View File

@@ -13526,7 +13526,26 @@ static void process_entry_function(struct hlsl_ctx *ctx,
else
{
if (profile->type == VKD3D_SHADER_TYPE_HULL && !ctx->is_patch_constant_func)
hlsl_fixme(ctx, &entry_func->loc, "Passthrough hull shader control point function.");
{
if (!ctx->input_control_point_type)
{
hlsl_error(ctx, &entry_func->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_INPUT_PATCH,
"Pass-through control point function \"%s\" is missing an InputPatch parameter.",
entry_func->func->name);
}
else if (ctx->output_control_point_count
&& ctx->output_control_point_count != ctx->input_control_point_count)
{
hlsl_error(ctx, &entry_func->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_CONTROL_POINT_COUNT,
"Output control point count %u does not match the input control point count %u.",
ctx->output_control_point_count, ctx->input_control_point_count);
}
else
{
ctx->output_control_point_type = ctx->input_control_point_type;
ctx->output_control_point_count = ctx->input_control_point_count;
}
}
}
if (profile->type == VKD3D_SHADER_TYPE_GEOMETRY && ctx->input_primitive_type == VKD3D_PT_UNDEFINED)

View File

@@ -174,6 +174,7 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_HLSL_INVALID_MAX_VERTEX_COUNT = 5042,
VKD3D_SHADER_ERROR_HLSL_MISSING_PRIMITIVE_TYPE = 5043,
VKD3D_SHADER_ERROR_HLSL_MISPLACED_STREAM_OUTPUT = 5044,
VKD3D_SHADER_ERROR_HLSL_MISSING_INPUT_PATCH = 5045,
VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300,
VKD3D_SHADER_WARNING_HLSL_DIVISION_BY_ZERO = 5301,

View File

@@ -99,7 +99,7 @@ if(!llvmpipe) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)
% Passthrough hull shader control point function.
[hull shader todo]
[hull shader]
struct data
{
float4 position : SV_Position;
@@ -131,7 +131,7 @@ void main(InputPatch<data, 3> input)
[test]
% DXC doesn't generate a passthrough control point phase like FXC does
if(!llvmpipe & sm<6) todo draw 3 control point patch list 3
if(!llvmpipe & sm<6) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe & sm<6) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)
[require]