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

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: comments 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
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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 // GetShaderPrecisionFormat doesn't accept GL_GEOMETRY_SHADER as a shader ty pe. Assume they're 1189 // GetShaderPrecisionFormat doesn't accept GL_GEOMETRY_SHADER as a shader ty pe. Assume they're
1190 // the same as the vertex shader. Only fragment shaders were ever allowed to omit support for 1190 // the same as the vertex shader. Only fragment shaders were ever allowed to omit support for
1191 // highp. GS was added after GetShaderPrecisionFormat was added to the list of features that 1191 // highp. GS was added after GetShaderPrecisionFormat was added to the list of features that
1192 // are recommended against. 1192 // are recommended against.
1193 if (glslCaps->fGeometryShaderSupport) { 1193 if (glslCaps->fGeometryShaderSupport) {
1194 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1194 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1195 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = 1195 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] =
1196 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p]; 1196 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p];
1197 } 1197 }
1198 } 1198 }
1199 glslCaps->initEffectiveFloatPrecisionTable();
1199 } 1200 }
1200 1201
1201 bool GrGLCaps::bgraIsInternalFormat() const { 1202 bool GrGLCaps::bgraIsInternalFormat() const {
1202 return fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = = GR_GL_BGRA; 1203 return fConfigTable[kBGRA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = = GR_GL_BGRA;
1203 } 1204 }
1204 1205
1205 bool GrGLCaps::getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig ext ernalConfig, 1206 bool GrGLCaps::getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig ext ernalConfig,
1206 GrGLenum* internalFormat, GrGLenum* externalFo rmat, 1207 GrGLenum* internalFormat, GrGLenum* externalFo rmat,
1207 GrGLenum* externalType) const { 1208 GrGLenum* externalType) const {
1208 if (!this->getExternalFormat(surfaceConfig, externalConfig, kTexImage_Extern alFormatUsage, 1209 if (!this->getExternalFormat(surfaceConfig, externalConfig, kTexImage_Extern alFormatUsage,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1874 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1874 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1875 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1875 fConfigTable[i].fFormats.fExternalFormat[j]); 1876 fConfigTable[i].fFormats.fExternalFormat[j]);
1876 } 1877 }
1877 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1878 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1878 } 1879 }
1879 #endif 1880 #endif
1880 } 1881 }
1881 1882
1882 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1883 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698