* This typically means that the user hasn't checked correctly for SM6 feature
support before trying to upload DXIL shader, which will then result in
unpredictable behaviour or crashes on replay.
* During capture we detect this and flag it in the overlay text, and prevent
capturing. On capture load we fail to load if we detect such a PSO.
* We can't rely on the driver's reflection, since name information might be
stripped and the driver is within its rights to not reflect anything even if
we have names. Similarly queries by names etc will not work.
* Also we can't try to change bindings that are immutable on SPIR-V shaders -
UBO/SSBO bindings, transform feedback varyings, attrib and fragdata locations.
* Programs can't mix and match SPIR-V and GLSL, so when including our own
shaders in the overlay program make sure they match what the user's shaders
are.
* For mesh output, we need to patch the SPIR-V if it's a SPIR-V shader instead
of trying to use the GL XFB varyings set.
* We don't want to have glslang specific bits mixed in with general SPIR-V bits.
This is also preparing for moving some SPIR-V structs into common code that
can be re-used in new reflection/disassembly as well as editing.
* We use VK_EXT_buffer_device_address where possible to reduce code complexity &
increase compatibility, but when not available we reserve a buffer within the
existing bindings.
* Only array descriptors have the feedback run. Non-array descriptors can still
be dynamically used/unused but it's expected that there is less pressure to
trim the list as this would only account for flow control and there is value
in showing bindings that may be dynamically unused. For arrays the size might
potentially be extremely large (with 'bindless' type arrays) so reducing it
only to the set of used items is important.
When selecting a draw with a tessellation evaluation shader using
layout(quads), RenderDoc would emit an "Unexpected output topology"
error.
Additional changes:
* Fixes a typo in the VK_EXT_transform_feedback name in various debug
prints.
* Renames the "GS Out" 3D View tab in the Mesh Viewer to "GS/DS Out",
to match the corresponding table. This affects all APIs.
* When needed on windows we convert to/from UTF-8. For most places this is easy
enough, the callstack processing is now moved to store most data as UTF-8 in
the first place.
* GLContextTLSData default constructor should be initialised.
* Add some missing deletes in shader reflection
* Call freeaddrinfo after getaddrinfo
* Don't leak if we're reserving 0 bytes in rdcstr over the top of an already
empty rdcstr
* The definition is specifically using chained min/max which return the other
argument if one is NaN, so a NaN being saturated is guaranteed to return 0.
* On D3D the implementation was severely complicated by two parallel paths - one
that 'flattened' vec4s out into easy-to-consume format for debugging. Instead
we do this as a post-process transformation now in the debugging itself.
* Similarly D3D's implementation used DXBC data directly to fetch data, when all
of the information needed is in the ShaderConstant arrays and used by Vulkan.
This allows us to share the implementation.
* Only GL still needs its own implementation since it needs to query the API for
offsets etc as it can change unreliably and can't easily produce a standard
reflection data. We do share the 'read from buffer data' implementation
though.
* For D3D11 byte offsets are always uint32 aligned, but for other APIs that's
not guaranteed. Storing a byte offset is strictly more expressive and a lot
simpler to reason about.
* We also pick the output pixel in the CBuffer_Zoo tests to ensure the API
agrees with our interpretation of the data.
* Follow-up commit will tidy D3D cbuffer code that needs it.
Fixes a crash in the driver on RADV when compiling the PostVS shader
for a shader that has these opcodes. The incorrect section boundaries
was causing BuiltIn decorations to not be stripped.
The SPIR-V spec requires OpName comes before any OpModuleProcessed.
Fixes a SPIR-V validation error on the generated PostVS shader if the
original shader has any OpModuleProcessed.
* This isn't relevant for Vulkan, but in GL it's valid to not specify a binding
and fetch it at runtime (and even if a binding is specified, it's not
immutable and can be changed).
* Similarly GL allows bare uniforms that aren't in a buffer, which we handle in
the same way by wrapping them into a $Globals UBO.