vkd3d-shader/hlsl: Validate and record input primitive types in geometry shaders.

This commit is contained in:
Shaun Ren
2025-03-10 16:21:08 -04:00
committed by Henri Verbeet
parent 57bb28e841
commit 870c68dd27
Notes: Henri Verbeet 2025-03-12 22:20:50 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1405
4 changed files with 163 additions and 28 deletions

View File

@@ -298,6 +298,12 @@ bool hlsl_type_is_patch_array(const struct hlsl_type *type)
|| type->e.array.array_type == HLSL_ARRAY_PATCH_OUTPUT);
}
bool hlsl_type_is_primitive_array(const struct hlsl_type *type)
{
return type->class == HLSL_CLASS_ARRAY && (type->e.array.array_type != HLSL_ARRAY_GENERIC
|| (type->modifiers & HLSL_PRIMITIVE_MODIFIERS_MASK));
}
bool hlsl_base_type_is_integer(enum hlsl_base_type type)
{
switch (type)
@@ -4746,6 +4752,7 @@ static bool hlsl_ctx_init(struct hlsl_ctx *ctx, const struct vkd3d_shader_compil
ctx->partitioning = 0;
ctx->input_control_point_count = UINT_MAX;
ctx->max_vertex_count = 0;
ctx->input_primitive_type = VKD3D_PT_UNDEFINED;
return true;
}