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

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

Issue 2238563002: Fix 4444 on Vulkan devices who don't support RGBA_4444 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 4 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
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 glslCaps->fVersionDeclString = "#version 330\n"; 130 glslCaps->fVersionDeclString = "#version 330\n";
131 131
132 132
133 // fConfigOutputSwizzle will default to RGBA so we only need to set it for a lpha only config. 133 // fConfigOutputSwizzle will default to RGBA so we only need to set it for a lpha only config.
134 for (int i = 0; i < kGrPixelConfigCnt; ++i) { 134 for (int i = 0; i < kGrPixelConfigCnt; ++i) {
135 GrPixelConfig config = static_cast<GrPixelConfig>(i); 135 GrPixelConfig config = static_cast<GrPixelConfig>(i);
136 if (GrPixelConfigIsAlphaOnly(config)) { 136 if (GrPixelConfigIsAlphaOnly(config)) {
137 glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RRRR(); 137 glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RRRR();
138 glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::AAAA(); 138 glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::AAAA();
139 } else { 139 } else {
140 glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA(); 140 if (kRGBA_4444_GrPixelConfig == config) {
bsalomon 2016/08/11 18:02:08 Maybe a comment here about why?
egdaniel 2016/08/11 20:09:15 Done.
141 glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::BGRA();
142 glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::BGRA();
143 } else {
144 glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA();
145 }
141 } 146 }
142 } 147 }
143 148
144 // Vulkan is based off ES 3.0 so the following should all be supported 149 // Vulkan is based off ES 3.0 so the following should all be supported
145 glslCaps->fUsesPrecisionModifiers = true; 150 glslCaps->fUsesPrecisionModifiers = true;
146 glslCaps->fFlatInterpolationSupport = true; 151 glslCaps->fFlatInterpolationSupport = true;
147 152
148 // GrShaderCaps 153 // GrShaderCaps
149 154
150 glslCaps->fShaderDerivativeSupport = true; 155 glslCaps->fShaderDerivativeSupport = true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 242
238 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface, 243 void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface,
239 VkPhysicalDevice physDev, 244 VkPhysicalDevice physDev,
240 VkFormat format) { 245 VkFormat format) {
241 VkFormatProperties props; 246 VkFormatProperties props;
242 memset(&props, 0, sizeof(VkFormatProperties)); 247 memset(&props, 0, sizeof(VkFormatProperties));
243 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops)); 248 GR_VK_CALL(interface, GetPhysicalDeviceFormatProperties(physDev, format, &pr ops));
244 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags); 249 InitConfigFlags(props.linearTilingFeatures, &fLinearFlags);
245 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags); 250 InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags);
246 } 251 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkCaps.h ('k') | src/gpu/vk/GrVkUtil.cpp » ('j') | src/gpu/vk/GrVkUtil.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698