summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_extensions.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-12-22 13:46:27 +0100
committerChristoph Bumiller <[email protected]>2013-01-30 13:10:11 +0100
commita901d54f67be0a9ec5a33195036eb6dfc54b501c (patch)
tree9f36335e1998648d47576cd869c0663188b4fc86 /src/mesa/state_tracker/st_extensions.c
parent0fcd2c5e2fa06339de8af80ff8d35e479d61ccf5 (diff)
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 <[email protected]> Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_extensions.c')
-rw-r--r--src/mesa/state_tracker/st_extensions.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 34c0d7b4052..214588f1fdf 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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);
}