diff options
author | Stephane Marchesin <[email protected]> | 2007-03-10 01:23:40 +0100 |
---|---|---|
committer | Stephane Marchesin <[email protected]> | 2007-03-10 01:30:33 +0100 |
commit | df1c3ff3ddaeee2dd32f0c3f7c298142c41982ff (patch) | |
tree | 49d34832d4dd03443dc79bcaa2ab53f95b5b3037 /src/mesa/drivers/dri/nouveau | |
parent | e61f674844afeae7bd5ff17084a46b7215401275 (diff) |
nouveau: some fixes to the nv04 state code.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv04_state.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state.c b/src/mesa/drivers/dri/nouveau/nv04_state.c index 4129ecc50ea..25df3d2a624 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state.c @@ -455,35 +455,37 @@ static GLboolean nv04BindBuffers(nouveauContextPtr nmesa, int num_color, nouveau_renderbuffer *depth) { GLuint x, y, w, h; + uint32_t depth_pitch=(depth?depth->pitch:0+15)&~15+16; + if (depth_pitch<256) depth_pitch=256; w = color[0]->mesa.Width; h = color[0]->mesa.Height; x = nmesa->drawX; y = nmesa->drawY; + BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_FORMAT, 1); + if (color[0]->mesa._ActualFormat == GL_RGBA8) + OUT_RING(0x108/*A8R8G8B8*/); + else + OUT_RING(0x103/*R5G6B5*/); + /* FIXME pitches have to be aligned ! */ BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_PITCH, 2); - OUT_RING(color[0]->pitch|(depth?(depth->pitch<<16):0)); + OUT_RING(color[0]->pitch|(depth_pitch<<16)); OUT_RING(color[0]->offset); - if (depth) { BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA, 1); OUT_RING(depth->offset); } - BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL, 2); - OUT_RING((w<<16)|x); - OUT_RING((h<<16)|y); +// BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL, 2); +// OUT_RING((w<<16)|x); +// OUT_RING((h<<16)|y); - /* FIXME not sure... */ - BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_SIZE, 1); - OUT_RING((h<<16)|w); - BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_FORMAT, 1); - if (color[0]->mesa._ActualFormat == GL_RGBA8) - OUT_RING(108/*A8R8G8B8*/); - else - OUT_RING(103/*R5G6B5*/); + /* FIXME not sure... */ +/* BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_SIZE, 1); + OUT_RING((h<<16)|w);*/ return GL_TRUE; } |