Scratch buffers are 1 MiB blocks which will end
up being suballocated. This was not intended and a fallout from the
earlier change where VA_SIZE was bumped to 2 MiB for Elden Ring.
Introduce a memory allocation flag INTERNAL_SCRATCH which disables
suballocation and VA map insert.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For internal debug shaders, it is helpful to ensure in-order logs when
sorted for later inspection.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Separate scratch pools by their intended usage. Allows e.g. preprocess buffers to be
allocated differently from normal buffers. Potentially can also allow
for separate pools for host visible scratch memory etc down the line.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
The D3D12 docs outline this as an implementation detail explicitly, so
we should do the same thing.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For certain ExecuteIndirect() uses, we're forced to use this path
since we have no way to update push descriptors indirectly yet.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
The runtime is specified to validate certain things.
Also, be more robust against unsupported command signatures, since we
might need to draw/dispatch at an offset. Avoids hard GPU crashes.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Gets better codegen, since compiler no longer has to assume
that negative indices can be generated, which means full 64-bit sign
extension and addressing math (slow).
Based on experiments, no native driver lets -1 indices work,
so it's safe to make the u32 assumption.
See test_root_descriptor_offset_sign as a justification for this change.
Also, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6562
for discussion on InBounds.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For now, just keep the NV path as well. It's the exact same extension
basically as the KHR one.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
If we don't get a swapchain on first frame for whatever reason, defer
creating the descriptors.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
If we fail to present after a swapchain recreation, force a SURFACE_LOST
scenario and try again later when things hopefully stabilize.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
It just called create_vulkan_swapchain anyways.
Also, add in extra parameter to support temporary user buffer fallbacks.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Refactor destroy_buffers to destroy_resources as it's more obvious what
it's doing that way.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Some dynamic state is at risk of being spammed with same arguments many
times. For the dynamic state that is trivial to check, do so.
Ghostwire: Tokyo has been observed to spam the same OMSetStencilRef
value causing some context rolls, also RSSetShadingRate has been set
redundantly.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes validation error on Intel where we are trying to create
CONCURRENT family with {0, -1}.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>