diff options
author | Marek Olšák <[email protected]> | 2010-10-05 02:52:03 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-10-24 23:43:13 +0200 |
commit | 8449a4772a73f613d9425b691cffba6a261df813 (patch) | |
tree | 8b1baf004fba3f1afcdaff46025bcbfd76afa48c /src/gallium/drivers/r300 | |
parent | 6e618535901ac71a74ffb80d3da7c841a82eec02 (diff) |
r300g: fix texture border for 16-bits-per-channel formats
This is kinda hacky, but it's hard to come up with a generic solution for
all formats when only a few are used in practice (I mostly get B8G8R8*8).
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 904736ef06d..730ef7a3ee2 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -620,14 +620,19 @@ static uint32_t r300_get_border_color(enum pipe_format format, } break; - default: - /* I think the fat formats (16, 32) are specified - * as the 8-bit ones. I am not sure how compressed formats - * work here. */ + case 8: r = ((float_to_ubyte(border_swizzled[0]) & 0xff) << 0) | ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) | ((float_to_ubyte(border_swizzled[2]) & 0xff) << 16) | ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24); + break; + + case 16: + r = ((float_to_ubyte(border_swizzled[2]) & 0xff) << 0) | + ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) | + ((float_to_ubyte(border_swizzled[0]) & 0xff) << 16) | + ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24); + break; } return r; |