mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add workaround for Qualcomm chips where uniform buffer offsets 'leak'
* There's weird behaviour seen where after binding a descriptor set with an offset, subsequent work in other command buffers doesn't behave correctly. Re-binding the descriptor set with a 0 offset seems to fix it, so I assume the offset is leaking and applying to subsequent binds that don't have any dynamic offsets.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
const uint32_t AMD_PCI_ID = 0x1002;
|
||||
const uint32_t NV_PCI_ID = 0x10DE;
|
||||
const uint32_t QUALCOMM_PCI_ID = 0x5143;
|
||||
|
||||
// utility struct for firing one-shot command buffers to begin/end markers
|
||||
struct ScopedCommandBuffer
|
||||
|
||||
@@ -132,12 +132,14 @@ extern const char *VulkanLibraryName;
|
||||
|
||||
extern const uint32_t AMD_PCI_ID;
|
||||
extern const uint32_t NV_PCI_ID;
|
||||
extern const uint32_t QUALCOMM_PCI_ID;
|
||||
|
||||
class VkDriverInfo
|
||||
{
|
||||
public:
|
||||
bool IsAMD() { return m_Vendor == AMD; }
|
||||
bool IsNV() { return m_Vendor == NV; }
|
||||
bool IsQualcomm() { return m_Vendor == QUALCOMM; }
|
||||
uint32_t Major() { return m_Major; }
|
||||
uint32_t Minor() { return m_Minor; }
|
||||
uint32_t Patch() { return m_Patch; }
|
||||
@@ -147,6 +149,8 @@ public:
|
||||
m_Vendor = AMD;
|
||||
else if(physProps.vendorID == NV_PCI_ID)
|
||||
m_Vendor = NV;
|
||||
else if(physProps.vendorID == QUALCOMM_PCI_ID)
|
||||
m_Vendor = QUALCOMM;
|
||||
else
|
||||
m_Vendor = UNKNOWN;
|
||||
|
||||
@@ -174,6 +178,7 @@ private:
|
||||
{
|
||||
AMD,
|
||||
NV,
|
||||
QUALCOMM,
|
||||
UNKNOWN,
|
||||
} m_Vendor;
|
||||
|
||||
|
||||
@@ -1502,6 +1502,15 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
|
||||
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
|
||||
|
||||
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
|
||||
|
||||
if(m_pDriver->GetDriverVersion().IsQualcomm())
|
||||
{
|
||||
uboOffs = 0;
|
||||
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
Unwrap(GetDebugManager()->m_TexDisplayPipeLayout), 0, 1,
|
||||
UnwrapPtr(descset), 1, &uboOffs);
|
||||
}
|
||||
|
||||
vt->CmdEndRenderPass(Unwrap(cmd));
|
||||
}
|
||||
|
||||
@@ -1646,6 +1655,14 @@ void VulkanReplay::RenderCheckerboard()
|
||||
vt->CmdSetViewport(Unwrap(cmd), 0, 1, &viewport);
|
||||
|
||||
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
|
||||
|
||||
if(m_pDriver->GetDriverVersion().IsQualcomm())
|
||||
{
|
||||
uboOffs = 0;
|
||||
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
Unwrap(GetDebugManager()->m_CheckerboardPipeLayout), 0, 1,
|
||||
UnwrapPtr(GetDebugManager()->m_CheckerboardDescSet), 1, &uboOffs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user