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, |