summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2011-11-22 19:04:04 +0300
committerDaniel Vetter <[email protected]>2011-11-22 17:08:13 +0100
commit1f3c5eae5c4be582e50c2d4d7950424d86059c45 (patch)
tree810649ee9b81962dff9b1035b7ad5f0b1a5b07a5 /src/gallium
parentc87d1a3c3d24924f8af082e47c18a6d535419089 (diff)
i915g: implement RGBX and BGRX render targets
They're not supported by hw directly, but it's easy to emulate them with a shader swizzling fixup. Signed-off-by: Vasily Khoruzhick <[email protected]> [danvet: The important thing is to write a 1 to the unused alpha channel, the ddx is relying on this for render accel.] Signed-off-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/i915/i915_screen.c2
-rw-r--r--src/gallium/drivers/i915/i915_state_static.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 75545f40172..bf7c2c2e8d3 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -298,7 +298,9 @@ i915_is_format_supported(struct pipe_screen *screen,
};
static const enum pipe_format render_supported[] = {
PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_FORMAT_B8G8R8X8_UNORM,
PIPE_FORMAT_R8G8B8A8_UNORM,
+ PIPE_FORMAT_R8G8B8X8_UNORM,
PIPE_FORMAT_B5G6R5_UNORM,
PIPE_FORMAT_B10G10R10A2_UNORM,
PIPE_FORMAT_L8_UNORM,
diff --git a/src/gallium/drivers/i915/i915_state_static.c b/src/gallium/drivers/i915/i915_state_static.c
index e462937c273..64b842a9f76 100644
--- a/src/gallium/drivers/i915/i915_state_static.c
+++ b/src/gallium/drivers/i915/i915_state_static.c
@@ -39,13 +39,14 @@ static unsigned translate_format(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_B8G8R8A8_UNORM:
+ case PIPE_FORMAT_B8G8R8X8_UNORM:
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ case PIPE_FORMAT_R8G8B8X8_UNORM:
return COLOR_BUF_ARGB8888;
case PIPE_FORMAT_B5G6R5_UNORM:
return COLOR_BUF_RGB565;
case PIPE_FORMAT_B5G5R5A1_UNORM:
return COLOR_BUF_ARGB1555;
- case PIPE_FORMAT_R8G8B8A8_UNORM:
- return COLOR_BUF_ARGB8888;
case PIPE_FORMAT_B4G4R4A4_UNORM:
return COLOR_BUF_ARGB4444;
case PIPE_FORMAT_B10G10R10A2_UNORM:
@@ -168,6 +169,8 @@ static const struct
uint hw_swizzle;
} fixup_formats[] = {
{ PIPE_FORMAT_R8G8B8A8_UNORM, 0x21030000 /* BGRA */},
+ { PIPE_FORMAT_B8G8R8X8_UNORM, 0x01250000 /* RGBX */},
+ { PIPE_FORMAT_R8G8B8X8_UNORM, 0x21050000 /* BGRX */},
{ PIPE_FORMAT_L8_UNORM, 0x00030000 /* RRRA */},
{ PIPE_FORMAT_I8_UNORM, 0x00030000 /* RRRA */},
{ PIPE_FORMAT_A8_UNORM, 0x33330000 /* AAAA */},