Commit Graph

9721 Commits

Author SHA1 Message Date
baldurk d2aee67afe Make it a bit easier to self-host capture on vulkan
* You need to register rdocself.json by hand but otherwise then the same
  workflow works as for other APIs.
2019-11-25 23:36:45 +00:00
baldurk 3fb132e9ff Fix copy-paste error removing wrong extension on vulkan init 2019-11-25 23:36:45 +00:00
baldurk 966d71e096 Explicitly reject BGRA order versions of formats we don't support on D3D 2019-11-25 23:36:44 +00:00
baldurk f35e082228 Keep track of VmaAllocation for each image/buffer and free it
* VMA requires us to free each suballocation even on shutdown where we just want
  to block-free
2019-11-25 23:36:44 +00:00
baldurk 316adb0eab Fix BGRA/RGBA order names for packed formats 2019-11-25 23:36:44 +00:00
baldurk 284996ae2c Check for errors on queue submissions 2019-11-25 23:36:44 +00:00
baldurk a4e152c999 Fix bit-packing output on vulkan 2019-11-25 23:36:44 +00:00
Benson Joeris 05b2afd164 Vulkan replay: omit zero size vkMapMemory calls.
The spec for `vkMapMemory` requires that `size` must be greater than 0.
However, `vkFlushMappedMemoryRanges` may include `VkMappedMemoryRange`s
with `size` equal to 0.

RenderDoc replays `vkFlushMappedMemoryRanges` by calling`vkMapMemory`,
copying the data, and then calling `vkUnmapMemory`. This can turn valid
`vkFlushMappedMemoryRanges` into invalid `vkMapMemory` calls.

This fix skips the `vkMapMemory` (and corresponding `vkUnmapMemory`
calls) for zero size ranges.

Change-Id: I08fd40f36f2c63e28f3df42bc799981b5eb35295
2019-11-25 23:36:32 +00:00
Steve Karolewics 9ff7b04f6f Move code to gather PSInput definitions to a separate function
The code to get initial values for PS debugging includes a step to
traverse the shader stage's inputs and previous stage's outputs, to
define a struct that is used in a replacement pixel shader to collect
the initial values. This logic is API-agnostic and can be moved to a
DXBC file to allow D3D12 to use it.
2019-11-25 09:54:08 +00:00
baldurk b222d6388c Don't flush bufinfo/resinfo opcodes
* The input miplevel is an integer even if the outputs are floats. The outputs
  won't be denormal as they're dimensions etc.
2019-11-22 15:08:16 +00:00
baldurk 9de4931213 Don't ever flush immediate values in shader debugging
* We assume that fxc won't output a denormalised float in the bytecode, and this
  prevents us from flushing integer inputs to otherwise flushable float-type
  operations
2019-11-22 14:59:18 +00:00
baldurk ce124cbc2e Add sensible defaults for depth-stencil state in vulkan helpers 2019-11-22 14:56:51 +00:00
baldurk 187b1a6e47 Add ability to pass macros to SPIR-V compilation in tests 2019-11-22 14:56:51 +00:00
baldurk 53569e56bb Allow AllocatedBuffer/AllocatedImage to be copied around in vulkan tests
* Instead of tracking their lifetime with that object, we move the lifetime
  tracking into the parent VulkanGraphicsTest and destroy them all at the end. A
  single handle can optionally be free'd on its own.
