mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/ir: Introduce a helper for validating DCL_VERTICES_OUT.
This commit is contained in:
parent
936adff58b
commit
22ba37c8b9
Notes:
Henri Verbeet
2024-09-16 14:22:01 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1074
@ -6230,6 +6230,14 @@ static void vsir_validate_dcl_temps(struct validation_context *ctx,
|
||||
ctx->dcl_temps_found = true;
|
||||
}
|
||||
|
||||
static void vsir_validate_dcl_vertices_out(struct validation_context *ctx,
|
||||
const struct vkd3d_shader_instruction *instruction)
|
||||
{
|
||||
if (instruction->declaration.count > 1024)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_GS, "GS output vertex count %u is invalid.",
|
||||
instruction->declaration.count);
|
||||
}
|
||||
|
||||
static void vsir_validate_else(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
|
||||
{
|
||||
vsir_validate_cf_type(ctx, instruction, VSIR_CF_STRUCTURED);
|
||||
@ -6457,6 +6465,7 @@ static const struct vsir_validator_instruction_desc vsir_validator_instructions[
|
||||
[VKD3DSIH_DCL_HS_MAX_TESSFACTOR] = {0, 0, vsir_validate_dcl_hs_max_tessfactor},
|
||||
[VKD3DSIH_DCL_INPUT_PRIMITIVE] = {0, 0, vsir_validate_dcl_input_primitive},
|
||||
[VKD3DSIH_DCL_TEMPS] = {0, 0, vsir_validate_dcl_temps},
|
||||
[VKD3DSIH_DCL_VERTICES_OUT] = {0, 0, vsir_validate_dcl_vertices_out},
|
||||
[VKD3DSIH_ELSE] = {0, 0, vsir_validate_else},
|
||||
[VKD3DSIH_ENDIF] = {0, 0, vsir_validate_endif},
|
||||
[VKD3DSIH_ENDLOOP] = {0, 0, vsir_validate_endloop},
|
||||
@ -6514,12 +6523,6 @@ static void vsir_validate_instruction(struct validation_context *ctx)
|
||||
ctx->dcl_temps_found = false;
|
||||
return;
|
||||
|
||||
case VKD3DSIH_DCL_VERTICES_OUT:
|
||||
if (instruction->declaration.count > 1024)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_GS, "GS output vertex count %u is invalid.",
|
||||
instruction->declaration.count);
|
||||
return;
|
||||
|
||||
case VKD3DSIH_DCL_OUTPUT_TOPOLOGY:
|
||||
if (instruction->declaration.primitive_type.type == VKD3D_PT_UNDEFINED
|
||||
|| instruction->declaration.primitive_type.type >= VKD3D_PT_COUNT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user