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

Unified Diff: src/gpu/glsl/GrGLSLCaps.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLCaps.h
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index 7b0868ea929900e4b0cc392e7bd7dac3672466ab..a1d458a5470d7a37239850cc6209554cfdf179ed 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -162,6 +162,11 @@ public:
return fConfigOutputSwizzle[config];
}
+ /** Precision qualifier that should be used with a sampler, given its config and visibility. */
+ GrSLPrecision samplerPrecision(GrPixelConfig config, GrShaderFlags visibility) const {
+ return static_cast<GrSLPrecision>(fSamplerPrecisions[visibility][config]);
+ }
+
GrGLSLGeneration generation() const { return fGLSLGeneration; }
/**
@@ -170,6 +175,9 @@ public:
SkString dump() const override;
private:
+ /** GrCaps subclasses must call this after filling in the shader precision table. */
+ void initSamplerPrecisionTable();
+
void onApplyOptionsOverrides(const GrContextOptions& options) override;
GrGLSLGeneration fGLSLGeneration;
@@ -216,6 +224,8 @@ private:
GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt];
GrSwizzle fConfigOutputSwizzle[kGrPixelConfigCnt];
+ uint8_t fSamplerPrecisions[(1 << kGrShaderTypeCount)][kGrPixelConfigCnt];
+
friend class GrGLCaps; // For initialization.
friend class GrVkCaps;
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698