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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Currently disabling this feature since it does not play well with val
idation layers which | 67 // Currently disabling this feature since it does not play well with val
idation layers which |
68 // expect a SPIR-V shader | 68 // expect a SPIR-V shader |
69 // fCanUseGLSLForShaderModule = true; | 69 // fCanUseGLSLForShaderModule = true; |
70 } | 70 } |
71 | 71 |
72 if (kQualcomm_VkVendor == properties.vendorID) { | 72 if (kQualcomm_VkVendor == properties.vendorID) { |
73 fMustDoCopiesFromOrigin = true; | 73 fMustDoCopiesFromOrigin = true; |
74 fAllowInitializationErrorOnTearDown = true; | 74 fAllowInitializationErrorOnTearDown = true; |
75 } | 75 } |
76 | 76 |
77 if (kNvidia_VkVendor == properties.vendorID) { | |
78 fSupportsCopiesAsDraws = true; | |
79 } | |
80 | |
81 this->applyOptionsOverrides(contextOptions); | 77 this->applyOptionsOverrides(contextOptions); |
82 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); | 78 GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); |
83 glslCaps->applyOptionsOverrides(contextOptions); | 79 glslCaps->applyOptionsOverrides(contextOptions); |
84 } | 80 } |
85 | 81 |
86 int get_max_sample_count(VkSampleCountFlags flags) { | 82 int get_max_sample_count(VkSampleCountFlags flags) { |
87 SkASSERT(flags & VK_SAMPLE_COUNT_1_BIT); | 83 SkASSERT(flags & VK_SAMPLE_COUNT_1_BIT); |
88 if (!(flags & VK_SAMPLE_COUNT_2_BIT)) { | 84 if (!(flags & VK_SAMPLE_COUNT_2_BIT)) { |
89 return 0; | 85 return 0; |
90 } | 86 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 254 |
259 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface, | 255 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface, |
260 VkPhysicalDevice physDev, | 256 VkPhysicalDevice physDev, |
261 VkFormat format) { | 257 VkFormat format) { |
262 VkFormatProperties props; | 258 VkFormatProperties props; |
263 memset(&props, 0, sizeof(VkFormatProperties)); | 259 memset(&props, 0, sizeof(VkFormatProperties)); |
264 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr
ops)); | 260 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr
ops)); |
265 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags); | 261 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags); |
266 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags); | 262 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags); |
267 } | 263 } |
OLD | NEW |