Commit a3e1f5f7 by Olli Etuaho Committed by Commit Bot

Fix determining max combined uniform blocks

The previous code was using a completely unrelated variable to compute max combined uniform blocks limit. BUG=angleproject:2099 Change-Id: I9e56b50a92790f525dda50adca52b6ac5edfc95a Reviewed-on: https://chromium-review.googlesource.com/562276 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 115fc55e
...@@ -520,7 +520,15 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -520,7 +520,15 @@ void GenerateCaps(const FunctionsGL *functions,
caps->maxUniformBufferBindings = QuerySingleGLInt(functions, GL_MAX_UNIFORM_BUFFER_BINDINGS); caps->maxUniformBufferBindings = QuerySingleGLInt(functions, GL_MAX_UNIFORM_BUFFER_BINDINGS);
caps->maxUniformBlockSize = QuerySingleGLInt64(functions, GL_MAX_UNIFORM_BLOCK_SIZE); caps->maxUniformBlockSize = QuerySingleGLInt64(functions, GL_MAX_UNIFORM_BLOCK_SIZE);
caps->uniformBufferOffsetAlignment = QuerySingleGLInt(functions, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); caps->uniformBufferOffsetAlignment = QuerySingleGLInt(functions, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT);
caps->maxCombinedUniformBlocks = caps->maxVertexUniformBlocks + caps->maxFragmentInputComponents;
GLuint maxCombinedUniformBlocks =
QuerySingleGLInt(functions, GL_MAX_COMBINED_UNIFORM_BLOCKS);
// The real cap contains the limits for shader types that are not available to ES, so limit
// the cap to the sum of vertex+fragment shader caps.
caps->maxCombinedUniformBlocks =
std::min(maxCombinedUniformBlocks,
caps->maxVertexUniformBlocks + caps->maxFragmentUniformBlocks);
caps->maxCombinedVertexUniformComponents = QuerySingleGLInt64(functions, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS); caps->maxCombinedVertexUniformComponents = QuerySingleGLInt64(functions, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS);
caps->maxCombinedFragmentUniformComponents = QuerySingleGLInt64(functions, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS); caps->maxCombinedFragmentUniformComponents = QuerySingleGLInt64(functions, GL_MAX_COMBINED_FRAGMENT_UNIFORM_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