Christoph Bumiller
2009-Jun-21 15:28 UTC
[PATCH] nvXX: format_supported needs to check DEPTH_STENCIL usage
See commit 0342229289c3bd5ed7bc595db4fc88003430209e. An earlier commit also caused us being given an unsupported depth buffer format. --- src/gallium/drivers/nv04/nv04_screen.c | 7 +++++++ src/gallium/drivers/nv10/nv10_screen.c | 7 +++++++ src/gallium/drivers/nv20/nv20_screen.c | 7 +++++++ src/gallium/drivers/nv30/nv30_screen.c | 7 +++++++ src/gallium/drivers/nv40/nv40_screen.c | 7 +++++++ src/gallium/drivers/nv50/nv50_screen.c | 7 +++++++ 6 files changed, 42 insertions(+), 0 deletions(-) diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c index 4bbedfb..601f1a9 100644 --- a/src/gallium/drivers/nv04/nv04_screen.c +++ b/src/gallium/drivers/nv04/nv04_screen.c @@ -79,6 +79,13 @@ nv04_screen_is_format_supported(struct pipe_screen *screen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z16_UNORM: return TRUE; default: diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c index b03c291..dc266dc 100644 --- a/src/gallium/drivers/nv10/nv10_screen.c +++ b/src/gallium/drivers/nv10/nv10_screen.c @@ -74,6 +74,13 @@ nv10_screen_is_format_supported(struct pipe_screen *screen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; diff --git a/src/gallium/drivers/nv20/nv20_screen.c b/src/gallium/drivers/nv20/nv20_screen.c index 024356c..55f2f68 100644 --- a/src/gallium/drivers/nv20/nv20_screen.c +++ b/src/gallium/drivers/nv20/nv20_screen.c @@ -74,6 +74,13 @@ nv20_screen_is_format_supported(struct pipe_screen *screen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index 31bc1f3..5266296 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -85,6 +85,13 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index b8b2af4..dd36185 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -86,6 +86,13 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index fd39fa7..f42b784 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -37,6 +37,13 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: + return TRUE; + default: + break; + } + } else + if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { + switch (format) { case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; -- 1.6.0.6 --------------090503050107050804030002 Content-Type: text/plain; name="0002-nv50-fix-HPOS-mapping-when-there-are-no-FP-attrs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0002-nv50-fix-HPOS-mapping-when-there-are-no-FP-attrs.patch"