Vulkan: Clamp the point size range to have a min value of 1.0
Bug: angleproject:2658
Change-Id: I32ff9aa27b064d9977eea0b83b18c52c4e42e38d
Reviewed-on: https://chromium-review.googlesource.com/1096054
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/TranslatorVulkan.cpp b/src/compiler/translator/TranslatorVulkan.cpp
index 47ac5b8..4ef013c 100644
--- a/src/compiler/translator/TranslatorVulkan.cpp
+++ b/src/compiler/translator/TranslatorVulkan.cpp
@@ -146,7 +146,7 @@
// Declares a new variable to replace gl_PointCoord with a version that is flipping the Y
// coordinate.
-void FlipGLPointCoordinates(TIntermBlock *root, TSymbolTable *symbolTable)
+void FlipGLPointCoord(TIntermBlock *root, TSymbolTable *symbolTable)
{
// Create a symbol reference to "gl_PointCoord"
const TVariable *pointCoord = BuiltInVariable::gl_PointCoord();
@@ -346,7 +346,7 @@
if (inputVarying.name == "gl_PointCoord")
{
- FlipGLPointCoordinates(root, &getSymbolTable());
+ FlipGLPointCoord(root, &getSymbolTable());
break;
}
}
diff --git a/src/libANGLE/Caps.cpp b/src/libANGLE/Caps.cpp
index 37965a0..293693e 100644
--- a/src/libANGLE/Caps.cpp
+++ b/src/libANGLE/Caps.cpp
@@ -907,8 +907,8 @@
maxLODBias(0),
maxCubeMapTextureSize(0),
maxRenderbufferSize(0),
- minAliasedPointSize(0),
- maxAliasedPointSize(0),
+ minAliasedPointSize(1.0f),
+ maxAliasedPointSize(1.0f),
minAliasedLineWidth(0),
maxAliasedLineWidth(0),
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index c3880b2..0ec0bfc 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -3126,9 +3126,11 @@
mCaps.maxTextureMatrixStackDepth = Caps::GlobalMatrixStackDepth;
}
- // Apply implementation limits
+ // Apply/Verify implementation limits
LimitCap(&mCaps.maxVertexAttributes, MAX_VERTEX_ATTRIBS);
+ ASSERT(mCaps.minAliasedPointSize >= 1.0f);
+
if (getClientVersion() < ES_3_1)
{
mCaps.maxVertexAttribBindings = mCaps.maxVertexAttributes;
diff --git a/src/libANGLE/renderer/gl/renderergl_utils.cpp b/src/libANGLE/renderer/gl/renderergl_utils.cpp
index 2e860b2..1464033 100644
--- a/src/libANGLE/renderer/gl/renderergl_utils.cpp
+++ b/src/libANGLE/renderer/gl/renderergl_utils.cpp
@@ -352,12 +352,14 @@
{
// Desktop GL core profile deprecated the GL_ALIASED_POINT_SIZE_RANGE query. Use
// GL_POINT_SIZE_RANGE instead.
- caps->minAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 0);
+ caps->minAliasedPointSize =
+ std::max(1.0f, QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 0));
caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_POINT_SIZE_RANGE, 1);
}
else
{
- caps->minAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0);
+ caps->minAliasedPointSize =
+ std::max(1.0f, QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 0));
caps->maxAliasedPointSize = QueryGLFloatRange(functions, GL_ALIASED_POINT_SIZE_RANGE, 1);
}
diff --git a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
index 5225268..d044a9b 100644
--- a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
+++ b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp
@@ -45,7 +45,8 @@
outCaps->maxLODBias = physicalDeviceProperties.limits.maxSamplerLodBias;
outCaps->maxCubeMapTextureSize = physicalDeviceProperties.limits.maxImageDimensionCube;
outCaps->maxRenderbufferSize = outCaps->max2DTextureSize;
- outCaps->minAliasedPointSize = physicalDeviceProperties.limits.pointSizeRange[0];
+ outCaps->minAliasedPointSize =
+ std::max(1.0f, physicalDeviceProperties.limits.pointSizeRange[0]);
outCaps->maxAliasedPointSize = physicalDeviceProperties.limits.pointSizeRange[1];
outCaps->minAliasedLineWidth = physicalDeviceProperties.limits.lineWidthRange[0];
outCaps->maxAliasedLineWidth = physicalDeviceProperties.limits.lineWidthRange[1];
diff --git a/src/tests/deqp_support/deqp_gles2_test_expectations.txt b/src/tests/deqp_support/deqp_gles2_test_expectations.txt
index 92ce339..601d43b 100644
--- a/src/tests/deqp_support/deqp_gles2_test_expectations.txt
+++ b/src/tests/deqp_support/deqp_gles2_test_expectations.txt
@@ -322,5 +322,4 @@
2444 VULKAN : dEQP-GLES2.functional.default_vertex_attrib.* = SKIP
// Vulkan AMD Windows specific failures
-2602 VULKAN WIN AMD : dEQP-GLES2.functional.buffer.write.* = SKIP
-2658 VULKAN WIN AMD : dEQP-GLES2.functional.shaders.builtin_variable.pointcoord = SKIP
\ No newline at end of file
+2602 VULKAN WIN AMD : dEQP-GLES2.functional.buffer.write.* = SKIP
\ No newline at end of file