mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Add explicit metal check for MS<->Array copies
* Two parts of this feature don't seem to work - MSAA Arrays and writeable MSAA textures. It's easier to disable it completely when running on Metal.
This commit is contained in:
@@ -708,6 +708,10 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps)
|
||||
m_Minor = VK_VERSION_MINOR(physProps.driverVersion);
|
||||
m_Patch = VK_VERSION_PATCH(physProps.driverVersion);
|
||||
|
||||
#if ENABLED(RDOC_APPLE)
|
||||
metalBackend = true;
|
||||
#endif
|
||||
|
||||
// nvidia uses its own version packing:
|
||||
// 10 | 8 | 8 | 6
|
||||
// major|minor|secondary_branch|tertiary_branch
|
||||
|
||||
@@ -189,6 +189,8 @@ public:
|
||||
uint32_t Patch() { return m_Patch; }
|
||||
VkDriverInfo(const VkPhysicalDeviceProperties &physProps);
|
||||
|
||||
// checks for when we're running on metal and some non-queryable things aren't supported
|
||||
bool RunningOnMetal() { return metalBackend; }
|
||||
// A workaround for a couple of bugs, removing texelFetch use from shaders.
|
||||
// It means broken functionality but at least no instant crashes
|
||||
bool TexelFetchBrokenDriver() { return texelFetchBrokenDriver; }
|
||||
@@ -211,6 +213,7 @@ private:
|
||||
|
||||
uint32_t m_Major, m_Minor, m_Patch;
|
||||
|
||||
bool metalBackend = false;
|
||||
bool texelFetchBrokenDriver = false;
|
||||
bool unreliableImgMemReqs = false;
|
||||
bool amdStorageMSAABrokenDriver = false;
|
||||
|
||||
@@ -33,8 +33,7 @@ enum class FeatureCheck
|
||||
NoCheck = 0x0,
|
||||
ShaderMSAAStorage = 0x1,
|
||||
FragmentStores = 0x2,
|
||||
// only unsupported on MoltenVK
|
||||
MSAAArrays = 0x4,
|
||||
NonMetalBackend = 0x4,
|
||||
};
|
||||
|
||||
BITMASK_OPERATORS(FeatureCheck);
|
||||
@@ -78,13 +77,13 @@ static const BuiltinShaderConfig builtinShaders[] = {
|
||||
{BuiltinShader::TrisizeFS, EmbeddedResource(glsl_trisize_frag), SPIRVShaderStage::Fragment,
|
||||
FeatureCheck::NoCheck, true},
|
||||
{BuiltinShader::MS2ArrayCS, EmbeddedResource(glsl_ms2array_comp), SPIRVShaderStage::Compute,
|
||||
FeatureCheck::ShaderMSAAStorage, true},
|
||||
FeatureCheck::ShaderMSAAStorage | FeatureCheck::NonMetalBackend, true},
|
||||
{BuiltinShader::Array2MSCS, EmbeddedResource(glsl_array2ms_comp), SPIRVShaderStage::Compute,
|
||||
FeatureCheck::ShaderMSAAStorage, true},
|
||||
FeatureCheck::ShaderMSAAStorage | FeatureCheck::NonMetalBackend, true},
|
||||
{BuiltinShader::DepthMS2ArrayFS, EmbeddedResource(glsl_depthms2arr_frag),
|
||||
SPIRVShaderStage::Fragment, FeatureCheck::MSAAArrays, true},
|
||||
SPIRVShaderStage::Fragment, FeatureCheck::NonMetalBackend, true},
|
||||
{BuiltinShader::DepthArray2MSFS, EmbeddedResource(glsl_deptharr2ms_frag),
|
||||
SPIRVShaderStage::Fragment, FeatureCheck::NoCheck, true},
|
||||
SPIRVShaderStage::Fragment, FeatureCheck::NonMetalBackend, true},
|
||||
};
|
||||
|
||||
RDCCOMPILE_ASSERT(ARRAY_COUNT(builtinShaders) == arraydim<BuiltinShader>(),
|
||||
@@ -154,10 +153,11 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
|
||||
continue;
|
||||
}
|
||||
|
||||
if(config.checks & FeatureCheck::MSAAArrays)
|
||||
if(config.checks & FeatureCheck::NonMetalBackend)
|
||||
{
|
||||
// for now we don't allow it at all - in future we could check on whether it's been enabled
|
||||
if(driver->GetExtensions(GetRecord(m_Device)).ext_MVK_moltenvk)
|
||||
// via a more advanced query
|
||||
if(driverVersion.RunningOnMetal())
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user