Compare commits

...

22 Commits

Author SHA1 Message Date
Emil Velikov
8957b696f9 docs: add sha256 checksums for 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 13:16:18 +01:00
Emil Velikov
ab9aacce2d docs: add release notes for 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 12:37:31 +01:00
Emil Velikov
1c261a97ec Update version to 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 12:34:16 +01:00
Kyle Brenneman
00aa3ee7cf glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)
Add a macro GL_LIB_NAME to hold the filename that configure comes up with
based on the --with-gl-lib-name and --enable-mangling options.

In driOpenDriver, use the GL_LIB_NAME macro instead of hard-coding
"libGL.so.1".

v2: Add an #ifndef/#define for GL_LIB_NAME so that non-autoconf builds will
    work.
v3: Fix the library filename in the Makefile.

Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d35391cfda)
2015-10-03 12:31:17 +01:00
Kyle Brenneman
256df77d51 mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.
When USE_MGL_NAMESPACE is defined, _glapi_get_stub will check for the "m"
prefix before trying to skip it, so that "glFoo" and "mglFoo" are
equivalent.

This should let it work with all the places where something calls
_glapi_get_proc_offset with a hard-coded name that starts with the normal
"gl" prefix.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55552
Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 798f260a2f)
2015-10-03 12:31:11 +01:00
Kyle Brenneman
f20d5a7bfc glx: Fix build errors with --enable-mangling (v2)
Rearranged the GLX_ALIAS macro in glextensions.h so that it will pick up
the renames from glx_mangle.h.

Fixed the alias attribute for glXGetProcAddress when USE_MGL_NAMESPACE is
defined.

v2: Add a comment clarifying why GLX_ALIAS needs two macros.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55552
Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit a27f2d991b)
2015-10-03 12:31:06 +01:00
Chris Wilson
a1a567c125 i965: Remove early release of DRI2 miptree
intel_update_winsys_renderbuffer_miptree() will release the existing
miptree when wrapping a new DRI2 buffer, so we can remove the early
release and so prevent a NULL mt dereference should importing the new
DRI2 name fail for any reason. (Reusing the old DRI2 name will result
in the rendering going astray, to a stale buffer, and not shown on the
screen, but it allows us to issue a warning and not crash much later in
innocent code.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86281
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit 70e91d61fd)
Nominated-by: Emil Velikov <emil.velikov@collabora.com>
2015-09-30 22:01:22 +01:00
Brian Paul
f6c645d9d6 st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats
For 8-bit RGB(A) texture formats we set the PIPE_BIND_RENDER_TARGET flag
to try to get a hardware format which also supports rendering (for FBO
textures).  Do the same thing for floating point formats.

