SPIRV-Tools/tools
Nathan Gauër 2ea4003633
opt: split composite from array flattening (#5733)
* opt: split composite from array flattening

DXC has an option to flatten resource arrays. But when this option
is not used, the resource arrays should be kept as-is.
On the other hand, when a struct contains resources, we MUST flatten is
to be compliant with the Vulkan spec.

Because this pass flattens both types of resources, using a struct of
resources automatically implied flattening arrays.
By adding those 2 new settings, we decide if the pass flattens only one type
of resources, or both.
Note: the flatten_arrays flag only impacts resource arrays.
Arrays of composites containing resources are still flattened.

Since the API is considered stable, I added 2 new functions to create
passes with one flag or the other, and kept the original behavior as-is.

Related to https://github.com/microsoft/DirectXShaderCompiler/issues/6745

Signed-off-by: Nathan Gauër <brioche@google.com>

* add commandline options

Signed-off-by: Nathan Gauër <brioche@google.com>

* clang-format

Signed-off-by: Nathan Gauër <brioche@google.com>

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-07-19 11:48:21 -04:00
..
as tools: refactorize tools flags parsing. (#5111) 2023-02-27 18:45:14 +01:00
cfg tools: refactorize tools flags parsing. (#5111) 2023-02-27 18:45:14 +01:00
diff diff: refactorize flag parsing (#5133) 2023-03-03 16:55:00 +01:00
dis spirv-dis: Add --nested-indent and --reorder-blocks (#5671) 2024-06-17 09:54:18 -04:00
emacs Define variable to skip installation 2017-07-04 12:24:44 -04:00
fuzz Remove uses of std::system(nullptr) (#5494) 2023-11-30 17:05:25 -05:00
lesspipe tools/lesspipe: Allow generic shell (#2255) 2018-12-27 15:06:37 -05:00
link linker: Add --use-highest-version option (#5376) 2023-08-21 17:05:33 -06:00
lint linter: refactorize linter flag parsing (#5134) 2023-03-02 15:17:34 +01:00
objdump Implement source extraction logic for spirv-objdump (#5150) 2023-03-22 23:57:18 +01:00
opt opt: split composite from array flattening (#5733) 2024-07-19 11:48:21 -04:00
reduce Remove uses of std::system(nullptr) (#5494) 2023-11-30 17:05:25 -05:00
sva SPV_KHR_quad_control (#5547) 2024-01-26 15:49:56 -05:00
util Add explicit deduction guide for FlagRegistration (#5141) 2023-03-07 16:44:56 -05:00
val spirv-val: Fix indentation of --version output (#5686) 2024-05-30 11:01:35 -04:00
CMakeLists.txt Implement source extraction logic for spirv-objdump (#5150) 2023-03-22 23:57:18 +01:00
io.h Flush stdout before changing mode back to text (#5477) 2023-11-15 17:02:00 +00:00