Commit Graph
467 Commits
Author SHA1 Message Date
baldurk 0dcedbbbcf Fix warnings on various GCC versions
* Primarily this change fixes -Wdeprecated-copy on GCC-9, but it also tidies
  warnings on other versions.
2019-06-27 11:47:45 +01:00
baldurk 6487acdf0f Fail to capture if Create*PipelineState has no valid shader code
* 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.
2019-06-27 10:22:13 +01:00
baldurk 88a5b4e0cf Add precise qualifiers on DXBC operations disassembly 2019-06-26 10:27:10 +01:00
baldurk f09c40b8c9 Fix broken cases with GL_ARB_gl_spirv. Closes #1405
* 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.
2019-06-07 18:53:02 +01:00
baldurk 48d854365d Move AddXFBAnnotations into common SPIR-V code so it can be shared 2019-06-07 18:45:57 +01:00
baldurk 9c8018ba18 Fix linux build 2019-06-03 15:32:17 +01:00
baldurk 1fd75c50f8 Disallow implicit casts to/from SPIR-V Id
* This can lead to bugs, so instead we should be explicit about what is an ID
  and what is a uint
2019-06-03 14:16:43 +01:00
baldurk d4e7a0633c Move SPIRVId/SPIRVIterator/SPIRVOperation to common header
* We also add an rdcspv namespace, which we'll be generating our own enums etc
  to replace the spirv.hpp spv namespace.
2019-06-03 14:16:43 +01:00
baldurk a27234c28c Split apart some of the SPIR-V headers
* 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.
2019-06-03 14:16:42 +01:00
baldurk 5368709111 Fix handling of matrix outputs in Vulkan GS/Tess mesh output 2019-05-24 17:12:54 +01:00
baldurk 807345fd0f Add auto-detection for dxc as a shader processing tool 2019-05-22 14:16:02 +01:00
baldurk 420379c50f Update glslang to c11e3156 (release 7.11.3214) 2019-05-20 12:40:56 +01:00
baldurk 7206a0cd25 Removing 'use std::vector' 2019-05-17 16:32:56 +01:00
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk a965a3a703 Remove 'using std::string'
* This will make it easier to replace std::string with rdcstr in future
2019-05-17 16:32:56 +01:00
baldurk 699f8753af Convert ToStr, Serialise, and TypeName to use literal strings 2019-05-15 14:12:17 +01:00
baldurk fb333ebc9b Remove 'using std::map'
* This will make it easier to replace std::map in future
2019-05-15 14:12:17 +01:00
baldurk 2498f7f0fd Fix fetching array outputs from vertex shaders
* This broke when fixing array outputs from tessellation/geometry shaders!
2019-04-26 15:33:24 +01:00
baldurk 8ffe33767c Handle UNormSRGB in some places that were missing handling 2019-04-23 16:31:18 +01:00
baldurk 615bb9ecad Remove all elements in the signature array that match not just the first
* For gl_ClipDistance etc there could be many entries with the same builtin
2019-04-12 16:51:22 +01:00
baldurk 7e33e1380b Don't try to patch output signature elements that are exploded arrays
* We only want to patch it once, for the original array.
2019-04-12 16:50:56 +01:00
baldurk e2a7ef3ceb Fix a couple of gcc 8 fall-through warnings 2019-04-12 10:46:39 +01:00
baldurk 76ebef4b50 Improve disassembly & reflection of spec constant op based array sizes 2019-04-09 14:35:30 +01:00
baldurk 7f56704a92 Feedback dynamic shader access to arrayed descriptors
* 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.
2019-04-05 09:19:22 +01:00
baldurk 32179d683d Fix idOffsets values when adding OpNops for empty SPIR-V sections 2019-04-05 09:19:22 +01:00
baldurk bd615a04da Update SPIR-V stringise for latest SPIR-V headers 2019-03-29 17:48:15 +00:00
Wade BrainerdandBaldur Karlsson cc0069e72f Fix Vulkan mesh output for tessellated quads
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.
2019-03-27 04:31:34 -07:00
baldurk fed3d0d710 Fix wrong flag set for reflecting UAV resources 2019-03-25 17:48:52 +00:00
Aliya Pazylbekovaandbaldurk fe36fb8945 Add space separator for list of extensions 2019-03-20 05:31:43 +00:00
baldurk c1408df4cd Remove wstring variants of string utils functions
* 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.
2019-03-13 14:21:28 +00:00
baldurk b14e3f2ef9 Fix valgrind issues found running unit tests
* 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
2019-02-19 17:54:53 +00:00
baldurk d1e0d7f88f Fix segfault if allocatedPrograms vector is deleted before shutdown 2019-02-18 20:43:00 +00:00
baldurk 3aa64e2e8e Completely emulate ARB_program_interface_query using glslang
* We already did this partially, enough for capturing, but now we also do it on
  replay.
2019-02-18 17:23:20 +00:00
baldurk 2ea6174c83 Update glslang to latest tip-of-tree
* This is glslang from commit 9f538c7207b87bd4219a8a9cc95e3c43798793b7
2019-02-18 17:23:20 +00:00
baldurk ac357a8dec Fix handling of saturate on NaNs in DXBC.
* 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.
2019-02-07 15:23:07 +00:00
baldurk fbb6b23b23 Support advanced cbuffer layouts
* This includes 8/16/64-bit integers, 16-bit/64-bit floats, and scalar block
  packing
2019-02-07 15:23:06 +00:00
baldurk e79b2d16b2 Tidy up FillCBufferVariables across APIs and share implementations
* 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.
2019-02-07 15:23:06 +00:00
baldurk 6bc6ca9557 Drop legacy ShaderRegister struct, store byte offset per constant
* 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.
2019-02-07 15:23:06 +00:00
baldurk 351c75e006 Fix some cases handling arrays of matrices
* 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.
2019-02-07 15:23:05 +00:00
baldurk 9e0e87b0a0 Update SPIR-V tools list, treat shaderc the same as glslang 2019-02-06 23:44:51 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 542f664645 Fix missing register swizzles on relative addressing lookups 2019-01-28 19:55:40 +00:00
Alex SmithandBaldur Karlsson 5444c4b3ab Treat Op(Member)DecorateStringGOOGLE as part of the annotation section
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.
2018-12-29 14:00:34 +00:00
Alex SmithandBaldur Karlsson 9db805a1cd Add OpName before OpModuleProcessed
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.
2018-12-29 14:00:34 +00:00
baldurk b006ea81a6 Handle all logical sections in SPIRVEditor 2018-12-21 12:38:29 +00:00
baldurk 2af0c8c9f8 Automatically strip nops when destroying SPIRVEditor 2018-12-21 12:38:29 +00:00
baldurk b33e5e018a Add tracking of which extensions are in the module 2018-12-21 12:38:28 +00:00
baldurk ef3aef17ff Add missing header on linux to fix compilation 2018-12-17 18:03:54 +00:00
baldurk 5f96644d08 Add support for global uniforms in SPIR-V and non-bound textures.
* 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.
2018-12-17 17:10:35 +00:00
baldurk 006bf38e79 Disable BufferSecurityCheck option on renderdoc libraries 2018-12-12 23:53:35 +00:00