vkd3d-shader/ir: Validate indices for SAMPLER registers.

This commit is contained in:
Giovanni Mascellani 2024-09-27 14:51:54 +02:00 committed by Henri Verbeet
parent da7c9694f1
commit ab23038367
Notes: Henri Verbeet 2024-10-03 19:35:06 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1142

View File

@ -6186,6 +6186,18 @@ static void vsir_validate_register(struct validation_context *ctx,
if (reg->dimension == VSIR_DIMENSION_SCALAR)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DIMENSION,
"Invalid dimension SCALAR for a SAMPLER register.");
if (reg->idx_count != 2)
{
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX_COUNT,
"Invalid index count %u for a SAMPLER register.",
reg->idx_count);
break;
}
if (reg->idx[0].rel_addr)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX,
"Non-NULL relative address for the descriptor index of a SAMPLER register.");
break;
case VKD3DSPR_RESOURCE: