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

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

Issue 1666803002: Add GL indirect drawing APIs (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_rastermultisample
Patch Set: formatting 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 | « include/gpu/gl/GrGLTypes.h ('k') | src/gpu/gl/GrGLCaps.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLAssembleInterface.cpp
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index 6b578f34fc7d1e13763d460a4ae40af5f6fef321..30eed62c5e49f05387a21117e492d647919a1145 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -138,6 +138,19 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(DrawBuffer);
GET_PROC(DrawBuffers);
GET_PROC(DrawElements);
+
+ if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") ||
+ extensions.has("GL_EXT_draw_instanced")) {
+ GET_PROC(DrawArraysInstanced);
+ GET_PROC(DrawElementsInstanced);
+ }
+
+ if (glVer >= GR_GL_VER(4,0)) {
+ // We don't use ARB_draw_indirect because it does not support a base instance.
+ GET_PROC(DrawArraysIndirect);
+ GET_PROC(DrawElementsIndirect);
+ }
+
GET_PROC(Enable);
GET_PROC(EnableVertexAttribArray);
GET_PROC(EndQuery);
@@ -228,6 +241,11 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(VertexAttrib2fv);
GET_PROC(VertexAttrib3fv);
GET_PROC(VertexAttrib4fv);
+
+ if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) {
+ GET_PROC(VertexAttribDivisor);
+ }
+
GET_PROC(VertexAttribPointer);
GET_PROC(Viewport);
GET_PROC(BindFragDataLocationIndexed);
@@ -338,14 +356,10 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
GET_PROC(GetProgramResourceLocation);
}
- if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") ||
- extensions.has("GL_EXT_draw_instanced")) {
- GET_PROC(DrawArraysInstanced);
- GET_PROC(DrawElementsInstanced);
- }
-
- if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) {
- GET_PROC(VertexAttribDivisor);
+ if (glVer >= GR_GL_VER(4,3)) {
+ // We don't use ARB_multi_draw_indirect because it does not support GL_DRAW_INDIRECT_BUFFER.
+ GET_PROC(MultiDrawArraysIndirect);
+ GET_PROC(MultiDrawElementsIndirect);
}
if (extensions.has("GL_NV_bindless_texture")) {
@@ -564,6 +578,20 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC(Disable);
GET_PROC(DisableVertexAttribArray);
GET_PROC(DrawArrays);
+
+ if (version >= GR_GL_VER(3,0)) {
+ GET_PROC(DrawArraysInstanced);
+ GET_PROC(DrawElementsInstanced);
+ } else if (extensions.has("GL_EXT_draw_instanced")) {
+ GET_PROC_SUFFIX(DrawArraysInstanced, EXT);
+ GET_PROC_SUFFIX(DrawElementsInstanced, EXT);
+ }
+
+ if (version >= GR_GL_VER(3,1)) {
+ GET_PROC(DrawArraysIndirect);
+ GET_PROC(DrawElementsIndirect);
+ }
+
GET_PROC(DrawElements);
GET_PROC(Enable);
GET_PROC(EnableVertexAttribArray);
@@ -643,6 +671,13 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC(VertexAttrib2fv);
GET_PROC(VertexAttrib3fv);
GET_PROC(VertexAttrib4fv);
+
+ if (version >= GR_GL_VER(3,0)) {
+ GET_PROC(VertexAttribDivisor);
+ } else if (extensions.has("GL_EXT_instanced_arrays")) {
+ GET_PROC_SUFFIX(VertexAttribDivisor, EXT);
+ }
+
GET_PROC(VertexAttribPointer);
GET_PROC(Viewport);
GET_PROC(BindFramebuffer);
@@ -779,18 +814,9 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC_SUFFIX(CoverageModulation, CHROMIUM);
}
- if (version >= GR_GL_VER(3,0)) {
- GET_PROC(DrawArraysInstanced);
- GET_PROC(DrawElementsInstanced);
- } else if (extensions.has("GL_EXT_draw_instanced")) {
- GET_PROC_SUFFIX(DrawArraysInstanced, EXT);
- GET_PROC_SUFFIX(DrawElementsInstanced, EXT);
- }
-
- if (version >= GR_GL_VER(3,0)) {
- GET_PROC(VertexAttribDivisor);
- } else if (extensions.has("GL_EXT_instanced_arrays")) {
- GET_PROC_SUFFIX(VertexAttribDivisor, EXT);
+ if (extensions.has("GL_EXT_multi_draw_indirect")) {
+ GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT);
+ GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT);
}
if (extensions.has("GL_NV_bindless_texture")) {
« no previous file with comments | « include/gpu/gl/GrGLTypes.h ('k') | src/gpu/gl/GrGLCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698