This allows the Redway3D Flat demo to run.

Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit cb758b892a)
2015-09-30 21:56:02 +01:00
Leo Liu
0dae12ac6e radeon/vce: fix vui time_scale zero error
if app pass 0 as frame_rate_num, it should not be encoded to the VUI.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1e97b41893)
2015-09-30 21:55:33 +01:00
Roland Scheidegger
41b44abdcb mesa: fix mipmap generation for immutable, compressed textures
If the immutable compressed texture didn't have the full mip pyramid,
this didn't work, because it tried to generate mip levels for non-existing
levels. _mesa_prepare_mipmap_level() would correctly handle this by returning
FALSE if the mip level didn't exist, however we actually created the
non-existing mip level right before that because we used _mesa_get_tex_image()
before calling _mesa_prepare_mipmap_level(). It would then proceed to crash
(we allocated the mip level, which is a bad idea on an immutable texture,
but didn't initialize the values, leading to assertion failures or segfaults).
Fix this by using _mesa_select_tex_image() instead and call it after
_mesa_prepare_mipmap_level(), as that function will allocate missing mip levels
for non-immutable textures already.
This fixes a (2 year old) crash with astromenace which was hack-fixed in ubuntu
packages instead: http://bugs.debian.org/718680 (I guess most apps do full mip
chains - I believe this app not doing it is actually unintentional, always one
level less than full mip chain...).

Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 19604d30e1)
2015-09-30 21:55:03 +01:00
Marek Olšák
1805e64739 st/mesa: fix front buffer regression after dropping st_validate_state in Blit
Broken by: d082c53249
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92072

Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit f3a0819533)
2015-09-30 21:54:36 +01:00
Kristian Høgsberg Kristensen
5b6ac61231 i965: Respect stride and subreg_offset for ATTR registers
When we assign hw regs to attributes, we don't incorporate the stride
and subreg_offset from the fs_reg. It's rarely used, but the integer
multiplication lowering uses unusual stride and subreg_offset
combination breaks when one source is an attribute.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91970
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 2ea16966ae)
2015-09-30 21:54:04 +01:00
Ian Romanick
dad649b66c t_dd_dmatmp: Use addition instead of subtraction in loop bounds
This is used everywhere else in this file because it avoids problems
when count is zero (due to trimming).

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38109
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Marius Predut <marius.predut@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 25543d8ec5)
2015-09-30 21:53:33 +01:00
Ian Romanick
e0a6546ddd t_dd_dmatmp: Pull out common 'count -= count & 3' code
This was missing in the HAVE_TRIANGLES path, and that could cause
incorrect rendering.

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38109
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: Marius Predut <marius.predut@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c0b3b2f760)
2015-09-30 21:53:02 +01:00
Ian Romanick
34ad2da6b9 t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere
No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0d475ee2b9)
2015-09-30 21:52:29 +01:00
Ian Romanick
e158605a37 t_dd_dmatmp: Clean up improper code formatting from previous patch
No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fad8d54de7)
2015-09-30 21:51:58 +01:00
Ian Romanick
430c84f73c t_dd_dmatmp: Make "count" actually be the count
The value passed in count previously was "vertex after the last vertex
to be processed."  Calling that "count" was misleading and kind of mean.
Looking at the code, many functions immediately do "count-start" to get
back the true count.  That's just silly.

If it is better for the loops to be 'for (j = start; j < (start +
count); j++)', GCC will do that transformation.

NOTE: There is some strange formatting left by this patch.  That was
done to make it more obvious that the before and after code is
equivalent.  These will be fixed in the next patch.

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

v2: Fix a remaining (count-start) in render_quad_strip_verts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d7bf7969b9)
2015-09-30 21:51:27 +01:00
Iago Toral Quiroga
be6c2706c1 mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.
From section 9.2. Binding and Managing Framebuffer Objects:

"Upon successful return from Get*FramebufferAttachmentParameteriv, if
pname is FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then params will contain
one of NONE, FRAMEBUFFER_DEFAULT, TEXTURE, or RENDERBUFFER, identifying
the type of object which contains the attached image."

And then it clarifies further:

"If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
either no framebuffer is bound to target; or the default framebuffer is
bound, attachment is DEPTH or STENCIL, and the number of depth or stencil
bits, respectively, is zero"

Currently, if the default framebuffer is bound, we always return
GL_FRAMEBUFFER_DEFAULT for FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, but
according to the spec, when GL_DEPTH or GL_STENCIL attachments are
the ones being queried, we should return GL_NONE if they don't exist.

Fixes the following dEQP test:
dEQP-GLES3.functional.state_query.fbo.framebuffer_attachment_x_size_initial

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cf439951b7)
2015-09-30 21:50:57 +01:00
Emil Velikov
78b0f48c3b cherry-ignore: add commit non applicable for 10.6
The nominated commit 7f8815bcb9 (i965: fix
textureGrad for cubemaps) addresses issue, raised post 10.6 branchpoint.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-30 21:43:37 +01:00
Jeremy Huddleston
15020937bd configure.ac: Add support to enable read-only text segment on x86.
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/240956
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6dfc5e28f7)
2015-09-30 21:30:16 +01:00
Emil Velikov
69f2e709aa cherry-ignore: add commit non applicable for 10.6
The nominated commit afa1efdc85 (mesa:
fix errors when reading depth with glReadPixels) addresses issue,
raised post 10.6 branchpoint.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-30 21:21:01 +01:00
Emil Velikov
02387926ad docs: add sha256 checksums for 10.6.8
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-20 11:55:41 +01:00
20 changed files with 282 additions and 115 deletions

