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

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

Issue 2182783004: Add test configs for instanced rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test configs for instanced rendering Created 4 years, 5 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.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index a484b05b955301eda63cb89d68e537620b7a6ce4..653b5ca725c9b6d4282d7a93ea3e963ce384fc6b 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -12,6 +12,7 @@
#include "GrGLContext.h"
#include "GrGLRenderTarget.h"
#include "glsl/GrGLSLCaps.h"
+#include "instanced/GLInstancedRendering.h"
#include "SkTSearch.h"
#include "SkTSort.h"
@@ -40,7 +41,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fDrawIndirectSupport = false;
fMultiDrawIndirectSupport = false;
fBaseInstanceSupport = false;
- fCanDrawIndirectToFloat = false;
fIsCoreProfile = false;
fBindFragDataLocationSupport = false;
fRectangleTextureSupport = false;
@@ -526,14 +526,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance");
}
- // OS X doesn't seem to write correctly to floating point textures when using glDraw*Indirect,
- // regardless of the underlying GPU.
-#ifndef SK_BUILD_FOR_MAC
- if (fDrawIndirectSupport) {
- fCanDrawIndirectToFloat = true;
- }
-#endif
-
this->initShaderPrecisionTable(ctxInfo, gli, glslCaps);
if (contextOptions.fUseShaderSwizzling) {
@@ -1116,7 +1108,6 @@ SkString GrGLCaps::dump() const {
r.appendf("Draw indirect support: %s\n", (fDrawIndirectSupport ? "YES" : "NO"));
r.appendf("Multi draw indirect support: %s\n", (fMultiDrawIndirectSupport ? "YES" : "NO"));
r.appendf("Base instance support: %s\n", (fBaseInstanceSupport ? "YES" : "NO"));
- r.appendf("Can draw indirect to float: %s\n", (fCanDrawIndirectToFloat ? "YES" : "NO"));
r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ? "YES" : "NO"));
r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" : "NO"));
r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSupport ? "YES" : "NO"));
@@ -1935,4 +1926,13 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa
#endif
}
-void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
+void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {
+ if (options.fEnableInstancedRendering) {
+ fInstancedSupport = gr_instanced::GLInstancedRendering::CheckSupport(*this);
+#ifndef SK_BUILD_FOR_MAC
+ // OS X doesn't seem to write correctly to floating point textures when using
+ // glDraw*Indirect, regardless of the underlying GPU.
+ fAvoidInstancedDrawsToFPTargets = true;
+#endif
+ }
+}
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698