OLD | NEW |
---|---|
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 // GrShaderCaps | 146 // GrShaderCaps |
147 | 147 |
148 glslCaps->fShaderDerivativeSupport = true; | 148 glslCaps->fShaderDerivativeSupport = true; |
149 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G rVkFeatureFlag); | 149 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G rVkFeatureFlag); |
150 #if 0 | 150 #if 0 |
151 // For now disabling dual source blending till we get it hooked up in the re st of system | 151 // For now disabling dual source blending till we get it hooked up in the re st of system |
152 glslCaps->fDualSourceBlendingSupport = SkToBool(featureFlags & kDualSrcBlend _GrVkFeatureFlag); | 152 glslCaps->fDualSourceBlendingSupport = SkToBool(featureFlags & kDualSrcBlend _GrVkFeatureFlag); |
153 #endif | 153 #endif |
154 glslCaps->fIntegerSupport = true; | 154 glslCaps->fIntegerSupport = true; |
155 | 155 |
156 // Assume the minimum precisions mandated by the GLSL spec for now. | |
157 glslCaps->fShaderPrecisionVaries = true; | |
158 for (int s = 0; s < kGrShaderTypeCount; ++s) { | |
egdaniel
2016/04/05 21:09:48
in vulkan/SPIR-V,
highp in glsl maps to 32 bit fl
Chris Dalton
2016/04/05 21:54:49
Done.
| |
159 auto& lowp = glslCaps->fFloatPrecisions[s][kLow_GrSLPrecision]; | |
160 lowp.fLogRangeLow = lowp.fLogRangeHigh = 1; | |
161 lowp.fBits = 8; | |
162 | |
163 auto& mediump = glslCaps->fFloatPrecisions[s][kLow_GrSLPrecision]; | |
164 mediump.fLogRangeLow = lowp.fLogRangeHigh = 14; | |
165 mediump.fBits = 10; | |
166 | |
167 auto& highp = glslCaps->fFloatPrecisions[s][kLow_GrSLPrecision]; | |
168 highp.fLogRangeLow = highp.fLogRangeHigh = 62; | |
169 highp.fBits = 16; | |
170 } | |
171 glslCaps->initEffectiveFloatPrecisionTable(); | |
172 | |
156 glslCaps->fMaxVertexSamplers = | 173 glslCaps->fMaxVertexSamplers = |
157 glslCaps->fMaxGeometrySamplers = | 174 glslCaps->fMaxGeometrySamplers = |
158 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip torSampledImages, | 175 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip torSampledImages, |
159 properties.limits.maxPerStageDescrip torSamplers); | 176 properties.limits.maxPerStageDescrip torSamplers); |
160 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa mpledImages, | 177 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa mpledImages, |
161 properties.limits.maxDescriptorSetSa mplers); | 178 properties.limits.maxDescriptorSetSa mplers); |
162 } | 179 } |
163 | 180 |
164 static void format_supported_for_feature(const GrVkInterface* interface, | 181 static void format_supported_for_feature(const GrVkInterface* interface, |
165 VkPhysicalDevice physDev, | 182 VkPhysicalDevice physDev, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 static const StencilFormat | 290 static const StencilFormat |
274 // internal Format stencil bits total bits packed? | 291 // internal Format stencil bits total bits packed? |
275 gS8 = { VK_FORMAT_S8_UINT, 8, 8, false }, | 292 gS8 = { VK_FORMAT_S8_UINT, 8, 8, false }, |
276 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32, true }; | 293 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32, true }; |
277 | 294 |
278 // I'm simply assuming that these two will be supported since they are used in example code. | 295 // I'm simply assuming that these two will be supported since they are used in example code. |
279 // TODO: Actaully figure this out | 296 // TODO: Actaully figure this out |
280 SET_CONFIG_CAN_STENCIL(gS8); | 297 SET_CONFIG_CAN_STENCIL(gS8); |
281 SET_CONFIG_CAN_STENCIL(gD24S8); | 298 SET_CONFIG_CAN_STENCIL(gD24S8); |
282 } | 299 } |
OLD | NEW |