View File

@@ -1 +1 @@
10.6.8
10.6.9

View File

@@ -1,2 +1,8 @@
# The vec4 nir i965 work landed after the 10.6 branchpoint
b8d2263c83d29f4626ac0fe0316978aa6262aefb i965/vec4_nir: Load constants as integers
# The issue/commit it fixes has landed post 10.6 branchpoint
afa1efdc8522d987e3af7c7a6272021caa33eb82 mesa: fix errors when reading depth with glReadPixels
# The issue/commit is fixes has landed post 10.6 branchpoint
7f8815bcb9af9b4b374ad7bd6e7cfa7529a6c980 i965: fix textureGrad for cubemaps

View File

@@ -1150,6 +1150,16 @@ AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
[DEFINES="${DEFINES} -DGLX_USE_TLS"])
dnl Read-only text section on x86 hardened platforms
AC_ARG_ENABLE([glx-read-only-text],
[AS_HELP_STRING([--enable-glx-read-only-text],
[Disable writable .text section on x86 (decreases performance) @<:@default=disabled@:>@])],
[enable_glx_read_only_text="$enableval"],
[enable_glx_read_only_text=no])
if test "x$enable_glx_read_only_text" = xyes; then
DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
fi
dnl
dnl More DRI setup
dnl

View File

@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
<h2>SHA256 checksums</h2>
<pre>
TBD
1f34dba2a8059782e3e4e0f18b9628004e253b2c69085f735b846d2e63c9e250 mesa-10.6.8.tar.gz
e36ee5ceeadb3966fb5ce5b4cf18322dbb76a4f075558ae49c3bba94f57d58fd mesa-10.6.8.tar.xz
</pre>

130
docs/relnotes/10.6.9.html Normal file
View File

@@ -0,0 +1,130 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.6.9 Release Notes / Octover 03, 2015</h1>
<p>
Mesa 10.6.9 is a bug fix release which fixes bugs found since the 10.6.8 release.
</p>
<p>
Mesa 10.6.9 implements the OpenGL 3.3 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
3.3 is <strong>only</strong> available if requested at context creation
because compatibility contexts are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
3406876aac67546d0c3e2cb97da330b62644c313e7992b95618662e13c54296a mesa-10.6.9.tar.gz
b04c4de6280b863babc2929573da17218d92e9e4ba6272d548d135415723e8c3 mesa-10.6.9.tar.xz
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38109">Bug 38109</a> - i915 driver crashes if too few vertices are submitted (Mesa 7.10.2)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55552">Bug 55552</a> - Compile errors with --enable-mangling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86281">Bug 86281</a> - brw_meta_fast_clear (brw=brw&#64;entry=0x7fffd4097a08, fb=fb&#64;entry=0x7fffd40fa900, buffers=buffers&#64;entry=2, partial_clear=partial_clear&#64;entry=false)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91970">Bug 91970</a> - [BSW regression] dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92072">Bug 92072</a> - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats</li>
</ul>
<p>Chris Wilson (1):</p>
<ul>
<li>i965: Remove early release of DRI2 miptree</li>
</ul>
<p>Emil Velikov (4):</p>
<ul>
<li>docs: add sha256 checksums for 10.6.8</li>
<li>cherry-ignore: add commit non applicable for 10.6</li>
<li>cherry-ignore: add commit non applicable for 10.6</li>
<li>Update version to 10.6.9</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>t_dd_dmatmp: Make "count" actually be the count</li>
<li>t_dd_dmatmp: Clean up improper code formatting from previous patch</li>
<li>t_dd_dmatmp: Use '&amp; 3' instead of '% 4' everywhere</li>
<li>t_dd_dmatmp: Pull out common 'count -= count &amp; 3' code</li>
<li>t_dd_dmatmp: Use addition instead of subtraction in loop bounds</li>
</ul>
<p>Jeremy Huddleston (1):</p>
<ul>
<li>configure.ac: Add support to enable read-only text segment on x86.</li>
</ul>
<p>Kristian Høgsberg Kristensen (1):</p>
<ul>
<li>i965: Respect stride and subreg_offset for ATTR registers</li>
</ul>
<p>Kyle Brenneman (3):</p>
<ul>
<li>glx: Fix build errors with --enable-mangling (v2)</li>
<li>mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.</li>
<li>glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)</li>
</ul>
<p>Leo Liu (1):</p>
<ul>
<li>radeon/vce: fix vui time_scale zero error</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>st/mesa: fix front buffer regression after dropping st_validate_state in Blit</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>mesa: fix mipmap generation for immutable, compressed textures</li>
</ul>
</div>
</body>
</html>

