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 1426653008: Revert of Create swizzle table inside of glsl caps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 86ff54e8305eabf38e959566d5b058b1f973c665..1d25a2ca2f47eba5fcf1d4362387f9467983b1c4 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -8,7 +8,6 @@
#include "GrGLCaps.h"
-#include "GrContextOptions.h"
#include "GrGLContext.h"
#include "glsl/GrGLSLCaps.h"
#include "SkTSearch.h"
@@ -28,6 +27,7 @@
fMaxFragmentTextureUnits = 0;
fRGBA8RenderbufferSupport = false;
fBGRAIsInternalFormat = false;
+ fTextureSwizzleSupport = false;
fUnpackRowLengthSupport = false;
fUnpackFlipYSupport = false;
fPackRowLengthSupport = false;
@@ -94,6 +94,13 @@
}
if (kGL_GrGLStandard == standard) {
+ fTextureSwizzleSupport = version >= GR_GL_VER(3,3) ||
+ ctxInfo.hasExtension("GL_ARB_texture_swizzle");
+ } else {
+ fTextureSwizzleSupport = version >= GR_GL_VER(3,0);
+ }
+
+ if (kGL_GrGLStandard == standard) {
fUnpackRowLengthSupport = true;
fUnpackFlipYSupport = false;
fPackRowLengthSupport = true;
@@ -484,8 +491,6 @@
this->initConfigTexturableTable(ctxInfo, gli, srgbSupport);
this->initConfigRenderableTable(ctxInfo, srgbSupport);
this->initShaderPrecisionTable(ctxInfo, gli, glslCaps);
- // Requires fTexutreSwizzleSupport and fTextureRedSupport to be set before this point.
- this->initConfigSwizzleTable(ctxInfo, glslCaps);
this->applyOptionsOverrides(contextOptions);
glslCaps->applyOptionsOverrides(contextOptions);
@@ -1164,6 +1169,7 @@
r.appendf("Max Vertex Attributes: %d\n", fMaxVertexAttributes);
r.appendf("Support RGBA8 Render Buffer: %s\n", (fRGBA8RenderbufferSupport ? "YES": "NO"));
r.appendf("BGRA is an internal format: %s\n", (fBGRAIsInternalFormat ? "YES": "NO"));
+ r.appendf("Support texture swizzle: %s\n", (fTextureSwizzleSupport ? "YES": "NO"));
r.appendf("Unpack Row length support: %s\n", (fUnpackRowLengthSupport ? "YES": "NO"));
r.appendf("Unpack Flip Y support: %s\n", (fUnpackFlipYSupport ? "YES": "NO"));
r.appendf("Pack Row length support: %s\n", (fPackRowLengthSupport ? "YES": "NO"));
@@ -1274,40 +1280,6 @@
}
}
-void GrGLCaps::initConfigSwizzleTable(const GrGLContextInfo& ctxInfo, GrGLSLCaps* glslCaps) {
- GrGLStandard standard = ctxInfo.standard();
- GrGLVersion version = ctxInfo.version();
-
- if (kGL_GrGLStandard == standard) {
- glslCaps->fMustSwizzleInShader = version >= GR_GL_VER(3,3) ||
- ctxInfo.hasExtension("GL_ARB_texture_swizzle");
- } else {
- glslCaps->fMustSwizzleInShader = version >= GR_GL_VER(3,0);
- }
-
- glslCaps->fConfigSwizzle[kUnknown_GrPixelConfig] = nullptr;
- if (fTextureRedSupport) {
- glslCaps->fConfigSwizzle[kAlpha_8_GrPixelConfig] = "rrrr";
- glslCaps->fConfigSwizzle[kAlpha_half_GrPixelConfig] = "rrrr";
- } else {
- glslCaps->fConfigSwizzle[kAlpha_8_GrPixelConfig] = "aaaa";
- glslCaps->fConfigSwizzle[kAlpha_half_GrPixelConfig] = "aaaa";
- }
- glslCaps->fConfigSwizzle[kIndex_8_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kRGB_565_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kRGBA_4444_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kRGBA_8888_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kBGRA_8888_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kSRGBA_8888_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kETC1_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kLATC_GrPixelConfig] = "rrrr";
- glslCaps->fConfigSwizzle[kR11_EAC_GrPixelConfig] = "rrrr";
- glslCaps->fConfigSwizzle[kASTC_12x12_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kRGBA_float_GrPixelConfig] = "rgba";
- glslCaps->fConfigSwizzle[kRGBA_half_GrPixelConfig] = "rgba";
-
-}
-
-void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
-
-
+
+
+
« 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