vkd3d-shader/spirv: Make output varyings not consumed by the next stage private variables.

This commit is contained in:
Zebediah Figura
2023-07-31 12:46:55 -05:00
committed by Alexandre Julliard
parent 11475ef62a
commit d932fba7c3
Notes: Alexandre Julliard 2023-08-03 21:25:28 +09:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/280
3 changed files with 11 additions and 5 deletions

View File

@ -133,10 +133,7 @@ static enum vkd3d_result remap_output_signature(struct vkd3d_shader_parser *pars
} }
else else
{ {
vkd3d_shader_parser_error(parser, VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED, e->target_location = SIGNATURE_TARGET_LOCATION_UNUSED;
"Aborting due to not yet implemented feature: "
"This stage outputs varyings not consumed by the next stage.");
return VKD3D_ERROR_NOT_IMPLEMENTED;
} }
} }

View File

@ -4978,6 +4978,12 @@ static void spirv_compiler_emit_output(struct spirv_compiler *compiler,
spirv_compiler_emit_register_execution_mode(compiler, &dst->reg); spirv_compiler_emit_register_execution_mode(compiler, &dst->reg);
} }
else if (signature_element->target_location == SIGNATURE_TARGET_LOCATION_UNUSED)
{
storage_class = SpvStorageClassPrivate;
id = spirv_compiler_emit_array_variable(compiler, &builder->global_stream,
storage_class, component_type, output_component_count, array_sizes, 2);
}
else else
{ {
unsigned int location = signature_element->target_location; unsigned int location = signature_element->target_location;

View File

@ -809,6 +809,8 @@ enum vkd3d_shader_input_sysval_semantic
VKD3D_SIV_LINE_DENSITY_TESS_FACTOR = 22, VKD3D_SIV_LINE_DENSITY_TESS_FACTOR = 22,
}; };
#define SIGNATURE_TARGET_LOCATION_UNUSED (~0u)
struct signature_element struct signature_element
{ {
unsigned int sort_index; unsigned int sort_index;
@ -823,7 +825,8 @@ struct signature_element
unsigned int mask; unsigned int mask;
unsigned int used_mask; unsigned int used_mask;
enum vkd3d_shader_minimum_precision min_precision; enum vkd3d_shader_minimum_precision min_precision;
/* Register index / location in the target shader. */ /* Register index / location in the target shader.
* If SIGNATURE_TARGET_LOCATION_UNUSED, this element should not be written. */
unsigned int target_location; unsigned int target_location;
}; };