View File

@@ -251,6 +251,9 @@ static void vui(struct rvce_encoder *enc)
{
int i;
if (!enc->pic.rate_ctrl.frame_rate_num)
return;
RVCE_BEGIN(0x04000009); // vui
RVCE_CS(0x00000000); //aspectRatioInfoPresentFlag
RVCE_CS(0x00000000); //aspectRatioInfo.aspectRatioIdc

View File

@@ -46,6 +46,7 @@ AM_CFLAGS = \
$(EXTRA_DEFINES_XF86VIDMODE) \
-D_REENTRANT \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
-DGL_LIB_NAME=\"lib@GL_LIB@.so.1\" \
$(DEFINES) \
$(LIBDRM_CFLAGS) \
$(DRI2PROTO_CFLAGS) \

View File

@@ -73,6 +73,10 @@ dri_message(int level, const char *f, ...)
}
}
#ifndef GL_LIB_NAME
#define GL_LIB_NAME "libGL.so.1"
#endif
#ifndef DEFAULT_DRIVER_DIR
/* this is normally defined in Mesa/configs/default with DRI_DRIVER_SEARCH_PATH */
#define DEFAULT_DRIVER_DIR "/usr/local/lib/dri"
@@ -99,7 +103,7 @@ driOpenDriver(const char *driverName)
int len;
/* Attempt to make sure libGL symbols will be visible to the driver */
glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
glhandle = dlopen(GL_LIB_NAME, RTLD_NOW | RTLD_GLOBAL);
libPaths = NULL;
if (geteuid() == getuid()) {

View File

@@ -2646,7 +2646,11 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
*/
_X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void)
#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
# if defined(USE_MGL_NAMESPACE)
__attribute__ ((alias("mglXGetProcAddressARB")));
# else
__attribute__ ((alias("glXGetProcAddressARB")));
# endif
#else
{
return glXGetProcAddressARB(procName);

View File

@@ -280,11 +280,17 @@ typedef void (*PFNGLXDISABLEEXTENSIONPROC) (const char *name);
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
#else
# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
/* GLX_ALIAS and GLX_ALIAS_VOID both expand to the macro GLX_ALIAS2. Using the
* extra expansion means that the name mangling macros in glx_mangle.h will
* apply before stringification, so the alias attribute will have a string like
* "mglXFoo" instead of "glXFoo". */
# define GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func) \
return_type real_func proto_args \
__attribute__ ((alias( # aliased_func ) ));
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func)
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
GLX_ALIAS2(void, real_func, proto_args, args, aliased_func)
# else
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type real_func proto_args \

View File

@@ -175,7 +175,7 @@ _glapi_get_stub(const char *name, int generate)
const struct mapi_stub *stub;
#ifdef USE_MGL_NAMESPACE
if (name)
if (name && name[0] == 'm')
name++;
#endif

View File

@@ -251,7 +251,7 @@ intel_run_render(struct gl_context * ctx, struct tnl_pipeline_stage *stage)
continue;
intel_render_tab_verts[prim & PRIM_MODE_MASK] (ctx, start,
start + length, prim);
length, prim);
}
tnl->Driver.Render.Finish(ctx);

View File

@@ -1413,7 +1413,6 @@ intel_process_dri2_buffer(struct brw_context *brw,
buffer->cpp, buffer->pitch);
}
intel_miptree_release(&rb->mt);
bo = drm_intel_bo_gem_create_from_name(brw->bufmgr, buffer_name,
buffer->name);
if (!bo) {

View File

@@ -1942,7 +1942,10 @@ fs_visitor::assign_vs_urb_setup()
inst->src[i].file = HW_REG;
inst->src[i].fixed_hw_reg =
retype(brw_vec8_grf(grf, 0), inst->src[i].type);
stride(byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type),
inst->src[i].subreg_offset),
inst->exec_size * inst->src[i].stride,
inst->exec_size, inst->src[i].stride);
}
}
}

