Commit 038ae144 by Jamie Madill Committed by Commit Bot

Vulkan: Fix up varying component limits.

We weren't subtracting reserved varying vectors from component limits. We also were using an incorrect value for fragment input components. Bug: angleproject:5496 Change-Id: I44fc3b2f15687f4dee7a1498d50378e69d74afe3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606536 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent e4497d60
...@@ -611,9 +611,8 @@ void RendererVk::ensureCapsInitialized() const ...@@ -611,9 +611,8 @@ void RendererVk::ensureCapsInitialized() const
// Uniforms are implemented using a uniform buffer, so the max number of uniforms we can // Uniforms are implemented using a uniform buffer, so the max number of uniforms we can
// support is the max buffer range divided by the size of a single uniform (4X float). // support is the max buffer range divided by the size of a single uniform (4X float).
mNativeCaps.maxVertexUniformVectors = maxUniformVectors; mNativeCaps.maxVertexUniformVectors = maxUniformVectors;
mNativeCaps.maxFragmentUniformVectors = maxUniformVectors; mNativeCaps.maxFragmentUniformVectors = maxUniformVectors;
mNativeCaps.maxFragmentInputComponents = maxUniformComponents;
for (gl::ShaderType shaderType : gl::AllShaderTypes()) for (gl::ShaderType shaderType : gl::AllShaderTypes())
{ {
mNativeCaps.maxShaderUniformComponents[shaderType] = maxUniformComponents; mNativeCaps.maxShaderUniformComponents[shaderType] = maxUniformComponents;
...@@ -827,13 +826,13 @@ void RendererVk::ensureCapsInitialized() const ...@@ -827,13 +826,13 @@ void RendererVk::ensureCapsInitialized() const
GLint reservedVaryingVectorCount = 1; GLint reservedVaryingVectorCount = 1;
// Reserve 1 extra for ANGLEPosition when GLLineRasterization is enabled // Reserve 1 extra for ANGLEPosition when GLLineRasterization is enabled
constexpr GLint kRservedVaryingForGLLineRasterization = 1; constexpr GLint kReservedVaryingForGLLineRasterization = 1;
// Reserve 1 extra for transform feedback capture of gl_Position. // Reserve 1 extra for transform feedback capture of gl_Position.
constexpr GLint kReservedVaryingForTransformFeedbackExtension = 1; constexpr GLint kReservedVaryingForTransformFeedbackExtension = 1;
if (getFeatures().basicGLLineRasterization.enabled) if (getFeatures().basicGLLineRasterization.enabled)
{ {
reservedVaryingVectorCount += kRservedVaryingForGLLineRasterization; reservedVaryingVectorCount += kReservedVaryingForGLLineRasterization;
} }
if (getFeatures().supportsTransformFeedbackExtension.enabled) if (getFeatures().supportsTransformFeedbackExtension.enabled)
{ {
...@@ -844,7 +843,10 @@ void RendererVk::ensureCapsInitialized() const ...@@ -844,7 +843,10 @@ void RendererVk::ensureCapsInitialized() const
std::min(limitsVk.maxVertexOutputComponents, limitsVk.maxFragmentInputComponents); std::min(limitsVk.maxVertexOutputComponents, limitsVk.maxFragmentInputComponents);
mNativeCaps.maxVaryingVectors = mNativeCaps.maxVaryingVectors =
LimitToInt((maxVaryingCount / kComponentsPerVector) - reservedVaryingVectorCount); LimitToInt((maxVaryingCount / kComponentsPerVector) - reservedVaryingVectorCount);
mNativeCaps.maxVertexOutputComponents = LimitToInt(limitsVk.maxVertexOutputComponents); mNativeCaps.maxVertexOutputComponents =
LimitToInt(limitsVk.maxVertexOutputComponents) - reservedVaryingVectorCount * 4;
mNativeCaps.maxFragmentInputComponents =
LimitToInt(limitsVk.maxFragmentInputComponents) - reservedVaryingVectorCount * 4;
mNativeCaps.maxTransformFeedbackInterleavedComponents = mNativeCaps.maxTransformFeedbackInterleavedComponents =
gl::IMPLEMENTATION_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; gl::IMPLEMENTATION_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;
...@@ -914,9 +916,11 @@ void RendererVk::ensureCapsInitialized() const ...@@ -914,9 +916,11 @@ void RendererVk::ensureCapsInitialized() const
mNativeCaps.maxFramebufferLayers = LimitToInt(limitsVk.maxFramebufferLayers); mNativeCaps.maxFramebufferLayers = LimitToInt(limitsVk.maxFramebufferLayers);
mNativeCaps.layerProvokingVertex = GL_LAST_VERTEX_CONVENTION_EXT; mNativeCaps.layerProvokingVertex = GL_LAST_VERTEX_CONVENTION_EXT;
mNativeCaps.maxGeometryInputComponents = LimitToInt(limitsVk.maxGeometryInputComponents); mNativeCaps.maxGeometryInputComponents =
mNativeCaps.maxGeometryOutputComponents = LimitToInt(limitsVk.maxGeometryOutputComponents); LimitToInt(limitsVk.maxGeometryInputComponents) - reservedVaryingVectorCount * 4;
mNativeCaps.maxGeometryOutputVertices = LimitToInt(limitsVk.maxGeometryOutputVertices); mNativeCaps.maxGeometryOutputComponents =
LimitToInt(limitsVk.maxGeometryOutputComponents) - reservedVaryingVectorCount * 4;
mNativeCaps.maxGeometryOutputVertices = LimitToInt(limitsVk.maxGeometryOutputVertices);
mNativeCaps.maxGeometryTotalOutputComponents = mNativeCaps.maxGeometryTotalOutputComponents =
LimitToInt(limitsVk.maxGeometryTotalOutputComponents); LimitToInt(limitsVk.maxGeometryTotalOutputComponents);
mNativeCaps.maxShaderStorageBlocks[gl::ShaderType::Geometry] = mNativeCaps.maxShaderStorageBlocks[gl::ShaderType::Geometry] =
......
...@@ -147,6 +147,9 @@ TEST_P(GeometryShaderTest, GeometryShaderImplementationDependentLimits) ...@@ -147,6 +147,9 @@ TEST_P(GeometryShaderTest, GeometryShaderImplementationDependentLimits)
{ {
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_geometry_shader")); ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_geometry_shader"));
// http://anglebug.com/5510
ANGLE_SKIP_TEST_IF(IsIntel() && IsVulkan() && IsLinux());
const std::map<GLenum, int> limits = {{GL_MAX_FRAMEBUFFER_LAYERS_EXT, 256}, const std::map<GLenum, int> limits = {{GL_MAX_FRAMEBUFFER_LAYERS_EXT, 256},
{GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT, 1024}, {GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT, 1024},
{GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT, 12}, {GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT, 12},
......
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