aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-08-11 16:17:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-11 16:17:39 -0700
commita825d5317c87784fa4ee7ff8e51ec3c2a9e0d2e3 (patch)
treee771916dc74016641e55b9c6e4f178e22b9262e2
parent300178b1c83e7a9b8d3bee7aeb09e0d4fb096d6b (diff)
Revert of Fix 4444 on Vulkan devices who don't support RGBA_4444 (patchset #4 id:60001 of https://codereview.chromium.org/2238563002/ )
Reason for revert: test failing on some gpus Original issue's description: > Fix 4444 on Vulkan devices who don't support RGBA_4444 > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2238563002 > > Committed: https://skia.googlesource.com/skia/+/637b3bf2b9c10398d823bd015a722842d4f2f971 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2240713003
-rw-r--r--src/gpu/vk/GrVkCaps.cpp11
-rw-r--r--src/gpu/vk/GrVkCaps.h2
-rw-r--r--src/gpu/vk/GrVkUtil.cpp8
-rw-r--r--tests/PackedConfigsTextureTest.cpp65
4 files changed, 4 insertions, 82 deletions
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 9027f68815..cf9f4f025e 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -137,16 +137,7 @@ void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceProperties& properties,
glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RRRR();
glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::AAAA();
} else {
- if (kRGBA_4444_GrPixelConfig == config) {
- // The vulkan spec does not require R4G4B4A4 to be supported for texturing so we
- // store the data in a B4G4R4A4 texture and then swizzle it when doing texture reads
- // or writing to outputs. Since we're not actually changing the data at all, the
- // only extra work is the swizzle in the shader for all operations.
- glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::BGRA();
- glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::BGRA();
- } else {
- glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA();
- }
+ glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA();
}
}
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index 3a35b64e4e..576972110d 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -101,7 +101,7 @@ private:
uint16_t fLinearFlags;
};
ConfigInfo fConfigTable[kGrPixelConfigCnt];
-
+
StencilFormat fPreferedStencilFormat;
// Tells of if we can pass in straight GLSL string into vkCreateShaderModule
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index ffbad25fd9..760b20b458 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -30,9 +30,7 @@ bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format) {
*format = VK_FORMAT_R5G6B5_UNORM_PACK16;
break;
case kRGBA_4444_GrPixelConfig:
- // R4G4B4A4 is not required to be supported so we actually
- // store the data is if it was B4G4R4A4 and swizzle in shaders
- *format = VK_FORMAT_B4G4R4A4_UNORM_PACK16;
+ *format = VK_FORMAT_R4G4B4A4_UNORM_PACK16;
break;
case kIndex_8_GrPixelConfig:
// No current vulkan support for this config
@@ -90,9 +88,7 @@ bool GrVkFormatToPixelConfig(VkFormat format, GrPixelConfig* config) {
case VK_FORMAT_R5G6B5_UNORM_PACK16:
*config = kRGB_565_GrPixelConfig;
break;
- case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
- // R4G4B4A4 is not required to be supported so we actually
- // store RGBA_4444 data as B4G4R4A4.
+ case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
*config = kRGBA_4444_GrPixelConfig;
break;
case VK_FORMAT_R8_UNORM:
diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp
deleted file mode 100644
index 7985b75980..0000000000
--- a/tests/PackedConfigsTextureTest.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * This is a straightforward test of using packed pixel configs (4444, 565).
- * This test will make sure that these RGBA_4444 and RGB_565 are always supported
- * as valid texturing configs.
- */
-
-#include "Test.h"
-
-#if SK_SUPPORT_GPU
-#include "GrContext.h"
-#include "GrTexture.h"
-
-static const int DEV_W = 100, DEV_H = 100;
-static const SkIRect DEV_RECT = SkIRect::MakeWH(DEV_W, DEV_H);
-
-template <typename T>
-void runTest(skiatest::Reporter* reporter, GrContext* context,
- T val1, T val2, int arraySize, GrPixelConfig config) {
- SkTDArray<T> controlPixelData, readBuffer;
- controlPixelData.setCount(arraySize);
- readBuffer.setCount(arraySize);
-
- for (int i = 0; i < arraySize; i += 2) {
- controlPixelData[i] = val1;
- controlPixelData[i + 1] = val2;
- }
-
- for (int origin = 0; origin < 2; ++origin) {
- GrSurfaceDesc desc;
- desc.fFlags = kNone_GrSurfaceFlags;
- desc.fWidth = DEV_W;
- desc.fHeight = DEV_H;
- desc.fConfig = config;
- desc.fOrigin = 0 == origin ?
- kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin;
- SkAutoTUnref<GrTexture> fpTexture(context->textureProvider()->createTexture(
- desc, SkBudgeted::kNo, controlPixelData.begin(), 0));
- SkASSERT(fpTexture);
- fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.begin(), 0);
- REPORTER_ASSERT(reporter,
- 0 == memcmp(readBuffer.begin(), controlPixelData.begin(),
- readBuffer.bytes()));
- }
-}
-
-static const int CONTROL_ARRAY_SIZE = DEV_W * DEV_H;
-
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RGBA4444TextureTest, reporter, ctxInfo) {
- runTest<uint16_t>(reporter, ctxInfo.grContext(), 0xFF00, 0xFA62,
- CONTROL_ARRAY_SIZE, kRGBA_4444_GrPixelConfig);
-}
-
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RGB565TextureTest, reporter, ctxInfo) {
- runTest<uint16_t>(reporter, ctxInfo.grContext(), 0xFF00, 0xFA62,
- CONTROL_ARRAY_SIZE, kRGB_565_GrPixelConfig);
-}
-
-#endif