View File

@@ -446,7 +446,7 @@ static GLboolean radeon_run_render( struct gl_context *ctx,
start, start+length);
if (length)
tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim );
tab[prim & PRIM_MODE_MASK](ctx, start, length, prim);
}
tnl->Driver.Render.Finish( ctx );

View File

@@ -3422,7 +3422,16 @@ _mesa_get_framebuffer_attachment_parameter(struct gl_context *ctx,
switch (pname) {
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
*params = _mesa_is_winsys_fbo(buffer)
/* From the OpenGL spec, 9.2. Binding and Managing Framebuffer Objects:
*
* "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
* either no framebuffer is bound to target; or the default framebuffer
* is bound, attachment is DEPTH or STENCIL, and the number of depth or
* stencil bits, respectively, is zero."
*/
*params = (_mesa_is_winsys_fbo(buffer) &&
((attachment != GL_DEPTH && attachment != GL_STENCIL) ||
(att->Type != GL_NONE)))
? GL_FRAMEBUFFER_DEFAULT : att->Type;
return;
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:

View File

@@ -1922,11 +1922,8 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
}
/* get dest gl_texture_image */
dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
if (!dstImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
return;
}
dstImage = _mesa_select_tex_image(texObj, target, level + 1);
assert(dstImage);
if (target == GL_TEXTURE_1D_ARRAY) {
srcDepth = srcHeight;
@@ -2107,7 +2104,19 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
srcWidth, srcHeight, srcDepth,
&dstWidth, &dstHeight, &dstDepth);
if (!nextLevel)
break;
goto end;
if (!_mesa_prepare_mipmap_level(ctx, texObj, level + 1,
dstWidth, dstHeight, dstDepth,
border, srcImage->InternalFormat,
srcImage->TexFormat)) {
/* all done */
goto end;
}
/* get dest gl_texture_image */
dstImage = _mesa_select_tex_image(texObj, target, level + 1);
assert(dstImage);
/* Compute dst image strides and alloc memory on first iteration */
temp_dst_row_stride = _mesa_format_row_stride(temp_format, dstWidth);
@@ -2121,13 +2130,6 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
}
}
/* get dest gl_texture_image */
dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
if (!dstImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
goto end;
}
/* for 2D arrays, setup array[depth] of slice pointers */
for (i = 0; i < srcDepth; i++) {
temp_src_slices[i] = temp_src + temp_src_img_stride * i;
@@ -2146,14 +2148,6 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
dstWidth, dstHeight, dstDepth,
temp_dst_slices, temp_dst_row_stride);
if (!_mesa_prepare_mipmap_level(ctx, texObj, level + 1,
dstWidth, dstHeight, dstDepth,
border, srcImage->InternalFormat,
srcImage->TexFormat)) {
/* all done */
goto end;
}
/* The image space was allocated above so use glTexSubImage now */
ctx->Driver.TexSubImage(ctx, 2, dstImage,
0, 0, 0, dstWidth, dstHeight, dstDepth,

View File

@@ -228,6 +228,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
st_adjust_blit_for_msaa_resolve(&blit);
st->pipe->blit(st->pipe, &blit);
dstRb->defined = true; /* front buffer tracking */
}
}
}
@@ -265,6 +266,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
st_adjust_blit_for_msaa_resolve(&blit);
st->pipe->blit(st->pipe, &blit);
dstRb->defined = true; /* front buffer tracking */
}
}
}

