Commit 38971fd1 by Geoff Lang Committed by Commit Bot

Vulkan: Support multiple depth stencil formats for backbuffers.

Since the backbuffer's depth stencil is always emualted, it can support any depth stencil format. BUG=angleproject:2692 Change-Id: I29df62bb322c1ac4e9fcd54e4cbc4c219cf12e83 Reviewed-on: https://chromium-review.googlesource.com/1119075 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 799e075a
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py": "Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
"2ecc99c12cd41bda7107a7d9ffe3786c", "2ecc99c12cd41bda7107a7d9ffe3786c",
"Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json": "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
"48d376e36fc9fbb1f2a804cc49fc6277", "d1afcd16318ca0a19550d713eb23b85a",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py": "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
"c1cc895645db3fe1cd284352890c219e", "c1cc895645db3fe1cd284352890c219e",
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert": "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert":
......
...@@ -69,7 +69,7 @@ angle::Result OffscreenSurfaceVk::AttachmentImage::initialize(DisplayVk *display ...@@ -69,7 +69,7 @@ angle::Result OffscreenSurfaceVk::AttachmentImage::initialize(DisplayVk *display
EGLint height, EGLint height,
const vk::Format &vkFormat) const vk::Format &vkFormat)
{ {
RendererVk *renderer = displayVk->getRenderer(); RendererVk *renderer = displayVk->getRenderer();
const angle::Format &textureFormat = vkFormat.textureFormat(); const angle::Format &textureFormat = vkFormat.textureFormat();
bool isDepthOrStencilFormat = textureFormat.depthBits > 0 || textureFormat.stencilBits > 0; bool isDepthOrStencilFormat = textureFormat.depthBits > 0 || textureFormat.stencilBits > 0;
...@@ -279,10 +279,10 @@ WindowSurfaceVk::~WindowSurfaceVk() ...@@ -279,10 +279,10 @@ WindowSurfaceVk::~WindowSurfaceVk()
void WindowSurfaceVk::destroy(const egl::Display *display) void WindowSurfaceVk::destroy(const egl::Display *display)
{ {
DisplayVk *displayVk = vk::GetImpl(display); DisplayVk *displayVk = vk::GetImpl(display);
RendererVk *renderer = displayVk->getRenderer(); RendererVk *renderer = displayVk->getRenderer();
VkDevice device = renderer->getDevice(); VkDevice device = renderer->getDevice();
VkInstance instance = renderer->getInstance(); VkInstance instance = renderer->getInstance();
// We might not need to flush the pipe here. // We might not need to flush the pipe here.
(void)renderer->finish(displayVk); (void)renderer->finish(displayVk);
......
...@@ -37,10 +37,10 @@ SurfaceImpl *DisplayVkAndroid::createWindowSurfaceVk(const egl::SurfaceState &st ...@@ -37,10 +37,10 @@ SurfaceImpl *DisplayVkAndroid::createWindowSurfaceVk(const egl::SurfaceState &st
egl::ConfigSet DisplayVkAndroid::generateConfigs() egl::ConfigSet DisplayVkAndroid::generateConfigs()
{ {
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8}; constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8};
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8}; constexpr EGLint kSampleCounts[] = {0};
constexpr EGLint kSampleCounts[] = {0}; return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this); this);
} }
bool DisplayVkAndroid::checkConfigSupport(egl::Config *config) bool DisplayVkAndroid::checkConfigSupport(egl::Config *config)
......
...@@ -41,6 +41,9 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties, ...@@ -41,6 +41,9 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
namespace egl_vk namespace egl_vk
{ {
constexpr GLenum kConfigDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8, GL_DEPTH_COMPONENT24,
GL_DEPTH_COMPONENT16};
// Permutes over all combinations of color format, depth stencil format and sample count and // Permutes over all combinations of color format, depth stencil format and sample count and
// generates a basic config which is passed to DisplayVk::checkConfigSupport. // generates a basic config which is passed to DisplayVk::checkConfigSupport.
egl::ConfigSet GenerateConfigs(const GLenum *colorFormats, egl::ConfigSet GenerateConfigs(const GLenum *colorFormats,
......
...@@ -223,6 +223,10 @@ ...@@ -223,6 +223,10 @@
"B8G8R8X8_UNORM": { "B8G8R8X8_UNORM": {
"buffer": "NONE", "buffer": "NONE",
"texture": "B8G8R8A8_UNORM" "texture": "B8G8R8A8_UNORM"
},
"D24_UNORM_X8_UINT": {
"buffer": "NONE",
"texture": "D24_UNORM_S8_UINT"
} }
}, },
"fallbacks": { "fallbacks": {
...@@ -232,6 +236,9 @@ ...@@ -232,6 +236,9 @@
"D24_UNORM_S8_UINT": { "D24_UNORM_S8_UINT": {
"texture": "D32_FLOAT_S8X24_UINT" "texture": "D32_FLOAT_S8X24_UINT"
}, },
"D24_UNORM_X8_UINT": {
"texture": "D32_FLOAT_S8X24_UINT"
},
"R8_UNORM": { "R8_UNORM": {
"buffer": "R32_FLOAT" "buffer": "R32_FLOAT"
......
...@@ -491,7 +491,15 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an ...@@ -491,7 +491,15 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
break; break;
case angle::Format::ID::D24_UNORM_X8_UINT: case angle::Format::ID::D24_UNORM_X8_UINT:
// This format is not implemented in Vulkan. internalFormat = GL_DEPTH_COMPONENT24;
initTextureFallback(physicalDevice, angle::Format::ID::D24_UNORM_S8_UINT,
VK_FORMAT_D24_UNORM_S8_UINT, nullptr,
angle::Format::ID::D32_FLOAT_S8X24_UINT,
VK_FORMAT_D32_SFLOAT_S8_UINT, nullptr);
bufferFormatID = angle::Format::ID::NONE;
vkBufferFormat = VK_FORMAT_UNDEFINED;
vertexLoadFunction = nullptr;
vertexLoadRequiresConversion = true;
break; break;
case angle::Format::ID::D32_FLOAT: case angle::Format::ID::D32_FLOAT:
......
...@@ -36,10 +36,10 @@ SurfaceImpl *DisplayVkWin32::createWindowSurfaceVk(const egl::SurfaceState &stat ...@@ -36,10 +36,10 @@ SurfaceImpl *DisplayVkWin32::createWindowSurfaceVk(const egl::SurfaceState &stat
egl::ConfigSet DisplayVkWin32::generateConfigs() egl::ConfigSet DisplayVkWin32::generateConfigs()
{ {
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX}; constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8}; constexpr EGLint kSampleCounts[] = {0};
constexpr EGLint kSampleCounts[] = {0}; return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this); this);
} }
bool DisplayVkWin32::checkConfigSupport(egl::Config *config) bool DisplayVkWin32::checkConfigSupport(egl::Config *config)
......
...@@ -64,10 +64,10 @@ SurfaceImpl *DisplayVkXcb::createWindowSurfaceVk(const egl::SurfaceState &state, ...@@ -64,10 +64,10 @@ SurfaceImpl *DisplayVkXcb::createWindowSurfaceVk(const egl::SurfaceState &state,
egl::ConfigSet DisplayVkXcb::generateConfigs() egl::ConfigSet DisplayVkXcb::generateConfigs()
{ {
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX}; constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8}; constexpr EGLint kSampleCounts[] = {0};
constexpr EGLint kSampleCounts[] = {0}; return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this); this);
} }
bool DisplayVkXcb::checkConfigSupport(egl::Config *config) bool DisplayVkXcb::checkConfigSupport(egl::Config *config)
......
...@@ -169,9 +169,13 @@ ...@@ -169,9 +169,13 @@
2635 WIN VULKAN : dEQP-EGL.functional.multicontext.shared_make_current = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.multicontext.shared_make_current = FAIL
2635 WIN VULKAN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_depth_stencil = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_depth_stencil = FAIL
2635 WIN VULKAN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_no_depth_no_stencil = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.query_surface.set_attribute.pbuffer.rgba8888_no_depth_no_stencil = FAIL
2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_no_stencil = FAIL
2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_stencil = FAIL 2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_stencil = FAIL
2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_no_depth_no_stencil = FAIL 2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_no_depth_no_stencil = FAIL
2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_depth_no_stencil = FAIL
2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_no_depth_no_stencil = FAIL 2715 WIN VULKAN : dEQP-EGL.functional.query_surface.simple.pbuffer.rgba8888_no_depth_no_stencil = FAIL
2739 WIN VULKAN : dEQP-EGL.functional.render.multi_context.gles2.* = FAIL
2739 WIN VULKAN : dEQP-EGL.functional.render.single_context.gles2.* = FAIL
2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.grow = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.grow = FAIL
2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.stretch_height = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.stretch_height = FAIL
2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.stretch_width = FAIL 2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.stretch_width = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment