Commit Graph
10393 Commits
Author SHA1 Message Date
baldurk ab74df54ca Use typecast provided at proxy texture creation time on D3D
* When we create proxy textures on D3D we create them as typeless, but this
  means we might lose the only time we are told about the type interpretation of
  the texture. If we then later get asked to view the texture as typeless, be
  sure to use that type info to interpret it, instead of defaulting to UNORM or
  FLOAT.
2019-11-26 17:38:26 +00:00
baldurk 186ca30045 Treat binding viewcasts are always definitive
* On APIs like vulkan the view casting happens from an already typed format, so
  don't assume that casts are only applied when the underlying format is
  typeless. When a cast is not valid the view format should never be different
  from the underlying image format as the API should never make it possible to
  validly create or bind a view with a different format.
2019-11-26 17:38:26 +00:00
baldurk edc8fb6bd6 Be more precise with texture remapping to handle integer textures 2019-11-26 17:38:26 +00:00
baldurk 45144ed478 Don't rely on proxy renderer for texture description in image viewer 2019-11-26 17:38:26 +00:00
baldurk f6d7e2c6e4 If a typed DXGI format isn't available, consider texture unsupported 2019-11-26 17:38:26 +00:00
baldurk 19847c4574 GL doesn't support block-compressed 3D textures 2019-11-26 17:38:26 +00:00
baldurk ba8d16ea1c Add y-flipping for GL in image viewer
* Conventionally images have an origin at the top left, opposite to GL, so we
  want to flip the same as the replay proxy using GL as a proxy renderer for a
  non-GL API.
2019-11-26 17:38:26 +00:00
baldurk bcc34fab0a All types of D24S8 textures should be swizzled on GL, not just MSAA 2019-11-26 17:38:26 +00:00
baldurk 44b2247151 Support creating typeless proxy textures in GL. Closes #1516
* Since GL requires a concrete texture format, we create the textures as UINT
  format, and then cast to the right view on display once we know.
* The cast requires a copy - ARB_texture_view isn't always supported and even
  when they are they require immutable textures (ARB_texture_storage) which we
  don't want to require either.
2019-11-26 17:38:26 +00:00
baldurk db563bb0bf Refactor public interface around handling of textures
* Subresource handling is more consistent - we pass around a struct now that
  contains the array slice, mip level, and sample. We remove the concept of
  'MSAA textures count samples as extra slices within the real slices' and
  internalise that completely. This also means we have a consistent set
  everywhere that we need to refer to a subresource.
* Functions that used to be in the ReplayOutput and use a couple of implicit
  parameters from the texture viewer configuration are now in the
  ReplayController and take them explicitly. This includes GetMinMax,
  GetHistogram, and PickPixel.
* Since these functions aren't ReplayOutput relative, if you want to decode the
  custom shader texture or the overlay texture you need to pass that ID
  directly.
2019-11-26 17:38:25 +00:00
baldurk 01344c7e83 Rename typeHint to typeCast 2019-11-26 17:38:25 +00:00
baldurk e6627542cf Don't enumerate available GPUs when running in renderdoccmd 2019-11-26 17:38:25 +00:00
baldurk 9b4a1c900f Unbind pixel packing buffers when uploading texture data. Closes #1614 2019-11-26 10:39:59 +00:00
baldurk d9a18aae63 Unbind pixel packing buffers when creating textures. Refs #1614 2019-11-26 10:36:04 +00:00
baldurk d469498c95 Ignore proxy targets when calling GetActiveTexRecord() 2019-11-26 10:35:27 +00:00
baldurk b861598d97 Add case for DXGI_FORMAT_B8G8R8A8_TYPELESS 2019-11-26 00:41:15 +00:00
Rémi PalandriandBaldur Karlsson 9da79fc778 add support for serialising invalidate framebuffer calls in GL 2019-11-25 23:39:31 +00:00
baldurk 03d064beb0 Tighten up handling of unsupported DXGI formats in DDS read/write 2019-11-25 23:36:45 +00:00
baldurk 9be59bd02e Ensure all resource formats have somewhat sensible parameters
* This is needed even for 'special' resource formats, as they may need e.g. the
  component type correctly specified.
2019-11-25 23:36:45 +00:00
baldurk c547937597 Add helpers for tests checking PCI vendorIDs/driver versions 2019-11-25 23:36:45 +00:00
baldurk b72283e38d Use EXT_debug_utils for internal markers and support queue-level markers
# Conflicts:
#	renderdoc/driver/vulkan/vk_replay.cpp
2019-11-25 23:36:45 +00:00
baldurk 001bc81eb7 Don't refer to renderdoc UI program as QRenderDoc in user-facing strings 2019-11-25 23:36:45 +00:00
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 JoerisandBaldur Karlsson 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 KarolewicsandBaldur Karlsson 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 JoerisandBaldur Karlsson 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 JoerisandBaldur Karlsson 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 WuandBaldur Karlsson 98f91fcc0e Fix missing assignment of hr in Serialise_CreateCommittedResource1 2019-11-20 22:57:57 +00:00