Skip to content

Commit

Permalink
Vulkan: Remove traces of VK_MSRTSS_GOOGLEX
Browse files Browse the repository at this point in the history
Devices that shipped this unreleased extension should have long been
updated to VK_MSRTSS_EXT

Bug: angleproject:4836
Change-Id: I23736ebf28afd4a6f3b5b0d5a6417b3e7564c293
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5627575
Auto-Submit: Shahbaz Youssefi <[email protected]>
Commit-Queue: Yuxin Hu <[email protected]>
Reviewed-by: Yuxin Hu <[email protected]>
  • Loading branch information
ShabbyX authored and Angle LUCI CQ committed Jun 12, 2024
1 parent a4e3c3c commit 65f8dc8
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 162 deletions.
7 changes: 0 additions & 7 deletions include/platform/autogen/FeaturesVk_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,6 @@ struct FeaturesVk : FeatureSetBase
&members, "https://anglebug.com/7551"
};

FeatureInfo supportsMultisampledRenderToSingleSampledGOOGLEX = {
"supportsMultisampledRenderToSingleSampledGOOGLEX",
FeatureCategory::VulkanFeatures,
"VkDevice supports the VK_GOOGLEX_multisampled_render_to_single_sampled extension",
&members, "https://anglebug.com/4836"
};

