Skip to content

Commit cd969c3

Browse files
aabdolrashidiAngle LUCI CQ
authored andcommitted
Vulkan: Disable clipCullDistance ext if GS/TS
The extension GL_EXT_clip_cull_distance also interacts with geometry and tessellation shaders. These features are currently in development. * Added temporary flag: supportsClipCullDistanceInGSAndTS * Currently disabled by default * clipCullDistanceEXT can only be enabled if this feature is enabled, or if the device does not support geometry or tessellation shaders. * After the features become available, this flag can be removed. Bug: angleproject:42264006 Bug: b/415288635 Change-Id: Iac5c672fd980710519407c482bc95d2b0019aea2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6795025 Reviewed-by: Shahbaz Youssefi <[email protected]> Commit-Queue: Amirali Abdolrashidi <[email protected]>
1 parent b61038b commit cd969c3

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

include/platform/autogen/FeaturesVk_autogen.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,12 @@ struct FeaturesVk : FeatureSetBase
14961496
&members,
14971497
};
14981498

1499+
FeatureInfo supportsClipCullDistanceInGSAndTS = {
1500+
"supportsClipCullDistanceInGSAndTS",
1501+
FeatureCategory::VulkanFeatures,
1502+
&members,
1503+
};
1504+
14991505
FeatureInfo supportsMaintenance9 = {
15001506
"supportsMaintenance9",
15011507
FeatureCategory::VulkanFeatures,

include/platform/vk_features.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,6 +1968,14 @@
19681968
],
19691969
"issue": "http://anglebug.com/386688871"
19701970
},
1971+
{
1972+
"name": "supports_clip_cull_distance_in_GS_and_TS",
1973+
"category": "Features",
1974+
"description": [
1975+
"Supports using clip/cull distance features in geometry and tessellation shaders"
1976+
],
1977+
"issue": "http://anglebug.com/42264006"
1978+
},
19711979
{
19721980
"name": "supports_maintenance9",
19731981
"category": "Features",

src/libANGLE/renderer/vulkan/vk_caps_utils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,9 @@ void Renderer::ensureCapsInitialized() const
12671267
// After implementing EXT_geometry_shader, EXT_clip_cull_distance should be additionally
12681268
// implemented to support the geometry shader. Until then, EXT_clip_cull_distance is enabled
12691269
// only in the experimental cases.
1270-
if (mPhysicalDeviceFeatures.shaderClipDistance &&
1270+
if ((mFeatures.supportsClipCullDistanceInGSAndTS.enabled ||
1271+
(!mNativeExtensions.geometryShaderAny() && !mNativeExtensions.tessellationShaderAny())) &&
1272+
mPhysicalDeviceFeatures.shaderClipDistance &&
12711273
limitsVk.maxClipDistances >= kMaxClipDistancePerSpec)
12721274
{
12731275
// Do not enable GL_APPLE_clip_distance for Samsung devices.

src/libANGLE/renderer/vulkan/vk_renderer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6174,6 +6174,11 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames,
61746174
&mFeatures, supportsUniformBufferStandardLayout,
61756175
mUniformBufferStandardLayoutFeatures.uniformBufferStandardLayout == VK_TRUE);
61766176

6177+
// http://anglebug.com/42264006
6178+
// GL_EXT_clip_cull_distance also adds features to geometry and tessellation shaders, which are
6179+
// currently disabled.
6180+
ANGLE_FEATURE_CONDITION(&mFeatures, supportsClipCullDistanceInGSAndTS, false);
6181+
61776182
// Disable memory report feature overrides if extension is not supported.
61786183
if ((mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled) &&
61796184
!mMemoryReportFeatures.deviceMemoryReport)

util/autogen/angle_features_autogen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ constexpr PackedEnumMap<Feature, const char *> kFeatureNames = {{
312312
{Feature::SupportsBindMemory2, "supportsBindMemory2"},
313313
{Feature::SupportsBlendOperationAdvanced, "supportsBlendOperationAdvanced"},
314314
{Feature::SupportsBlendOperationAdvancedCoherent, "supportsBlendOperationAdvancedCoherent"},
315+
{Feature::SupportsClipCullDistanceInGSAndTS, "supportsClipCullDistanceInGSAndTS"},
315316
{Feature::SupportsColorWriteEnable, "supportsColorWriteEnable"},
316317
{Feature::SupportsComputeTranscodeEtcToBc, "supportsComputeTranscodeEtcToBc"},
317318
{Feature::SupportsCustomBorderColor, "supportsCustomBorderColor"},

util/autogen/angle_features_autogen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ enum class Feature
312312
SupportsBindMemory2,
313313
SupportsBlendOperationAdvanced,
314314
SupportsBlendOperationAdvancedCoherent,
315+
SupportsClipCullDistanceInGSAndTS,
315316
SupportsColorWriteEnable,
316317
SupportsComputeTranscodeEtcToBc,
317318
SupportsCustomBorderColor,

0 commit comments

Comments
 (0)