summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-08-27 17:31:04 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-08-30 13:55:07 +0200
commit9f4998639c3c47f0b7ee3e2a29b7f3609d3f7796 (patch)
treec305c22b3828851eb12a233c70e4f0f01a44d8bb /src/gallium
parentfb92fc25b00beda4df48865670c8769c7a669aac (diff)
nv50,nvc0: reject R8G8B8A8/X8_UNORM for multisample surfaces
The window system buffer will be BGRA and applications will try to directly resolve to it, which would trigger an INVALID_OPERATION in BlitFramebuffer if the multisample renderbuffer is RGBA.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c7
-rw-r--r--src/gallium/drivers/nvc0/nvc0_screen.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 581aad19627..985a55c3223 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -43,7 +43,7 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
unsigned sample_count,
unsigned bindings)
{
- if (sample_count > 2 && sample_count != 4 && sample_count != 8)
+ if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */
return FALSE;
if (sample_count == 8 && util_format_get_blocksizebits(format) >= 128)
return FALSE;
@@ -56,6 +56,11 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
if (nv50_screen(pscreen)->tesla->grclass < NVA0_3D)
return FALSE;
break;
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ case PIPE_FORMAT_R8G8B8X8_UNORM:
+ /* HACK: GL requires equal formats for MS resolve and window is BGRA */
+ if (sample_count > 1)
+ return FALSE;
default:
break;
}
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index c79256a6ba2..204887d2e8b 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -40,12 +40,22 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
unsigned sample_count,
unsigned bindings)
{
- if (sample_count > 2 && sample_count != 4 && sample_count != 8)
+ if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */
return FALSE;
if (!util_format_is_supported(format, bindings))
return FALSE;
+ switch (format) {
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ case PIPE_FORMAT_R8G8B8X8_UNORM:
+ /* HACK: GL requires equal formats for MS resolve and window is BGRA */
+ if (sample_count > 1)
+ return FALSE;
+ default:
+ break;
+ }
+
/* transfers & shared are always supported */
bindings &= ~(PIPE_BIND_TRANSFER_READ |
PIPE_BIND_TRANSFER_WRITE |