<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[120263] trunk/dports/x11/mesa</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/120263">120263</a></dd>
<dt>Author</dt> <dd>jeremyhu@macports.org</dd>
<dt>Date</dt> <dd>2014-05-20 20:46:08 -0700 (Tue, 20 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>mesa: Update to latest changes on the 8.0 branch</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsx11mesaPortfile">trunk/dports/x11/mesa/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsx11mesafiles0003mesafixperlevelmaxtexturesizeerrorcheckingpatch">trunk/dports/x11/mesa/files/0003-mesa-fix-per-level-max-texture-size-error-checking.patch</a></li>
<li><a href="#trunkdportsx11mesafiles0008glslinitialiseconstforceglslextensionwarningipatch">trunk/dports/x11/mesa/files/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch</a></li>
<li><a href="#trunkdportsx11mesafiles0009mesatestforGL_EXT_framebuffer_sRGBinglPopAttribpatch">trunk/dports/x11/mesa/files/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch</a></li>
<li><a href="#trunkdportsx11mesafiles0011AppleglFlushisnotneededwithCGLFlushDrawablepatch">trunk/dports/x11/mesa/files/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch</a></li>
<li><a href="#trunkdportsx11mesafiles0012glapiAvoidheapcorruptionin_glapi_tablepatch">trunk/dports/x11/mesa/files/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch</a></li>
<li><a href="#trunkdportsx11mesafiles0013darwinFixtestforkCGLPFAOpenGLProfilesupportatpatch">trunk/dports/x11/mesa/files/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsx11mesafiles0001darwindonotcreatedoublebufferedoffscreenpixelpatch">trunk/dports/x11/mesa/files/0001-darwin-do-not-create-double-buffered-offscreen-pixel.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsx11mesaPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/x11/mesa/Portfile (120262 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/Portfile        2014-05-20 22:43:40 UTC (rev 120262)
+++ trunk/dports/x11/mesa/Portfile        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -5,8 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> name                mesa
</span><span class="cx"> epoch               1
</span><del>-version             8.0.4
-revision            3
</del><ins>+version             8.0.5
</ins><span class="cx"> categories          x11 graphics
</span><span class="cx"> maintainers         jeremyhu openmaintainer
</span><span class="cx"> license             MIT
</span><span class="lines">@@ -19,10 +18,11 @@
</span><span class="cx"> worksrcdir          Mesa-${version}
</span><span class="cx"> platforms           macosx darwin
</span><span class="cx"> use_bzip2           yes
</span><del>-master_sites        ftp://ftp.freedesktop.org/pub/mesa/${version}/
-checksums           sha1    c64f8c03caf9ededd5f7011e246c42a649096c8c \
-                    rmd160  c8f822a529adc4390d70f48746d9a6d4b79c85b4 \
-                    sha256  02ed19f4f5f6535dda03a9932a81438aa78ea723ebba1f39a3d49a70a4e1d07e
</del><ins>+master_sites        ftp://ftp.freedesktop.org/pub/mesa/older-versions/8.x/${version}/ \
+                    ftp://ftp.freedesktop.org/pub/mesa/${version}/
+checksums           sha1    c30ef84363dc9ace0504bd5bcae14cfc718f1d62 \
+                    rmd160  c4b2547a95950ea07708251a5f260888267d5cd0 \
+                    sha256  511b8da34f8e69ed24caf422964fb7ae747f3b1d8093f6b8aa2602164a475a5e
</ins><span class="cx"> 
</span><span class="cx"> depends_build       bin:makedepend:makedepend \
</span><span class="cx">                     bin:tclsh8.5:tcl
</span><span class="lines">@@ -35,7 +35,12 @@
</span><span class="cx"> 
</span><span class="cx"> patchfiles \
</span><span class="cx">     patch-src-mapi-vgapi-Makefile.diff \
</span><del>-    0001-darwin-do-not-create-double-buffered-offscreen-pixel.patch
</del><ins>+    0003-mesa-fix-per-level-max-texture-size-error-checking.patch \
+    0008-glsl-initialise-const-force-glsl-extension-warning-i.patch \
+    0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch \
+    0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch \
+    0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch \
+    0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch
</ins><span class="cx"> patch.pre_args -p1
</span><span class="cx"> 
</span><span class="cx"> use_configure  no
</span></span></pre></div>
<a id="trunkdportsx11mesafiles0001darwindonotcreatedoublebufferedoffscreenpixelpatch"></a>
<div class="delfile"><h4>Deleted: trunk/dports/x11/mesa/files/0001-darwin-do-not-create-double-buffered-offscreen-pixel.patch (120262 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0001-darwin-do-not-create-double-buffered-offscreen-pixel.patch        2014-05-20 22:43:40 UTC (rev 120262)
+++ trunk/dports/x11/mesa/files/0001-darwin-do-not-create-double-buffered-offscreen-pixel.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-From 59997d619d8957fca3b2042fe4ebeed0709c0204 Mon Sep 17 00:00:00 2001
-From: Jonas Maebe &lt;jonas.maebe@elis.ugent.be&gt;
-Date: Mon, 10 Sep 2012 00:44:15 +0200
-Subject: [PATCH] darwin: do not create double-buffered offscreen pixel
- formats
-
-http://xquartz.macosforge.org/trac/ticket/536
-
-Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
-(cherry picked from commit 5fdf1f784bf449d7ce9839506fa23c5357696c4c)
----
- src/glx/apple/apple_visual.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
-index a246164..282934f 100644
---- a/src/glx/apple/apple_visual.c
-+++ b/src/glx/apple/apple_visual.c
-@@ -116,7 +116,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-       *uses_stereo = false;
-    }

--   if (mode-&gt;doubleBufferMode) {
-+   if (!offscreen &amp;&amp; mode-&gt;doubleBufferMode) {
-       attr[numattr++] = kCGLPFADoubleBuffer;
-       *double_buffered = true;
-    }
--- 
-1.7.12.1
-
</del></span></pre></div>
<a id="trunkdportsx11mesafiles0003mesafixperlevelmaxtexturesizeerrorcheckingpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0003-mesa-fix-per-level-max-texture-size-error-checking.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0003-mesa-fix-per-level-max-texture-size-error-checking.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0003-mesa-fix-per-level-max-texture-size-error-checking.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+From 9cf1afbf8ae87ddbb29b24a0f9f2724e9e2935c1 Mon Sep 17 00:00:00 2001
+From: Brian Paul &lt;brianp@vmware.com&gt;
+Date: Tue, 4 Sep 2012 20:17:15 -0600
+Subject: [PATCH 03/13] mesa: fix per-level max texture size error checking
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is a long-standing omission in Mesa's texture image size checking.
+We need to take the mipmap level into consideration when checking if the
+width, height and depth are too large.
+
+Fixes the new piglit max-texture-size-level test.
+Thanks to Stéphane Marchesin for finding this problem.
+
+Note: This is a candidate for the stable branches.
+
+Reviewed-by: Michel Dänzer &lt;michel.daenzer@amd.com&gt;
+(cherry picked from commit 771e7b6d884bb4294a89f276a904d90b28efb90a)
+---
+ src/mesa/main/teximage.c | 36 +++++++++++++++++++++---------------
+ 1 file changed, 21 insertions(+), 15 deletions(-)
+
+diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
+index 3aecc0f..ed22fa9 100644
+--- a/src/mesa/main/teximage.c
++++ b/src/mesa/main/teximage.c
+@@ -1251,11 +1251,12 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,

+    switch (target) {
+    case GL_PROXY_TEXTURE_1D:
+-      maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxTextureLevels - 1);
+-      if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+-         return GL_FALSE;
+       if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
+          return GL_FALSE;
++      maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxTextureLevels - 1); /* level zero size */
++      maxSize &gt;&gt;= level;  /* level size */
++      if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
++         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+@@ -1263,13 +1264,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_2D:
++      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
++         return GL_FALSE;
+       maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxTextureLevels - 1);
++      maxSize &gt;&gt;= level;
+       if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (height &lt; 2 * border || height &gt; 2 * border + maxSize)
+          return GL_FALSE;
+-      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
+-         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+@@ -1279,15 +1281,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_3D:
++      if (level &gt;= ctx-&gt;Const.Max3DTextureLevels)
++         return GL_FALSE;
+       maxSize = 1 &lt;&lt; (ctx-&gt;Const.Max3DTextureLevels - 1);
++      maxSize &gt;&gt;= level;
+       if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (height &lt; 2 * border || height &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (depth &lt; 2 * border || depth &gt; 2 * border + maxSize)
+          return GL_FALSE;
+-      if (level &gt;= ctx-&gt;Const.Max3DTextureLevels)
+-         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+@@ -1299,23 +1302,24 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_RECTANGLE_NV:
++      if (level != 0)
++         return GL_FALSE;
+       maxSize = ctx-&gt;Const.MaxTextureRectSize;
+       if (width &lt; 0 || width &gt; maxSize)
+          return GL_FALSE;
+       if (height &lt; 0 || height &gt; maxSize)
+          return GL_FALSE;
+-      if (level != 0)
+-         return GL_FALSE;
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
++      if (level &gt;= ctx-&gt;Const.MaxCubeTextureLevels)
++         return GL_FALSE;
+       maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxCubeTextureLevels - 1);
++      maxSize &gt;&gt;= level;
+       if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (height &lt; 2 * border || height &gt; 2 * border + maxSize)
+          return GL_FALSE;
+-      if (level &gt;= ctx-&gt;Const.MaxCubeTextureLevels)
+-         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+@@ -1325,13 +1329,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
++      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
++         return GL_FALSE;
+       maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxTextureLevels - 1);
++      maxSize &gt;&gt;= level;
+       if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (height &lt; 1 || height &gt; ctx-&gt;Const.MaxArrayTextureLayers)
+          return GL_FALSE;
+-      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
+-         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+@@ -1339,15 +1344,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
+       return GL_TRUE;

