mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Validate stream output parameters in geometry shaders.
This commit is contained in:
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
@@ -12561,6 +12561,23 @@ static void process_entry_function(struct hlsl_ctx *ctx,
|
||||
|
||||
prepend_input_var_copy(ctx, entry_func, var);
|
||||
}
|
||||
else if (hlsl_get_stream_output_type(var->data_type))
|
||||
{
|
||||
if (profile->type != VKD3D_SHADER_TYPE_GEOMETRY)
|
||||
{
|
||||
hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INCOMPATIBLE_PROFILE,
|
||||
"Stream output parameters can only be used in geometry shaders.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(var->storage_modifiers & HLSL_STORAGE_IN) || !(var->storage_modifiers & HLSL_STORAGE_OUT))
|
||||
hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||
"Stream output parameter \"%s\" must be declared as \"inout\".", var->name);
|
||||
|
||||
/* TODO: check that maxvertexcount * component_count(element_type) <= 1024. */
|
||||
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hlsl_get_multiarray_element_type(var->data_type)->class != HLSL_CLASS_STRUCT
|
||||
|
Reference in New Issue
Block a user