aboutsummaryrefslogtreecommitdiff
path: root/mesalib
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib')
-rw-r--r--mesalib/configure.ac11
-rw-r--r--mesalib/docs/GL3.txt2
-rw-r--r--mesalib/docs/relnotes-9.1.html11
-rw-r--r--mesalib/docs/vmware-guest.html17
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_texture_buffer_range.xml22
-rw-r--r--mesalib/src/mapi/glapi/gen/Makefile.am1
-rwxr-xr-xmesalib/src/mapi/glapi/gen/gl_API.xml4
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c1
-rw-r--r--mesalib/src/mesa/main/APIspec.dtd52
-rw-r--r--mesalib/src/mesa/main/context.c6
-rw-r--r--mesalib/src/mesa/main/dd.h6
-rw-r--r--mesalib/src/mesa/main/extensions.c2
-rw-r--r--mesalib/src/mesa/main/formats.c2
-rw-r--r--mesalib/src/mesa/main/get.c1
-rw-r--r--mesalib/src/mesa/main/get_hash_params.py6
-rw-r--r--mesalib/src/mesa/main/glformats.c12
-rw-r--r--mesalib/src/mesa/main/mtypes.h6
-rw-r--r--mesalib/src/mesa/main/teximage.c89
-rw-r--r--mesalib/src/mesa/main/teximage.h4
-rw-r--r--mesalib/src/mesa/main/texparam.c12
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c22
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c15
22 files changed, 200 insertions, 104 deletions
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.
</p>
<ul>
+<li>GL_ANGLE_texture_compression_dxt3</li>
+<li>GL_ANGLE_texture_compression_dxt5</li>
+<li>GL_ARB_ES3_compatibility</li>
+<li>GL_ARB_internalformat_query</li>
<li>GL_ARB_map_buffer_alignment</li>
-<li>GL_ARB_texture_cube_map_array</li>
+<li>GL_ARB_shading_language_packing</li>
<li>GL_ARB_texture_buffer_object_rgb32</li>
+<li>GL_ARB_texture_cube_map_array</li>
+<li>GL_EXT_color_buffer_float</li>
+<li>GL_OES_depth_texture_cube_map</li>
+<li>OpenGL 3.1 core profile support on Radeon HD2000 up to HD6000 series </li>
+<li>Multisample anti-aliasing support on Radeon X1000 series</li>
</ul>
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.
<p>
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.
</p>
<p>
@@ -162,6 +163,22 @@ Then
sudo cp 00-vmwgfx.rules /etc/udev/rules.d
sudo depmod -ae
</pre>
+
+Note: some distros put DRM kernel drivers in different directories.
+For example, sometimes vmwgfx.ko might be found in
+<code>/lib/modules/{version}/extra/vmwgfx.ko</code> or in
+<code>/lib/modules/{version}/kernel/drivers/gpu/drm/vmwgfx/vmwgfx.ko</code>.
+<p>
+After installing vmwgfx.ko you might want to run the following command to
+check that the new kernel module is in the expected place:
+<pre>
+ find /lib/modules -name vmwgfx.ko -exec ls -l '{}' \;
+</pre>
+If you see the kernel module listed in more than one place, you may need to
+move things around.
+<p>
+Finally, if you update your kernel you'll probably have to rebuild and
+reinstall the vmwgfx.ko module again.
</ul>
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 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_ARB_texture_buffer_range" number="139">
+
+ <enum name="TEXTURE_BUFFER_OFFSET" value="0x919D"/>
+ <enum name="TEXTURE_BUFFER_SIZE" value="0x919E"/>
+ <enum name="TEXTURE_BUFFER_OFFSET_ALIGNMENT" value="0x919F"/>
+
+ <function name="TexBufferRange" offset="assign">
+ <param name="target" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="buffer" type="GLuint"/>
+ <param name="offset" type="GLintptr"/>
+ <param name="size" type="GLsizeiptr"/>
+ </function>
+
+</category>
+
+</OpenGLAPI>
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 11d6a8366..a3e1351b5 100755
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -8316,6 +8316,10 @@
<xi:include href="ARB_invalidate_subdata.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<!-- ARB extensions #133...#138 -->
+
+<xi:include href="ARB_texture_buffer_range.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<!-- Non-ARB extensions sorted by extension number. -->
<category name="GL_EXT_blend_color" number="2">
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 @@
-<!ELEMENT apispec (template|api)+>
-
-<!ELEMENT api (category*, function*)>
-<!ELEMENT category EMPTY>
-<!ELEMENT function EMPTY>
-
-<!ELEMENT template (proto, desc*)>
-<!ELEMENT proto (return, (param|vector)*)>
-<!ELEMENT return EMPTY>
-<!ELEMENT param EMPTY>
-<!ELEMENT vector (param*)>
-<!ELEMENT desc ((value|range)*, desc*)>
-<!ELEMENT value EMPTY>
-<!ELEMENT range EMPTY>
-
-<!ATTLIST api name NMTOKEN #REQUIRED
- implementation (true | false) "false">
-<!ATTLIST category name NMTOKEN #REQUIRED>
-<!ATTLIST function name NMTOKEN #REQUIRED
- default_prefix NMTOKEN "_mesa_"
- external (true | false) "false"
- template NMTOKEN #REQUIRED
- gltype CDATA #IMPLIED
- vector_size NMTOKEN #IMPLIED
- expand_vector (true | false) "false"
- skip_desc (true | false) "false">
-
-<!ATTLIST template name NMTOKEN #REQUIRED
- direction (set | get) "set">
-
-<!ATTLIST return type CDATA #REQUIRED>
-<!ATTLIST param name NMTOKEN #REQUIRED
- type CDATA #REQUIRED
- hide_if_expanded (true | false) "false"
- category NMTOKEN #IMPLIED>
-<!ATTLIST vector name NMTOKEN #REQUIRED
- type CDATA #REQUIRED
- size NMTOKEN #REQUIRED
- category NMTOKEN #IMPLIED>
-
-<!ATTLIST desc name NMTOKEN #REQUIRED
- vector_size CDATA #IMPLIED
- convert (true | false) #IMPLIED
- error NMTOKEN "GL_INVALID_ENUM"
- category NMTOKEN #IMPLIED>
-
-<!ATTLIST value name CDATA #REQUIRED
- category NMTOKEN #IMPLIED>
-<!ATTLIST range from NMTOKEN #REQUIRED
- to NMTOKEN #REQUIRED
- base NMTOKEN #IMPLIED
- category NMTOKEN #IMPLIED>
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
@@ -109,12 +109,6 @@ struct dd_function_table {
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.
*/
void (*Finish)( struct gl_context *ctx );
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);
}