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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkProgramDesc.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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrVkCaps.h" 8 #include "GrVkCaps.h"
9 9
10 #include "GrVkUtil.h" 10 #include "GrVkUtil.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 // GrShaderCaps 148 // GrShaderCaps
149 149
150 glslCaps->fShaderDerivativeSupport = true; 150 glslCaps->fShaderDerivativeSupport = true;
151 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G rVkFeatureFlag); 151 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G rVkFeatureFlag);
152 152
153 glslCaps->fDualSourceBlendingSupport = SkToBool(featureFlags & kDualSrcBlend _GrVkFeatureFlag); 153 glslCaps->fDualSourceBlendingSupport = SkToBool(featureFlags & kDualSrcBlend _GrVkFeatureFlag);
154 154
155 glslCaps->fIntegerSupport = true; 155 glslCaps->fIntegerSupport = true;
156 156
157 // Assume the minimum precisions mandated by the SPIR-V spec.
158 glslCaps->fShaderPrecisionVaries = true;
159 for (int s = 0; s < kGrShaderTypeCount; ++s) {
160 auto& highp = glslCaps->fFloatPrecisions[s][kHigh_GrSLPrecision];
161 highp.fLogRangeLow = highp.fLogRangeHigh = 127;
162 highp.fBits = 23;
163
164 auto& mediump = glslCaps->fFloatPrecisions[s][kMedium_GrSLPrecision];
165 mediump.fLogRangeLow = mediump.fLogRangeHigh = 14;
166 mediump.fBits = 10;
167
168 glslCaps->fFloatPrecisions[s][kLow_GrSLPrecision] = mediump;
169 }
170 glslCaps->initSamplerPrecisionTable();
171
157 glslCaps->fMaxVertexSamplers = 172 glslCaps->fMaxVertexSamplers =
158 glslCaps->fMaxGeometrySamplers = 173 glslCaps->fMaxGeometrySamplers =
159 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip torSampledImages, 174 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip torSampledImages,
160 properties.limits.maxPerStageDescrip torSamplers); 175 properties.limits.maxPerStageDescrip torSamplers);
161 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa mpledImages, 176 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa mpledImages,
162 properties.limits.maxDescriptorSetSa mplers); 177 properties.limits.maxDescriptorSetSa mplers);
163 } 178 }
164 179
165 bool stencil_format_supported(const GrVkInterface* interface, 180 bool stencil_format_supported(const GrVkInterface* interface,
166 VkPhysicalDevice physDev, 181 VkPhysicalDevice physDev,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 237
223 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface, 238 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface,
224 VkPhysicalDevice physDev, 239 VkPhysicalDevice physDev,
225 VkFormat format) { 240 VkFormat format) {
226 VkFormatProperties props; 241 VkFormatProperties props;
227 memset(&props, 0, sizeof(VkFormatProperties)); 242 memset(&props, 0, sizeof(VkFormatProperties));
228 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops)); 243 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops));
229 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags); 244 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags);
230 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags); 245 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags);
231 } 246 }
OLDNEW
« 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