Commit d2fa07e4 by Jiawei Shao Committed by Commit Bot

ES31: Support queries on primitives generated by geometry shader

This patch implements a new query target GL_PRIMITIVES_GENERATED_EXT for querying the number of primitives generated by geometry shader. BUG=angleproject:1941 TEST=dEQP-GLES31.functional.geometry_shading.query.primitives_generated* Change-Id: Icdc0d2d8be4ff4d589972eada2fa1f917d7bae4c Reviewed-on: https://chromium-review.googlesource.com/963793Reviewed-by: 's avatarJiajia Qin <jiajia.qin@intel.com> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 8574357f
...@@ -214,6 +214,7 @@ void State::initialize(const Context *context, ...@@ -214,6 +214,7 @@ void State::initialize(const Context *context,
mActiveQueries[GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN].set(context, nullptr); mActiveQueries[GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN].set(context, nullptr);
mActiveQueries[GL_TIME_ELAPSED_EXT].set(context, nullptr); mActiveQueries[GL_TIME_ELAPSED_EXT].set(context, nullptr);
mActiveQueries[GL_COMMANDS_COMPLETED_CHROMIUM].set(context, nullptr); mActiveQueries[GL_COMMANDS_COMPLETED_CHROMIUM].set(context, nullptr);
mActiveQueries[GL_PRIMITIVES_GENERATED_EXT].set(context, nullptr);
mProgram = nullptr; mProgram = nullptr;
......
...@@ -33,6 +33,9 @@ GLuint64 MergeQueryResults(GLenum type, GLuint64 currentResult, GLuint64 newResu ...@@ -33,6 +33,9 @@ GLuint64 MergeQueryResults(GLenum type, GLuint64 currentResult, GLuint64 newResu
case GL_TIMESTAMP: case GL_TIMESTAMP:
return newResult; return newResult;
case GL_PRIMITIVES_GENERATED_EXT:
return currentResult + newResult;
default: default:
UNREACHABLE(); UNREACHABLE();
return 0; return 0;
......
...@@ -33,9 +33,12 @@ ...@@ -33,9 +33,12 @@
namespace rx namespace rx
{ {
static const GLenum QueryTypes[] = {GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, static constexpr GLenum QueryTypes[] = {GL_ANY_SAMPLES_PASSED,
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
GL_COMMANDS_COMPLETED_CHROMIUM}; GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN,
GL_TIME_ELAPSED,
GL_COMMANDS_COMPLETED_CHROMIUM,
GL_PRIMITIVES_GENERATED_EXT};
StateManagerGL::IndexedBufferBinding::IndexedBufferBinding() : offset(0), size(0), buffer(0) StateManagerGL::IndexedBufferBinding::IndexedBufferBinding() : offset(0), size(0), buffer(0)
{ {
......
...@@ -983,6 +983,8 @@ bool ValidQueryType(const Context *context, GLenum queryType) ...@@ -983,6 +983,8 @@ bool ValidQueryType(const Context *context, GLenum queryType)
return context->getExtensions().disjointTimerQuery; return context->getExtensions().disjointTimerQuery;
case GL_COMMANDS_COMPLETED_CHROMIUM: case GL_COMMANDS_COMPLETED_CHROMIUM:
return context->getExtensions().syncQuery; return context->getExtensions().syncQuery;
case GL_PRIMITIVES_GENERATED_EXT:
return context->getExtensions().geometryShader;
default: default:
return false; return false;
} }
......
...@@ -1643,7 +1643,6 @@ ...@@ -1643,7 +1643,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_directive.tessellation_shader = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_directive.tessellation_shader = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.object_labels.program_pipeline = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.object_labels.program_pipeline = FAIL
1941 OPENGL D3D11 : dEQP-GLES31.functional.geometry_shading.query.primitives_* = FAIL
1941 OPENGL D3D11 : dEQP-GLES31.functional.geometry_shading.query.referenced_by_geometry_shader = FAIL 1941 OPENGL D3D11 : dEQP-GLES31.functional.geometry_shading.query.referenced_by_geometry_shader = FAIL
2324 DEBUG RELEASE : dEQP-GLES31.functional.debug.negative_coverage.callbacks.compute.program_not_active = FAIL 2324 DEBUG RELEASE : dEQP-GLES31.functional.debug.negative_coverage.callbacks.compute.program_not_active = FAIL
......
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