From 436f8246cd5a377596f6e42e6562da186ef8df48 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 31 Jan 2013 08:07:51 +0100 Subject: libxtrans mesa pixman xkeyboard-config git update 31 jan 2013 libxtrans: bd53f4c8543faf910a7a151241ee07661b4d57ad mesa: a527b2192e3cb4a68af927ab405e38181d2fcf75 pixman: 958bd334b3c17f529c80f2eeef4224f45c62f292 xkeyboard-config: 46cfd7a3b5c6b6e00648407bd4c0dd56ae86d65a --- mesalib/configure.ac | 11 ++- mesalib/docs/GL3.txt | 2 +- mesalib/docs/relnotes-9.1.html | 11 ++- mesalib/docs/vmware-guest.html | 17 +++++ .../mapi/glapi/gen/ARB_texture_buffer_range.xml | 22 ++++++ mesalib/src/mapi/glapi/gen/Makefile.am | 1 + mesalib/src/mapi/glapi/gen/gl_API.xml | 4 + mesalib/src/mesa/drivers/common/driverfuncs.c | 1 - mesalib/src/mesa/main/APIspec.dtd | 52 ------------- mesalib/src/mesa/main/context.c | 6 +- mesalib/src/mesa/main/dd.h | 6 -- mesalib/src/mesa/main/extensions.c | 2 +- mesalib/src/mesa/main/formats.c | 2 +- mesalib/src/mesa/main/get.c | 1 + mesalib/src/mesa/main/get_hash_params.py | 6 ++ mesalib/src/mesa/main/glformats.c | 12 +-- mesalib/src/mesa/main/mtypes.h | 6 ++ mesalib/src/mesa/main/teximage.c | 89 +++++++++++++++++----- mesalib/src/mesa/main/teximage.h | 4 + mesalib/src/mesa/main/texparam.c | 12 +++ mesalib/src/mesa/state_tracker/st_atom_texture.c | 22 +++++- mesalib/src/mesa/state_tracker/st_extensions.c | 15 +++- 22 files changed, 200 insertions(+), 104 deletions(-) create mode 100644 mesalib/src/mapi/glapi/gen/ARB_texture_buffer_range.xml delete mode 100644 mesalib/src/mesa/main/APIspec.dtd (limited to 'mesalib') diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 9cc5c4ae5..564ca3ccf 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -57,10 +57,10 @@ LT_PREREQ([2.2]) LT_INIT([disable-static]) AX_PROG_BISON([], - AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"] + AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"], [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])])) AX_PROG_FLEX([], - AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"] + AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"], [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])])) AC_PATH_PROG([PERL], [perl]) @@ -1834,14 +1834,12 @@ if test "x$with_gallium_drivers" != x; then if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then radeon_llvm_check NEED_RADEON_GALLIUM=yes; - LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo" + R600_NEED_RADEON_GALLIUM=yes; + LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo bitreader asmparser" fi if test "x$enable_r600_llvm" = xyes; then USE_R600_LLVM_COMPILER=yes; fi - if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then - LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser" - fi gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" ;; xradeonsi) @@ -1990,6 +1988,7 @@ AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes) AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes) AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes) AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes) +AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes) AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes) AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes) AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes) diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 21c37c008..88621e330 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -149,7 +149,7 @@ ARB_robust_buffer_access_behavior not started ARB_shader_image_size not started ARB_shader_storage_buffer_object not started ARB_stencil_texturing not started -ARB_texture_buffer_range not started +ARB_texture_buffer_range DONE (nv50, nvc0) ARB_texture_query_levels not started ARB_texture_storage_multisample not started ARB_texture_view not started diff --git a/mesalib/docs/relnotes-9.1.html b/mesalib/docs/relnotes-9.1.html index ffca27539..350ae2766 100644 --- a/mesalib/docs/relnotes-9.1.html +++ b/mesalib/docs/relnotes-9.1.html @@ -44,9 +44,18 @@ Note: some of the new features are only available with certain drivers.

