vkd3d-shader/ir: Validate index count for RASTOUT registers.

This commit is contained in:
Giovanni Mascellani 2024-09-26 21:32:30 +02:00 committed by Henri Verbeet
parent 19d35d89cd
commit 99aebb1b31
Notes: Henri Verbeet 2024-10-02 22:38:04 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1136

View File

@ -6244,6 +6244,24 @@ static void vsir_validate_register(struct validation_context *ctx,
reg->idx_count);
break;
case VKD3DSPR_RASTOUT:
if (reg->idx_count != 1)
{
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX_COUNT,
"Invalid index count %u for a RASTOUT 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 a RASTOUT register.");
if (reg->idx[0].offset >= 3)
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_INDEX,
"Invalid offset for a RASTOUT register.");
break;
default:
break;
}