Another nasty struct size bug found.
authorAapo Tahkola <aet@rasterburn.org>
Thu, 24 Feb 2005 13:59:56 +0000 (13:59 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Thu, 24 Feb 2005 13:59:56 +0000 (13:59 +0000)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_tex.c

index c7e1b8edca7886bdfd37c413cffa6d9983598788..d3dbccc8ed6f95864db3adda4261b258c1283eae 100644 (file)
@@ -122,11 +122,16 @@ struct r300_dma_region {
     int aos_reg;        /* VAP register assignment */
 };
 
+#define DUMP_DMA(rmesa) fprintf(stderr, "start=%d, end=%d, prt=%d, offset=%d, stride=%d, size=%d, format=%d, reg=%d\n",\
+rmesa->dma.current.start, rmesa->dma.current.end, rmesa->dma.current.ptr, rmesa->dma.current.aos_offset, \
+rmesa->dma.current.aos_stride, rmesa->dma.current.aos_size, rmesa->dma.current.aos_format, rmesa->dma.current.aos_reg);
+
 struct r300_dma {
        /* Active dma region.  Allocations for vertices and retained
         * regions come from here.  Also used for emitting random vertices,
         * these may be flushed by calling flush_current();
         */
+       int dummy; /* move this below current to make arbvptorus work */
        struct r300_dma_region current;
 
        void (*flush) (r300ContextPtr);
@@ -671,10 +676,11 @@ struct r300_state {
        
        GLuint render_inputs; /* actual render inputs that R300 was configured for. 
                                 They are the same as tnl->render_inputs for fixed pipeline */  
+#if 0
        struct {
                int transform_offset;  /* Transform matrix offset, -1 if none */
                } vap_param;  /* vertex processor parameter allocation - tells where to write parameters */
-
+#endif
        int hw_stencil;
 };
 
index de21bfc81b0caf3773aa2f2cde0dc8708a82e8b6..45cff5b7eb9e7afb060e066939bd447a4402ebe1 100644 (file)
@@ -376,7 +376,7 @@ void r300RefillCurrentDmaRegion(r300ContextPtr rmesa)
        int size = 0;
        drmDMAReq dma;
        int ret;
-
+       
        if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
                fprintf(stderr, "%s\n", __FUNCTION__);
 
index ca945956b845b6f063b1992d211fd4165a75add9..4fd3dc6eb7b259723bc1934fa9c1cdac95810784 100644 (file)
@@ -310,6 +310,7 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
 
                vic_1 |= R300_INPUT_CNTL_POS;
        }
+       //DUMP_DMA(rmesa);
 
        if (inputs & _TNL_BIT_NORMAL) {
                CONFIGURE_AOS(i_normal, AOS_FORMAT_FLOAT,
@@ -321,7 +322,7 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd)
        }
 
        if (inputs & _TNL_BIT_COLOR0) {
-               int emitsize;
+               int emitsize=4;
 
                if (!immd) {
                        if (VB->ColorPtr[0]->size == 4 &&
index 0123c75c2ffbb055d953636cf1c1efc18f8d3bad..e20e34c199cbd9d27d0f4e487047963382ef7abc 100644 (file)
@@ -1515,7 +1515,7 @@ void r300GenerateSimpleVertexShader(r300ContextPtr r300)
        int i;
 
        /* Allocate parameters */
-       r300->state.vap_param.transform_offset=0x0;  /* transform matrix */
+       //r300->state.vap_param.transform_offset=0x0;  /* transform matrix */
        r300->state.vertex_shader.param_offset=0x0;
        r300->state.vertex_shader.param_count=0x4;  /* 4 vector values - 4x4 matrix */
        
@@ -1674,6 +1674,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa)
        GLcontext* ctx = rmesa->radeon.glCtx;
        int inst_count;
        int param_count;
+       LOCAL_VARS
 
        /* Reset state, in case we don't use something */
        ((drm_r300_cmd_header_t*)rmesa->hw.vpp.cmd)->vpu.count = 0;
@@ -1752,7 +1753,7 @@ void r300GenerateTexturePixelShader(r300ContextPtr r300)
 
                                break;
                        default:
-                               fprintf(stderr, "ModeRGB=%s is not implemented yet !\n",
+                               WARN_ONCE("ModeRGB=%s is not implemented yet !\n",
                                         _mesa_lookup_enum_by_nr(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeRGB));
                                /* PFS_NOP */
                                r300->state.pixel_shader.program.alu.inst[alu_inst].inst0=
@@ -1788,7 +1789,7 @@ void r300GenerateTexturePixelShader(r300ContextPtr r300)
 
                                break;
                        default:
-                               fprintf(stderr, "ModeA=%s is not implemented yet !\n",
+                               WARN_ONCE("ModeA=%s is not implemented yet !\n",
                                         _mesa_lookup_enum_by_nr(r300->radeon.glCtx->Texture.Unit[i]._CurrentCombine->ModeA));
                                /* PFS_NOP */
                                r300->state.pixel_shader.program.alu.inst[alu_inst].inst2=
index c3010d3cebc2f0037c0a2909a19be31a3d873813..e6c8c18011b6701746cfdd423880f7f4f4cedf6d 100644 (file)
@@ -816,7 +816,7 @@ static void r300TexEnv(GLcontext * ctx, GLenum target,
         */
        switch (pname) {
        case GL_TEXTURE_ENV_COLOR:{
-               fprintf(stderr, "%s:%s I am broken - Fixme !\n", __FILE__, __FUNCTION__);
+               WARN_ONCE("I am broken - Fixme !\n");
                /*
                        GLubyte c[4];
                        GLuint envColor;