aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-31 08:07:51 +0100
committermarha <marha@users.sourceforge.net>2013-01-31 08:07:51 +0100
commit436f8246cd5a377596f6e42e6562da186ef8df48 (patch)
treea00e72591f276cac16bc0fd65bc263ba89c93c00 /mesalib/src/mesa/state_tracker
parent69c8cec54b01ed522bf10baf20da70304bac701a (diff)
downloadvcxsrv-436f8246cd5a377596f6e42e6562da186ef8df48.tar.gz
vcxsrv-436f8246cd5a377596f6e42e6562da186ef8df48.tar.bz2
vcxsrv-436f8246cd5a377596f6e42e6562da186ef8df48.zip
libxtrans mesa pixman xkeyboard-config git update 31 jan 2013
libxtrans: bd53f4c8543faf910a7a151241ee07661b4d57ad mesa: a527b2192e3cb4a68af927ab405e38181d2fcf75 pixman: 958bd334b3c17f529c80f2eeef4224f45c62f292 xkeyboard-config: 46cfd7a3b5c6b6e00648407bd4c0dd56ae86d65a
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c22
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c15
2 files changed, 35 insertions, 2 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index dba1d829c..4b43b2a7d 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -152,7 +152,27 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
u_sampler_view_default_template(&templ,
stObj->pt,
format);
- templ.u.tex.first_level = stObj->base.BaseLevel;
+
+ if (stObj->pt->target == PIPE_BUFFER) {
+ unsigned base, size;
+ unsigned f, n;
+ const struct util_format_description *desc
+ = util_format_description(templ.format);
+
+ base = stObj->base.BufferOffset;
+ if (base >= stObj->pt->width0)
+ return NULL;
+ size = MIN2(stObj->pt->width0 - base, (unsigned)stObj->base.BufferSize);
+
+ f = ((base * 8) / desc->block.bits) * desc->block.width;
+ n = ((size * 8) / desc->block.bits) * desc->block.width;
+ if (!n)
+ return NULL;
+ templ.u.buf.first_element = f;
+ templ.u.buf.last_element = f + (n - 1);
+ } else {
+ templ.u.tex.first_level = stObj->base.BaseLevel;
+ }
if (swizzle != SWIZZLE_NOOP) {
templ.swizzle_r = GET_SWZ(swizzle, 0);
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index af54cf7c8..214588f1f 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -534,7 +534,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.EXT_blend_minmax = GL_TRUE;
ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
- ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
ctx->Extensions.EXT_fog_coord = GL_TRUE;
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
@@ -653,6 +652,13 @@ void st_init_extensions(struct st_context *st)
break;
}
}
+ if (ctx->Const.MaxSamples == 1) {
+ /* one sample doesn't really make sense */
+ ctx->Const.MaxSamples = 0;
+ }
+ else if (ctx->Const.MaxSamples >= 2) {
+ ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
+ }
if (ctx->Const.MaxDualSourceDrawBuffers > 0)
ctx->Extensions.ARB_blend_func_extended = GL_TRUE;
@@ -679,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);
}