Revert "Revert "Fixes from sample count change""
This reverts commit 914b285d45717bf8da8f141b41cec098749a6d0e.
Reason for revert: Already have fix for bug, which is quicker than fixing merge conflict
Original change's description:
> Revert "Fixes from sample count change"
>
> This reverts commit f3316224b95e4d3325972552df0d1c046ae73225.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Fixes from sample count change
> >
> > Re blacklist imagination msaa on Vulkan and fix i->1 bug in GL
> >
> > Bug: skia:
> > Change-Id: I8045565b2064d2ee037ab43b167e6d5d3a59268e
> > Reviewed-on: https://skia-review.googlesource.com/24780
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,caryclark@google.com
>
> Change-Id: I8e3c95621eb0bc6ea2be24cc4ee67f88239263ed
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/24863
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,caryclark@google.com
Change-Id: I43cb50691885cae8fe8bab1f034eb6a00b77de81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/24900
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 909b4fb..16e7a7e 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -83,7 +83,7 @@
this->initGrCaps(properties, memoryProperties, featureFlags);
this->initShaderCaps(properties, featureFlags);
- this->initConfigTable(vkInterface, physDev);
+ this->initConfigTable(vkInterface, physDev, properties);
this->initStencilFormat(vkInterface, physDev);
if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) {
@@ -309,12 +309,13 @@
}
}
-void GrVkCaps::initConfigTable(const GrVkInterface* interface, VkPhysicalDevice physDev) {
+void GrVkCaps::initConfigTable(const GrVkInterface* interface, VkPhysicalDevice physDev,
+ const VkPhysicalDeviceProperties& properties) {
for (int i = 0; i < kGrPixelConfigCnt; ++i) {
VkFormat format;
if (GrPixelConfigToVkFormat(static_cast<GrPixelConfig>(i), &format)) {
if (!GrPixelConfigIsSRGB(static_cast<GrPixelConfig>(i)) || fSRGBSupport) {
- fConfigTable[i].init(interface, physDev, format);
+ fConfigTable[i].init(interface, physDev, properties, format);
}
}
}
@@ -342,6 +343,7 @@
void GrVkCaps::ConfigInfo::initSampleCounts(const GrVkInterface* interface,
VkPhysicalDevice physDev,
+ const VkPhysicalDeviceProperties& physProps,
VkFormat format) {
VkImageUsageFlags usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
@@ -361,6 +363,10 @@
if (flags & VK_SAMPLE_COUNT_1_BIT) {
fColorSampleCounts.push(0);
}
+ if (kImagination_VkVendor == physProps.vendorID) {
+ // MSAA does not work on imagination
+ return;
+ }
if (flags & VK_SAMPLE_COUNT_2_BIT) {
fColorSampleCounts.push(2);
}
@@ -383,6 +389,7 @@
void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface,
VkPhysicalDevice physDev,
+ const VkPhysicalDeviceProperties& properties,
VkFormat format) {
VkFormatProperties props;
memset(&props, 0, sizeof(VkFormatProperties));
@@ -390,7 +397,7 @@
InitConfigFlags(props.linearTilingFeatures, &fLinearFlags);
InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags);
if (fOptimalFlags & kRenderable_Flag) {
- this->initSampleCounts(interface, physDev, format);
+ this->initSampleCounts(interface, physDev, properties, format);
}
}