* 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.
* 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.
* 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.
* 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.
* 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.
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
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.
* 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
* 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.
* 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.
* 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.
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
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
* 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.