mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 22:13:25 -10:00
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 <[email protected]> Reviewed-by: Jamie Madill <[email protected]>
This commit is contained in:
1 parent
799e075abe
commit
38971fd135
9 files changed
+41
-19
No files matched your search
@@ -68,7 +68,7 @@
|
||||
"Vulkan format:src/libANGLE/renderer/vulkan/gen_vk_format_table.py":
|
||||
"2ecc99c12cd41bda7107a7d9ffe3786c",
|
||||
"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":
|
||||
"c1cc895645db3fe1cd284352890c219e",
|
||||
"Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert":
|
||||
|
||||
@@ -69,7 +69,7 @@ angle::Result OffscreenSurfaceVk::AttachmentImage::initialize(DisplayVk *display
|
||||
EGLint height,
|
||||
const vk::Format &vkFormat)
|
||||
{
|
||||
RendererVk *renderer = displayVk->getRenderer();
|
||||
RendererVk *renderer = displayVk->getRenderer();
|
||||
|
||||
const angle::Format &textureFormat = vkFormat.textureFormat();
|
||||
bool isDepthOrStencilFormat = textureFormat.depthBits > 0 || textureFormat.stencilBits > 0;
|
||||
@@ -279,10 +279,10 @@ WindowSurfaceVk::~WindowSurfaceVk()
|
||||
|
||||
void WindowSurfaceVk::destroy(const egl::Display *display)
|
||||
{
|
||||
DisplayVk *displayVk = vk::GetImpl(display);
|
||||
RendererVk *renderer = displayVk->getRenderer();
|
||||
VkDevice device = renderer->getDevice();
|
||||
VkInstance instance = renderer->getInstance();
|
||||
DisplayVk *displayVk = vk::GetImpl(display);
|
||||
RendererVk *renderer = displayVk->getRenderer();
|
||||
VkDevice device = renderer->getDevice();
|
||||
VkInstance instance = renderer->getInstance();
|
||||
|
||||
// We might not need to flush the pipe here.
|
||||
(void)renderer->finish(displayVk);
|
||||
|
||||
@@ -37,10 +37,10 @@ SurfaceImpl *DisplayVkAndroid::createWindowSurfaceVk(const egl::SurfaceState &st
|
||||
|
||||
egl::ConfigSet DisplayVkAndroid::generateConfigs()
|
||||
{
|
||||
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8};
|
||||
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this);
|
||||
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_RGB8};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
|
||||
this);
|
||||
}
|
||||
|
||||
bool DisplayVkAndroid::checkConfigSupport(egl::Config *config)
|
||||
|
||||
@@ -41,6 +41,9 @@ void GenerateCaps(const VkPhysicalDeviceProperties &physicalDeviceProperties,
|
||||
|
||||
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
|
||||
// generates a basic config which is passed to DisplayVk::checkConfigSupport.
|
||||
egl::ConfigSet GenerateConfigs(const GLenum *colorFormats,
|
||||
|
||||
@@ -223,6 +223,10 @@
|
||||
"B8G8R8X8_UNORM": {
|
||||
"buffer": "NONE",
|
||||
"texture": "B8G8R8A8_UNORM"
|
||||
},
|
||||
"D24_UNORM_X8_UINT": {
|
||||
"buffer": "NONE",
|
||||
"texture": "D24_UNORM_S8_UINT"
|
||||
}
|
||||
},
|
||||
"fallbacks": {
|
||||
@@ -232,6 +236,9 @@
|
||||
"D24_UNORM_S8_UINT": {
|
||||
"texture": "D32_FLOAT_S8X24_UINT"
|
||||
},
|
||||
"D24_UNORM_X8_UINT": {
|
||||
"texture": "D32_FLOAT_S8X24_UINT"
|
||||
},
|
||||
|
||||
"R8_UNORM": {
|
||||
"buffer": "R32_FLOAT"
|
||||
|
||||
@@ -491,7 +491,15 @@ void Format::initialize(VkPhysicalDevice physicalDevice, const angle::Format &an
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
case angle::Format::ID::D32_FLOAT:
|
||||
|
||||
@@ -36,10 +36,10 @@ SurfaceImpl *DisplayVkWin32::createWindowSurfaceVk(const egl::SurfaceState &stat
|
||||
|
||||
egl::ConfigSet DisplayVkWin32::generateConfigs()
|
||||
{
|
||||
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
|
||||
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this);
|
||||
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
|
||||
this);
|
||||
}
|
||||
|
||||
bool DisplayVkWin32::checkConfigSupport(egl::Config *config)
|
||||
|
||||
@@ -64,10 +64,10 @@ SurfaceImpl *DisplayVkXcb::createWindowSurfaceVk(const egl::SurfaceState &state,
|
||||
|
||||
egl::ConfigSet DisplayVkXcb::generateConfigs()
|
||||
{
|
||||
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
|
||||
constexpr GLenum kDepthStencilFormats[] = {GL_NONE, GL_DEPTH24_STENCIL8};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, kDepthStencilFormats, kSampleCounts, this);
|
||||
constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX};
|
||||
constexpr EGLint kSampleCounts[] = {0};
|
||||
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, kSampleCounts,
|
||||
this);
|
||||
}
|
||||
|
||||
bool DisplayVkXcb::checkConfigSupport(egl::Config *config)
|
||||
|
||||
@@ -169,9 +169,13 @@
|
||||
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_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_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
|
||||
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.stretch_height = FAIL
|
||||
2635 WIN VULKAN : dEQP-EGL.functional.resize.surface_size.stretch_width = FAIL
|
||||
|
||||
Reference in new issue
Block a user