FeatureInfo supportsMultisampledRenderToSingleSampled = {
"supportsMultisampledRenderToSingleSampled",
FeatureCategory::VulkanFeatures,
Expand Down
8 changes: 0 additions & 8 deletions include/platform/vk_features.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,6 @@
],
"issue": "https://anglebug.com/7551"
},
{
"name": "supports_multisampled_render_to_single_sampled_GOOGLEX",
"category": "Features",
"description": [
"VkDevice supports the VK_GOOGLEX_multisampled_render_to_single_sampled extension"
],
"issue": "https://anglebug.com/4836"
},
{
"name": "supports_multisampled_render_to_single_sampled",
"category": "Features",
Expand Down
30 changes: 0 additions & 30 deletions src/common/vulkan/vk_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,6 @@
# include <vulkan/vulkan.h>
#endif

// For the unreleased VK_GOOGLEX_multisampled_render_to_single_sampled
#if !defined(VK_GOOGLEX_multisampled_render_to_single_sampled)
# define VK_GOOGLEX_multisampled_render_to_single_sampled 1
# define VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1
# define VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME \
"VK_GOOGLEX_multisampled_render_to_single_sampled"

# define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_GOOGLEX \
((VkStructureType)(1000376000))
# define VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_GOOGLEX \
((VkStructureType)(1000376001))

typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesGOOGLEX
{
VkStructureType sType;
const void *pNext;
VkBool32 multisampledRenderToSingleSampled;
} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesGOOGLEX;

typedef struct VkMultisampledRenderToSingleSampledInfoGOOGLEX
{
VkStructureType sType;
const void *pNext;
VkBool32 multisampledRenderToSingleSampledEnable;
VkSampleCountFlagBits rasterizationSamples;
VkResolveModeFlagBits depthResolveMode;
VkResolveModeFlagBits stencilResolveMode;
} VkMultisampledRenderToSingleSampledInfoGOOGLEX;
#endif /* VK_GOOGLEX_multisampled_render_to_single_sampled */

#if !defined(ANGLE_SHARED_LIBVULKAN)

namespace rx
Expand Down
3 changes: 1 addition & 2 deletions src/libANGLE/renderer/vulkan/RenderbufferVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ angle::Result RenderbufferVk::setStorageImpl(const gl::Context *context,

const bool isRenderToTexture = mode == gl::MultisamplingMode::MultisampledRenderToTexture;
const bool hasRenderToTextureEXT =
renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled ||
renderer->getFeatures().supportsMultisampledRenderToSingleSampledGOOGLEX.enabled;
renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled;

// Transfer and sampled usage are used for various utilities such as readback or blit.
VkImageUsageFlags usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
Expand Down
3 changes: 1 addition & 2 deletions src/libANGLE/renderer/vulkan/TextureVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2719,8 +2719,7 @@ angle::Result TextureVk::getAttachmentRenderTarget(const gl::Context *context,
ANGLE_TRY(performImageQueueTransferIfNecessary(contextVk));

const bool hasRenderToTextureEXT =
contextVk->getFeatures().supportsMultisampledRenderToSingleSampled.enabled ||
contextVk->getFeatures().supportsMultisampledRenderToSingleSampledGOOGLEX.enabled;
contextVk->getFeatures().supportsMultisampledRenderToSingleSampled.enabled;

// If samples > 1 here, we have a singlesampled texture that's being multisampled rendered to.
// In this case, create a multisampled image that is otherwise identical to the single sampled
Expand Down
36 changes: 9 additions & 27 deletions src/libANGLE/renderer/vulkan/vk_cache_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,11 @@ void InitializeMSRTSS(Context *context,
uint8_t renderToTextureSamples,
VkSubpassDescription2 *subpass,
VkSubpassDescriptionDepthStencilResolve *msrtssResolve,
VkMultisampledRenderToSingleSampledInfoEXT *msrtss,
VkMultisampledRenderToSingleSampledInfoGOOGLEX *msrtssGOOGLEX)
VkMultisampledRenderToSingleSampledInfoEXT *msrtss)
{
Renderer *renderer = context->getRenderer();

ASSERT(renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled ||
renderer->getFeatures().supportsMultisampledRenderToSingleSampledGOOGLEX.enabled);
ASSERT(renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled);

*msrtssResolve = {};
msrtssResolve->sType = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE;
Expand All @@ -812,22 +810,8 @@ void InitializeMSRTSS(Context *context,
msrtss->rasterizationSamples = gl_vk::GetSamples(
renderToTextureSamples, context->getFeatures().limitSampleCountTo2.enabled);

*msrtssGOOGLEX = {};
msrtssGOOGLEX->sType = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_GOOGLEX;
msrtssGOOGLEX->multisampledRenderToSingleSampledEnable = true;
msrtssGOOGLEX->rasterizationSamples = msrtss->rasterizationSamples;
msrtssGOOGLEX->depthResolveMode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT;
msrtssGOOGLEX->stencilResolveMode = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT;

if (renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled)
{
// msrtss->pNext is not null so can't use AddToPNextChain
AppendToPNextChain(subpass, msrtss);
}
else
{
AddToPNextChain(subpass, msrtssGOOGLEX);
}
// msrtss->pNext is not null so can't use AddToPNextChain
AppendToPNextChain(subpass, msrtss);
}

void SetRenderPassViewMask(Context *context,
Expand Down Expand Up @@ -6727,8 +6711,7 @@ angle::Result RenderPassCache::MakeRenderPass(vk::Context *context,
const bool needInputAttachments = desc.hasFramebufferFetch();
const bool isRenderToTextureThroughExtension =
desc.isRenderToTexture() &&
(renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled ||
renderer->getFeatures().supportsMultisampledRenderToSingleSampledGOOGLEX.enabled);
renderer->getFeatures().supportsMultisampledRenderToSingleSampled.enabled;
const bool isRenderToTextureThroughEmulation =
desc.isRenderToTexture() && !isRenderToTextureThroughExtension;

Expand Down Expand Up @@ -7059,10 +7042,9 @@ angle::Result RenderPassCache::MakeRenderPass(vk::Context *context,

// If depth/stencil is to be resolved, add a VkSubpassDescriptionDepthStencilResolve to the
// pNext chain of the subpass description.
VkSubpassDescriptionDepthStencilResolve depthStencilResolve = {};
VkSubpassDescriptionDepthStencilResolve msrtssResolve = {};
VkMultisampledRenderToSingleSampledInfoEXT msrtss = {};
VkMultisampledRenderToSingleSampledInfoGOOGLEX msrtssGOOGLEX = {};
VkSubpassDescriptionDepthStencilResolve depthStencilResolve = {};
VkSubpassDescriptionDepthStencilResolve msrtssResolve = {};
VkMultisampledRenderToSingleSampledInfoEXT msrtss = {};
if (desc.hasDepthStencilResolveAttachment())
{
ASSERT(!isRenderToTextureThroughExtension);
Expand Down Expand Up @@ -7112,7 +7094,7 @@ angle::Result RenderPassCache::MakeRenderPass(vk::Context *context,
{
ASSERT(subpassDesc.size() == 1);
vk::InitializeMSRTSS(context, renderToTextureSamples, &subpassDesc.back(), &msrtssResolve,
&msrtss, &msrtssGOOGLEX);
&msrtss);
}

VkFragmentShadingRateAttachmentInfoKHR fragmentShadingRateAttachmentInfo = {};
Expand Down
135 changes: 53 additions & 82 deletions src/libANGLE/renderer/vulkan/vk_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2195,8 +2195,7 @@ angle::Result Renderer::initializeMemoryAllocator(vk::Context *context)
// geometryStreams (feature)
// - VK_EXT_index_type_uint8: indexTypeUint8 (feature)
// - VK_EXT_device_memory_report: deviceMemoryReport (feature)
// - VK_EXT_multisampled_render_to_single_sampled or
// VK_GOOGLEX_multisampled_render_to_single_sampled: multisampledRenderToSingleSampled (feature)
// - VK_EXT_multisampled_render_to_single_sampled: multisampledRenderToSingleSampled (feature)
// - VK_EXT_image_2d_view_of_3d: image2DViewOf3D (feature)
// sampler2DViewOf3D (feature)
// - VK_EXT_custom_border_color: customBorderColors (feature)
Expand Down Expand Up @@ -2269,11 +2268,6 @@ void Renderer::appendDeviceExtensionFeaturesNotPromoted(
{
vk::AddToPNextChain(deviceFeatures, &mMultisampledRenderToSingleSampledFeatures);
}
else if (ExtensionFound(VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME,
deviceExtensionNames))
{
vk::AddToPNextChain(deviceFeatures, &mMultisampledRenderToSingleSampledFeaturesGOOGLEX);
}

if (ExtensionFound(VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME, deviceExtensionNames))
{
Expand Down Expand Up @@ -2600,10 +2594,6 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE
mMultisampledRenderToSingleSampledFeatures.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT;

mMultisampledRenderToSingleSampledFeaturesGOOGLEX = {};
mMultisampledRenderToSingleSampledFeaturesGOOGLEX.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_GOOGLEX;

mImage2dViewOf3dFeatures = {};
mImage2dViewOf3dFeatures.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT;
Expand Down Expand Up @@ -2759,55 +2749,54 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE
vkGetPhysicalDeviceProperties2(mPhysicalDevice, &deviceProperties);

// Clean up pNext chains
mPhysicalDevice11Properties.pNext = nullptr;
mPhysicalDevice11Features.pNext = nullptr;
mLineRasterizationFeatures.pNext = nullptr;
mMemoryReportFeatures.pNext = nullptr;
mProvokingVertexFeatures.pNext = nullptr;
mVertexAttributeDivisorFeatures.pNext = nullptr;
mVertexAttributeDivisorProperties.pNext = nullptr;
mTransformFeedbackFeatures.pNext = nullptr;
mIndexTypeUint8Features.pNext = nullptr;
mSubgroupProperties.pNext = nullptr;
mSubgroupExtendedTypesFeatures.pNext = nullptr;
mCustomBorderColorFeatures.pNext = nullptr;
mShaderFloat16Int8Features.pNext = nullptr;
mDepthStencilResolveProperties.pNext = nullptr;
mMultisampledRenderToSingleSampledFeatures.pNext = nullptr;
mMultisampledRenderToSingleSampledFeaturesGOOGLEX.pNext = nullptr;
mImage2dViewOf3dFeatures.pNext = nullptr;
mMultiviewFeatures.pNext = nullptr;
mMultiviewProperties.pNext = nullptr;
mDriverProperties.pNext = nullptr;
mSamplerYcbcrConversionFeatures.pNext = nullptr;
mProtectedMemoryFeatures.pNext = nullptr;
mHostQueryResetFeatures.pNext = nullptr;
mDepthClampZeroOneFeatures.pNext = nullptr;
mDepthClipControlFeatures.pNext = nullptr;
mPrimitivesGeneratedQueryFeatures.pNext = nullptr;
mPrimitiveTopologyListRestartFeatures.pNext = nullptr;
mExtendedDynamicStateFeatures.pNext = nullptr;
mExtendedDynamicState2Features.pNext = nullptr;
mGraphicsPipelineLibraryFeatures.pNext = nullptr;
mGraphicsPipelineLibraryProperties.pNext = nullptr;
mVertexInputDynamicStateFeatures.pNext = nullptr;
mDynamicRenderingFeatures.pNext = nullptr;
mDynamicRenderingLocalReadFeatures.pNext = nullptr;
mFragmentShadingRateFeatures.pNext = nullptr;
mFragmentShaderInterlockFeatures.pNext = nullptr;
mImagelessFramebufferFeatures.pNext = nullptr;
mPipelineRobustnessFeatures.pNext = nullptr;
mPipelineProtectedAccessFeatures.pNext = nullptr;
mRasterizationOrderAttachmentAccessFeatures.pNext = nullptr;
mSwapchainMaintenance1Features.pNext = nullptr;
mDitheringFeatures.pNext = nullptr;
mDrmProperties.pNext = nullptr;
mTimelineSemaphoreFeatures.pNext = nullptr;
mHostImageCopyFeatures.pNext = nullptr;
mHostImageCopyProperties.pNext = nullptr;
m8BitStorageFeatures.pNext = nullptr;
m16BitStorageFeatures.pNext = nullptr;
mSynchronization2Features.pNext = nullptr;
mPhysicalDevice11Properties.pNext = nullptr;
mPhysicalDevice11Features.pNext = nullptr;
mLineRasterizationFeatures.pNext = nullptr;
mMemoryReportFeatures.pNext = nullptr;
mProvokingVertexFeatures.pNext = nullptr;
mVertexAttributeDivisorFeatures.pNext = nullptr;
mVertexAttributeDivisorProperties.pNext = nullptr;
mTransformFeedbackFeatures.pNext = nullptr;
mIndexTypeUint8Features.pNext = nullptr;
mSubgroupProperties.pNext = nullptr;
mSubgroupExtendedTypesFeatures.pNext = nullptr;
mCustomBorderColorFeatures.pNext = nullptr;
mShaderFloat16Int8Features.pNext = nullptr;
mDepthStencilResolveProperties.pNext = nullptr;
mMultisampledRenderToSingleSampledFeatures.pNext = nullptr;
mImage2dViewOf3dFeatures.pNext = nullptr;
mMultiviewFeatures.pNext = nullptr;
mMultiviewProperties.pNext = nullptr;
mDriverProperties.pNext = nullptr;
mSamplerYcbcrConversionFeatures.pNext = nullptr;
mProtectedMemoryFeatures.pNext = nullptr;
mHostQueryResetFeatures.pNext = nullptr;
mDepthClampZeroOneFeatures.pNext = nullptr;
mDepthClipControlFeatures.pNext = nullptr;
mPrimitivesGeneratedQueryFeatures.pNext = nullptr;
mPrimitiveTopologyListRestartFeatures.pNext = nullptr;
mExtendedDynamicStateFeatures.pNext = nullptr;
mExtendedDynamicState2Features.pNext = nullptr;
mGraphicsPipelineLibraryFeatures.pNext = nullptr;
mGraphicsPipelineLibraryProperties.pNext = nullptr;
mVertexInputDynamicStateFeatures.pNext = nullptr;
mDynamicRenderingFeatures.pNext = nullptr;
mDynamicRenderingLocalReadFeatures.pNext = nullptr;
mFragmentShadingRateFeatures.pNext = nullptr;
mFragmentShaderInterlockFeatures.pNext = nullptr;
mImagelessFramebufferFeatures.pNext = nullptr;
mPipelineRobustnessFeatures.pNext = nullptr;
mPipelineProtectedAccessFeatures.pNext = nullptr;
mRasterizationOrderAttachmentAccessFeatures.pNext = nullptr;
mSwapchainMaintenance1Features.pNext = nullptr;
mDitheringFeatures.pNext = nullptr;
mDrmProperties.pNext = nullptr;
mTimelineSemaphoreFeatures.pNext = nullptr;
mHostImageCopyFeatures.pNext = nullptr;
mHostImageCopyProperties.pNext = nullptr;
m8BitStorageFeatures.pNext = nullptr;
m16BitStorageFeatures.pNext = nullptr;
mSynchronization2Features.pNext = nullptr;
#if defined(ANGLE_PLATFORM_ANDROID)
mExternalFormatResolveFeatures.pNext = nullptr;
mExternalFormatResolveProperties.pNext = nullptr;
Expand Down Expand Up @@ -2973,14 +2962,6 @@ void Renderer::enableDeviceExtensionsNotPromoted(const vk::ExtensionNameList &de
vk::AddToPNextChain(&mEnabledFeatures, &mMultisampledRenderToSingleSampledFeatures);
}

if (mFeatures.supportsMultisampledRenderToSingleSampledGOOGLEX.enabled)
{
ASSERT(!mFeatures.supportsMultisampledRenderToSingleSampled.enabled);
mEnabledDeviceExtensions.push_back(
VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME);
vk::AddToPNextChain(&mEnabledFeatures, &mMultisampledRenderToSingleSampledFeaturesGOOGLEX);
}

if (mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled)
{
ASSERT(mMemoryReportFeatures.deviceMemoryReport);
Expand Down Expand Up @@ -4453,14 +4434,6 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames,
mMultisampledRenderToSingleSampledFeatures.multisampledRenderToSingleSampled ==
VK_TRUE);

ANGLE_FEATURE_CONDITION(
&mFeatures, supportsMultisampledRenderToSingleSampledGOOGLEX,
!mFeatures.supportsMultisampledRenderToSingleSampled.enabled &&
mFeatures.supportsRenderpass2.enabled &&
mFeatures.supportsDepthStencilResolve.enabled &&
mMultisampledRenderToSingleSampledFeaturesGOOGLEX.multisampledRenderToSingleSampled ==
VK_TRUE);

// Preferring the MSRTSS flag is for texture initialization. If the MSRTSS is not used at first,
// it will be used (if available) when recreating the image if it is bound to an MSRTT
// framebuffer.
Expand Down Expand Up @@ -4632,12 +4605,10 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames,
//
ANGLE_FEATURE_CONDITION(&mFeatures, allowMultisampledRenderToTextureEmulation,
(isTileBasedRenderer && !isARM) || isSamsung);
ANGLE_FEATURE_CONDITION(
&mFeatures, enableMultisampledRenderToTexture,
mFeatures.supportsMultisampledRenderToSingleSampled.enabled ||
mFeatures.supportsMultisampledRenderToSingleSampledGOOGLEX.enabled ||
(mFeatures.supportsDepthStencilResolve.enabled &&
mFeatures.allowMultisampledRenderToTextureEmulation.enabled));
ANGLE_FEATURE_CONDITION(&mFeatures, enableMultisampledRenderToTexture,
mFeatures.supportsMultisampledRenderToSingleSampled.enabled ||
(mFeatures.supportsDepthStencilResolve.enabled &&
mFeatures.allowMultisampledRenderToTextureEmulation.enabled));

// Currently we enable cube map arrays based on the imageCubeArray Vk feature.
// TODO: Check device caps for full cube map array support. https://anglebug.com/5143
Expand Down
Loading

0 comments on commit 65f8dc8

Please sign in to comment.