st/mesa: add support for GL_ARB_texture_buffer_range

v2: Update to handle BufferSize being -1 and return a NULL sampler
view if the specified range would cause out of bounds access.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Christoph Bumiller
2012-12-22 13:46:27 +01:00
parent 0fcd2c5e2f
commit a901d54f67
2 changed files with 28 additions and 1 deletions

View File

@@ -685,6 +685,13 @@ void st_init_extensions(struct st_context *st)
}
if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS)) {
ctx->Extensions.ARB_texture_buffer_object = GL_TRUE;
ctx->Const.TextureBufferOffsetAlignment =
screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT);
if (ctx->Const.TextureBufferOffsetAlignment)
ctx->Extensions.ARB_texture_buffer_range = GL_TRUE;
init_format_extensions(st, tbo_rgb32, Elements(tbo_rgb32),
PIPE_BUFFER, PIPE_BIND_SAMPLER_VIEW);
}