mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
anv: Properly handle all sizes of specialization constants
Closes: #2812
cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4675>
(cherry picked from commit a44e63398b)
This commit is contained in:
parent
cacb0c0268
commit
ca9452e34c
2 changed files with 16 additions and 3 deletions
|
|
@ -1246,7 +1246,7 @@
|
|||
"description": "anv: Properly handle all sizes of specialization constants",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -156,10 +156,23 @@ anv_shader_compile_to_nir(struct anv_device *device,
|
|||
assert(data + entry.size <= spec_info->pData + spec_info->dataSize);
|
||||
|
||||
spec_entries[i].id = spec_info->pMapEntries[i].constantID;
|
||||
if (spec_info->dataSize == 8)
|
||||
switch (entry.size) {
|
||||
case 8:
|
||||
spec_entries[i].data64 = *(const uint64_t *)data;
|
||||
else
|
||||
break;
|
||||
case 4:
|
||||
spec_entries[i].data32 = *(const uint32_t *)data;
|
||||
break;
|
||||
case 2:
|
||||
spec_entries[i].data32 = *(const uint16_t *)data;
|
||||
break;
|
||||
case 1:
|
||||
spec_entries[i].data32 = *(const uint8_t *)data;
|
||||
break;
|
||||
default:
|
||||
assert(!"Invalid spec constant size");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue