mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
writer/hlsl: Simplify UBO accesses for static indexing
Use the new semantic constant value information to significantly reduce the complex indexing logic emitted for UBO accesses. This will dramatically reduce the number of `for` loops that are decayed to `while` loops. Change-Id: I1b0adb5edde2b4ed39c6beafc2e28106b86e0edd Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57701 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
@@ -4,7 +4,6 @@ cbuffer cbuffer_v : register(b0, space0) {
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
const uint scalar_offset = (0u) / 4;
|
||||
const int use = (asint(v[scalar_offset / 4][scalar_offset % 4]) + 1);
|
||||
const int use = (asint(v[0].x) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user