Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 52dae16

Browse files
gary-sweetCommit Bot
authored andcommitted
Vulkan : Fix maxVertexOutputComponents
GL_MAX_VERTEX_OUTPUT_COMPONENTS should mirror Vulkan's reported maxVertexOutputComponents; this shouldn't include any gl_Position adjustments. It was previously set as maxVaryingVectors * 4. The workaround for AMD that reserved an extra varying due to driver instability is no longer required (see: https://chromium-review.googlesource.com/c/angle/angle/+/1980272) Bug: angleproject:4233 Change-Id: I8d7b8eafa7edd4c56005dad039fe69e072692fca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975851 Commit-Queue: Shahbaz Youssefi <[email protected]> Reviewed-by: Jamie Madill <[email protected]>
1 parent 86d9c93 commit 52dae16

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/libANGLE/renderer/vulkan/vk_caps_utils.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,11 @@ void RendererVk::ensureCapsInitialized() const
427427
// The gles2.0 section 2.10 states that "gl_Position is not a varying variable and does
428428
// not count against this limit.", but the Vulkan spec has no such mention in its Built-in
429429
// vars section. It is implicit that we need to actually reserve it for Vulkan in that case.
430-
//
431-
// Note: AMD has a weird behavior when we edge toward the maximum number of varyings and can
432-
// often crash. Reserving an additional varying just for them bringing the total to 2.
433-
constexpr GLint kReservedVaryingCount = 2;
434-
mNativeCaps.maxVaryingVectors =
435-
LimitToInt((limitsVk.maxVertexOutputComponents / 4) - kReservedVaryingCount);
436-
mNativeCaps.maxVertexOutputComponents =
437-
LimitToInt(static_cast<uint32_t>(mNativeCaps.maxVaryingVectors * 4));
430+
GLint reservedVaryingVectorCount = 1;
431+
432+
mNativeCaps.maxVaryingVectors = LimitToInt(
433+
(limitsVk.maxVertexOutputComponents / kComponentsPerVector) - reservedVaryingVectorCount);
434+
mNativeCaps.maxVertexOutputComponents = LimitToInt(limitsVk.maxVertexOutputComponents);
438435

439436
mNativeCaps.maxTransformFeedbackInterleavedComponents =
440437
gl::IMPLEMENTATION_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;

0 commit comments

Comments
 (0)