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

Side by Side Diff: src/gpu/gl/GrGLCaps.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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 10
(...skipping 23 matching lines...) Expand all
34 fPackFlipYSupport = false; 34 fPackFlipYSupport = false;
35 fTextureUsageSupport = false; 35 fTextureUsageSupport = false;
36 fTexStorageSupport = false; 36 fTexStorageSupport = false;
37 fTextureRedSupport = false; 37 fTextureRedSupport = false;
38 fImagingSupport = false; 38 fImagingSupport = false;
39 fVertexArrayObjectSupport = false; 39 fVertexArrayObjectSupport = false;
40 fDirectStateAccessSupport = false; 40 fDirectStateAccessSupport = false;
41 fDebugSupport = false; 41 fDebugSupport = false;
42 fES2CompatibilitySupport = false; 42 fES2CompatibilitySupport = false;
43 fMultisampleDisableSupport = false; 43 fMultisampleDisableSupport = false;
44 fDrawIndirectSupport = false;
45 fMultiDrawIndirectSupport = false;
46 fBaseInstanceSupport = false;
44 fUseNonVBOVertexAndIndexDynamicData = false; 47 fUseNonVBOVertexAndIndexDynamicData = false;
45 fIsCoreProfile = false; 48 fIsCoreProfile = false;
46 fBindFragDataLocationSupport = false; 49 fBindFragDataLocationSupport = false;
47 fExternalTextureSupport = false; 50 fExternalTextureSupport = false;
48 fRectangleTextureSupport = false; 51 fRectangleTextureSupport = false;
49 fTextureSwizzleSupport = false; 52 fTextureSwizzleSupport = false;
50 fSRGBWriteControl = false; 53 fSRGBWriteControl = false;
51 fRGBA8888PixelsOpsAreSlow = false; 54 fRGBA8888PixelsOpsAreSlow = false;
52 fPartialFBOReadIsSlow = false; 55 fPartialFBOReadIsSlow = false;
53 56
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 version >= GR_GL_VER(3, 2) || 479 version >= GR_GL_VER(3, 2) ||
477 (ctxInfo.hasExtension("GL_ARB_draw_instanced") && 480 (ctxInfo.hasExtension("GL_ARB_draw_instanced") &&
478 ctxInfo.hasExtension("GL_ARB_instanced_arrays")); 481 ctxInfo.hasExtension("GL_ARB_instanced_arrays"));
479 } else { 482 } else {
480 fSupportsInstancedDraws = 483 fSupportsInstancedDraws =
481 version >= GR_GL_VER(3, 0) || 484 version >= GR_GL_VER(3, 0) ||
482 (ctxInfo.hasExtension("GL_EXT_draw_instanced") && 485 (ctxInfo.hasExtension("GL_EXT_draw_instanced") &&
483 ctxInfo.hasExtension("GL_EXT_instanced_arrays")); 486 ctxInfo.hasExtension("GL_EXT_instanced_arrays"));
484 } 487 }
485 488
489 if (kGL_GrGLStandard == standard) {
490 // We don't use ARB_draw_indirect because it does not support a base ins tance.
491 // We don't use ARB_multi_draw_indirect because it does not support GL_D RAW_INDIRECT_BUFFER.
492 fDrawIndirectSupport =
493 fMultiDrawIndirectSupport = fBaseInstanceSupport = version >= GR_GL_ VER(4,3);
494 } else {
495 fDrawIndirectSupport = version >= GR_GL_VER(3,1);
496 fMultiDrawIndirectSupport = ctxInfo.hasExtension("GL_EXT_multi_draw_indi rect");
497 fBaseInstanceSupport = ctxInfo.hasExtension("GL_EXT_base_instance");
498 }
499
486 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); 500 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps);
487 501
488 if (contextOptions.fUseShaderSwizzling) { 502 if (contextOptions.fUseShaderSwizzling) {
489 fTextureSwizzleSupport = false; 503 fTextureSwizzleSupport = false;
490 } 504 }
491 505
492 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com patibility have 506 // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES com patibility have
493 // already been detected. 507 // already been detected.
494 this->initConfigTable(ctxInfo, gli, glslCaps); 508 this->initConfigTable(ctxInfo, gli, glslCaps);
495 509
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 r.appendf("Pack Flip Y support: %s\n", (fPackFlipYSupport ? "YES": "NO")); 944 r.appendf("Pack Flip Y support: %s\n", (fPackFlipYSupport ? "YES": "NO"));
931 945
932 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" )); 946 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" ));
933 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" )); 947 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" ));
934 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); 948 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO"));
935 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 949 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
936 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 950 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
937 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO")); 951 r.appendf("Direct state access support: %s\n", (fDirectStateAccessSupport ? "YES": "NO"));
938 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO")); 952 r.appendf("Debug support: %s\n", (fDebugSupport ? "YES": "NO"));
939 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO")); 953 r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO"));
954 r.appendf("Draw indirect support: %s\n", (fDrawIndirectSupport ? "YES" : "NO "));
955 r.appendf("Multi draw indirect support: %s\n", (fMultiDrawIndirectSupport ? "YES" : "NO"));
956 r.appendf("Base instance support: %s\n", (fBaseInstanceSupport ? "YES" : "NO "));
940 r.appendf("Use non-VBO for dynamic data: %s\n", 957 r.appendf("Use non-VBO for dynamic data: %s\n",
941 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 958 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
942 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO")); 959 r.appendf("SRGB write contol: %s\n", (fSRGBWriteControl ? "YES" : "NO"));
943 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ? "YES" : "NO")); 960 r.appendf("RGBA 8888 pixel ops are slow: %s\n", (fRGBA8888PixelsOpsAreSlow ? "YES" : "NO"));
944 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" : "NO")); 961 r.appendf("Partial FBO read is slow: %s\n", (fPartialFBOReadIsSlow ? "YES" : "NO"));
945 r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSuppor t ? "YES" : "NO")); 962 r.appendf("Bind uniform location support: %s\n", (fBindUniformLocationSuppor t ? "YES" : "NO"));
946 r.appendf("External texture support: %s\n", (fExternalTextureSupport ? "YES" : "NO")); 963 r.appendf("External texture support: %s\n", (fExternalTextureSupport ? "YES" : "NO"));
947 r.appendf("Rectangle texture support: %s\n", (fRectangleTextureSupport? "YES " : "NO")); 964 r.appendf("Rectangle texture support: %s\n", (fRectangleTextureSupport? "YES " : "NO"));
948 r.appendf("Texture swizzle support: %s\n", (fTextureSwizzleSupport ? "YES" : "NO")); 965 r.appendf("Texture swizzle support: %s\n", (fTextureSwizzleSupport ? "YES" : "NO"));
949 966
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1660 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1644 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1661 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1645 fConfigTable[i].fFormats.fExternalFormat[j]); 1662 fConfigTable[i].fFormats.fExternalFormat[j]);
1646 } 1663 }
1647 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1664 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1648 } 1665 }
1649 #endif 1666 #endif
1650 } 1667 }
1651 1668
1652 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1669 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698