diff options
author | Marek Olšák <[email protected]> | 2010-04-27 00:09:21 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-04-27 00:14:58 +0200 |
commit | 307f28cf1e8aed0c764bb1e38752ff6f42fee2da (patch) | |
tree | d764349ef5180f93d3039340e4cc983d8c48f544 | |
parent | a961431285804e39e9089a9382954e454b9f6816 (diff) |
r300g: add support for more unaligned vertex formats
An aligned stride is still needed for it to work.
I am slowly approaching the Sauerbraten milestone!
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index cc8209db6a3..edd522288bd 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1294,18 +1294,46 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe, /* Replace some formats with their aligned counterparts, * this is OK because we check for aligned strides too. */ switch (*format) { + /* Align to RGBA8. */ + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8G8_UNORM: case PIPE_FORMAT_R8G8B8_UNORM: - *format = PIPE_FORMAT_R8G8B8X8_UNORM; + *format = PIPE_FORMAT_R8G8B8A8_UNORM; continue; + case PIPE_FORMAT_R8_SNORM: + case PIPE_FORMAT_R8G8_SNORM: case PIPE_FORMAT_R8G8B8_SNORM: *format = PIPE_FORMAT_R8G8B8A8_SNORM; continue; + case PIPE_FORMAT_R8_USCALED: + case PIPE_FORMAT_R8G8_USCALED: case PIPE_FORMAT_R8G8B8_USCALED: *format = PIPE_FORMAT_R8G8B8A8_USCALED; continue; + case PIPE_FORMAT_R8_SSCALED: + case PIPE_FORMAT_R8G8_SSCALED: case PIPE_FORMAT_R8G8B8_SSCALED: *format = PIPE_FORMAT_R8G8B8A8_SSCALED; continue; + + /* Align to RG16. */ + case PIPE_FORMAT_R16_UNORM: + *format = PIPE_FORMAT_R16G16_UNORM; + continue; + case PIPE_FORMAT_R16_SNORM: + *format = PIPE_FORMAT_R16G16_SNORM; + continue; + case PIPE_FORMAT_R16_USCALED: + *format = PIPE_FORMAT_R16G16_USCALED; + continue; + case PIPE_FORMAT_R16_SSCALED: + *format = PIPE_FORMAT_R16G16_SSCALED; + continue; + case PIPE_FORMAT_R16_FLOAT: + *format = PIPE_FORMAT_R16G16_FLOAT; + continue; + + /* Align to RGBA16. */ case PIPE_FORMAT_R16G16B16_UNORM: *format = PIPE_FORMAT_R16G16B16A16_UNORM; continue; @@ -1318,6 +1346,10 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe, case PIPE_FORMAT_R16G16B16_SSCALED: *format = PIPE_FORMAT_R16G16B16A16_SSCALED; continue; + case PIPE_FORMAT_R16G16B16_FLOAT: + *format = PIPE_FORMAT_R16G16B16A16_FLOAT; + continue; + default:; } |