mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-18 12:33:47 +00:00
Make Snorm formats non-renderable
They aren't guaranteed renderable in Vulkan nor core OpenGL 4.5 without extensions. They happened to work on a lot of our CQ builders but failed on Intel OpenGL Linux which helped understand this was an issue. BUG=dawn:128 Change-Id: I83c4f8116c1125c3bac2f1dd6197976c9063e129 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9682 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
bfc9cee5d3
commit
ccf805046a
@ -112,18 +112,18 @@ namespace dawn_native {
|
||||
|
||||
// 1 byte color formats
|
||||
AddColorFormat(dawn::TextureFormat::R8Unorm, true, 1);
|
||||
AddColorFormat(dawn::TextureFormat::R8Snorm, true, 1);
|
||||
AddColorFormat(dawn::TextureFormat::R8Snorm, false, 1);
|
||||
AddColorFormat(dawn::TextureFormat::R8Uint, true, 1);
|
||||
AddColorFormat(dawn::TextureFormat::R8Sint, true, 1);
|
||||
|
||||
// 2 bytes color formats
|
||||
AddColorFormat(dawn::TextureFormat::R16Unorm, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::R16Snorm, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::R16Snorm, false, 2);
|
||||
AddColorFormat(dawn::TextureFormat::R16Uint, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::R16Sint, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::R16Float, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::RG8Unorm, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::RG8Snorm, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::RG8Snorm, false, 2);
|
||||
AddColorFormat(dawn::TextureFormat::RG8Uint, true, 2);
|
||||
AddColorFormat(dawn::TextureFormat::RG8Sint, true, 2);
|
||||
|
||||
@ -132,13 +132,13 @@ namespace dawn_native {
|
||||
AddColorFormat(dawn::TextureFormat::R32Sint, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::R32Float, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Unorm, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Snorm, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Snorm, false, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Uint, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Sint, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RG16Float, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8Unorm, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8UnormSrgb, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8Snorm, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8Snorm, false, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8Uint, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA8Sint, true, 4);
|
||||
AddColorFormat(dawn::TextureFormat::BGRA8Unorm, true, 4);
|
||||
@ -152,7 +152,7 @@ namespace dawn_native {
|
||||
AddColorFormat(dawn::TextureFormat::RG32Sint, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RG32Float, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Unorm, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Snorm, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Snorm, false, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Uint, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Sint, true, 8);
|
||||
AddColorFormat(dawn::TextureFormat::RGBA16Float, true, 8);
|
||||
|
@ -394,11 +394,7 @@ class TextureFormatTest : public DawnTest {
|
||||
std::vector<float> uncompressedData = {0.0f, 1.0f / maxValue, 1.0f, -1.0f};
|
||||
|
||||
DoFloatFormatSamplingTest(formatInfo, textureData, uncompressedData, 0.0001f / maxValue);
|
||||
|
||||
// It is not possible to render minValue because -1.0f is the minimum and corresponds to
|
||||
// -maxValue (minValue is - maxValue -1)
|
||||
textureData[3] = -maxValue;
|
||||
DoFormatRenderingTest(formatInfo, uncompressedData, textureData);
|
||||
// Snorm formats aren't renderable because they are not guaranteed renderable in Vulkan
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -507,49 +503,31 @@ TEST_P(TextureFormatTest, BGRA8Unorm) {
|
||||
|
||||
// Test the R8Snorm format
|
||||
TEST_P(TextureFormatTest, R8Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int8_t>({dawn::TextureFormat::R8Snorm, 1, Float, 1});
|
||||
}
|
||||
|
||||
// Test the RG8Snorm format
|
||||
TEST_P(TextureFormatTest, RG8Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int8_t>({dawn::TextureFormat::RG8Snorm, 2, Float, 2});
|
||||
}
|
||||
|
||||
// Test the RGBA8Snorm format
|
||||
TEST_P(TextureFormatTest, RGBA8Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int8_t>({dawn::TextureFormat::RGBA8Snorm, 4, Float, 4});
|
||||
}
|
||||
|
||||
// Test the R16Snorm format
|
||||
TEST_P(TextureFormatTest, R16Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int16_t>({dawn::TextureFormat::R16Snorm, 2, Float, 1});
|
||||
}
|
||||
|
||||
// Test the RG16Snorm format
|
||||
TEST_P(TextureFormatTest, RG16Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int16_t>({dawn::TextureFormat::RG16Snorm, 4, Float, 2});
|
||||
}
|
||||
|
||||
// Test the RGBA16Snorm format
|
||||
TEST_P(TextureFormatTest, RGBA16Snorm) {
|
||||
// TODO(cwallez@chromium.org): This fails on the Mesa Intel GL driver, understand why.
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux() && IsIntel());
|
||||
|
||||
DoSnormTest<int16_t>({dawn::TextureFormat::RGBA16Snorm, 8, Float, 4});
|
||||
}
|
||||
|
||||
|
@ -245,10 +245,19 @@ TEST_F(TextureValidationTest, NonRenderableAndOutputAttachment) {
|
||||
descriptor.format = dawn::TextureFormat::RGBA8Unorm;
|
||||
device.CreateTexture(&descriptor);
|
||||
|
||||
// Fails because RG11B10Float is non-renderable
|
||||
descriptor.format = dawn::TextureFormat::RG11B10Float;
|
||||
dawn::TextureFormat nonRenderableFormats[] = {
|
||||
dawn::TextureFormat::RG11B10Float, dawn::TextureFormat::R8Snorm,
|
||||
dawn::TextureFormat::RG8Snorm, dawn::TextureFormat::RGBA8Snorm,
|
||||
dawn::TextureFormat::R16Snorm, dawn::TextureFormat::RG16Snorm,
|
||||
dawn::TextureFormat::RGBA16Snorm,
|
||||
};
|
||||
|
||||
for (dawn::TextureFormat format : nonRenderableFormats) {
|
||||
// Fails because `format` is non-renderable
|
||||
descriptor.format = format;
|
||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(jiawei.shao@intel.com): add tests to verify we cannot create 1D or 3D textures with
|
||||
// compressed texture formats.
|
||||
|
Loading…
x
Reference in New Issue
Block a user