+    case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
++      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
++         return GL_FALSE;
+       maxSize = 1 &lt;&lt; (ctx-&gt;Const.MaxTextureLevels - 1);
++      maxSize &gt;&gt;= level;
+       if (width &lt; 2 * border || width &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (height &lt; 2 * border || height &gt; 2 * border + maxSize)
+          return GL_FALSE;
+       if (depth &lt; 1 || depth &gt; ctx-&gt;Const.MaxArrayTextureLayers)
+          return GL_FALSE;
+-      if (level &gt;= ctx-&gt;Const.MaxTextureLevels)
+-         return GL_FALSE;
+       if (!ctx-&gt;Extensions.ARB_texture_non_power_of_two) {
+          if (width &gt; 0 &amp;&amp; !_mesa_is_pow_two(width - 2 * border))
+             return GL_FALSE;
+-- 
+1.9.2
+
</ins></span></pre></div>
<a id="trunkdportsx11mesafiles0008glslinitialiseconstforceglslextensionwarningipatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+From db8cb2250335a93cad6e877e634116e5cd6b42fc Mon Sep 17 00:00:00 2001
+From: Dave Airlie &lt;airlied@redhat.com&gt;
+Date: Tue, 13 Mar 2012 14:53:25 +0000
+Subject: [PATCH 08/13] glsl: initialise const force glsl extension warning in
+ fake ctx
+
+valgrind complained about an uninitialised value being used in
+glsl_parser_extras.cpp, and this was the one it was giving out about.
+
+Just initialise the value in the fakectx.
+
+Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48057
+(cherry picked from commit b78a77f979b21a84aecb6fa4f19a2ed51a48c306)
+---
+ src/glsl/builtins/tools/generate_builtins.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
+index 72d12bb..bd15c4d 100755
+--- a/src/glsl/builtins/tools/generate_builtins.py
++++ b/src/glsl/builtins/tools/generate_builtins.py
+@@ -156,6 +156,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
+    fakeCtx.API = API_OPENGL;
+    fakeCtx.Const.GLSLVersion = 130;
+    fakeCtx.Extensions.ARB_ES2_compatibility = true;
++   fakeCtx.Const.ForceGLSLExtensionsWarn = false;
+    gl_shader *sh = _mesa_new_shader(NULL, 0, target);
+    struct _mesa_glsl_parse_state *st =
+       new(sh) _mesa_glsl_parse_state(&amp;fakeCtx, target, sh);
+-- 
+1.9.2
+
</ins></span></pre></div>
<a id="trunkdportsx11mesafiles0009mesatestforGL_EXT_framebuffer_sRGBinglPopAttribpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+From 2286bd68a832a4d4908d50e1a4496853e1f3305a Mon Sep 17 00:00:00 2001
+From: Brian Paul &lt;brianp@vmware.com&gt;
+Date: Mon, 27 Aug 2012 21:52:07 -0600
+Subject: [PATCH 09/13] mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
+
+To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
+(cherry picked from commit 1aee8803f83f7ae24d9c2150c70afff2b1ee4c2f)
+---
+ src/mesa/main/attrib.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
+index 225ac89..cc384c7 100644
+--- a/src/mesa/main/attrib.c
++++ b/src/mesa/main/attrib.c
+@@ -993,7 +993,8 @@ _mesa_PopAttrib(void)
+                _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color-&gt;ClampReadColor);

+                /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
+-               _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color-&gt;sRGBEnabled);
++               if (ctx-&gt;Extensions.EXT_framebuffer_sRGB)
++                  _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color-&gt;sRGBEnabled);
+             }
+             break;
+          case GL_CURRENT_BIT:
+-- 
+1.9.2
+
</ins></span></pre></div>
<a id="trunkdportsx11mesafiles0011AppleglFlushisnotneededwithCGLFlushDrawablepatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+From 9c50093adff0c7531ab32a7ec9ce3b91712b4d20 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Date: Sat, 20 Jul 2013 10:25:28 -0700
+Subject: [PATCH 11/13] Apple: glFlush() is not needed with CGLFlushDrawable()
+
+&lt;rdar://problem/14496373&gt;
+
+Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+(cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398)
+---
+ src/glx/apple/apple_glx.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c
+index 56cff64..4e2aa33 100644
+--- a/src/glx/apple/apple_glx.c
++++ b/src/glx/apple/apple_glx.c
+@@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr)
+ {
+    struct apple_glx_context *ac = ptr;

+-   /* This may not be needed with CGLFlushDrawable: */
+-   glFlush();
+    apple_cgl.flush_drawable(ac-&gt;context_obj);
+ }

