* [spirv] Add option to flatten array of resources.
Current SPIR-V code generation uses 1 binding number for an array of
resources (e.g. an array of textures). However, the DX side uses one
binding number per array element. The newly added
'-fspv-flatten-resource-arrays' changes the SPIR-V backend behavior to
use one binding number per array element, and uses spirv-opt to flatten
the array.
TODO: Add a test where the array is passed around.
TODO: Test this works with steven's PR and proper results are produced.
* [spirv] Update tests to include array of samplers.
* [spirv] Take early exit condition out of the loop.
* [spirv] Add documentation for the new cmd option.
* [spirv] Invoke CreateDescriptorScalarReplacementPass when needed.
* [spirv] address code review comments.
* [spirv] Respect the -auto-binding-space option in SPIR-V backend.
* [spirv] Use default space if vk::binding doesn't provide dset.
* Address code review comments.
* Add support to convert DXR HLSL to SPV_NV_ray_tracing
* Fix multiple typos and cleanup using clang-format.
* Update tests to verify transpose and custom matrix type
Update tests to add multple entry functions of same shader stage
* Replace ExecutionModel class with ShaderModel::Kind
- This change removes ExecutionModel class and relies on ShaderModel::Kind to track current entry point shader stage
- Also instead of declaring it in SpirvEmitter, DeclResultIdMapper & GlPerVertex, we declare it only once in common object SpirvContext
* Dont create a stageVar for raytracing interface variables.
* Don't perform 'new' memory allocation for FunctionInfo object
This change also -
- removes invalid "SpirvEmitter::" from function declarations in SpirvEmitter class.
- fix build errors by adding a default constructor in FunctionInfo struct to allow functionInfoMap allocate an empty object for no search results.
* Fix some more typos and fomatting errors.
* Update RST with raytracing stage info
* In SpirvContext.h, replace unsigned by uint32_t
* Test add ascii art and fixup grammar mistakes.
* Use placement new to allocate FunctionInfo objects.
Also bundle the insertion into functionInfoMap and workQueue together.
* Remove outdated comment.
* Update RST with intrinsic mapping and typo fixes.
* Some more wording fixes to RST for raytracing.
* Accidently broke table in RST due to missing '-'
* Add tick marks for supported stages in RST
* Final clang-format formatting fixes.
* Add missing labels to flowchart and spacing.
Added a new command-line option: -fspv-debug=<category>, where
category can be file, source, line, and tool, to give developers
fine-grained control of what debug information they want in
the generated SPIR-V code.
format: -fvk-bind-register <type-number> <space> <binding> <set>
Also created a short alias for it: -vkbr.
This option gives the ultimate manual control of descriptor
assignment. It requires:
* All resources are annotated with :register() in the source code
* -fvk-bind-register is specified for every resource
It overrules all other mechanisms.
It cannot be used together with -fvk-{u|b|s|t}-shift.
This option reciprocates (multiplicatively inverts) SV_Position.w
after reading it from stage input in PS. This is used to accommodate
the difference between Vulkan and DirectX.
Added -Wno-vk-ignored-features to suppress warnings on features
that are ignored because of no Vulkan support. Examples include
cbuffer member initializer.
2 means no indication as to whether this is a depth or non-depth
image.
Reverted "Hack OpSampledImage for depth-comparison sampling".
This reverts commit 0f165c6483.
It's actually a spec reading issue that it seems we cannot
have stand-alone variables for Position, PointSize, ClipDistance,
or CullDistance in HS/DS/GS.
Removed all code regarding Position and PointSize from GlPerVertex.
We still need to keep GlPerVertex aroudn to handle ClipDistance
and CullDistance though.
In HLSL, dual-source color blending is enabled only via API;
the shader needs no special marks: it only writes SV_Target0
& SV_Target1 like normal.
But in Vulkan, to enable dual-source blending, the shader need
to mark the two participating output variables with Index = 0
and Index = 1, respectively.
So we introduce a new attribute, vk::index(), to let developers
to specify the index of an output variable so dual-source
blending can be enabled.
See Vulkan spec "26.1.2. Dual-Source Blending".
GLSL as a shading language does not define the layout rules for
std140/std430; the OpenGL graphics environment defines that.
This is also more consistent with -fvk-use-dx-layout.
* [spirv] Add -fspv-target-env command line option.
The valid values for this option currently are:
vulkan1.0
vulkan1.1
If no target environment is specified, vulkan1.0 is used as default.
Added FeatureManager to record all extensions specified from
the command-line and emit error if trying to use one not permitted.
Added command-line option -fspv-extension= to specify
whitelisted extensions.
This commit uses the HlslCounterBufferGOOGLE decoration to link
the main RW/Append/Consume StructuredBuffer with its associated
counter buffer. It also uses HLSLSemanticGOOGLE to decorate
stage IO variables with their semantic strings from the source code.
In SPIR-V, if shifting a value by an amount that is greater than
the value's bitwidth, the result is undefined.
FXC and DXC/DXIL performs a bitwise and over the RHS of the shift
operation to only consider its (n - 1) least significant bits,
where n is the bitwidth of LHS.
This commit changes the behavior of how to handle externally-visiable
non-resource-type stand-alone variables. Previously they are emitted
as stand-alone SPIR-V variables. Now they are grouped into a cbuffer
that named as $Globals. This is more aligned with how DirectX handles
them.