mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-10 06:11:36 +00:00
Cache vulkan version-detecting information at device create time
This commit is contained in:
6 files changed
+14
-9
No files matched your search
@@ -331,12 +331,12 @@ private:
|
||||
|
||||
struct PhysicalDeviceData
|
||||
{
|
||||
PhysicalDeviceData() : readbackMemIndex(0), uploadMemIndex(0), GPULocalMemIndex(0)
|
||||
PhysicalDeviceData()
|
||||
: readbackMemIndex(0), uploadMemIndex(0), GPULocalMemIndex(0), props(), driverInfo(props)
|
||||
{
|
||||
fakeMemProps = NULL;
|
||||
memIdxMap = NULL;
|
||||
RDCEraseEl(features);
|
||||
RDCEraseEl(props);
|
||||
RDCEraseEl(memProps);
|
||||
RDCEraseEl(fmtprops);
|
||||
RDCEraseEl(queueProps);
|
||||
@@ -356,6 +356,7 @@ private:
|
||||
VkPhysicalDeviceMemoryProperties *fakeMemProps;
|
||||
uint32_t *memIdxMap;
|
||||
|
||||
VkDriverInfo driverInfo;
|
||||
VkPhysicalDeviceFeatures features;
|
||||
VkPhysicalDeviceProperties props;
|
||||
VkPhysicalDeviceMemoryProperties memProps;
|
||||
@@ -968,7 +969,7 @@ public:
|
||||
|
||||
const VkPhysicalDeviceFeatures &GetDeviceFeatures() { return m_PhysicalDeviceData.features; }
|
||||
const VkPhysicalDeviceProperties &GetDeviceProps() { return m_PhysicalDeviceData.props; }
|
||||
VkDriverInfo GetDriverVersion() { return VkDriverInfo(m_PhysicalDeviceData.props); }
|
||||
VkDriverInfo GetDriverInfo() { return m_PhysicalDeviceData.driverInfo; }
|
||||
// Device initialization
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(VkResult, vkCreateInstance, const VkInstanceCreateInfo *pCreateInfo,
|
||||
|
||||
@@ -1432,7 +1432,7 @@ void VulkanReplay::CreateResources()
|
||||
|
||||
AMDCounters *counters = NULL;
|
||||
|
||||
GPUVendor vendor = m_pDriver->GetDriverVersion().Vendor();
|
||||
GPUVendor vendor = m_pDriver->GetDriverInfo().Vendor();
|
||||
|
||||
if(vendor == GPUVendor::AMD)
|
||||
{
|
||||
@@ -2354,7 +2354,7 @@ void VulkanReplay::HistogramMinMax::Init(WrappedVulkan *driver, VkDescriptorPool
|
||||
|
||||
std::string defines = "";
|
||||
|
||||
if(driver->GetDriverVersion().TexelFetchBrokenDriver())
|
||||
if(driver->GetDriverInfo().TexelFetchBrokenDriver())
|
||||
defines += "#define NO_TEXEL_FETCH\n";
|
||||
defines += string("#define SHADER_RESTYPE ") + ToStr(t) + "\n";
|
||||
defines += string("#define UINT_TEX ") + (f == 1 ? "1" : "0") + "\n";
|
||||
|
||||
@@ -555,7 +555,7 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
|
||||
|
||||
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
|
||||
|
||||
if(m_pDriver->GetDriverVersion().QualcommLeakingUBOOffsets())
|
||||
if(m_pDriver->GetDriverInfo().QualcommLeakingUBOOffsets())
|
||||
{
|
||||
offsets[0] = offsets[1] = 0;
|
||||
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
|
||||
@@ -627,7 +627,7 @@ void VulkanReplay::RenderCheckerboard()
|
||||
|
||||
vt->CmdDraw(Unwrap(cmd), 4, 1, 0, 0);
|
||||
|
||||
if(m_pDriver->GetDriverVersion().QualcommLeakingUBOOffsets())
|
||||
if(m_pDriver->GetDriverInfo().QualcommLeakingUBOOffsets())
|
||||
{
|
||||
uboOffs = 0;
|
||||
vt->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
|
||||
@@ -128,7 +128,7 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
|
||||
|
||||
SetCaching(true);
|
||||
|
||||
VkDriverInfo driverVersion = driver->GetDriverVersion();
|
||||
VkDriverInfo driverVersion = driver->GetDriverInfo();
|
||||
const VkPhysicalDeviceFeatures &features = driver->GetDeviceFeatures();
|
||||
|
||||
std::vector<std::string> sources;
|
||||
|
||||
@@ -1867,6 +1867,8 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
|
||||
ObjDisp(physicalDevice)
|
||||
->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.features);
|
||||
|
||||
m_PhysicalDeviceData.driverInfo = VkDriverInfo(m_PhysicalDeviceData.props);
|
||||
|
||||
m_Replay.SetDriverInformation(m_PhysicalDeviceData.props);
|
||||
|
||||
// MoltenVK reports 0x3fffffff for this limit so just ignore that value if it comes up
|
||||
@@ -1899,7 +1901,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
|
||||
}
|
||||
}
|
||||
|
||||
APIProps.vendor = GetDriverVersion().Vendor();
|
||||
APIProps.vendor = GetDriverInfo().Vendor();
|
||||
|
||||
m_ShaderCache = new VulkanShaderCache(this);
|
||||
|
||||
@@ -2244,6 +2246,8 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice,
|
||||
ObjDisp(physicalDevice)
|
||||
->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.features);
|
||||
|
||||
m_PhysicalDeviceData.driverInfo = VkDriverInfo(m_PhysicalDeviceData.props);
|
||||
|
||||
for(int i = VK_FORMAT_BEGIN_RANGE + 1; i < VK_FORMAT_END_RANGE; i++)
|
||||
ObjDisp(physicalDevice)
|
||||
->GetPhysicalDeviceFormatProperties(Unwrap(physicalDevice), VkFormat(i),
|
||||
|
||||
Reference in new issue
Block a user