Commit ad2ae93e by Luc Ferron Committed by Commit Bot

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: 's avatarGeoff Lang <geofflang@chromium.org>
parent 93279812
......@@ -146,7 +146,7 @@ constexpr ImmutableString kFlippedPointCoordName = ImmutableString("flippedPoint
// 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 @@ void TranslatorVulkan::translate(TIntermBlock *root,
if (inputVarying.name == "gl_PointCoord")
{
FlipGLPointCoordinates(root, &getSymbolTable());
FlipGLPointCoord(root, &getSymbolTable());
break;
}
}
......
......@@ -907,8 +907,8 @@ Caps::Caps()
maxLODBias(0),
maxCubeMapTextureSize(0),
maxRenderbufferSize(0),
minAliasedPointSize(0),
maxAliasedPointSize(0),
minAliasedPointSize(1.0f),
maxAliasedPointSize(1.0f),
minAliasedLineWidth(0),
maxAliasedLineWidth(0),
......
......@@ -3126,9 +3126,11 @@ void Context::initCaps()
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;
......
......@@ -352,12 +352,14 @@ void GenerateCaps(const FunctionsGL *functions,
{
// 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);
}
......
......@@ -45,7 +45,8 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
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];
......
......@@ -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
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