Commit 4dba2767 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Enable OES_shader_multisample_interpolation

Bug: angleproject:5395 Change-Id: I5cebb30fa71ad3c6f04a185ee992f77a900e6b26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558931 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarMohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent bc82325e
......@@ -473,7 +473,7 @@ void RendererVk::ensureCapsInitialized() const
// Enable EXT_external_buffer on Andoid. External buffers are implemented using Android hadware
// buffer (struct AHardwareBuffer).
mNativeExtensions.externalBufferEXT = IsAndroid() && (GetAndroidSDKVersion() >= 26);
mNativeExtensions.externalBufferEXT = IsAndroid() && GetAndroidSDKVersion() >= 26;
// From the Vulkan specs:
// sampleRateShading specifies whether Sample Shading and multisample interpolation are
......@@ -481,9 +481,17 @@ void RendererVk::ensureCapsInitialized() const
// VkPipelineMultisampleStateCreateInfo structure must be set to VK_FALSE and the
// minSampleShading member is ignored. This also specifies whether shader modules can declare
// the SampleRateShading capability
bool supportSampleRateShading = (mPhysicalDeviceFeatures.sampleRateShading == VK_TRUE);
bool supportSampleRateShading = mPhysicalDeviceFeatures.sampleRateShading == VK_TRUE;
mNativeExtensions.sampleShadingOES = supportSampleRateShading;
// From the SPIR-V spec at 3.21. BuiltIn, SampleId and SamplePosition needs
// SampleRateShading. https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html
// To replace non-constant index to constant 0 index, this extension assumes that ANGLE only
// supports the number of samples less than or equal to 32.
constexpr unsigned int kNotSupportedSampleCounts = VK_SAMPLE_COUNT_64_BIT;
mNativeExtensions.sampleVariablesOES =
supportSampleRateShading && vk_gl::GetMaxSampleCount(kNotSupportedSampleCounts) == 0;
mNativeCaps.minInterpolationOffset = limitsVk.minInterpolationOffset;
mNativeCaps.maxInterpolationOffset = limitsVk.maxInterpolationOffset;
mNativeCaps.subPixelInterpolationOffsetBits = limitsVk.subPixelInterpolationOffsetBits;
......@@ -499,21 +507,11 @@ void RendererVk::ensureCapsInitialized() const
// OES_shader_multisample_interpolation requires a maximum value of -0.5 for
// MIN_FRAGMENT_INTERPOLATION_OFFSET_OES and minimum 0.5 for
// MAX_FRAGMENT_INTERPOLATION_OFFSET_OES. Vulkan has an identical limit for
// minInterpolationOffset, but it's limit for maxInterpolationOffset is 0.5-(1/ULP).
// minInterpolationOffset, but its limit for maxInterpolationOffset is 0.5-(1/ULP).
// OES_shader_multisample_interpolation is therefore only supported if
// maxInterpolationOffset is at least 0.5.
mNativeExtensions.multisampleInterpolationOES =
supportSampleRateShading && (mNativeCaps.maxInterpolationOffset >= 0.5);
// OES_shader_multisample_interpolation requires OES_sample_variables, disable for now
mNativeExtensions.multisampleInterpolationOES = false;
// From the SPIR-V spec at 3.21. BuiltIn, SampleId and SamplePosition needs
// SampleRateShading. https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html
// To replace non-constant index to constant 0 index, this extension assumes that ANGLE only
// supports the number of samples less than or equal to 32.
constexpr unsigned int kNotSupportedSampleCounts = VK_SAMPLE_COUNT_64_BIT;
mNativeExtensions.sampleVariablesOES =
supportSampleRateShading && (vk_gl::GetMaxSampleCount(kNotSupportedSampleCounts) == 0);
mNativeExtensions.sampleVariablesOES && mNativeCaps.maxInterpolationOffset >= 0.5;
// https://vulkan.lunarg.com/doc/view/1.0.30.0/linux/vkspec.chunked/ch31s02.html
mNativeCaps.maxElementIndex = std::numeric_limits<GLuint>::max() - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment