diff options
author | Dave Airlie <[email protected]> | 2012-12-15 13:03:54 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-12-16 06:55:39 +1000 |
commit | 39fa4c0a58e9103ec564c26e50382aa0e0af081b (patch) | |
tree | 28974f71149cf554f9b5815fc572ac4e77eb7d5a /src/mesa | |
parent | 1b62c326ea36dcfe66e84a75d11b4bbbc4231c69 (diff) |
st/mesa: add texture buffer object rgb32 support.
This checks if the pipe driver can support RGB32 formats.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index f3f01ebd5e4..262cc3d6c74 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -494,6 +494,14 @@ void st_init_extensions(struct st_context *st) PIPE_FORMAT_B10G10R10A2_SSCALED } }, }; + static const struct st_extension_format_mapping tbo_rgb32[] = { + { {o(ARB_texture_buffer_object_rgb32) }, + { PIPE_FORMAT_R32G32B32_FLOAT, + PIPE_FORMAT_R32G32B32_UINT, + PIPE_FORMAT_R32G32B32_SINT, + } }, + }; + /* * Extensions that are supported by all Gallium drivers: */ @@ -661,8 +669,12 @@ void st_init_extensions(struct st_context *st) if (ctx->Const.MinMapBufferAlignment >= 64) { ctx->Extensions.ARB_map_buffer_alignment = GL_TRUE; } - if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS)) + if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS)) { ctx->Extensions.ARB_texture_buffer_object = GL_TRUE; + init_format_extensions(st, tbo_rgb32, Elements(tbo_rgb32), + PIPE_BUFFER, PIPE_BIND_SAMPLER_VIEW); + } + /* Unpacking a varying in the fragment shader costs 1 texture indirection. * If the number of available texture indirections is very limited, then we |