Commit e71ea19a by Corentin Wallez Committed by Commit Bot

Allow queries of different types to be active at the same time

BUG=605775 Change-Id: I0e23fae25d450c504f174a080279cf51aebcd123 Reviewed-on: https://chromium-review.googlesource.com/340112Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 3f572680
...@@ -979,11 +979,12 @@ void State::detachTransformFeedback(GLuint transformFeedback) ...@@ -979,11 +979,12 @@ void State::detachTransformFeedback(GLuint transformFeedback)
} }
} }
bool State::isQueryActive() const bool State::isQueryActive(GLenum type) const
{ {
for (auto &iter : mActiveQueries) for (auto &iter : mActiveQueries)
{ {
if (iter.second.get() != NULL) Query *query = iter.second.get();
if (query != nullptr && query->getType() == type)
{ {
return true; return true;
} }
......
...@@ -194,7 +194,7 @@ class State : angle::NonCopyable ...@@ -194,7 +194,7 @@ class State : angle::NonCopyable
void detachTransformFeedback(GLuint transformFeedback); void detachTransformFeedback(GLuint transformFeedback);
// Query binding manipulation // Query binding manipulation
bool isQueryActive() const; bool isQueryActive(GLenum type) const;
bool isQueryActive(Query *query) const; bool isQueryActive(Query *query) const;
void setActiveQuery(GLenum target, Query *query); void setActiveQuery(GLenum target, Query *query);
GLuint getActiveQueryId(GLenum target) const; GLuint getActiveQueryId(GLenum target) const;
......
...@@ -1168,9 +1168,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id) ...@@ -1168,9 +1168,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id)
// of GL_ANY_SAMPLES_PASSED_EXT and GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, // of GL_ANY_SAMPLES_PASSED_EXT and GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT,
// no query may be active for either if glBeginQuery targets either. // no query may be active for either if glBeginQuery targets either.
// TODO(ewell): I think this needs to be changed for timer and occlusion queries to work at the if (context->getState().isQueryActive(target))
// same time
if (context->getState().isQueryActive())
{ {
context->recordError(Error(GL_INVALID_OPERATION, "Other query is active")); context->recordError(Error(GL_INVALID_OPERATION, "Other query is active"));
return false; return false;
......
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