mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Introduce a boilerplate to validate the generated IR.
For the moment the validator is trivial, it never fails. Checks will be added incrementally.
This commit is contained in:
committed by
Alexandre Julliard
parent
cf871d2cb2
commit
c052cd8998
Notes:
Alexandre Julliard
2023-09-22 22:46:19 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/317
@@ -1290,5 +1290,22 @@ enum vkd3d_result vkd3d_shader_normalise(struct vkd3d_shader_parser *parser,
|
||||
if (result >= 0 && TRACE_ON())
|
||||
vkd3d_shader_trace(instructions, &parser->shader_version);
|
||||
|
||||
if (result >= 0 && !parser->failed)
|
||||
vsir_validate(parser);
|
||||
|
||||
if (result >= 0 && parser->failed)
|
||||
result = VKD3D_ERROR_INVALID_SHADER;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
struct validation_context
|
||||
{
|
||||
struct vkd3d_shader_parser *parser;
|
||||
};
|
||||
|
||||
void vsir_validate(struct vkd3d_shader_parser *parser)
|
||||
{
|
||||
if (!(parser->config_flags & VKD3D_SHADER_CONFIG_FLAG_FORCE_VALIDATION))
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user