Mesa commit 93115c4b235896df097b91edec7458a8a4488c4e deleted some
interesting
code i want to resurrect.
Mostly code from old src/mesa/drivers/dri/nouveau/nv04_swtcl.c
I tried to include #include "tnl_dd/t_dd_tritmp.h" directly into nv04_render.c
and after this compilation fail (with gcc 4.4.3). Guess i need to include it
somewhat differently?
../../../../../src/mesa/tnl_dd/t_dd_tritmp.h:766: error: 'TAG' defined as
function, returning function
From c5f7559adfbc4b6e34cba7ee6d1199a8709e5981 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <rand...@mail.ru>
Date: Thu, 4 Mar 2010 17:52:40 +0000
Subject: [PATCH 1/2] Limit max texture size to 2048 on nv0x
---
src/mesa/drivers/dri/nouveau/nv04_context.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c
index 1acd41d..6ee9d3c 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_context.c
@@ -173,6 +173,7 @@ nv04_context_create(struct nouveau_screen *screen, const GLvisual *visual,
hw->chan->flush_notify = nv04_channel_flush_notify;
/* GL constants. */
+ ctx->Const.MaxTextureLevels = 12;
ctx->Const.MaxTextureCoordUnits = NV04_TEXTURE_UNITS;
ctx->Const.MaxTextureImageUnits = NV04_TEXTURE_UNITS;
ctx->Const.MaxTextureUnits = NV04_TEXTURE_UNITS;
--
1.6.5.4
From 50c585a409efdce367aabffa6192bd98d4e9da28 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <rand...@mail.ru>
Date: Thu, 4 Mar 2010 17:54:20 +0000
Subject: [PATCH 2/2] Add WAR_ONCE macro locally, begin implementing rendering more than one primitive per call (port from Marcheu's code)
---
src/mesa/drivers/dri/nouveau/nv04_render.c | 46 ++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/mesa/drivers/dri/nouveau/nv04_render.c b/src/mesa/drivers/dri/nouveau/nv04_render.c
index b5943d9..46234f3 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_render.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_render.c
@@ -23,6 +23,19 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
+
+#define WARN_ONCE(a, ...) do {\
+ static int warn##__LINE__=1;\
+ if(warn##__LINE__){\
+ fprintf(stderr, "*********************************WARN_ONCE*********************************\n");\
+ fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__);\
+ fprintf(stderr, a, ## __VA_ARGS__);\
+ fprintf(stderr, "***************************************************************************\n");\
+ warn##__LINE__=0;\
+ } \
+ }while(0)
+
+// #include "tnl_dd/t_dd_tritmp.h"
#include "nouveau_driver.h"
#include "nouveau_context.h"
@@ -148,14 +161,31 @@ swtnl_reset_stipple(GLcontext *ctx)
static void
swtnl_points(GLcontext *ctx, GLuint first, GLuint last)
{
+WARN_ONCE("points rendering - Unimplemented\n");
}
static void
swtnl_line(GLcontext *ctx, GLuint v1, GLuint v2)
{
+WARN_ONCE("line rendering - Unimplemented\n");
}
static void
+swtnl_2triangles(GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint v5, GLuint v6)
+{
+ BEGIN_PRIMITIVE(6);
+ OUT_VERTEX(v1);
+ OUT_VERTEX(v2);
+ OUT_VERTEX(v3);
+ OUT_VERTEX(v4);
+ OUT_VERTEX(v5);
+ OUT_VERTEX(v6);
+ END_PRIMITIVE(0xFEDCBA);
+}
+
+
+
+static void
swtnl_triangle(GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3)
{
BEGIN_PRIMITIVE(3);
@@ -176,6 +206,22 @@ swtnl_quad(GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4)
END_PRIMITIVE(0x320210);
}
+static void
+swtnl_render_triangles_verts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags)
+{
+ int i;
+ for(i=start;i<count-5;i+=6)
+ swtnl_2triangles(ctx, i+0, i+1, i+2, i+3, i+4, i+5);
+ if (i!=count)
+ {
+ swtnl_triangle(ctx, i+0,i+1,i+2);
+ i+=3;
+ }
+
+ if (i!=count)
+ printf("oops\n");
+}
+
/* TnL initialization. */
void
nv04_render_init(GLcontext *ctx)
--
1.6.5.4
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev