summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2007-02-20 15:19:23 -0800
committerIan Romanick <[email protected]>2007-02-20 15:19:23 -0800
commita4b344baa2484c65a1618f3cce3a94c91dea8ef7 (patch)
treef2d3e6571c94378db5a87d882c039909d6a47d3f /src/mesa/drivers
parentf0bcee5db0523edaacbd1fb0eaa74b435ae7c188 (diff)
parent440759c2cdfdd9a7fbc6500fca2afa519126c1a7 (diff)
Merge branch 'master' of ssh+git://[email protected]/git/mesa/mesa
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/beos/GLView.cpp6
-rw-r--r--src/mesa/drivers/directfb/idirectfbgl_mesa.c4
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffer_objects.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c83
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_state.c213
-rw-r--r--src/mesa/drivers/dri/nouveau/nv50_state.c76
-rw-r--r--src/mesa/drivers/dri/r300/Makefile6
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c270
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c6
-rw-r--r--src/mesa/drivers/ggi/ggimesa.c4
-rw-r--r--src/mesa/drivers/glide/fxdd.c6
-rw-r--r--src/mesa/drivers/windows/gdi/mesa.def6
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c8
-rw-r--r--src/mesa/drivers/windows/gldirect/dglcontext.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c4
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c4
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c4
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c2
-rw-r--r--src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c6
-rw-r--r--src/mesa/drivers/windows/icd/mesa.def6
26 files changed, 551 insertions, 182 deletions
diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp
index 45473a8ef27..9e4a7ebe56e 100644
--- a/src/mesa/drivers/beos/GLView.cpp
+++ b/src/mesa/drivers/beos/GLView.cpp
@@ -43,7 +43,7 @@ extern "C" {
#include "texobj.h"
#include "teximage.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast/s_context.h"
@@ -344,7 +344,7 @@ BGLView::BGLView(BRect rect, char *name,
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
+ _vbo_CreateContext(ctx);
_tnl_CreateContext(ctx);
_swsetup_CreateContext(ctx);
_swsetup_Wakeup(ctx);
@@ -830,7 +830,7 @@ void MesaDriver::UpdateState( GLcontext *ctx, GLuint new_state )
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
if (ctx->Color.DrawBuffer[0] == GL_FRONT) {
diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
index 9e76e0f6e07..88ac4bb31d5 100644
--- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c
+++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
@@ -374,7 +374,7 @@ dfbUpdateState( GLcontext *ctx, GLuint new_state )
{
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
}
@@ -787,7 +787,7 @@ directfbgl_create_context( GLcontext *context,
}
_swrast_CreateContext( context );
- _ac_CreateContext( context );
+ _vbo_CreateContext( context );
_tnl_CreateContext( context );
_swsetup_CreateContext( context );
_swsetup_Wakeup( context );
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
index 31c41d86857..ba3c7f0c1f7 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
@@ -50,7 +50,10 @@ intel_bufferobj_alloc(GLcontext * ctx, GLuint name, GLenum target)
_mesa_initialize_buffer_object(&obj->Base, name, target);
driGenBuffers(intel->intelScreen->regionPool,
- "bufferobj", 1, &obj->buffer, 64, 0, 0);
+ "bufferobj", 1, &obj->buffer, 64,
+ DRM_BO_FLAG_MEM_LOCAL |
+ DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE,
+ 0);
return &obj->Base;
}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index d69c6824ed5..5f304ccab92 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -34,6 +34,34 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "mtypes.h"
#include "colormac.h"
+static void nv10ViewportScale(nouveauContextPtr nmesa)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ GLuint w = ctx->Viewport.Width;
+ GLuint h = ctx->Viewport.Height;
+
+ GLfloat max_depth = (ctx->Viewport.Near + ctx->Viewport.Far) * 0.5;
+/* if (ctx->DrawBuffer) {
+ switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
+ case 16:
+ max_depth *= 32767.0;
+ break;
+ case 24:
+ max_depth *= 16777215.0;
+ break;
+ }
+ } else {*/
+ /* Default to 24 bits range */
+ max_depth *= 16777215.0;
+/* }*/
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X, 4);
+ OUT_RING_CACHEf ((((GLfloat) w) * 0.5) - 2048.0);
+ OUT_RING_CACHEf ((((GLfloat) h) * 0.5) - 2048.0);
+ OUT_RING_CACHEf (max_depth);
+ OUT_RING_CACHEf (0.0);
+}
+
static void nv10AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
@@ -98,16 +126,27 @@ static void nv10ClearColor(GLcontext *ctx, const GLfloat color[4])
static void nv10ClearDepth(GLcontext *ctx, GLclampd d)
{
- /* FIXME: check if 16 or 24/32 bits depth buffer */
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
- nmesa->clear_value=((nmesa->clear_value&0x000000FF)|(((uint32_t)(d*0xFFFFFF))<<8));
+
+/* switch (ctx->DrawBuffer->_DepthBuffer->DepthBits) {
+ case 16:
+ nmesa->clear_value = (uint32_t)(d*0x7FFF);
+ break;
+ case 24:*/
+ nmesa->clear_value = ((nmesa->clear_value&0x000000FF) |
+ (((uint32_t)(d*0xFFFFFF))<<8));
+/* break;
+ }*/
}
static void nv10ClearStencil(GLcontext *ctx, GLint s)
{
- /* FIXME: not valid for 16 bits depth buffer (0 stencil bits) */
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
- nmesa->clear_value=((nmesa->clear_value&0xFFFFFF00)|(s&0x000000FF));
+
+/* if (ctx->DrawBuffer->_DepthBuffer->DepthBits == 24) {*/
+ nmesa->clear_value = ((nmesa->clear_value&0xFFFFFF00)|
+ (s&0x000000FF));
+/* }*/
}
static void nv10ClipPlane(GLcontext *ctx, GLenum plane, const GLfloat *equation)
@@ -164,9 +203,17 @@ static void nv10DepthMask(GLcontext *ctx, GLboolean flag)
static void nv10DepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ GLfloat depth_scale = 16777216.0;
+ if (ctx->DrawBuffer->_DepthBuffer->DepthBits == 16) {
+ depth_scale = 32768.0;
+ }
+
BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_DEPTH_RANGE_NEAR, 2);
- OUT_RING_CACHEf(nearval);
- OUT_RING_CACHEf(farval);
+ OUT_RING_CACHEf(nearval * depth_scale);
+ OUT_RING_CACHEf(farval * depth_scale);
+
+ nv10ViewportScale(nmesa);
}
/** Specify the current buffer for writing */
@@ -616,8 +663,10 @@ static void nv10WindowMoved(nouveauContextPtr nmesa)
OUT_RING(0);
BEGIN_RING_CACHE(NvSub3D,
- NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 2);
+ NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 1);
OUT_RING_CACHE(((w+x-1) << 16) | x | 0x08000800);
+ BEGIN_RING_CACHE(NvSub3D,
+ NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(0), 1);
OUT_RING_CACHE(((h+y-1) << 16) | y | 0x08000800);
for (i=1; i<8; i++) {
BEGIN_RING_CACHE(NvSub3D,
@@ -628,18 +677,7 @@ static void nv10WindowMoved(nouveauContextPtr nmesa)
OUT_RING_CACHE(0);
}
- /* viewport transform */
- BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
- OUT_RING_CACHEf ((GLfloat) x);
- OUT_RING_CACHEf ((GLfloat) (y+h));
- OUT_RING_CACHEf (0.0);
- OUT_RING_CACHEf (0.0);
-
- BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_SCALE_X, 4);
- OUT_RING_CACHEf ((((GLfloat) w) * 0.5) - 2048.0);
- OUT_RING_CACHEf ((((GLfloat) h) * 0.5) - 2048.0);
- OUT_RING_CACHEf (16777215.0 * 0.5);
- OUT_RING_CACHEf (0.0);
+ nv10ViewportScale(nmesa);
}
/* Initialise any card-specific non-GL related state */
@@ -700,6 +738,13 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color,
OUT_RING_CACHE(color[0]->offset);
OUT_RING_CACHE(depth ? depth->offset : color[0]->offset);
+ /* Always set to bottom left of buffer */
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf ((GLfloat) h);
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf (0.0);
+
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state.c b/src/mesa/drivers/dri/nouveau/nv20_state.c
index 8e38d6eba00..030713c0dbb 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state.c
@@ -41,8 +41,8 @@ static void nv20AlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
CLAMPED_FLOAT_TO_UBYTE(ubRef, ref);
BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC, 2);
- OUT_RING_CACHE(func); /* NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_FUNC */
- OUT_RING_CACHE(ubRef); /* NV20_TCL_PRIMITIVE_3D_ALPHA_FUNC_REF */
+ OUT_RING_CACHE(func);
+ OUT_RING_CACHE(ubRef);
}
static void nv20BlendColor(GLcontext *ctx, const GLfloat color[4])
@@ -76,6 +76,11 @@ static void nv20BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfac
OUT_RING_CACHE((dfactorA<<16) | dfactorRGB);
}
+static void nv20Clear(GLcontext *ctx, GLbitfield mask)
+{
+ /* TODO */
+}
+
static void nv20ClearColor(GLcontext *ctx, const GLfloat color[4])
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
@@ -297,7 +302,11 @@ static void nv20Enable(GLcontext *ctx, GLenum cap, GLboolean state)
// case GL_POST_COLOR_MATRIX_COLOR_TABLE:
// case GL_POST_CONVOLUTION_COLOR_TABLE:
// case GL_RESCALE_NORMAL:
-// case GL_SCISSOR_TEST:
+ case GL_SCISSOR_TEST:
+ /* No enable bit, nv20Scissor will adjust to max range */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+ break;
// case GL_SEPARABLE_2D:
case GL_STENCIL_TEST:
// TODO BACK and FRONT ?
@@ -511,9 +520,22 @@ static void nv20PolygonMode(GLcontext *ctx, GLenum face, GLenum mode)
}
/** Set the scale and units used to calculate depth values */
-void (*PolygonOffset)(GLcontext *ctx, GLfloat factor, GLfloat units);
+static void nv20PolygonOffset(GLcontext *ctx, GLfloat factor, GLfloat units)
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_OFFSET_FACTOR, 2);
+ OUT_RING_CACHEf(factor);
+ OUT_RING_CACHEf(units);
+}
+
/** Set the polygon stippling pattern */
-void (*PolygonStipple)(GLcontext *ctx, const GLubyte *mask );
+static void nv20PolygonStipple(GLcontext *ctx, const GLubyte *mask )
+{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_POLYGON_STIPPLE_PATTERN(0), 32);
+ OUT_RING_CACHEp(mask, 32);
+}
+
/* Specifies the current buffer for reading */
void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
/** Set rasterization mode */
@@ -522,6 +544,22 @@ void (*RenderMode)(GLcontext *ctx, GLenum mode );
/** Define the scissor box */
static void nv20Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* There's no scissor enable bit, so adjust the scissor to cover the
+ * maximum draw buffer bounds
+ */
+ if (!ctx->Scissor.Enabled) {
+ x = y = 0;
+ w = h = 4095;
+ } else {
+ x += nmesa->drawX;
+ y += nmesa->drawY;
+ }
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SCISSOR_X2_X1, 2);
+ OUT_RING_CACHE(((x+w-1) << 16) | x);
+ OUT_RING_CACHE(((y+h-1) << 16) | y);
}
/** Select flat or smooth shading */
@@ -576,22 +614,103 @@ void (*TexEnv)(GLcontext *ctx, GLenum target, GLenum pname,
void (*TexParameter)(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj,
GLenum pname, const GLfloat *params);
-void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat);
-/** Set the viewport */
-static void nv20Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+static void nv20TextureMatrix(GLcontext *ctx, GLuint unit, const GLmatrix *mat)
{
- /* TODO: Where do the VIEWPORT_XFRM_* regs come in? */
- nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
- BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 2);
- OUT_RING_CACHE((w << 16) | x);
- OUT_RING_CACHE((h << 16) | y);
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_TX_MATRIX(unit, 0), 16);
+ /*XXX: This SHOULD work.*/
+ OUT_RING_CACHEp(mat->m, 16);
+}
+
+/* Update anything that depends on the window position/size */
+static void nv20WindowMoved(nouveauContextPtr nmesa)
+{
+ GLcontext *ctx = nmesa->glCtx;
+ GLfloat *v = nmesa->viewport.m;
+ GLuint w = ctx->Viewport.Width;
+ GLuint h = ctx->Viewport.Height;
+ GLuint x = ctx->Viewport.X + nmesa->drawX;
+ GLuint y = ctx->Viewport.Y + nmesa->drawY;
+ int i;
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 2);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x02b4, 1);
+ OUT_RING(0);
+
+ BEGIN_RING_CACHE(NvSub3D,
+ NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 1);
+ OUT_RING_CACHE((4095 << 16) | 0);
+ BEGIN_RING_CACHE(NvSub3D,
+ NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(0), 1);
+ OUT_RING_CACHE((4095 << 16) | 0);
+ for (i=1; i<8; i++) {
+ BEGIN_RING_CACHE(NvSub3D,
+ NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(i), 1);
+ OUT_RING_CACHE(0);
+ BEGIN_RING_CACHE(NvSub3D,
+ NV20_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_VERT(i), 1);
+ OUT_RING_CACHE(0);
+ }
+
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+
+ /* TODO: recalc viewport scale coefs */
}
/* Initialise any card-specific non-GL related state */
static GLboolean nv20InitCard(nouveauContextPtr nmesa)
{
- return GL_TRUE;
+ nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
+
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SET_OBJECT1, 2);
+ OUT_RING(NvDmaFB); /* 184 dma_object1 */
+ OUT_RING(NvDmaFB); /* 188 dma_object2 */
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SET_OBJECT3, 2);
+ OUT_RING(NvDmaFB); /* 194 dma_object3 */
+ OUT_RING(NvDmaFB); /* 198 dma_object4 */
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_SET_OBJECT8, 1);
+ OUT_RING(NvDmaFB); /* 1a8 dma_object8 */
+
+ BEGIN_RING_SIZE(NvSub3D, 0x17e0, 3);
+ OUT_RINGf(0.0);
+ OUT_RINGf(0.0);
+ OUT_RINGf(1.0);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1e6c, 1);
+ OUT_RING(0x0db6);
+ BEGIN_RING_SIZE(NvSub3D, 0x0290, 1);
+ OUT_RING(0x00100001);
+ BEGIN_RING_SIZE(NvSub3D, 0x09fc, 1);
+ OUT_RING(0);
+ BEGIN_RING_SIZE(NvSub3D, 0x1d80, 1);
+ OUT_RING(1);
+ BEGIN_RING_SIZE(NvSub3D, 0x09f8, 1);
+ OUT_RING(4);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x17ec, 3);
+ OUT_RINGf(0.0);
+ OUT_RINGf(1.0);
+ OUT_RINGf(0.0);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1d88, 1);
+ OUT_RING(3);
+
+ /* FIXME: More dma objects to setup ? */
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1e98, 1);
+ OUT_RING(0);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x120, 3);
+ OUT_RING(0);
+ OUT_RING(1);
+ OUT_RING(2);
+
+ return GL_TRUE;
}
/* Update buffer offset/pitch/format */
@@ -599,26 +718,57 @@ static GLboolean nv20BindBuffers(nouveauContextPtr nmesa, int num_color,
nouveau_renderbuffer **color,
nouveau_renderbuffer *depth)
{
- return GL_TRUE;
-}
+ GLuint x, y, w, h;
+ GLuint pitch, format, depth_pitch;
+
+ w = color[0]->mesa.Width;
+ h = color[0]->mesa.Height;
+ x = nmesa->drawX;
+ y = nmesa->drawY;
+
+ if (num_color != 1)
+ return GL_FALSE;
+
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 6);
+ OUT_RING_CACHE((w << 16) | x);
+ OUT_RING_CACHE((h << 16) | y);
+ depth_pitch = (depth ? depth->pitch : color[0]->pitch);
+ pitch = (depth_pitch<<16) | color[0]->pitch;
+ format = 0x128;
+ if (color[0]->mesa._ActualFormat != GL_RGBA8) {
+ format = 0x123; /* R5G6B5 color buffer */
+ }
+ OUT_RING_CACHE(format);
+ OUT_RING_CACHE(pitch);
+ OUT_RING_CACHE(color[0]->offset);
+ OUT_RING_CACHE(depth ? depth->offset : color[0]->offset);
+
+ if (depth) {
+ BEGIN_RING_SIZE(NvSub3D, NV20_TCL_PRIMITIVE_3D_LMA_DEPTH_BUFFER_PITCH, 2);
+ /* TODO: use a different buffer */
+ OUT_RING(depth->pitch);
+ OUT_RING(depth->offset);
+ }
-/* Update anything that depends on the window position/size */
-static void nv20WindowMoved(nouveauContextPtr nmesa)
-{
+ /* Always set to bottom left of buffer */
+ BEGIN_RING_CACHE(NvSub3D, NV20_TCL_PRIMITIVE_3D_VIEWPORT_ORIGIN_X, 4);
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf ((GLfloat) h);
+ OUT_RING_CACHEf (0.0);
+ OUT_RING_CACHEf (0.0);
+
+ return GL_TRUE;
}
void nv20InitStateFuncs(GLcontext *ctx, struct dd_function_table *func)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
- nmesa->hw_func.InitCard = nv20InitCard;
- nmesa->hw_func.BindBuffers = nv20BindBuffers;
- nmesa->hw_func.WindowMoved = nv20WindowMoved;
-
func->AlphaFunc = nv20AlphaFunc;
func->BlendColor = nv20BlendColor;
func->BlendEquationSeparate = nv20BlendEquationSeparate;
func->BlendFuncSeparate = nv20BlendFuncSeparate;
+ func->Clear = nv20Clear;
func->ClearColor = nv20ClearColor;
func->ClearDepth = nv20ClearDepth;
func->ClearStencil = nv20ClearStencil;
@@ -641,22 +791,21 @@ void nv20InitStateFuncs(GLcontext *ctx, struct dd_function_table *func)
func->PointParameterfv = nv20PointParameterfv;
func->PointSize = nv20PointSize;
func->PolygonMode = nv20PolygonMode;
-#if 0
func->PolygonOffset = nv20PolygonOffset;
func->PolygonStipple = nv20PolygonStipple;
- func->ReadBuffer = nv20ReadBuffer;
- func->RenderMode = nv20RenderMode;
-#endif
+/* func->ReadBuffer = nv20ReadBuffer;*/
+/* func->RenderMode = nv20RenderMode;*/
func->Scissor = nv20Scissor;
func->ShadeModel = nv20ShadeModel;
func->StencilFuncSeparate = nv20StencilFuncSeparate;
func->StencilMaskSeparate = nv20StencilMaskSeparate;
func->StencilOpSeparate = nv20StencilOpSeparate;
-#if 0
- func->TexGen = nv20TexGen;
- func->TexParameter = nv20TexParameter;
+/* func->TexGen = nv20TexGen;*/
+/* func->TexParameter = nv20TexParameter;*/
func->TextureMatrix = nv20TextureMatrix;
-#endif
- func->Viewport = nv20Viewport;
+
+ nmesa->hw_func.InitCard = nv20InitCard;
+ nmesa->hw_func.BindBuffers = nv20BindBuffers;
+ nmesa->hw_func.WindowMoved = nv20WindowMoved;
}
diff --git a/src/mesa/drivers/dri/nouveau/nv50_state.c b/src/mesa/drivers/dri/nouveau/nv50_state.c
index d03c6bf6f25..818e268615c 100644
--- a/src/mesa/drivers/dri/nouveau/nv50_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv50_state.c
@@ -293,7 +293,11 @@ static void nv50Enable(GLcontext *ctx, GLenum cap, GLboolean state)
// case GL_POST_COLOR_MATRIX_COLOR_TABLE:
// case GL_POST_CONVOLUTION_COLOR_TABLE:
// case GL_RESCALE_NORMAL:
-// case GL_SCISSOR_TEST:
+ case GL_SCISSOR_TEST:
+ /* No enable bit, nv50Scissor will adjust to max range */
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
+ break;
// case GL_SEPARABLE_2D:
case GL_STENCIL_TEST:
// TODO BACK and FRONT ?
@@ -416,6 +420,21 @@ void (*RenderMode)(GLcontext *ctx, GLenum mode );
static void nv50Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
+ /* There's no scissor enable bit, so adjust the scissor to cover the
+ * maximum draw buffer bounds
+ */
+ if (!ctx->Scissor.Enabled) {
+ x = y = 0;
+ w = h = 8191;
+ } else {
+ x += nmesa->drawX;
+ y += nmesa->drawY;
+ }
+
+ BEGIN_RING_CACHE(NvSub3D, NV50_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2);
+ OUT_RING_CACHE(((w) << 16) | x);
+ OUT_RING_CACHE(((h) << 16) | y);
}
/** Select flat or smooth shading */
@@ -503,10 +522,65 @@ static void nv50TextureMatrix(GLcontext *ctx, GLuint unit, const GLmatrix *mat)
static void nv50WindowMoved(nouveauContextPtr nmesa)
{
+ GLcontext *ctx = nmesa->glCtx;
+ GLfloat *v = nmesa->viewport.m;
+ GLuint w = ctx->Viewport.Width;
+ GLuint h = ctx->Viewport.Height;
+ GLuint x = ctx->Viewport.X + nmesa->drawX;
+ GLuint y = ctx->Viewport.Y + nmesa->drawY;
+ int i;
+
+ BEGIN_RING_CACHE(NvSub3D,
+ NV50_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 2);
+ OUT_RING_CACHE((8191 << 16) | 0);
+ OUT_RING_CACHE((8191 << 16) | 0);
+ for (i=1; i<8; i++) {
+ BEGIN_RING_CACHE(NvSub3D,
+ NV50_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(i), 2);
+ OUT_RING_CACHE(0);
+ OUT_RING_CACHE(0);
+ }
+
+ ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
+ ctx->Scissor.Width, ctx->Scissor.Height);
}
static GLboolean nv50InitCard(nouveauContextPtr nmesa)
{
+ int i,j;
+
+ nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D);
+
+ BEGIN_RING_SIZE(NvSub3D, 0x1558, 1);
+ OUT_RING(1);
+
+ BEGIN_RING_SIZE(NvSub3D, NV50_TCL_PRIMITIVE_3D_SET_OBJECT_1(0), 8);
+ for (i=0; i<8; i++) {
+ OUT_RING(NvDmaFB);
+ }
+
+ BEGIN_RING_SIZE(NvSub3D, NV50_TCL_PRIMITIVE_3D_SET_OBJECT_0(0), 12);
+ for (i=0; i<12; i++) {
+ OUT_RING(NvDmaFB);
+ }
+
+ BEGIN_RING_SIZE(NvSub3D, 0x121c, 1);
+ OUT_RING(1);
+
+ for (i=0; i<8; i++) {
+ BEGIN_RING_SIZE(NvSub3D, 0x0200 + (i*0x20), 5);
+ for (j=0; j<5; j++) {
+ OUT_RING(0);
+ }
+ }
+
+ BEGIN_RING_SIZE(NvSub3D, 0x0fe0, 5);
+ OUT_RING(0);
+ OUT_RING(0);
+ OUT_RING(0x16);
+ OUT_RING(0);
+ OUT_RING(0);
+
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile
index 5abb91d9876..2ee23289341 100644
--- a/src/mesa/drivers/dri/r300/Makefile
+++ b/src/mesa/drivers/dri/r300/Makefile
@@ -90,9 +90,11 @@ COMMON_SYMLINKS = \
include ../Makefile.template
-$(SYMLINKS):
+server:
mkdir -p server
- for i in $(SYMLINKS) ; do rm -f $$i && test -f ../radeon/$$i && ln -s ../../radeon/$$i $$i ; done
+
+$(SYMLINKS): server
+ @[ -e $@ ] || ln -sf ../../radeon/$@ server/
$(COMMON_SYMLINKS):
@[ -e $@ ] || ln -sf ../radeon/$@ ./
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index b1402351591..48b50bca653 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -731,7 +731,7 @@ struct r300_fragment_program {
int max_temp_idx;
/* the index of the sin constant is stored here */
- GLint const_sin;
+ GLint const_sin[2];
GLuint optimization;
};
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index b00cf9ed33e..8e45bd54030 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -33,7 +33,6 @@
/*TODO'S
*
- * - SCS instructions
* - Depth write, WPOS/FOGC inputs
* - FogOption
* - Verify results of opcodes for accuracy, I've only checked them
@@ -1081,7 +1080,7 @@ static void emit_arith(struct r300_fragment_program *rp,
break;
}
if (emit_sop &&
- (s_swiz[REG_GET_VSWZ(src[i])].flags & SLOT_VECTOR)) {
+ (s_swiz[REG_GET_SSWZ(src[i])].flags & SLOT_VECTOR)) {
vpos = spos = MAX2(vpos, spos);
break;
}
@@ -1204,6 +1203,25 @@ static GLuint get_attrib(struct r300_fragment_program *rp, GLuint attr)
}
#endif
+static void make_sin_const(struct r300_fragment_program *rp)
+{
+ if(rp->const_sin[0] == -1){
+ GLfloat cnstv[4];
+
+ cnstv[0] = 1.273239545; // 4/PI
+ cnstv[1] =-0.405284735; // -4/(PI*PI)
+ cnstv[2] = 3.141592654; // PI
+ cnstv[3] = 0.2225; // weight
+ rp->const_sin[0] = emit_const4fv(rp, cnstv);
+
+ cnstv[0] = 0.5;
+ cnstv[1] = -1.5;
+ cnstv[2] = 0.159154943; // 1/(2*PI)
+ cnstv[3] = 6.283185307; // 2*PI
+ rp->const_sin[1] = emit_const4fv(rp, cnstv);
+ }
+}
+
static GLboolean parse_program(struct r300_fragment_program *rp)
{
struct gl_fragment_program *mp = &rp->mesa_program;
@@ -1260,84 +1278,68 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
* cos using a parabola (see SIN):
* cos(x):
* x += PI/2
- * x = (x < PI)?x : x-2*PI
+ * x = (x/(2*PI))+0.5
+ * x = frac(x)
+ * x = (x*2*PI)-PI
* result = sin(x)
*/
temp = get_temp_reg(rp);
- if(rp->const_sin == -1){
- cnstv[0] = 1.273239545;
- cnstv[1] =-0.405284735;
- cnstv[2] = 3.141592654;
- cnstv[3] = 0.225;
- rp->const_sin = emit_const4fv(rp, cnstv);
- }
- cnst = rp->const_sin;
+ make_sin_const(rp);
src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
- emit_arith(rp, PFS_OP_LG2, temp, WRITEMASK_W,
- pfs_half,
- undef,
- undef,
- 0);
+ /* add 0.5*PI and do range reduction */
emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
- swizzle(cnst, Z, Z, Z, Z), //PI
+ swizzle(rp->const_sin[0], Z, Z, Z, Z), //PI
pfs_half,
swizzle(keep(src[0]), X, X, X, X),
0);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
- negate(swizzle(temp, W, W, W, W)), //-2
- swizzle(cnst, Z, Z, Z, Z), //PI
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
swizzle(temp, X, X, X, X),
+ swizzle(rp->const_sin[1], Z, Z, Z, Z),
+ pfs_half,
0);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y,
- swizzle(cnst, Z, Z, Z, Z), //PI
- negate(pfs_half),
- swizzle(src[0], X, X, X, X),
+ emit_arith(rp, PFS_OP_FRC, temp, WRITEMASK_X,
+ swizzle(temp, X, X, X, X),
+ undef,
+ undef,
0);
-
- emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z,
- swizzle(temp, W, W, W, W),
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Z,
swizzle(temp, X, X, X, X),
- swizzle(temp, Y, Y, Y, Y),
+ swizzle(rp->const_sin[1], W, W, W, W), //2*PI
+ negate(swizzle(rp->const_sin[0], Z, Z, Z, Z)), //-PI
0);
/* SIN */
emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X | WRITEMASK_Y,
swizzle(temp, Z, Z, Z, Z),
- cnst,
+ rp->const_sin[0],
pfs_zero,
0);
- if(rp->optimization == DRI_CONF_FP_OPTIMIZATION_SPEED){
- emit_arith(rp, PFS_OP_MAD, dest, mask,
- swizzle(temp, Y, Y, Y, Y),
- absolute(swizzle(temp, Z, Z, Z, Z)),
- swizzle(temp, X, X, X, X),
- flags);
- }else{
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
- swizzle(temp, Y, Y, Y, Y),
- absolute(swizzle(temp, Z, Z, Z, Z)),
- swizzle(temp, X, X, X, X),
- 0);
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
+ swizzle(temp, Y, Y, Y, Y),
+ absolute(swizzle(temp, Z, Z, Z, Z)),
+ swizzle(temp, X, X, X, X),
+ 0);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y,
- swizzle(temp, X, X, X, X),
- absolute(swizzle(temp, X, X, X, X)),
- negate(swizzle(temp, X, X, X, X)),
- 0);
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y,
+ swizzle(temp, X, X, X, X),
+ absolute(swizzle(temp, X, X, X, X)),
+ negate(swizzle(temp, X, X, X, X)),
+ 0);
- emit_arith(rp, PFS_OP_MAD, dest, mask,
- swizzle(temp, Y, Y, Y, Y),
- swizzle(cnst, W, W, W, W),
- swizzle(temp, X, X, X, X),
- flags);
- }
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, Y, Y, Y, Y),
+ swizzle(rp->const_sin[0], W, W, W, W),
+ swizzle(temp, X, X, X, X),
+ flags);
+
free_temp(rp, temp);
break;
case OPCODE_DP3:
@@ -1577,7 +1579,93 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
flags);
break;
case OPCODE_SCS:
- ERROR("SCS not implemented\n");
+ /*
+ * cos using a parabola (see SIN):
+ * cos(x):
+ * x += PI/2
+ * x = (x/(2*PI))+0.5
+ * x = frac(x)
+ * x = (x*2*PI)-PI
+ * result = sin(x)
+ */
+ temp = get_temp_reg(rp);
+ make_sin_const(rp);
+ src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
+
+ /* add 0.5*PI and do range reduction */
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X|WRITEMASK_Y,
+ swizzle(rp->const_sin[0], Z, Z, Z, Z),
+ rp->const_sin[1],
+ swizzle(keep(src[0]), X, X, X, X),
+ 0);
+
+ emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_W,
+ swizzle(rp->const_sin[0], Z, Z, Z, Z),
+ negate(pfs_half),
+ swizzle(keep(src[0]), X, X, X, X),
+ 0);
+
+ emit_arith(rp, PFS_OP_CMP, temp, WRITEMASK_Z,
+ swizzle(temp, X, X, X, X),
+ swizzle(temp, Y, Y, Y, Y),
+ swizzle(temp, W, W, W, W),
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X | WRITEMASK_Y,
+ swizzle(temp, Z, Z, Z, Z),
+ rp->const_sin[0],
+ pfs_zero,
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
+ swizzle(temp, Y, Y, Y, Y),
+ absolute(swizzle(temp, Z, Z, Z, Z)),
+ swizzle(temp, X, X, X, X),
+ 0);
+
+ if(mask & WRITEMASK_Y)
+ {
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X | WRITEMASK_Y,
+ swizzle(keep(src[0]), X, X, X, X),
+ rp->const_sin[0],
+ pfs_zero,
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
+ swizzle(temp, Y, Y, Y, Y),
+ absolute(swizzle(keep(src[0]), X, X, X, X)),
+ swizzle(temp, X, X, X, X),
+ 0);
+ }
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Z,
+ swizzle(temp, W, W, W, W),
+ absolute(swizzle(temp, W, W, W, W)),
+ negate(swizzle(temp, W, W, W, W)),
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_X,
+ swizzle(temp, Z, Z, Z, Z),
+ swizzle(rp->const_sin[0], W, W, W, W),
+ swizzle(temp, W, W, W, W),
+ flags);
+
+ if(mask & WRITEMASK_Y)
+ {
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_W,
+ swizzle(temp, X, X, X, X),
+ absolute(swizzle(temp, X, X, X, X)),
+ negate(swizzle(temp, X, X, X, X)),
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, dest, WRITEMASK_Y,
+ swizzle(temp, W, W, W, W),
+ swizzle(rp->const_sin[0], W, W, W, W),
+ swizzle(temp, X, X, X, X),
+ flags);
+ }
+ free_temp(rp, temp);
break;
case OPCODE_SGE:
src[0] = t_src(rp, fpi->SrcReg[0]);
@@ -1603,48 +1691,56 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
*/
temp = get_temp_reg(rp);
- if(rp->const_sin == -1){
- cnstv[0] = 1.273239545;
- cnstv[1] =-0.405284735;
- cnstv[2] = 3.141592654;
- cnstv[3] = 0.225;
- rp->const_sin = emit_const4fv(rp, cnstv);
- }
- cnst = rp->const_sin;
+ make_sin_const(rp);
src[0] = t_scalar_src(rp, fpi->SrcReg[0]);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X | WRITEMASK_Y,
+ /* do range reduction */
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
swizzle(keep(src[0]), X, X, X, X),
- cnst,
+ swizzle(rp->const_sin[1], Z, Z, Z, Z),
+ pfs_half,
+ 0);
+
+ emit_arith(rp, PFS_OP_FRC, temp, WRITEMASK_X,
+ swizzle(temp, X, X, X, X),
+ undef,
+ undef,
+ 0);
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Z,
+ swizzle(temp, X, X, X, X),
+ swizzle(rp->const_sin[1], W, W, W, W), //2*PI
+ negate(swizzle(rp->const_sin[0], Z, Z, Z, Z)), //PI
+ 0);
+
+ /* SIN */
+
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X | WRITEMASK_Y,
+ swizzle(temp, Z, Z, Z, Z),
+ rp->const_sin[0],
pfs_zero,
0);
- if(rp->optimization == DRI_CONF_FP_OPTIMIZATION_SPEED){
- emit_arith(rp, PFS_OP_MAD, dest, mask,
- swizzle(temp, Y, Y, Y, Y),
- absolute(swizzle(src[0], X, X, X, X)),
- swizzle(temp, X, X, X, X),
- flags);
- }else{
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
- swizzle(temp, Y, Y, Y, Y),
- absolute(swizzle(src[0], X, X, X, X)),
- swizzle(temp, X, X, X, X),
- 0);
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_X,
+ swizzle(temp, Y, Y, Y, Y),
+ absolute(swizzle(temp, Z, Z, Z, Z)),
+ swizzle(temp, X, X, X, X),
+ 0);
- emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y,
- swizzle(temp, X, X, X, X),
- absolute(swizzle(temp, X, X, X, X)),
- negate(swizzle(temp, X, X, X, X)),
- 0);
+ emit_arith(rp, PFS_OP_MAD, temp, WRITEMASK_Y,
+ swizzle(temp, X, X, X, X),
+ absolute(swizzle(temp, X, X, X, X)),
+ negate(swizzle(temp, X, X, X, X)),
+ 0);
- emit_arith(rp, PFS_OP_MAD, dest, mask,
- swizzle(temp, Y, Y, Y, Y),
- swizzle(cnst, W, W, W, W),
- swizzle(temp, X, X, X, X),
- flags);
- }
+ emit_arith(rp, PFS_OP_MAD, dest, mask,
+ swizzle(temp, Y, Y, Y, Y),
+ swizzle(rp->const_sin[0], W, W, W, W),
+ swizzle(temp, X, X, X, X),
+ flags);
+
free_temp(rp, temp);
break;
case OPCODE_SLT:
@@ -1739,7 +1835,7 @@ static void init_program(r300ContextPtr r300, struct r300_fragment_program *rp)
rp->max_temp_idx = 0;
rp->node[0].alu_end = -1;
rp->node[0].tex_end = -1;
- rp->const_sin = -1;
+ rp->const_sin[0] = -1;
_mesa_memset(cs, 0, sizeof(*rp->cs));
for (i=0;i<PFS_MAX_ALU_INST;i++) {
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index bd9d3ac0ad9..f9d57dbdd81 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -54,7 +54,7 @@
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
@@ -143,7 +143,7 @@ update_state( GLcontext *ctx, GLuint new_state )
/* not much to do here - pass it on */
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
}
@@ -776,7 +776,7 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share )
/* Create module contexts */
glctx = (GLcontext *) &ctx->glcontext;
_swrast_CreateContext( glctx );
- _ac_CreateContext( glctx );
+ _vbo_CreateContext( glctx );
_tnl_CreateContext( glctx );
_swsetup_CreateContext( glctx );
_swsetup_Wakeup( glctx );
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index 47d7f2bdb99..85592d98dab 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -39,7 +39,7 @@
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "teximage.h"
#include "texformat.h"
#include "texstore.h"
@@ -563,7 +563,7 @@ ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis)
_mesa_enable_sw_extensions(ctx->gl_ctx);
_swrast_CreateContext(ctx->gl_ctx);
- _ac_CreateContext(ctx->gl_ctx);
+ _vbo_CreateContext(ctx->gl_ctx);
_tnl_CreateContext(ctx->gl_ctx);
_swsetup_CreateContext(ctx->gl_ctx);
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index f49c3889f66..43d3cd94051 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -1783,7 +1783,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(ctx);
- _ac_CreateContext(ctx);
+ _vbo_CreateContext(ctx);
_tnl_CreateContext(ctx);
_swsetup_CreateContext(ctx);
@@ -1826,7 +1826,7 @@ fxDDDestroyFxMesaContext(fxMesaContext fxMesa)
{
_swsetup_DestroyContext(fxMesa->glCtx);
_tnl_DestroyContext(fxMesa->glCtx);
- _ac_DestroyContext(fxMesa->glCtx);
+ _vbo_DestroyContext(fxMesa->glCtx);
_swrast_DestroyContext(fxMesa->glCtx);
if (fxMesa->state)
@@ -2101,7 +2101,7 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state)
}
_swrast_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
_swsetup_InvalidateState(ctx, new_state);
diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def
index f0b275730ca..8d654281215 100644
--- a/src/mesa/drivers/windows/gdi/mesa.def
+++ b/src/mesa/drivers/windows/gdi/mesa.def
@@ -859,9 +859,9 @@ EXPORTS
wglGetExtensionsStringARB
;
; Mesa internals - mostly for OSMESA
- _ac_CreateContext
- _ac_DestroyContext
- _ac_InvalidateState
+ _vbo_CreateContext
+ _vbo_DestroyContext
+ _vbo_InvalidateState
_glapi_check_multithread
_glapi_get_context
_glapi_get_proc_address
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 8c3229ab14c..078b590af87 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -11,7 +11,7 @@
#include "framebuffer.h"
#include "renderbuffer.h"
#include "drivers/common/driverfuncs.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
@@ -1125,7 +1125,7 @@ static void wmesa_update_state(GLcontext *ctx, GLuint new_state)
{
_swrast_InvalidateState(ctx, new_state);
_swsetup_InvalidateState(ctx, new_state);
- _ac_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
/* TODO - This code is not complete yet because I
@@ -1242,7 +1242,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
/* Initialize the software rasterizer and helper modules. */
if (!_swrast_CreateContext(ctx) ||
- !_ac_CreateContext(ctx) ||
+ !_vbo_CreateContext(ctx) ||
!_tnl_CreateContext(ctx) ||
!_swsetup_CreateContext(ctx)) {
_mesa_free_context_data(ctx);
@@ -1285,7 +1285,7 @@ void WMesaDestroyContext( WMesaContext pwc )
_swsetup_DestroyContext(ctx);
_tnl_DestroyContext(ctx);
- _ac_DestroyContext(ctx);
+ _vbo_DestroyContext(ctx);
_swrast_DestroyContext(ctx);
_mesa_free_context_data(ctx);
diff --git a/src/mesa/drivers/windows/gldirect/dglcontext.c b/src/mesa/drivers/windows/gldirect/dglcontext.c
index 5dafe14518d..4ad7a76e67f 100644
--- a/src/mesa/drivers/windows/gldirect/dglcontext.c
+++ b/src/mesa/drivers/windows/gldirect/dglcontext.c
@@ -1453,7 +1453,7 @@ SkipPrimaryCreate:
#ifdef _USE_GLD3_WGL
// Init Mesa internals
_swrast_CreateContext( lpCtx->glCtx );
- _ac_CreateContext( lpCtx->glCtx );
+ _vbo_CreateContext( lpCtx->glCtx );
_tnl_CreateContext( lpCtx->glCtx );
_swsetup_CreateContext( lpCtx->glCtx );
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c
index cad299540d7..d5fa6428006 100644
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c
+++ b/src/mesa/drivers/windows/gldirect/dx7/gld_driver_dx7.c
@@ -52,7 +52,7 @@
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
@@ -868,7 +868,7 @@ void gld_update_state_DX7(
return;
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
// SetupIndex will be used in the pipelines for choosing setup function
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c
index 6be41a80dd3..ba60980bbe8 100644
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c
+++ b/src/mesa/drivers/windows/gldirect/dx7/gld_ext_dx7.c
@@ -58,7 +58,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
index 5da25003c08..c99ba0bba55 100644
--- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
+++ b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c
@@ -54,7 +54,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c
index 0a6d9f8555c..7afa9190cdf 100644
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c
+++ b/src/mesa/drivers/windows/gldirect/dx8/gld_driver_dx8.c
@@ -52,7 +52,7 @@
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
@@ -850,7 +850,7 @@ void gld_update_state_DX8(
return;
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
// SetupIndex will be used in the pipelines for choosing setup function
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c
index 108f12a9d16..b51bba9b3ca 100644
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c
+++ b/src/mesa/drivers/windows/gldirect/dx8/gld_ext_dx8.c
@@ -58,7 +58,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
index 700b5200862..a5b5462f039 100644
--- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
+++ b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c
@@ -54,7 +54,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
index 1b01cb1f7f3..c191564d6eb 100644
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
+++ b/src/mesa/drivers/windows/gldirect/dx9/gld_driver_dx9.c
@@ -52,7 +52,7 @@
#include "texformat.h"
#include "teximage.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
@@ -876,7 +876,7 @@ void gld_update_state_DX9(
return;
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
// SetupIndex will be used in the pipelines for choosing setup function
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
index 745c987602b..e8c73a6ff80 100644
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
+++ b/src/mesa/drivers/windows/gldirect/dx9/gld_ext_dx9.c
@@ -58,7 +58,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
index 65fd821276e..403a9d5f86e 100644
--- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
+++ b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c
@@ -54,7 +54,7 @@
#include "mtypes.h"
#include "texformat.h"
#include "texstore.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast_setup/ss_context.h"
diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
index 0f11b4fe513..b590dc795a0 100644
--- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
+++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c
@@ -54,7 +54,7 @@
#include "texformat.h"
#include "texstore.h"
#include "teximage.h"
-#include "array_cache/acache.h"
+#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast/s_context.h"
@@ -1321,7 +1321,7 @@ static void wmesa_update_state(
{
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
+ _vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
}
@@ -1631,7 +1631,7 @@ BOOL gldInitialiseMesa_MesaSW(
_mesa_enable_1_3_extensions(ctx);
// _swrast_CreateContext( ctx );
-// _ac_CreateContext( ctx );
+// _vbo_CreateContext( ctx );
// _tnl_CreateContext( ctx );
// _swsetup_CreateContext( ctx );
diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def
index 1826192d307..465b380a0cb 100644
--- a/src/mesa/drivers/windows/icd/mesa.def
+++ b/src/mesa/drivers/windows/icd/mesa.def
@@ -24,9 +24,9 @@ EXPORTS
;
; Mesa internals - mostly for OSMESA
- _ac_CreateContext
- _ac_DestroyContext
- _ac_InvalidateState
+ _vbo_CreateContext
+ _vbo_DestroyContext
+ _vbo_InvalidateState
_glapi_get_context
_glapi_get_proc_address
_mesa_buffer_data