aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-22 14:00:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-22 18:50:58 +0000
commit7128fdd82d7c4bd5e17dd5a2ebb6135904335746 (patch)
tree91dadcaef1c6ba0cce3a913ab18a7d318405f2b7 /src
parent112565e3e7e0403a2a1bf1db9a42134a5cd6ed85 (diff)
Remove kZeroCopy_GrSurfaceFlag
Change-Id: I2869f97a14f3a1363ebfef5d657bd6468fc991f7 Reviewed-on: https://skia-review.googlesource.com/17491 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp35
1 files changed, 5 insertions, 30 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 968902bf0e..7fbca9f9da 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -696,21 +696,6 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budget
return nullptr;
}
- bool linearTiling = false;
- if (SkToBool(desc.fFlags & kZeroCopy_GrSurfaceFlag)) {
- // we can't have a linear texture with a mipmap
- if (texels.count() > 1) {
- SkDebugf("Trying to create linear tiled texture with mipmap");
- return nullptr;
- }
- if (fVkCaps->isConfigTexturableLinearly(desc.fConfig) &&
- (!renderTarget || fVkCaps->isConfigRenderableLinearly(desc.fConfig, false))) {
- linearTiling = true;
- } else {
- return nullptr;
- }
- }
-
VkImageUsageFlags usageFlags = VK_IMAGE_USAGE_SAMPLED_BIT;
if (renderTarget) {
usageFlags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -724,9 +709,6 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budget
// texture.
usageFlags |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
- VkFlags memProps = (!texels.empty() && linearTiling) ? VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT :
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
-
// This ImageDesc refers to the texture that will be read by the client. Thus even if msaa is
// requested, this ImageDesc describes the resolved texture. Therefore we always have samples set
// to 1.
@@ -736,11 +718,11 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budget
imageDesc.fFormat = pixelFormat;
imageDesc.fWidth = desc.fWidth;
imageDesc.fHeight = desc.fHeight;
- imageDesc.fLevels = linearTiling ? 1 : mipLevels;
+ imageDesc.fLevels = mipLevels;
imageDesc.fSamples = 1;
- imageDesc.fImageTiling = linearTiling ? VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL;
+ imageDesc.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
imageDesc.fUsageFlags = usageFlags;
- imageDesc.fMemProps = memProps;
+ imageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
GrVkTexture* tex;
if (renderTarget) {
@@ -756,15 +738,8 @@ GrTexture* GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budget
if (!texels.empty()) {
SkASSERT(texels.begin()->fPixels);
- bool success;
- if (linearTiling) {
- success = this->uploadTexDataLinear(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
- texels.begin()->fPixels, texels.begin()->fRowBytes);
- } else {
- success = this->uploadTexDataOptimal(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
- texels);
- }
- if (!success) {
+ if (!this->uploadTexDataOptimal(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
+ texels)) {
tex->unref();
return nullptr;
}