aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2017-07-20 11:02:49 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-20 11:02:59 +0000
commitff98644cb480d3ed5bcc97c16a4043b06a4c9da4 (patch)
tree05747f712923791d6df14077714cede88d9d51ff /src
parent390aaaf403f2e2487c44613e22c4d931c44315fb (diff)
Revert "Revert "Fixes from sample count change""
This reverts commit 390aaaf403f2e2487c44613e22c4d931c44315fb. Reason for revert: could not revert breaking change automatically because of conflict during merge Original change's description: > Revert "Fixes from sample count change" > > This reverts commit f3316224b95e4d3325972552df0d1c046ae73225. > > Reason for revert: android vulkan build broken > > 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: I076a4226f5725b3d48592402772ca39b64cae478 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/24840 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=egdaniel@google.com,bsalomon@google.com,caryclark@google.com Change-Id: I890540a68c18ed390773e97066ed92fea370d083 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/24842 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp2
-rw-r--r--src/gpu/vk/GrVkCaps.cpp15
-rw-r--r--src/gpu/vk/GrVkCaps.h8
3 files changed, 17 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 766b438d2b..81311a4fba 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -2138,7 +2138,7 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
static const int kDefaultSamples[] = {0,1,2,4,8};
int count = SK_ARRAY_COUNT(kDefaultSamples);
for (; count > 0; --count) {
- if (kDefaultSamples[count-i] <= fMaxColorSampleCount) {
+ if (kDefaultSamples[count-1] <= fMaxColorSampleCount) {
break;
}
}
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 909b4fbd4c..16e7a7ef6d 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -83,7 +83,7 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
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::initStencilFormat(const GrVkInterface* interface, VkPhysicalDevic
}
}
-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::InitConfigFlags(VkFormatFeatureFlags vkFlags, uint16_
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 @@ void GrVkCaps::ConfigInfo::initSampleCounts(const GrVkInterface* interface,
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::initSampleCounts(const GrVkInterface* interface,
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 @@ void GrVkCaps::ConfigInfo::init(const GrVkInterface* interface,
InitConfigFlags(props.linearTilingFeatures, &fLinearFlags);
InitConfigFlags(props.optimalTilingFeatures, &fOptimalFlags);
if (fOptimalFlags & kRenderable_Flag) {
- this->initSampleCounts(interface, physDev, format);
+ this->initSampleCounts(interface, physDev, properties, format);
}
}
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index b0854867c8..0161bf7e37 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -126,15 +126,17 @@ private:
void initSampleCount(const VkPhysicalDeviceProperties& properties);
- void initConfigTable(const GrVkInterface*, VkPhysicalDevice);
+ void initConfigTable(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&);
void initStencilFormat(const GrVkInterface* iface, VkPhysicalDevice physDev);
struct ConfigInfo {
ConfigInfo() : fOptimalFlags(0), fLinearFlags(0) {}
- void init(const GrVkInterface*, VkPhysicalDevice, VkFormat);
+ void init(const GrVkInterface*, VkPhysicalDevice, const VkPhysicalDeviceProperties&,
+ VkFormat);
static void InitConfigFlags(VkFormatFeatureFlags, uint16_t* flags);
- void initSampleCounts(const GrVkInterface*, VkPhysicalDevice, VkFormat);
+ void initSampleCounts(const GrVkInterface*, VkPhysicalDevice,
+ const VkPhysicalDeviceProperties&, VkFormat);
enum {
kTextureable_Flag = 0x1,