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

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1846963004: Infer sampler precision from pixel config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ... and gcc doesn't like the enums Created 4 years, 8 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/GrTextureAccess.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 // GetShaderPrecisionFormat doesn't accept GL_GEOMETRY_SHADER as a shader ty pe. Assume they're 1190 // GetShaderPrecisionFormat doesn't accept GL_GEOMETRY_SHADER as a shader ty pe. Assume they're
1191 // the same as the vertex shader. Only fragment shaders were ever allowed to omit support for 1191 // the same as the vertex shader. Only fragment shaders were ever allowed to omit support for
1192 // highp. GS was added after GetShaderPrecisionFormat was added to the list of features that 1192 // highp. GS was added after GetShaderPrecisionFormat was added to the list of features that
1193 // are recommended against. 1193 // are recommended against.
1194 if (glslCaps->fGeometryShaderSupport) { 1194 if (glslCaps->fGeometryShaderSupport) {
1195 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1195 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1196 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = 1196 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] =
1197 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p]; 1197 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p];
1198 } 1198 }
1199 } 1199 }
1200 glslCaps->initSamplerPrecisionTable();
1200 } 1201 }
1201 1202
1202 bool GrGLCaps::bgraIsInternalFormat() const { 1203 bool GrGLCaps::bgraIsInternalFormat() const {
1203 return fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = = GR_GL_BGRA; 1204 return fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = = GR_GL_BGRA;
1204 } 1205 }
1205 1206
1206 bool GrGLCaps::getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig ext ernalConfig, 1207 bool GrGLCaps::getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig ext ernalConfig,
1207 GrGLenum* internalFormat, GrGLenum* externalFo rmat, 1208 GrGLenum* internalFormat, GrGLenum* externalFo rmat,
1208 GrGLenum* externalType) const { 1209 GrGLenum* externalType) const {
1209 if (!this->getExternalFormat(surfaceConfig, externalConfig, kTexImage_Extern alFormatUsage, 1210 if (!this->getExternalFormat(surfaceConfig, externalConfig, kTexImage_Extern alFormatUsage,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1875 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1875 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1876 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1876 fConfigTable[i].fFormats.fExternalFormat[j]); 1877 fConfigTable[i].fFormats.fExternalFormat[j]);
1877 } 1878 }
1878 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1879 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1879 } 1880 }
1880 #endif 1881 #endif
1881 } 1882 }
1882 1883
1883 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1884 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « src/gpu/GrTextureAccess.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698