diff --git a/mesalib/docs/vmware-guest.html b/mesalib/docs/vmware-guest.html index ac5f03c9c..b5f136f33 100644 --- a/mesalib/docs/vmware-guest.html +++ b/mesalib/docs/vmware-guest.html @@ -29,6 +29,7 @@ MacOS are all supported.

End users shouldn't have to go through all these steps once the driver is included in newer Linux distributions. +Fedora 18 and Ubuntu 12.10 include the VMware guest GL driver, for example.

@@ -162,6 +163,22 @@ Then sudo cp 00-vmwgfx.rules /etc/udev/rules.d sudo depmod -ae + +Note: some distros put DRM kernel drivers in different directories. +For example, sometimes vmwgfx.ko might be found in +/lib/modules/{version}/extra/vmwgfx.ko or in +/lib/modules/{version}/kernel/drivers/gpu/drm/vmwgfx/vmwgfx.ko. +

+After installing vmwgfx.ko you might want to run the following command to +check that the new kernel module is in the expected place: +

+  find /lib/modules -name vmwgfx.ko -exec ls -l '{}' \;
+
+If you see the kernel module listed in more than one place, you may need to +move things around. +

+Finally, if you update your kernel you'll probably have to rebuild and +reinstall the vmwgfx.ko module again. diff --git a/mesalib/src/mapi/glapi/gen/ARB_texture_buffer_range.xml b/mesalib/src/mapi/glapi/gen/ARB_texture_buffer_range.xml new file mode 100644 index 000000000..2176c08ef --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_texture_buffer_range.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/mesalib/src/mapi/glapi/gen/Makefile.am b/mesalib/src/mapi/glapi/gen/Makefile.am index f869d28e5..4d51bbca6 100644 --- a/mesalib/src/mapi/glapi/gen/Makefile.am +++ b/mesalib/src/mapi/glapi/gen/Makefile.am @@ -108,6 +108,7 @@ API_XML = \ ARB_seamless_cube_map.xml \ ARB_sync.xml \ ARB_texture_buffer_object.xml \ + ARB_texture_buffer_range.xml \ ARB_texture_compression_rgtc.xml \ ARB_texture_float.xml \ ARB_texture_rg.xml \ diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 404ccea8e..4cbd72462 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -8316,6 +8316,10 @@ + + + + diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c index cf6b686dd..aab61e1a4 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.c +++ b/mesalib/src/mesa/drivers/common/driverfuncs.c @@ -75,7 +75,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UpdateState = NULL; /* REQUIRED! */ driver->GetBufferSize = NULL; /* REQUIRED! */ driver->ResizeBuffers = _mesa_resize_framebuffer; - driver->Error = NULL; driver->Finish = NULL; driver->Flush = NULL; diff --git a/mesalib/src/mesa/main/APIspec.dtd b/mesalib/src/mesa/main/APIspec.dtd deleted file mode 100644 index efcfa31f1..000000000 --- a/mesalib/src/mesa/main/APIspec.dtd +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 5e9e539b2..e5ed97f00 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -564,6 +564,7 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS; ctx->Const.MaxTextureBufferSize = 65536; + ctx->Const.TextureBufferOffsetAlignment = 1; ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE; ctx->Const.SubPixelBits = SUB_PIXEL_BITS; ctx->Const.MinPointSize = MIN_POINT_SIZE; @@ -1663,11 +1664,6 @@ _mesa_record_error(struct gl_context *ctx, GLenum error) if (ctx->ErrorValue == GL_NO_ERROR) { ctx->ErrorValue = error; } - - /* Call device driver's error handler, if any. This is used on the Mac. */ - if (ctx->Driver.Error) { - ctx->Driver.Error(ctx); - } } diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index f91fd4120..9a75fd954 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -108,12 +108,6 @@ struct dd_function_table { void (*ResizeBuffers)( struct gl_context *ctx, struct gl_framebuffer *fb, GLuint width, GLuint height); - /** - * Called whenever an error is generated. - * __struct gl_contextRec::ErrorValue contains the error value. - */ - void (*Error)( struct gl_context *ctx ); - /** * This is called whenever glFinish() is called. */ diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 7ae07fb5a..c9638a1af 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -131,6 +131,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GLL, 2000 }, { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GLC, 2008 }, { "GL_ARB_texture_buffer_object_rgb32", o(ARB_texture_buffer_object_rgb32), GLC, 2009 }, + { "GL_ARB_texture_buffer_range", o(ARB_texture_buffer_range), GLC, 2012 }, { "GL_ARB_texture_compression", o(dummy_true), GLL, 2000 }, { "GL_ARB_texture_compression_rgtc", o(ARB_texture_compression_rgtc), GL, 2004 }, { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), GLL, 1999 }, @@ -418,7 +419,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_fog_coord = GL_TRUE; ctx->Extensions.EXT_framebuffer_object = GL_TRUE; ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; - ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; ctx->Extensions.EXT_point_parameters = GL_TRUE; diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index 47a1d6802..1c9e63377 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -2649,7 +2649,7 @@ _mesa_format_to_type_and_comps(gl_format format, } /** - * Check if a gl_format exactly matches a GL formaat/type combination + * Check if a gl_format exactly matches a GL format/type combination * such that we can use memcpy() from one to the other. * \param gl_format a MESA_FORMAT_x value * \param format the user-specified image format diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 5f4e2fa51..da1e01cb5 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -353,6 +353,7 @@ EXTRA_EXT(ARB_uniform_buffer_object); EXTRA_EXT(ARB_timer_query); EXTRA_EXT(ARB_map_buffer_alignment); EXTRA_EXT(ARB_texture_cube_map_array); +EXTRA_EXT(ARB_texture_buffer_range); static const int extra_NV_primitive_restart[] = { diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 26a722a87..b6bed809c 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -701,6 +701,12 @@ descriptor=[ # GL_ARB_texture_cube_map_array [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ], +]}, + +# Enums restricted to OpenGL Core profile +{ "apis": ["GL_CORE"], "params": [ +# GL_ARB_texture_buffer_range + [ "TEXTURE_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.TextureBufferOffsetAlignment), extra_ARB_texture_buffer_range" ], ]} ] diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index 6160d8ecd..8728540cf 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -1485,18 +1485,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, else if (ctx->Extensions.ARB_depth_buffer_float && type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV) return GL_NO_ERROR; - switch (type) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - return GL_INVALID_OPERATION; - default: + else return GL_INVALID_ENUM; - } case GL_DUDV_ATI: case GL_DU8DV8_ATI: diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 3369623f7..b92f98e7d 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1295,6 +1295,9 @@ struct gl_texture_object GLenum BufferObjectFormat; /** Equivalent Mesa format for BufferObjectFormat. */ gl_format _BufferObjectFormat; + /** GL_ARB_texture_buffer_range */ + GLintptr BufferOffset; + GLsizeiptr BufferSize; /**< if this is -1, use BufferObject->Size instead */ /** GL_OES_EGL_image_external */ GLint RequiredTextureImageUnits; @@ -2851,6 +2854,8 @@ struct gl_constants GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */ + GLuint TextureBufferOffsetAlignment; /**< GL_ARB_texture_buffer_range */ + GLuint MaxArrayLockSize; GLint SubPixelBits; @@ -3075,6 +3080,7 @@ struct gl_extensions GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_buffer_object; GLboolean ARB_texture_buffer_object_rgb32; + GLboolean ARB_texture_buffer_range; GLboolean ARB_texture_compression_rgtc; GLboolean ARB_texture_cube_map; GLboolean ARB_texture_cube_map_array; diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 31a559e9d..f03e84ad8 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -3994,23 +3994,16 @@ validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) } -/** GL_ARB_texture_buffer_object */ -void GLAPIENTRY -_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) +static void +texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat, + struct gl_buffer_object *bufObj, + GLintptr offset, GLsizeiptr size) { struct gl_texture_object *texObj; - struct gl_buffer_object *bufObj; gl_format format; - GET_CURRENT_CONTEXT(ctx); FLUSH_VERTICES(ctx, 0); - if (!(ctx->API == API_OPENGL_CORE && - ctx->Extensions.ARB_texture_buffer_object)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer"); - return; - } - if (target != GL_TEXTURE_BUFFER_ARB) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(target)"); return; @@ -4023,12 +4016,6 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) return; } - bufObj = _mesa_lookup_bufferobj(ctx, buffer); - if (buffer && !bufObj) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer(buffer %u)", buffer); - return; - } - texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); @@ -4036,6 +4023,74 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) _mesa_reference_buffer_object(ctx, &texObj->BufferObject, bufObj); texObj->BufferObjectFormat = internalFormat; texObj->_BufferObjectFormat = format; + texObj->BufferOffset = offset; + texObj->BufferSize = size; } _mesa_unlock_texture(ctx, texObj); } + +/** GL_ARB_texture_buffer_object */ +void GLAPIENTRY +_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) +{ + struct gl_buffer_object *bufObj; + + GET_CURRENT_CONTEXT(ctx); + + /* NOTE: ARB_texture_buffer_object has interactions with + * the compatibility profile that are not implemented. + */ + if (!(ctx->API == API_OPENGL_CORE && + ctx->Extensions.ARB_texture_buffer_object)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer"); + return; + } + + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (!bufObj && buffer) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer(buffer %u)", buffer); + return; + } + + texbufferrange(ctx, target, internalFormat, bufObj, 0, buffer ? -1 : 0); +} + +/** GL_ARB_texture_buffer_range */ +void GLAPIENTRY +_mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, + GLintptr offset, GLsizeiptr size) +{ + struct gl_buffer_object *bufObj; + + GET_CURRENT_CONTEXT(ctx); + + if (!(ctx->API == API_OPENGL_CORE && + ctx->Extensions.ARB_texture_buffer_range)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBufferRange"); + return; + } + + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (bufObj) { + if (offset < 0 || + size <= 0 || + (offset + size) > bufObj->Size) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexBufferRange"); + return; + } + if (offset % ctx->Const.TextureBufferOffsetAlignment) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTexBufferRange(invalid offset alignment)"); + return; + } + } else if (buffer) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBufferRange(buffer %u)", + buffer); + return; + } else { + offset = 0; + size = 0; + } + + texbufferrange(ctx, target, internalFormat, bufObj, offset, size); +} diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h index 65e933371..7124cac52 100644 --- a/mesalib/src/mesa/main/teximage.h +++ b/mesalib/src/mesa/main/teximage.h @@ -289,6 +289,10 @@ _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, extern void GLAPIENTRY _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer); +extern void GLAPIENTRY +_mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, + GLintptr offset, GLsizeiptr size); + /*@}*/ diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 52ede13c0..b6afd35ba 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -1181,6 +1181,18 @@ get_tex_level_parameter_buffer(struct gl_context *ctx, *params = _mesa_get_format_bits(texFormat, pname); break; + /* GL_ARB_texture_buffer_range */ + case GL_TEXTURE_BUFFER_OFFSET: + if (!ctx->Extensions.ARB_texture_buffer_range) + goto invalid_pname; + *params = texObj->BufferOffset; + break; + case GL_TEXTURE_BUFFER_SIZE: + if (!ctx->Extensions.ARB_texture_buffer_range) + goto invalid_pname; + *params = (texObj->BufferSize == -1) ? bo->Size : texObj->BufferSize; + break; + /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: /* Always illegal for GL_TEXTURE_BUFFER */ 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); } -- cgit v1.2.3