microsoft/compiler: Semantic table should be de-duped for multi-row semantics too
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Bill Kristiansen <billkris@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14399>
This commit is contained in:
parent
218f8302d2
commit
5e3d64d067
|
@ -368,11 +368,15 @@ uint32_t
|
|||
append_semantic_index_to_table(struct dxil_psv_sem_index_table *table, uint32_t index,
|
||||
uint32_t num_rows)
|
||||
{
|
||||
if (num_rows == 1) {
|
||||
for (unsigned i = 0; i < table->size; ++i) {
|
||||
if (table->data[i] == index)
|
||||
return i;
|
||||
}
|
||||
for (unsigned i = 0; i < table->size; ++i) {
|
||||
unsigned j = 0;
|
||||
for (; j < num_rows && i + j < table->size; ++j)
|
||||
if (table->data[i + j] != index + j)
|
||||
break;
|
||||
if (j == num_rows)
|
||||
return i;
|
||||
else if (j > 0)
|
||||
i += j - 1;
|
||||
}
|
||||
uint32_t retval = table->size;
|
||||
assert(table->size + num_rows <= 80);
|
||||
|
|
Loading…
Reference in New Issue