Get NeHe demos 06, 07 and 19 working.
e32(0x00000003);
+ #if 0 /* looks like the Z offset issue got fixed */
rmesa->hw.vte.cmd[1] = R300_VPORT_X_SCALE_ENA
| R300_VPORT_X_OFFSET_ENA
| R300_VPORT_Y_SCALE_ENA
| R300_VPORT_Y_OFFSET_ENA
| R300_VTX_W0_FMT;
+ #endif
R300_STATECHANGE(rmesa, vte);
r300EmitState(rmesa);
r300EmitVertexShader(rmesa);
r300EmitPixelShader(rmesa);
+ #if 0
+ reg_start(R300_RB3D_COLORMASK, 0);
+ e32(0xf);
+ #endif
+ /* ----------------------------------- */
+
/* We need LOAD_VBPNTR to setup AOS_ATTR fields.. the offsets are irrelevant */
r300EmitLOAD_VBPNTR(rmesa, 0);
r300->hw.tex.unknown4.cmd[R300_TEX_VALUE_0+i]=0x0;
r300->hw.tex.unknown5.cmd[R300_TEX_VALUE_0+i]=0x0;
+
+ fprintf(stderr, "Want to set format %08x\n", t->format);
/* We don't know how to set this yet */
r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x88a0c;
+ r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x88013;
+ /* Use the code below to quickly find matching texture
+ formats. Requires an app that displays the same texture
+ repeatedly */
+ #if 0
+ {
+ static int fmt=0;
+ static int k=0;
+ k++;
+ if(k>400){
+ k=0;
+ fmt++;
+ if(fmt>0xff){
+ exit(-1);
+ fmt=0;
+ }
+ //sleep(1);
+ }
+ r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x00a0c | (fmt<<12);
+ }
+ #endif
+ r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x53a0c;
+ fprintf(stderr, "Instead setting format %08x\n", r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]);
+
- } else {
- /* Fill in with 0's */
- #if 0 /* No need.. */
- r300->hw.tex.filter.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.unknown1.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.size.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.format.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.offset.cmd[R300_TEX_VALUE_0+i]=r300->radeon.radeonScreen->fbLocation;
- r300->hw.tex.unknown4.cmd[R300_TEX_VALUE_0+i]=0x0;
- r300->hw.tex.unknown5.cmd[R300_TEX_VALUE_0+i]=0x0;
- #endif
}
}
const GLboolean force16bpt =
(rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16);
(void)format;
-
+
switch (internalFormat) {
case 4:
case GL_RGBA:
t->filter &= ~R200_MAX_MIP_LEVEL_MASK;
t->filter |= (numLevels - 1) << R200_MAX_MIP_LEVEL_SHIFT;
- t->format &= ~(R200_TXFORMAT_WIDTH_MASK |
- R200_TXFORMAT_HEIGHT_MASK |
+ t->format &= ~(R300_TX_FORMAT_WIDTH_MASK |
+ R300_TX_FORMAT_HEIGHT_MASK |
R200_TXFORMAT_CUBIC_MAP_ENABLE |
R200_TXFORMAT_F5_WIDTH_MASK |
R200_TXFORMAT_F5_HEIGHT_MASK);
- t->format |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
- (log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
+ t->format |= ((log2Width << R300_TX_FORMAT_WIDTH_SHIFT) |
+ (log2Height << R300_TX_FORMAT_HEIGHT_SHIFT));
t->format_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
if (tObj->Target == GL_TEXTURE_3D) {
if (GET_CHIP(rmesa->radeon.radeonScreen) == RADEON_CHIP_REAL_R200) {
/*
* T0 hang workaround -------------
- * not needed for r300 derivatives?
+ * not needed for r200 derivatives?
*/
if ((rmesa->hw.ctx.cmd[CTX_PP_CNTL] & R200_TEX_ENABLE_MASK) ==
R200_TEX_0_ENABLE
/*
* Texture cache LRU hang workaround -------------
- * not needed for r300 derivatives?
+ * not needed for r200 derivatives?
*/
dbg = 0x0;