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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 VkPhysicalDeviceMemoryProperties memoryProperties; | 55 VkPhysicalDeviceMemoryProperties memoryProperties; |
56 GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryPr
operties)); | 56 GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryPr
operties)); |
57 | 57 |
58 this->initGrCaps(properties, memoryProperties, featureFlags); | 58 this->initGrCaps(properties, memoryProperties, featureFlags); |
59 this->initGLSLCaps(properties, featureFlags); | 59 this->initGLSLCaps(properties, featureFlags); |
60 this->initConfigTexturableTable(vkInterface, physDev); | 60 this->initConfigTexturableTable(vkInterface, physDev); |
61 this->initConfigRenderableTable(vkInterface, physDev); | 61 this->initConfigRenderableTable(vkInterface, physDev); |
62 this->initStencilFormats(vkInterface, physDev); | 62 this->initStencilFormats(vkInterface, physDev); |
63 | 63 |
64 if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) { | 64 if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) { |
65 fCanUseGLSLForShaderModule = true; | 65 // Currently disabling this feature since it does not play well with val
idation layers which |
| 66 // expect a SPIR-V shader |
| 67 // fCanUseGLSLForShaderModule = true; |
66 } | 68 } |
67 | 69 |
68 this->applyOptionsOverrides(contextOptions); | 70 this->applyOptionsOverrides(contextOptions); |
69 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 71 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
70 glslCaps->applyOptionsOverrides(contextOptions); | 72 glslCaps->applyOptionsOverrides(contextOptions); |
71 } | 73 } |
72 | 74 |
73 int get_max_sample_count(VkSampleCountFlags flags) { | 75 int get_max_sample_count(VkSampleCountFlags flags) { |
74 SkASSERT(flags & VK_SAMPLE_COUNT_1_BIT); | 76 SkASSERT(flags & VK_SAMPLE_COUNT_1_BIT); |
75 if (!(flags & VK_SAMPLE_COUNT_2_BIT)) { | 77 if (!(flags & VK_SAMPLE_COUNT_2_BIT)) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 142 } |
141 | 143 |
142 // Vulkan is based off ES 3.0 so the following should all be supported | 144 // Vulkan is based off ES 3.0 so the following should all be supported |
143 glslCaps->fUsesPrecisionModifiers = true; | 145 glslCaps->fUsesPrecisionModifiers = true; |
144 glslCaps->fFlatInterpolationSupport = true; | 146 glslCaps->fFlatInterpolationSupport = true; |
145 | 147 |
146 // GrShaderCaps | 148 // GrShaderCaps |
147 | 149 |
148 glslCaps->fShaderDerivativeSupport = true; | 150 glslCaps->fShaderDerivativeSupport = true; |
149 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G
rVkFeatureFlag); | 151 glslCaps->fGeometryShaderSupport = SkToBool(featureFlags & kGeometryShader_G
rVkFeatureFlag); |
150 #if 0 | 152 |
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); | 153 glslCaps->fDualSourceBlendingSupport = SkToBool(featureFlags & kDualSrcBlend
_GrVkFeatureFlag); |
153 #endif | 154 |
154 glslCaps->fIntegerSupport = true; | 155 glslCaps->fIntegerSupport = true; |
155 | 156 |
156 glslCaps->fMaxVertexSamplers = | 157 glslCaps->fMaxVertexSamplers = |
157 glslCaps->fMaxGeometrySamplers = | 158 glslCaps->fMaxGeometrySamplers = |
158 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip
torSampledImages, | 159 glslCaps->fMaxFragmentSamplers = SkTMin(properties.limits.maxPerStageDescrip
torSampledImages, |
159 properties.limits.maxPerStageDescrip
torSamplers); | 160 properties.limits.maxPerStageDescrip
torSamplers); |
160 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa
mpledImages, | 161 glslCaps->fMaxCombinedSamplers = SkTMin(properties.limits.maxDescriptorSetSa
mpledImages, |
161 properties.limits.maxDescriptorSetSa
mplers); | 162 properties.limits.maxDescriptorSetSa
mplers); |
162 } | 163 } |
163 | 164 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // internal Format stencil bits total bits
packed? | 275 // internal Format stencil bits total bits
packed? |
275 gS8 = { VK_FORMAT_S8_UINT, 8, 8,
false }, | 276 gS8 = { VK_FORMAT_S8_UINT, 8, 8,
false }, |
276 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32,
true }; | 277 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32,
true }; |
277 | 278 |
278 // I'm simply assuming that these two will be supported since they are used
in example code. | 279 // I'm simply assuming that these two will be supported since they are used
in example code. |
279 // TODO: Actaully figure this out | 280 // TODO: Actaully figure this out |
280 SET_CONFIG_CAN_STENCIL(gS8); | 281 SET_CONFIG_CAN_STENCIL(gS8); |
281 SET_CONFIG_CAN_STENCIL(gD24S8); | 282 SET_CONFIG_CAN_STENCIL(gD24S8); |
282 } | 283 } |
283 | 284 |
OLD | NEW |