Fixup GL instanced rendering commands
We've ended up with a flag in both GrCaps and GrGLCaps to indicate the same instanced rendering functionality. This change removes the GrGLCaps version of the flag and also also fixes the interface assembler to use the proper suffix when loading the EXT version of the extension. BUG=skia: Review URL: https://codereview.chromium.org/1537483002
This commit is contained in:
parent
3819d2d767
commit
1250944aaa
@ -779,13 +779,18 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
|
|||||||
GET_PROC_SUFFIX(CoverageModulation, CHROMIUM);
|
GET_PROC_SUFFIX(CoverageModulation, CHROMIUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version >= GR_GL_VER(3,0) || extensions.has("GL_EXT_draw_instanced")) {
|
if (version >= GR_GL_VER(3,0)) {
|
||||||
GET_PROC(DrawArraysInstanced);
|
GET_PROC(DrawArraysInstanced);
|
||||||
GET_PROC(DrawElementsInstanced);
|
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) || extensions.has("GL_EXT_instanced_arrays")) {
|
if (version >= GR_GL_VER(3,0)) {
|
||||||
GET_PROC(VertexAttribDivisor);
|
GET_PROC(VertexAttribDivisor);
|
||||||
|
} else if (extensions.has("GL_EXT_instanced_arrays")) {
|
||||||
|
GET_PROC_SUFFIX(VertexAttribDivisor, EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extensions.has("GL_NV_bindless_texture")) {
|
if (extensions.has("GL_NV_bindless_texture")) {
|
||||||
|
@ -39,7 +39,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
|
|||||||
fImagingSupport = false;
|
fImagingSupport = false;
|
||||||
fTwoFormatLimit = false;
|
fTwoFormatLimit = false;
|
||||||
fVertexArrayObjectSupport = false;
|
fVertexArrayObjectSupport = false;
|
||||||
fInstancedDrawingSupport = false;
|
|
||||||
fDirectStateAccessSupport = false;
|
fDirectStateAccessSupport = false;
|
||||||
fDebugSupport = false;
|
fDebugSupport = false;
|
||||||
fES2CompatibilitySupport = false;
|
fES2CompatibilitySupport = false;
|
||||||
@ -210,16 +209,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
|||||||
ctxInfo.hasExtension("GL_OES_vertex_array_object");
|
ctxInfo.hasExtension("GL_OES_vertex_array_object");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(3,2)) ||
|
|
||||||
(kGLES_GrGLStandard == standard && version >= GR_GL_VER(3,0))) {
|
|
||||||
fInstancedDrawingSupport = true;
|
|
||||||
} else {
|
|
||||||
fInstancedDrawingSupport = (ctxInfo.hasExtension("GL_ARB_draw_instanced") ||
|
|
||||||
ctxInfo.hasExtension("GL_EXT_draw_instanced")) &&
|
|
||||||
(ctxInfo.hasExtension("GL_ARB_instanced_arrays") ||
|
|
||||||
ctxInfo.hasExtension("GL_EXT_instanced_arrays"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kGL_GrGLStandard == standard) {
|
if (kGL_GrGLStandard == standard) {
|
||||||
fDirectStateAccessSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access");
|
fDirectStateAccessSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access");
|
||||||
} else {
|
} else {
|
||||||
@ -1221,7 +1210,6 @@ SkString GrGLCaps::dump() const {
|
|||||||
r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
|
r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
|
||||||
r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
|
r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
|
||||||
r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
|
r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
|
||||||
r.appendf("Instanced drawing support: %s\n", (fInstancedDrawingSupport ? "YES": "NO"));
|
|
||||||
r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO"));
|
r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO"));
|
||||||
r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO"));
|
r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO"));
|
||||||
r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
|
r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
|
||||||
|
@ -209,9 +209,6 @@ public:
|
|||||||
/// Is there support for Vertex Array Objects?
|
/// Is there support for Vertex Array Objects?
|
||||||
bool vertexArrayObjectSupport() const { return fVertexArrayObjectSupport; }
|
bool vertexArrayObjectSupport() const { return fVertexArrayObjectSupport; }
|
||||||
|
|
||||||
/// Is there support for glDraw*Instanced and glVertexAttribDivisor?
|
|
||||||
bool instancedDrawingSupport() const { return fInstancedDrawingSupport; }
|
|
||||||
|
|
||||||
/// Is there support for GL_EXT_direct_state_access?
|
/// Is there support for GL_EXT_direct_state_access?
|
||||||
bool directStateAccessSupport() const { return fDirectStateAccessSupport; }
|
bool directStateAccessSupport() const { return fDirectStateAccessSupport; }
|
||||||
|
|
||||||
@ -363,7 +360,6 @@ private:
|
|||||||
bool fImagingSupport : 1;
|
bool fImagingSupport : 1;
|
||||||
bool fTwoFormatLimit : 1;
|
bool fTwoFormatLimit : 1;
|
||||||
bool fVertexArrayObjectSupport : 1;
|
bool fVertexArrayObjectSupport : 1;
|
||||||
bool fInstancedDrawingSupport : 1;
|
|
||||||
bool fDirectStateAccessSupport : 1;
|
bool fDirectStateAccessSupport : 1;
|
||||||
bool fDebugSupport : 1;
|
bool fDebugSupport : 1;
|
||||||
bool fES2CompatibilitySupport : 1;
|
bool fES2CompatibilitySupport : 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user