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

Side by Side Diff: src/gpu/vk/GrVkCaps.cpp

Issue 1920163004: Remove AttachmentInfo from VulkanViewer setup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore check Created 4 years, 7 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 | « no previous file | tools/vulkan/VulkanTestContext.h » ('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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 VkFormat format) { 182 VkFormat format) {
183 VkFormatProperties props; 183 VkFormatProperties props;
184 memset(&props, 0, sizeof(VkFormatProperties)); 184 memset(&props, 0, sizeof(VkFormatProperties));
185 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops)); 185 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops));
186 return SkToBool(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT & props.optim alTilingFeatures); 186 return SkToBool(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT & props.optim alTilingFeatures);
187 } 187 }
188 188
189 void GrVkCaps::initStencilFormat(const GrVkInterface* interface, VkPhysicalDevic e physDev) { 189 void GrVkCaps::initStencilFormat(const GrVkInterface* interface, VkPhysicalDevic e physDev) {
190 // List of legal stencil formats (though perhaps not supported on 190 // List of legal stencil formats (though perhaps not supported on
191 // the particular gpu/driver) from most preferred to least. We are guarantee d to have either 191 // the particular gpu/driver) from most preferred to least. We are guarantee d to have either
192 // VK_FORMAT_D24_UNORM_S8_UINT or VK_FORMAT_D24_SFLOAT_S8_UINT. VK_FORMAT_D3 2_SFLOAT_S8_UINT 192 // VK_FORMAT_D24_UNORM_S8_UINT or VK_FORMAT_D32_SFLOAT_S8_UINT. VK_FORMAT_D3 2_SFLOAT_S8_UINT
193 // can optionally have 24 unused bits at the end so we assume the total bits is 64. 193 // can optionally have 24 unused bits at the end so we assume the total bits is 64.
194 static const StencilFormat 194 static const StencilFormat
195 // internal Format stencil bits total bits packed? 195 // internal Format stencil bits total bits packed?
196 gS8 = { VK_FORMAT_S8_UINT, 8, 8, false }, 196 gS8 = { VK_FORMAT_S8_UINT, 8, 8, false },
197 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32, true }, 197 gD24S8 = { VK_FORMAT_D24_UNORM_S8_UINT, 8, 32, true },
198 gD32S8 = { VK_FORMAT_D32_SFLOAT_S8_UINT, 8, 64, true }; 198 gD32S8 = { VK_FORMAT_D32_SFLOAT_S8_UINT, 8, 64, true };
199 199
200 if (stencil_format_supported(interface, physDev, VK_FORMAT_S8_UINT)) { 200 if (stencil_format_supported(interface, physDev, VK_FORMAT_S8_UINT)) {
201 fPreferedStencilFormat = gS8; 201 fPreferedStencilFormat = gS8;
202 } else if (stencil_format_supported(interface, physDev, VK_FORMAT_D24_UNORM_ S8_UINT)) { 202 } else if (stencil_format_supported(interface, physDev, VK_FORMAT_D24_UNORM_ S8_UINT)) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface, 238 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface,
239 VkPhysicalDevice physDev, 239 VkPhysicalDevice physDev,
240 VkFormat format) { 240 VkFormat format) {
241 VkFormatProperties props; 241 VkFormatProperties props;
242 memset(&props, 0, sizeof(VkFormatProperties)); 242 memset(&props, 0, sizeof(VkFormatProperties));
243 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops)); 243 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops));
244 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags); 244 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags);
245 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags); 245 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags);
246 } 246 }
OLDNEW
« no previous file with comments | « no previous file | tools/vulkan/VulkanTestContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698