From 940158a6f2e98069a47293d713df674e16ad8a11 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 28 Sep 2005 03:37:22 +0000 Subject: Replace all uses of __glEvalComputeK (and the doubly redundant EvalComputeK) with calls to one of __glMap[12][df]_size. This was tested with progs/samples/eval (from Mesa). --- GL/glx/impsize.h | 1 - GL/glx/render2.c | 9 ++++----- GL/glx/render2swap.c | 9 ++++----- GL/glx/rensize.c | 8 ++++---- GL/glx/singlesize.c | 33 ++------------------------------- 5 files changed, 14 insertions(+), 46 deletions(-) (limited to 'GL/glx') diff --git a/GL/glx/impsize.h b/GL/glx/impsize.h index a04f49cf3..0eaebb6d5 100644 --- a/GL/glx/impsize.h +++ b/GL/glx/impsize.h @@ -52,6 +52,5 @@ #include "indirect_size.h" extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h); -extern int __glEvalComputeK(GLenum target); #endif /* _impsize_h_ */ diff --git a/GL/glx/render2.c b/GL/glx/render2.c index bc49d4fdd..39d0c132a 100644 --- a/GL/glx/render2.c +++ b/GL/glx/render2.c @@ -44,7 +44,6 @@ #include "g_disptab.h" #include "g_disptab_EXT.h" -extern GLint __glEvalComputeK(GLenum target); void __glXDisp_Map1f(GLbyte *pc) { @@ -57,7 +56,7 @@ void __glXDisp_Map1f(GLbyte *pc) u1 = *(GLfloat *)(pc + 4); u2 = *(GLfloat *)(pc + 8); points = (GLfloat *)(pc + 16); - k = __glEvalComputeK(target); + k = __glMap1f_size(target); glMap1f(target, u1, u2, k, order, points); } @@ -77,7 +76,7 @@ void __glXDisp_Map2f(GLbyte *pc) v2 = *(GLfloat *)(pc + 20); points = (GLfloat *)(pc + 28); - k = __glEvalComputeK(target); + k = __glMap2f_size(target); ustride = vorder * k; vstride = k; @@ -95,7 +94,7 @@ void __glXDisp_Map1d(GLbyte *pc) target = *(GLenum*) (pc + 16); order = *(GLint*) (pc + 20); - k = __glEvalComputeK(target); + k = __glMap1d_size(target); #ifdef __GLX_ALIGN64 if (order < 0 || k < 0) { @@ -138,7 +137,7 @@ void __glXDisp_Map2d(GLbyte *pc) target = *(GLenum *)(pc + 32); uorder = *(GLint *)(pc + 36); vorder = *(GLint *)(pc + 40); - k = __glEvalComputeK(target); + k = __glMap2d_size(target); #ifdef __GLX_ALIGN64 if (vorder < 0 || uorder < 0 || k < 0) { diff --git a/GL/glx/render2swap.c b/GL/glx/render2swap.c index 64ba77e5a..65ac5e18a 100644 --- a/GL/glx/render2swap.c +++ b/GL/glx/render2swap.c @@ -44,7 +44,6 @@ #include "g_disptab.h" #include "g_disptab_EXT.h" -extern GLint __glEvalComputeK(GLenum target); void __glXDispSwap_Map1f(GLbyte *pc) { @@ -65,7 +64,7 @@ void __glXDispSwap_Map1f(GLbyte *pc) u1 = *(GLfloat *)(pc + 4); u2 = *(GLfloat *)(pc + 8); points = (GLfloat *)(pc + 16); - k = __glEvalComputeK(target); + k = __glMap1f_size(target); if (order <= 0 || k < 0) { /* Erroneous command. */ @@ -104,7 +103,7 @@ void __glXDispSwap_Map2f(GLbyte *pc) v2 = *(GLfloat *)(pc + 20); points = (GLfloat *)(pc + 28); - k = __glEvalComputeK(target); + k = __glMap2f_size(target); ustride = vorder * k; vstride = k; @@ -134,7 +133,7 @@ void __glXDispSwap_Map1d(GLbyte *pc) target = *(GLenum*) (pc + 16); order = *(GLint*) (pc + 20); - k = __glEvalComputeK(target); + k = __glMap1d_size(target); if (order <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; @@ -182,7 +181,7 @@ void __glXDispSwap_Map2d(GLbyte *pc) target = *(GLenum *)(pc + 32); uorder = *(GLint *)(pc + 36); vorder = *(GLint *)(pc + 40); - k = __glEvalComputeK(target); + k = __glMap2d_size(target); if (vorder <= 0 || uorder <= 0 || k < 0) { /* Erroneous command. */ compsize = 0; diff --git a/GL/glx/rensize.c b/GL/glx/rensize.c index b49520ad5..f75122242 100644 --- a/GL/glx/rensize.c +++ b/GL/glx/rensize.c @@ -184,7 +184,7 @@ int __glXMap1dReqSize(GLbyte *pc, Bool swap ) target = SWAPL( target ); order = SWAPL( order ); } - k = __glEvalComputeK( target ); + k = __glMap1d_size( target ); return 8 * Map1Size( k, order ); } @@ -199,7 +199,7 @@ int __glXMap1fReqSize(GLbyte *pc, Bool swap ) target = SWAPL( target ); order = SWAPL( order ); } - k = __glEvalComputeK(target); + k = __glMap1f_size(target); return 4 * Map1Size(k, order); } @@ -222,7 +222,7 @@ int __glXMap2dReqSize(GLbyte *pc, Bool swap ) uorder = SWAPL( uorder ); vorder = SWAPL( vorder ); } - k = __glEvalComputeK( target ); + k = __glMap2d_size( target ); return 8 * Map2Size( k, uorder, vorder ); } @@ -239,7 +239,7 @@ int __glXMap2fReqSize(GLbyte *pc, Bool swap ) uorder = SWAPL( uorder ); vorder = SWAPL( vorder ); } - k = __glEvalComputeK( target ); + k = __glMap2f_size( target ); return 4 * Map2Size( k, uorder, vorder ); } diff --git a/GL/glx/singlesize.c b/GL/glx/singlesize.c index 04de960a9..d55871c1f 100644 --- a/GL/glx/singlesize.c +++ b/GL/glx/singlesize.c @@ -231,35 +231,6 @@ GLint __glGetLightiv_size(GLenum pname) return __glGetLightfv_size(pname); } -static GLint EvalComputeK(GLenum target) -{ - switch(target) { - case GL_MAP1_VERTEX_4: - case GL_MAP1_COLOR_4: - case GL_MAP1_TEXTURE_COORD_4: - case GL_MAP2_VERTEX_4: - case GL_MAP2_COLOR_4: - case GL_MAP2_TEXTURE_COORD_4: - return 4; - case GL_MAP1_VERTEX_3: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_NORMAL: - case GL_MAP2_VERTEX_3: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_NORMAL: - return 3; - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP2_TEXTURE_COORD_2: - return 2; - case GL_MAP1_TEXTURE_COORD_1: - case GL_MAP2_TEXTURE_COORD_1: - case GL_MAP1_INDEX: - case GL_MAP2_INDEX: - return 1; - } - return 0; -} - GLint __glGetMap_size(GLenum target, GLenum query) { GLint k, order=0, majorMinor[2]; @@ -279,7 +250,7 @@ GLint __glGetMap_size(GLenum target, GLenum query) case GL_MAP1_VERTEX_4: switch (query) { case GL_COEFF: - k = EvalComputeK(target); + k = __glMap1d_size(target); glGetMapiv(target, GL_ORDER, &order); /* ** The query above might fail, but then order will be zero anyway. @@ -302,7 +273,7 @@ GLint __glGetMap_size(GLenum target, GLenum query) case GL_MAP2_VERTEX_4: switch (query) { case GL_COEFF: - k = EvalComputeK(target); + k = __glMap2d_size(target); majorMinor[0] = majorMinor[1] = 0; glGetMapiv(target, GL_ORDER, majorMinor); /* -- cgit v1.2.3