Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1014)

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 885013002: gpu: Add TransformFeedback & Uniform Buffer related consts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed early returns Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 7ef54448b6182b75e13c2295d96cb7d5258334c3..b047a700232ef5b5d93d77935ee9b79a409308e0 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -702,6 +702,15 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) {
return true;
}
return false;
+ case GL_MAX_UNIFORM_BUFFER_BINDINGS:
+ *params = capabilities_.max_uniform_buffer_bindings;
+ return true;
+ case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+ *params = capabilities_.max_transform_feedback_separate_attribs;
+ return true;
+ case GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
+ *params = capabilities_.uniform_buffer_offset_alignment;
+ return true;
default:
return false;
}
@@ -2638,6 +2647,10 @@ void GLES2Implementation::GenTransformFeedbacksHelper(
// the old model but possibly not true in the new model if another context has
// deleted the resource.
+// NOTE #2: There is a bug in some BindXXXHelpers, that IDs might be marked as
+// used even when Bind has failed. However, the bug is minor compared to the
+// overhead & duplicated checking in client side.
+
void GLES2Implementation::BindBufferHelper(
GLenum target, GLuint buffer_id) {
// TODO(gman): See note #1 above.
@@ -2662,8 +2675,7 @@ void GLES2Implementation::BindBufferHelper(
changed = true;
break;
}
- // TODO(gman): There's a bug here. If the target is invalid the ID will not be
- // used even though it's marked it as used here.
+ // TODO(gman): See note #2 above.
if (changed) {
GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind(
this, target, buffer_id, &GLES2Implementation::BindBufferStub);
@@ -2679,8 +2691,7 @@ void GLES2Implementation::BindBufferStub(GLenum target, GLuint buffer) {
void GLES2Implementation::BindBufferBaseHelper(
GLenum target, GLuint index, GLuint buffer_id) {
// TODO(zmo): See note #1 above.
- // TODO(zmo): There's a bug here. If the target or index is invalid the ID
- // will not be used even though it's marked it as used here.
+ // TODO(zmo): See note #2 above.
GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind(
this, target, index, buffer_id, &GLES2Implementation::BindBufferBaseStub);
}
@@ -2696,8 +2707,7 @@ void GLES2Implementation::BindBufferRangeHelper(
GLenum target, GLuint index, GLuint buffer_id,
GLintptr offset, GLsizeiptr size) {
// TODO(zmo): See note #1 above.
- // TODO(zmo): There's a bug here. If an arguments is invalid the ID will not
- // be used even though it's marked it as used here.
+ // TODO(zmo): See note #2 above.
GetIdHandler(id_namespaces::kBuffers)->MarkAsUsedForBind(
this, target, index, buffer_id, offset, size,
&GLES2Implementation::BindBufferRangeStub);
@@ -2777,8 +2787,7 @@ void GLES2Implementation::BindRenderbufferHelper(
changed = true;
break;
}
- // TODO(gman): There's a bug here. If the target is invalid the ID will not be
- // used even though it's marked it as used here.
+ // TODO(zmo): See note #2 above.
if (changed) {
GetIdHandler(id_namespaces::kRenderbuffers)->MarkAsUsedForBind(
this, target, renderbuffer,
@@ -2827,8 +2836,7 @@ void GLES2Implementation::BindTextureHelper(GLenum target, GLuint texture) {
changed = true;
break;
}
- // TODO(gman): There's a bug here. If the target is invalid the ID will not be
- // used. even though it's marked it as used here.
+ // TODO(gman): See note #2 above.
if (changed) {
GetIdHandler(id_namespaces::kTextures)->MarkAsUsedForBind(
this, target, texture, &GLES2Implementation::BindTextureStub);
@@ -2847,7 +2855,6 @@ void GLES2Implementation::BindTransformFeedbackHelper(
}
void GLES2Implementation::BindVertexArrayOESHelper(GLuint array) {
- // TODO(gman): See note #1 above.
bool changed = false;
if (vertex_array_object_manager_->BindVertexArray(array, &changed)) {
if (changed) {
@@ -2878,8 +2885,7 @@ void GLES2Implementation::BindValuebufferCHROMIUMHelper(GLenum target,
changed = true;
break;
}
- // TODO(gman): There's a bug here. If the target is invalid the ID will not be
- // used even though it's marked it as used here.
+ // TODO(gman): See note #2 above.
if (changed) {
GetIdHandler(id_namespaces::kValuebuffers)->MarkAsUsedForBind(
this, target, valuebuffer,
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698