Commit 52dae168 by Gary Sweet Committed by Commit Bot

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 <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 86d9c93a
...@@ -427,14 +427,11 @@ void RendererVk::ensureCapsInitialized() const ...@@ -427,14 +427,11 @@ void RendererVk::ensureCapsInitialized() const
// The gles2.0 section 2.10 states that "gl_Position is not a varying variable and does // The gles2.0 section 2.10 states that "gl_Position is not a varying variable and does
// not count against this limit.", but the Vulkan spec has no such mention in its Built-in // not count against this limit.", but the Vulkan spec has no such mention in its Built-in
// vars section. It is implicit that we need to actually reserve it for Vulkan in that case. // vars section. It is implicit that we need to actually reserve it for Vulkan in that case.
// GLint reservedVaryingVectorCount = 1;
// Note: AMD has a weird behavior when we edge toward the maximum number of varyings and can
// often crash. Reserving an additional varying just for them bringing the total to 2. mNativeCaps.maxVaryingVectors = LimitToInt(
constexpr GLint kReservedVaryingCount = 2; (limitsVk.maxVertexOutputComponents / kComponentsPerVector) - reservedVaryingVectorCount);
mNativeCaps.maxVaryingVectors = mNativeCaps.maxVertexOutputComponents = LimitToInt(limitsVk.maxVertexOutputComponents);
LimitToInt((limitsVk.maxVertexOutputComponents / 4) - kReservedVaryingCount);
mNativeCaps.maxVertexOutputComponents =
LimitToInt(static_cast<uint32_t>(mNativeCaps.maxVaryingVectors * 4));
mNativeCaps.maxTransformFeedbackInterleavedComponents = mNativeCaps.maxTransformFeedbackInterleavedComponents =
gl::IMPLEMENTATION_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; gl::IMPLEMENTATION_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;
......
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