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

Unified Diff: src/gpu/gl/GrGLInterface.cpp

Issue 1684413003: Implement support for using GL ES 3.0 with command buffer (Closed) Base URL: https://skia.googlesource.com/skia.git@no-texture-rectangle-gles
Patch Set: comment wording Created 4 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
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLInterface.cpp
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index c09efae2b88bd87007efdcfdda0209fd368d44f2..53911bfcc9f13af1d6e0acff2b0dad1e8ae1b8c7 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -216,6 +216,15 @@ bool GrGLInterface::validate() const {
if (GR_GL_INVALID_VER == glVer) {
RETURN_FALSE_INTERFACE
}
+ // TODO: Remove this once command buffer implements full ES3.
+ bool ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3 = false;
+ if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
+ const GrGLubyte* rendererUByte;
+ GR_GL_CALL_RET(this, rendererUByte, GetString(GR_GL_RENDERER));
+ const char* renderer = reinterpret_cast<const char*>(rendererUByte);
+ ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3 =
+ 0 == strcmp(renderer, "Chromium");
+ }
// Now check that baseline ES/Desktop fns not covered above are present
// and that we have fn pointers for any advertised fExtensions that we will
@@ -306,8 +315,10 @@ bool GrGLInterface::validate() const {
}
}
} else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storage")) {
- if (nullptr == fFunctions.fTexStorage2D) {
- RETURN_FALSE_INTERFACE
+ if (!ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3) {
+ if (nullptr == fFunctions.fTexStorage2D) {
+ RETURN_FALSE_INTERFACE
+ }
}
}
@@ -480,9 +491,11 @@ bool GrGLInterface::validate() const {
if (glVer >= GR_GL_VER(3,0) ||
(kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_range")) ||
(kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_range"))) {
- if (nullptr == fFunctions.fMapBufferRange ||
- nullptr == fFunctions.fFlushMappedBufferRange) {
- RETURN_FALSE_INTERFACE;
+ if (!ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3) {
+ if (nullptr == fFunctions.fMapBufferRange ||
+ nullptr == fFunctions.fFlushMappedBufferRange) {
+ RETURN_FALSE_INTERFACE;
+ }
}
}
@@ -562,14 +575,16 @@ bool GrGLInterface::validate() const {
nullptr == fFunctions.fDrawElementsInstanced) {
RETURN_FALSE_INTERFACE
}
- }
+ }
} else if (kGLES_GrGLStandard == fStandard) {
- if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_draw_instanced")) {
- if (nullptr == fFunctions.fDrawArraysInstanced ||
- nullptr == fFunctions.fDrawElementsInstanced) {
- RETURN_FALSE_INTERFACE
+ if (!ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3) {
+ if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_draw_instanced")) {
+ if (nullptr == fFunctions.fDrawArraysInstanced ||
+ nullptr == fFunctions.fDrawElementsInstanced) {
+ RETURN_FALSE_INTERFACE
+ }
}
- }
+ }
}
if (kGL_GrGLStandard == fStandard) {
@@ -577,13 +592,15 @@ bool GrGLInterface::validate() const {
if (nullptr == fFunctions.fVertexAttribDivisor) {
RETURN_FALSE_INTERFACE
}
- }
+ }
} else if (kGLES_GrGLStandard == fStandard) {
- if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_instanced_arrays")) {
- if (nullptr == fFunctions.fVertexAttribDivisor) {
- RETURN_FALSE_INTERFACE
+ if (!ALLOW_MISSING_FUNCTIONS_FOR_INCOMPLETE_COMMAND_BUFFER_ES3) {
+ if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_instanced_arrays")) {
+ if (nullptr == fFunctions.fVertexAttribDivisor) {
+ RETURN_FALSE_INTERFACE
+ }
}
- }
+ }
}
if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698