View File

@@ -1960,7 +1960,11 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
else if (internalFormat == 3 || internalFormat == 4 ||
internalFormat == GL_RGB || internalFormat == GL_RGBA ||
internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 ||
internalFormat == GL_BGRA)
internalFormat == GL_BGRA ||
internalFormat == GL_RGB16F ||
internalFormat == GL_RGBA16F ||
internalFormat == GL_RGB32F ||
internalFormat == GL_RGBA32F)
bindings |= PIPE_BIND_RENDER_TARGET;
/* GLES allows the driver to choose any format which matches

View File

@@ -121,9 +121,9 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr ) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -148,7 +148,7 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
/* Emit whole number of lines in total and in each buffer:
*/
count -= (count-start) & 1;
count -= count & 1;
currentsz = GET_CURRENT_VB_MAX_VERTS();
currentsz -= currentsz & 1;
dmasz -= dmasz & 1;
@@ -156,9 +156,9 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr ) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -186,9 +186,9 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j + 1 < count; j += nr - 1 ) {
for (j = 0; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -214,10 +214,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
INIT( GL_LINE_STRIP );
if (flags & PRIM_BEGIN)
j = start;
else
j = start + 1;
j = (flags & PRIM_BEGIN) ? 0 : 1;
/* Ensure last vertex won't wrap buffers:
*/
@@ -234,23 +231,23 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
nr = MIN2( currentsz, count - j );
if (j + nr >= count &&
start < count - 1 &&
count > 1 &&
(flags & PRIM_END))
{
void *tmp;
tmp = ALLOC_VERTS(nr+1);
tmp = TAG(emit_verts)( ctx, j, nr, tmp );
tmp = TAG(emit_verts)(ctx, start + j, nr, tmp);
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
(void) tmp;
}
else {
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
}
}
else if (start + 1 < count && (flags & PRIM_END)) {
else if (count > 1 && (flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_VERTS(2);
tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
@@ -284,14 +281,14 @@ static void TAG(render_triangles_verts)( struct gl_context *ctx,
/* Emit whole number of tris in total. dmasz is already a multiple
* of 3.
*/
count -= (count-start)%3;
count -= count % 3;
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
}
@@ -322,9 +319,9 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx,
dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
for (j = start ; j + 2 < count; j += nr - 2 ) {
for (j = 0; j + 2 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -354,12 +351,12 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
currentsz = dmasz;
}
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
for (j = 1; j + 1 < count; j += nr - 2) {
void *tmp;
nr = MIN2( currentsz, count - j + 1 );
tmp = ALLOC_VERTS( nr );
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
tmp = TAG(emit_verts)( ctx, start + j, nr - 1, tmp );
(void) tmp;
currentsz = dmasz;
}
@@ -394,12 +391,12 @@ static void TAG(render_poly_verts)( struct gl_context *ctx,
currentsz = dmasz;
}
for (j = start + 1 ; j + 1 < count ; j += nr - 2 ) {
for (j = 1 ; j + 1 < count ; j += nr - 2 ) {
void *tmp;
nr = MIN2( currentsz, count - j + 1 );
tmp = ALLOC_VERTS( nr );
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
tmp = TAG(emit_verts)(ctx, start + j, nr - 1, tmp);
(void) tmp;
currentsz = dmasz;
}
@@ -437,9 +434,9 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
dmasz -= (dmasz & 2);
currentsz -= (currentsz & 2);
for (j = start ; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -465,7 +462,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
/* Emit whole number of quads in total, and in each buffer.
*/
dmasz -= dmasz & 1;
count -= (count-start) & 1;
count -= count & 1;
currentsz -= currentsz & 1;
if (currentsz < 12)
@@ -474,14 +471,14 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
currentsz = currentsz/6*2;
dmasz = dmasz/6*2;
for (j = start; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
if (nr >= 4) {
GLint quads = (nr/2)-1;
GLint i;
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) {
for (i = j; i < j + quads * 2; i += 2) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+2), (i+1) );
EMIT_TWO_ELTS( 4, (i+3), (i+2) );
@@ -519,15 +516,15 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
dmasz -= dmasz & 1;
currentsz = GET_CURRENT_VB_MAX_VERTS();
currentsz -= currentsz & 1;
count -= (count-start) & 1;
count -= count & 1;
if (currentsz < 8) {
currentsz = dmasz;
}
for (j = start; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@@ -545,6 +542,9 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
GLuint count,
GLuint flags )
{
/* Emit whole number of quads in total. */
count -= count & 3;
if (HAVE_QUADS) {
LOCAL_VARS;
int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4;
@@ -553,18 +553,13 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
INIT(GL_QUADS);
/* Emit whole number of quads in total. dmasz is already a multiple
* of 4.
*/
count -= (count-start)%4;
currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
}
@@ -587,7 +582,6 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
/* Emit whole number of quads in total, and in each buffer.
*/
dmasz -= dmasz & 3;
count -= (count-start) & 3;
currentsz -= currentsz & 3;
/* Adjust for rendering as triangles:
@@ -598,14 +592,14 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr ) {
for (j = 0; j < count; j += nr ) {
nr = MIN2( currentsz, count - j );
if (nr >= 4) {
GLint quads = nr/4;
GLint i;
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) {
for (i = j; i < j + quads * 4; i += 4) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+3), (i+1) );
EMIT_TWO_ELTS( 4, (i+2), (i+3) );
@@ -629,15 +623,15 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
INIT(GL_TRIANGLES);
for (j = start; j < count-3; j += 4) {
for (j = 0; j + 3 < count; j += 4) {
void *tmp = ALLOC_VERTS( 6 );
/* Send v0, v1, v3
*/
tmp = EMIT_VERTS(ctx, j, 2, tmp);
tmp = EMIT_VERTS(ctx, j + 3, 1, tmp);
tmp = EMIT_VERTS(ctx, start + j, 2, tmp);
tmp = EMIT_VERTS(ctx, start + j + 3, 1, tmp);
/* Send v1, v2, v3
*/
tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
tmp = EMIT_VERTS(ctx, start + j + 1, 3, tmp);
(void) tmp;
}
}
@@ -698,9 +692,9 @@ static void TAG(render_points_elts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr ) {
for (j = 0; j < count; j += nr ) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -728,7 +722,7 @@ static void TAG(render_lines_elts)( struct gl_context *ctx,
/* Emit whole number of lines in total and in each buffer:
*/
count -= (count-start) & 1;
count -= count & 1;
currentsz -= currentsz & 1;
dmasz -= dmasz & 1;
@@ -736,9 +730,9 @@ static void TAG(render_lines_elts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr ) {
for (j = 0; j < count; j += nr ) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -768,9 +762,9 @@ static void TAG(render_line_strip_elts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j + 1 < count; j += nr - 1 ) {
for (j = 0; j + 1 < count; j += nr - 1) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)( ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -798,10 +792,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
FLUSH();
ELT_INIT( GL_LINE_STRIP );
if (flags & PRIM_BEGIN)
j = start;
else
j = start + 1;
j = (flags & PRIM_BEGIN) ? 0 : 1;
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
@@ -818,23 +809,23 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
nr = MIN2( currentsz, count - j );
if (j + nr >= count &&
start < count - 1 &&
count > 1 &&
(flags & PRIM_END))
{
void *tmp;
tmp = ALLOC_ELTS(nr+1);
tmp = TAG(emit_elts)( ctx, elts+j, nr, tmp );
tmp = TAG(emit_elts)(ctx, elts + start + j, nr, tmp);
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
(void) tmp;
}
else {
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
currentsz = dmasz;
}
}
}
else if (start + 1 < count && (flags & PRIM_END)) {
else if (count > 1 && (flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_ELTS(2);
tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );
@@ -874,14 +865,14 @@ static void TAG(render_triangles_elts)( struct gl_context *ctx,
/* Emit whole number of tris in total. dmasz is already a multiple
* of 3.
*/
count -= (count-start)%3;
count -= count % 3;
currentsz -= currentsz%3;
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -914,9 +905,9 @@ static void TAG(render_tri_strip_elts)( struct gl_context *ctx,
dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
for (j = start ; j + 2 < count; j += nr - 2 ) {
for (j = 0; j + 2 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)( ctx, elts + start + j, nr, ALLOC_ELTS(nr) );
FLUSH();
currentsz = dmasz;
}
@@ -947,12 +938,12 @@ static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
currentsz = dmasz;
}
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
for (j = 1; j + 1 < count; j += nr - 2) {
void *tmp;
nr = MIN2( currentsz, count - j + 1 );
tmp = ALLOC_ELTS( nr );
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
tmp = TAG(emit_elts)(ctx, elts + start + j, nr - 1, tmp);
(void) tmp;
FLUSH();
currentsz = dmasz;
@@ -985,12 +976,12 @@ static void TAG(render_poly_elts)( struct gl_context *ctx,
currentsz = dmasz;
}
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
for (j = 1 ; j + 1 < count; j += nr - 2) {
void *tmp;
nr = MIN2( currentsz, count - j + 1 );
tmp = ALLOC_ELTS( nr );
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
tmp = TAG(emit_elts)(ctx, elts + start + j, nr - 1, tmp);
(void) tmp;
FLUSH();
currentsz = dmasz;
@@ -1023,7 +1014,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
/* Emit whole number of quads in total, and in each buffer.
*/
dmasz -= dmasz & 1;
count -= (count-start) & 1;
count -= count & 1;
currentsz -= currentsz & 1;
if (currentsz < 12)
@@ -1035,7 +1026,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
currentsz = currentsz/6*2;
dmasz = dmasz/6*2;
for (j = start; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
if (nr >= 4)
@@ -1044,7 +1035,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
GLint quads = (nr/2)-1;
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
for (i = j; i < j + quads; i++, elts += 2) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[2], elts[1] );
EMIT_TWO_ELTS( 4, elts[3], elts[2] );
@@ -1060,9 +1051,9 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
else {
ELT_INIT( GL_TRIANGLE_STRIP );
for (j = start; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -1076,6 +1067,9 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
GLuint count,
GLuint flags )
{
/* Emit whole number of quads in total. */
count -= count & 3;
if (HAVE_QUADS) {
LOCAL_VARS;
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
@@ -1088,14 +1082,12 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
count -= (count-start)%4;
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count; j += nr) {
for (j = 0; j < count; j += nr) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
@@ -1112,7 +1104,6 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
/* Emit whole number of quads in total, and in each buffer.
*/
dmasz -= dmasz & 3;
count -= (count-start) & 3;
currentsz -= currentsz & 3;
/* Adjust for rendering as triangles:
@@ -1123,7 +1114,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j + 3 < count; j += nr - 2 ) {
for (j = 0; j + 3 < count; j += nr - 2) {
nr = MIN2( currentsz, count - j );
if (nr >= 4)
@@ -1132,7 +1123,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
GLint i;
ELTS_VARS( ALLOC_ELTS( quads * 6 ) );
for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
for (i = j; i < j + quads; i++, elts += 4) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[3], elts[1] );
EMIT_TWO_ELTS( 4, elts[2], elts[3] );