mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/ir: Set the signature sort indices in shader_signature_merge().
Since the sort index is just a convenience field it is more appropriate to only set it where it is required, instead of requiring all frontends and passes to retain sensible values for it.
This commit is contained in:
parent
c332adaa68
commit
cd74461d6d
Notes:
Henri Verbeet
2024-10-08 22:12:25 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1161
@ -419,8 +419,6 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
|
||||
const char *name;
|
||||
uint32_t mask;
|
||||
|
||||
e[i].sort_index = i;
|
||||
|
||||
if (has_stream_index)
|
||||
e[i].stream_index = read_u32(&ptr);
|
||||
else
|
||||
|
@ -1471,6 +1471,9 @@ static bool shader_signature_merge(struct shader_signature *s, uint8_t range_map
|
||||
return false;
|
||||
memcpy(elements, s->elements, element_count * sizeof(*elements));
|
||||
|
||||
for (i = 0; i < element_count; ++i)
|
||||
elements[i].sort_index = i;
|
||||
|
||||
qsort(elements, element_count, sizeof(elements[0]), signature_element_register_compare);
|
||||
|
||||
for (i = 0, new_count = 0; i < element_count; i = j, elements[new_count++] = *e)
|
||||
|
@ -1061,6 +1061,9 @@ enum vkd3d_shader_input_sysval_semantic
|
||||
|
||||
struct signature_element
|
||||
{
|
||||
/* sort_index is not a property of the signature element, it is just a
|
||||
* convenience field used to retain the original order in a signature and
|
||||
* recover it after having permuted the signature itself. */
|
||||
unsigned int sort_index;
|
||||
const char *semantic_name;
|
||||
unsigned int semantic_index;
|
||||
|
Loading…
Reference in New Issue
Block a user