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

Unified Diff: src/gpu/vk/GrVkCaps.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkCaps.cpp
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index b72a5125239f3078f2fdc2e4041bee518b6148c3..5b62a3767cc1ec2678717519959e4b2f81f9e04b 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -154,6 +154,21 @@ void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceProperties& properties,
glslCaps->fIntegerSupport = true;
+ // Assume the minimum precisions mandated by the SPIR-V spec.
+ glslCaps->fShaderPrecisionVaries = true;
+ for (int s = 0; s < kGrShaderTypeCount; ++s) {
+ auto& highp = glslCaps->fFloatPrecisions[s][kHigh_GrSLPrecision];
+ highp.fLogRangeLow = highp.fLogRangeHigh = 127;
+ highp.fBits = 23;
+
+ auto& mediump = glslCaps->fFloatPrecisions[s][kMedium_GrSLPrecision];
+ mediump.fLogRangeLow = mediump.fLogRangeHigh = 14;
+ mediump.fBits = 10;
+
+ glslCaps->fFloatPrecisions[s][kLow_GrSLPrecision] = mediump;
+ }
+ glslCaps->initSamplerPrecisionTable();
+
glslCaps->fMaxVertexSamplers =
glslCaps->fMaxGeometrySamplers =
glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescriptorSampledImages,
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698