-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite some handling codes of unpacked output locations
We have the logic to keep all locations in some conditions to initialize more location map entries than actually needed. The original logic is somewhat vague when TCS dynamic indexing is involved (the same to mesh shader outputs). For example: layout(location = 10) out float data[5] ... data[i] = XXX Location 0-9 should be initialized to 'unmapped' status and we only map the actual location range, which is location 10-14. The original code mapped all locations 0-14. This is incorrect if we have two arrays: layout(location = 5) out float data1[5] layout(location = 10) out float data2[5] ... data1[i] = XXX data2[j] = YYY In resource collecting pass, also re-write some handling codes of unpacked output locations. This is to address such case: layout(location = 0) out float data1[5] layout(location = 5) out float data2 layout(location = 6) out float data3[5] ... data1[i] = XXX data2 = 0.5 data3[j] = YYY When handing dynamic indexing, data1 is assigned to location 0-5 and data3 is assigned to location 6-10 without location mapping needed in resource collecting pass. data2 could take location 5 but our current logic assigns it to 0 without checking already-occupied locations. Such error is found when compiling a separate TCS (not full pipeline). So we must first colllect occupied locations and do location mapping after that.
- Loading branch information
Showing
2 changed files
with
152 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters