Commit 2d874693 by Nicolas Capens Committed by Nicolas Capens

Fix depth format assert.

Recently added depth formats were not recognized and caused an assert. Change-Id: Ide1c783f183770d40673051ccd48b3f8e689f8db Reviewed-on: https://swiftshader-review.googlesource.com/15969Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d80d4c4b
...@@ -251,42 +251,15 @@ namespace es2 ...@@ -251,42 +251,15 @@ namespace es2
egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) egl::Image *Device::createDepthStencilSurface(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{ {
ASSERT(sw::Surface::isDepth(format));
if(height > OUTLINE_RESOLUTION) if(height > OUTLINE_RESOLUTION)
{ {
ERR("Invalid parameters: %dx%d", width, height); ERR("Invalid parameters: %dx%d", width, height);
return nullptr; return nullptr;
} }
bool lockable = true; bool lockable = !sw::Surface::hasQuadLayout(format);
switch(format)
{
case FORMAT_S8:
// case FORMAT_D15S1:
case FORMAT_D24S8:
case FORMAT_D24X8:
// case FORMAT_D24X4S4:
case FORMAT_D24FS8:
case FORMAT_D32:
case FORMAT_D16:
case FORMAT_D32F:
case FORMAT_D32F_COMPLEMENTARY:
lockable = false;
break;
// case FORMAT_S8_LOCKABLE:
// case FORMAT_D16_LOCKABLE:
case FORMAT_D32F_LOCKABLE:
// case FORMAT_D32_LOCKABLE:
case FORMAT_DF24S8:
case FORMAT_DF16S8:
case FORMAT_D32FS8_TEXTURE:
case FORMAT_D32FS8_SHADOW:
lockable = true;
break;
default:
UNREACHABLE(format);
}
egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable); egl::Image *surface = egl::Image::create(width, height, format, multiSampleDepth, lockable);
if(!surface) if(!surface)
......
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