+-- 
+1.9.2
+
</ins></span></pre></div>
<a id="trunkdportsx11mesafiles0012glapiAvoidheapcorruptionin_glapi_tablepatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+From 629600450b3845a768c0edc92ea3f444d03a2738 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Date: Tue, 20 May 2014 01:37:58 -0700
+Subject: [PATCH 12/13] glapi: Avoid heap corruption in _glapi_table
+
+Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Reviewed-by: Chia-I Wu &lt;olv@lunarg.com&gt;
+(cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e)
+---
+ src/mapi/glapi/gen/gl_gentable.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py
+index 5657e32..0d0a02d 100644
+--- a/src/mapi/glapi/gen/gl_gentable.py
++++ b/src/mapi/glapi/gen/gl_gentable.py
+@@ -111,7 +111,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) {

+ struct _glapi_table *
+ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
+-    struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
++    struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc));
+     char symboln[512];

+     if(!disp)
+-- 
+1.9.2
+
</ins></span></pre></div>
<a id="trunkdportsx11mesafiles0013darwinFixtestforkCGLPFAOpenGLProfilesupportatpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/x11/mesa/files/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch (0 => 120263)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/mesa/files/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch                                (rev 0)
+++ trunk/dports/x11/mesa/files/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch        2014-05-21 03:46:08 UTC (rev 120263)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+From ba59a779ed41e08fa16805c1c60da39885546d0e Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Date: Tue, 20 May 2014 10:53:00 -0700
+Subject: [PATCH 13/13] darwin: Fix test for kCGLPFAOpenGLProfile support at
+ runtime
+
+Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+(cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4)
+---
+ src/glx/apple/apple_visual.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
+index 282934f..238c248 100644
+--- a/src/glx/apple/apple_visual.c
++++ b/src/glx/apple/apple_visual.c
+@@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
+    GLint vsref = 0;
+    CGLError error = 0;

+-   /* Request an OpenGL 3.2 profile if one is available */
+-   if(apple_cgl.version_major &gt; 1 || (apple_cgl.version_major == 1 &amp;&amp; apple_cgl.version_minor &gt;= 3)) {
+-      attr[numattr++] = kCGLPFAOpenGLProfile;
+-      attr[numattr++] = kCGLOGLPVersion_3_2_Core;
+-   }
++   /* Request an OpenGL 3.2 profile if one is available and supported */
++   attr[numattr++] = kCGLPFAOpenGLProfile;
++   attr[numattr++] = kCGLOGLPVersion_3_2_Core;
++
++   /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */
++   attr[numattr] = 0;
++   error = apple_cgl.choose_pixel_format(attr, pfobj, &amp;vsref);
++   if (error == kCGLBadAttribute)
++      numattr -= 2;

+    if (offscreen) {
+       apple_glx_diagnostic
+-- 
+1.9.2
+
</ins></span></pre>
</div>
</div>

</body>
</html>