Oliver McFadden skrev:
> I tested all the patches but none of them helped my flickering bug. I
> did some
> debugging on my vert/frag program and I think the problem is with one
> of the
> texcoords. I use 6 texcoords, which are generated in the vertex
> program and
> passed to the fragment program.

I wile do some more dumps of the texcords. But it wile probable bee a
couple of days before i get some time to do it.
Du you fink if might bee the ordering of the instructions? The binary
drivers do a lot of reordering. 1 of the tings it does is move the
instructions that sets result.color.* as the last instructions.

> Btw, I think you can leave the checks for primary color (COL0) alone;
> Mesa
> should always provide it so we don't need to handle it specially, afaik.

This little vertex program gives strange colors fore front if wee don't
test for COL0 and set it if it issent there.

     "!!ARBvp1.0\n"
      "MOV  result.color.back.primary, {0,1,0,0};\n"

      "DP4  result.position.x, vertex.position,
state.matrix.modelview.row[0];\n"
      "DP4  result.position.y, vertex.position,
state.matrix.modelview.row[1];\n"
      "DP4  result.position.z, vertex.position,
state.matrix.modelview.row[2];\n"
      "DP4  result.position.w, vertex.position,
state.matrix.modelview.row[3];\n"
      "END\n";


I have attached the code for the entire test. It fits into revenge :-).
#include <SDL/SDL.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <GL/glut.h>
#include "dump.h"

static float Zrot = 0;
static GLuint prognum;

static void Display( void )
{
  glEnable(GL_VERTEX_PROGRAM_ARB);
   glEnable(GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
   glFrontFace(GL_CCW);
  
   glPolygonMode(GL_FRONT, GL_FILL);
   glPolygonMode(GL_BACK, GL_LINE);
   glClearColor(0.8, 0.8, 0.8, 1.0);
   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );


   glLoadIdentity();
   glRotatef(Zrot, 1, 1, 0.4);

   glPushMatrix();

   glVertexAttrib3fARB(3, 1, 0.5, 0.25);
   glBegin(GL_TRIANGLES);
   glVertexAttrib3fARB(3, 0.5, 1.0, 0.0);
   glVertexAttrib2fARB(0.5, 0.5, -0.5);
   glVertexAttrib3fARB(3, 1.0, 0.0, 0.0);
   glVertexAttrib2fARB(0.5, -0.5, -0.5);
   glVertexAttrib3fARB(3, 0.5, 0.0, 1.0);
   glVertexAttrib2fARB(0.5, 0,  0.5);
   glEnd();

   glPopMatrix();
}

static void Init( void )
{
   GLint errno;
   
   static const char *prog1 =
      "!!ARBvp1.0\n"
      "MOV  result.color.back.primary, {0,1,0,0};\n"

      "DP4  result.position.x, vertex.position, state.matrix.modelview.row[0];\n"
      "DP4  result.position.y, vertex.position, state.matrix.modelview.row[1];\n"
      "DP4  result.position.z, vertex.position, state.matrix.modelview.row[2];\n"
      "DP4  result.position.w, vertex.position, state.matrix.modelview.row[3];\n"
      "END\n";

   glGenProgramsARB(1, &prognum);

   glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
   glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
                        strlen(prog1), (const GLubyte *) prog1);

   assert(glIsProgramARB(prognum));
   errno = glGetError();
   printf("glGetError = %d\n", errno);
   if (errno != GL_NO_ERROR)
   {
      GLint errorpos;

      glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
      printf("errorpos: %d\n", errorpos);
      printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
   }
}

void testVP_BFC0(void)
{
  Init();
  glMatrixMode( GL_PROJECTION );
  glLoadIdentity();
  glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0 );
  glMatrixMode( GL_MODELVIEW );
  glLoadIdentity();
  int i=0;
  for(i=0;i<10;i++){
    Zrot=i*32;
    dump_rb_pre ();
    Display();
    struct timespec req = {1 , 0 };
    glFinish ();
    nanosleep (&req, NULL);
    dump_rb_post ();
  }
  glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0);
  
  glDeleteProgramsARB(1,&prognum);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to