diff options
author | Dave Airlie <[email protected]> | 2012-12-16 10:31:32 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2013-01-11 22:31:54 +0000 |
commit | d23aa650015ec017649f5a4ce8cb12d8c314bd3a (patch) | |
tree | a76e70719be1969b929be5f96bc8f6993bfc653f /src/gallium/drivers/r600/r600_texture.c | |
parent | 77c10225eef43eb428ebbc80f1dd426e3d33b281 (diff) |
r600g: texture buffer object + glsl 1.40 enable support (v2)
This adds TBO support to r600g, and with GLSL 1.40 enabled,
we now get 3.1 core profiles advertised for r600g.
The r600/700 implementation is a bit different from the evergreen one,
as r6/7 hw lacks vertex fetch swizzles. So we implement it by passing 5
constants per sampler to the shader, the shader uses the first 4 as masks
for each component and the 5th as the alpha value to OR in.
Now TXQ is also broken so we have to pass a constant for the buffer size,
on evergreen we just pass this, on r6/7 we pass it as the 6th element
in the const info buffer.
v1.1: drop return as DDX doesn't use a texture type
v2: add r600/700 support.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_texture.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index 85da0930242..45a30f85df4 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -912,18 +912,26 @@ void r600_init_surface_functions(struct r600_context *r600) r600->context.surface_destroy = r600_surface_destroy; } -static unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, - const unsigned char *swizzle_view) +unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, + const unsigned char *swizzle_view, + boolean vtx) { unsigned i; unsigned char swizzle[4]; unsigned result = 0; - const uint32_t swizzle_shift[4] = { + const uint32_t tex_swizzle_shift[4] = { 16, 19, 22, 25, }; + const uint32_t vtx_swizzle_shift[4] = { + 3, 6, 9, 12, + }; const uint32_t swizzle_bit[4] = { 0, 1, 2, 3, }; + const uint32_t *swizzle_shift = tex_swizzle_shift; + + if (vtx) + swizzle_shift = vtx_swizzle_shift; if (swizzle_view) { util_format_compose_swizzles(swizzle_format, swizzle_view, swizzle); @@ -977,7 +985,7 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen, }; desc = util_format_description(format); - word4 |= r600_get_swizzle_combined(desc->swizzle, swizzle_view); + word4 |= r600_get_swizzle_combined(desc->swizzle, swizzle_view, FALSE); /* Colorspace (return non-RGB formats directly). */ switch (desc->colorspace) { |