2019-11-22 14:56:51 +00:00
baldurk f42cb9e23c Use shader bindpoint mapping when generating HLSL shader editing stubs 2019-11-21 21:25:40 +00:00
baldurk 99e13a72f2 Improve logging around frame capturers
* This can be useful for users of the in-application API to identify what frame
  capturers are available (in case they're passing the wrong handles)
2019-11-21 21:25:40 +00:00
baldurk 4243ab8fbe Fix stencil array copies in D3D12 CopyArrayToTex2DMS 2019-11-21 21:25:39 +00:00
baldurk 592d2edff1 When saving typeless textures to DDS, use typeCast to inform type used 2019-11-21 21:25:39 +00:00
baldurk 64c9b93e27 Make sure that the DSV flag is set when fetching MSAA texture data 2019-11-21 21:25:39 +00:00
baldurk 39b6f8eb02 Fix D3D MSAA<->Array conversion for D16, interpret as UNORM not as FLOAT 2019-11-21 17:09:01 +00:00
baldurk 1c062c1eda When a capture is loaded in the API inspector, populate the events 2019-11-21 17:09:01 +00:00
baldurk 4458ab3205 Remove assumptions that captures are always frames
* Previously we had "Frame X" and "Start of Frame" hardcoded in the event
  browser, and the end of frame was in many cases assumed to be a present call.
  However with the in-application API this is not necessarily true.
* Presents are now serialised separately in all APIs and displayed wherever they
  happen in the frame, and if there is no present at the end of the frame an
  "End of Capture" marker is inserted. Similarly API-defined captures are not
  given a potentially misleading frame number.
2019-11-21 17:09:01 +00:00
baldurk cb216441fe Ensure we prepare initial states for late-created programs. Closes #1606
* The initial states for GL programs contain a uniform mapping table, which is
  required for correct replay. We already do this in glLinkProgram we were just
  missing the call in glCreateShaderProgramv.
2019-11-21 17:09:00 +00:00
Benson Joeris 3b48de6b2d Vulkan: Don't split depth/stencil aspects when initializing images
For images with both depth and stencil aspects, `VkImageMemoryBarrier`s
must include both depth and stencil aspects--e.g. you cannot transition
the layout of the depth alone. This can be violated by the barriers in
RenderDoc replay that transition image layouts before and after
initialization. This change ensures that, if depth or stencil needs to
be initialized, then beth will be initialized, and the image layout
transition will be applied to the two aspects together.

Specifically, `ImgRefs` stores a separate FrameRefType for each aspect.
This can cause the depth and stencil aspects to have different reset
requirements, which can cause a barrier to contain only one of the
depth/stencil aspects.

Change-Id: I8a16a0c450bd8e6cb0d60c1d688b01b75df86915
2019-11-21 15:47:23 +00:00
Benson Joeris d236e3e06c Vulkan: Fix layouts for image contents initialization.
Apply_InitialState transitions the image layouts to TRANSFER_DST_OPTIMAL
before copying/filling the image initial contents. However, the
`oldLayout` for these transitions was set incorrectly--in particular,
before the first replay, the image is in the UNDEFINED layout, but is
transitioned from whatever layout it is in at the end of the capture.
In fact, it is safe to always set the `oldLayout` to UNDEFINED, since
these barriers immediately precede a write.

This change introduced some additional assymetry between the barriers
before/after the write, which required `ImageInitializationBarriers` to
produce both sets of barriers (before/after write), rather than just
reversing the barriers.

Change-Id: Ica6fdaafb2442192691f9ed853cfce094bf2da4f
2019-11-21 15:47:23 +00:00
baldurk 7440497029 Invert tracking of texture views/texture buffers on GL
* Instead of the buffer/source texture tracking all the views of itself and
  checking to see if it should be force-included because any of its views were
  included, we instead track the underlying resource for each view or buffer
  texture.
* This means if e.g. a view or buffer texture gets dirtied, we can propagate
  that through to the underlying data store which needs to get dirtied so that
  we can fetch its initial states.
2019-11-20 22:58:08 +00:00
baldurk e353fd1a00 Fix WARP use on D3D12 2019-11-20 22:58:08 +00:00
Zonglin Wu 98f91fcc0e Fix missing assignment of hr in Serialise_CreateCommittedResource1 2019-11-20 22:57:57 +00:00
baldurk aa7c2170b9 Add D3D12 test command line parameter to enable GPUVA 2019-11-20 18:53:00 +00:00
baldurk ff309d8c54 Add helpers for setting markers on D3D12 2019-11-20 18:53:00 +00:00
baldurk 1cd0f0b5e2 Add helpful check for making repro cases 2019-11-20 18:53:00 +00:00
baldurk dedd3e83fa Fix '--gpu warp' specifier in tests 2019-11-20 18:53:00 +00:00
baldurk bda6066737 Allow specifying rasterized stream for creating geom shaders 2019-11-20 18:53:00 +00:00
baldurk 9f12e5d01e Fix wrong IDs being used for src and dest in glCopyImageSubData 2019-11-20 18:53:00 +00:00
baldurk a430f9d42e Account for format-based checks when displaying casted typeless textures 2019-11-20 18:53:00 +00:00
baldurk 861e7d8b67 Fix missing cases for typecasting SRGB in DXGI GetTypedFormat 2019-11-20 18:53:00 +00:00
baldurk 37deb472ea Ensure WRAP_R is set to CLAMP_TO_EDGE when sampling textures in GL 2019-11-20 18:37:44 +00:00
baldurk 66aaf6dc13 Set component count properly for block-compressed formats on GL 2019-11-20 18:37:43 +00:00
baldurk 07dc55c39d Handle depth formats better in DDS loading 2019-11-20 18:37:43 +00:00
baldurk 111ca43800 Fix handling of sub-8bit packed formats in DDS 2019-11-20 18:37:43 +00:00
baldurk acfc226780 Fix support for GL_S[R|RG]8_EXT formats 2019-11-20 18:37:43 +00:00
baldurk d0c27b352f When forcing RaytracingTier to unsupported, fetch the rest of the struct 2019-11-20 18:37:43 +00:00
Steve Karolewics 5179c99f7d Add impl for creating a D3D12 global state for shader debugging. 2019-11-20 16:35:14 +00:00
baldurk 0867435a7e Whitelist some GL/GLES extensions that are already supported. 2019-11-19 23:20:56 +00:00
baldurk 94655e3b17 Disable NV D32S8 vendorcheck workaround 2019-11-19 23:20:56 +00:00
baldurk 5ea8d7b3d8 Add possible cause of JDWP failures - bad intent arguments 2019-11-19 23:20:56 +00:00
baldurk dd89430895 Fail sooner if package fails to start completely
* This may be due to bad intent args
2019-11-19 23:20:56 +00:00
baldurk 13f796a0ef Add an error if intent arguments aren't formatted correctly. 2019-11-19 23:20:55 +00:00
baldurk e61990a48c Set reflection information in bytecode 2019-11-19 23:20:55 +00:00
baldurk ba8186559d Don't allow resource records to become their own parents 2019-11-19 23:20:55 +00:00