Fixed issue with MSAA textures on Oculus Quest.

This commit is contained in:
Dominic Filion Guay
2019-09-12 14:29:14 -07:00
committed by baldurk
parent af97e50b3a
commit 57c60cdfb8
5 changed files with 19 additions and 10 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0) uniform PRECISION usampler2DArray srcArray;
// binding = 1 used as stencil read in the depth-stencil copy fragment shaders
layout(rgba32ui, binding = 2) writeonly uniform PRECISION uimage2DMSArray dstMS;
layout(binding = 2) writeonly uniform PRECISION uimage2DMSArray dstMS;
#ifdef VULKAN
+1 -1
View File
@@ -35,7 +35,7 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0) uniform PRECISION usampler2DMSArray srcMS;
// binding = 1 used as stencil read in the depth-stencil copy fragment shaders
layout(rgba32ui, binding = 2) writeonly uniform PRECISION uimage2DArray dstArray;
layout(binding = 2) writeonly uniform PRECISION uimage2DArray dstArray;
#ifdef VULKAN
@@ -32,8 +32,7 @@
void VulkanDebugManager::CopyTex2DMSToArray(VkImage destArray, VkImage srcMS, VkExtent3D extent,
uint32_t layers, uint32_t samples, VkFormat fmt)
{
if(!m_pDriver->GetDeviceFeatures().shaderStorageImageMultisample ||
!m_pDriver->GetDeviceFeatures().shaderStorageImageWriteWithoutFormat)
if(!m_pDriver->GetDeviceFeatures().shaderStorageImageWriteWithoutFormat)
return;
if(m_MS2ArrayPipe == VK_NULL_HANDLE)
+13 -3
View File
@@ -33,6 +33,7 @@ enum class FeatureCheck
ShaderMSAAStorage = 0x1,
FragmentStores = 0x2,
NonMetalBackend = 0x4,
FormatlessWrite = 0x8,
};
BITMASK_OPERATORS(FeatureCheck);
@@ -76,9 +77,10 @@ static const BuiltinShaderConfig builtinShaders[] = {
{BuiltinShader::TrisizeFS, EmbeddedResource(glsl_trisize_frag), rdcspv::ShaderStage::Fragment,
FeatureCheck::NoCheck, true},
{BuiltinShader::MS2ArrayCS, EmbeddedResource(glsl_ms2array_comp), rdcspv::ShaderStage::Compute,
FeatureCheck::ShaderMSAAStorage | FeatureCheck::NonMetalBackend, true},
FeatureCheck::FormatlessWrite | FeatureCheck::NonMetalBackend, true},
{BuiltinShader::Array2MSCS, EmbeddedResource(glsl_array2ms_comp), rdcspv::ShaderStage::Compute,
FeatureCheck::ShaderMSAAStorage | FeatureCheck::NonMetalBackend, true},
FeatureCheck::ShaderMSAAStorage | FeatureCheck::FormatlessWrite | FeatureCheck::NonMetalBackend,
true},
{BuiltinShader::DepthMS2ArrayFS, EmbeddedResource(glsl_depthms2arr_frag),
rdcspv::ShaderStage::Fragment, FeatureCheck::NonMetalBackend, true},
{BuiltinShader::DepthArray2MSFS, EmbeddedResource(glsl_deptharr2ms_frag),
@@ -146,7 +148,15 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver)
if(config.checks & FeatureCheck::ShaderMSAAStorage)
{
if(driverVersion.TexelFetchBrokenDriver() || driverVersion.AMDStorageMSAABrokenDriver() ||
!features.shaderStorageImageMultisample || !features.shaderStorageImageWriteWithoutFormat)
!features.shaderStorageImageMultisample)
{
continue;
}
}
if(config.checks & FeatureCheck::FormatlessWrite)
{
if(!features.shaderStorageImageWriteWithoutFormat)
{
continue;
}
@@ -2369,7 +2369,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi
enabledFeatures.shaderStorageImageMultisample = true;
else
RDCWARN(
"shaderStorageImageMultisample = false, save/load from 2DMS textures will not be "
"shaderStorageImageMultisample = false, accurately replaying 2DMS textures will not be "
"possible");
if(availFeatures.fragmentStoresAndAtomics)
@@ -2883,8 +2883,8 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice,
enabledFeatures.shaderStorageImageMultisample = true;
else
RDCWARN(
"shaderStorageImageMultisample = false, save/load from 2DMS textures will not be "
"possible");
"shaderStorageImageMultisample = false, accurately replaying from 2DMS textures will not "
"be possible");
if(availFeatures.sampleRateShading)
enabledFeatures.sampleRateShading = true;