Просмотр исходного кода

mesa: add back-door support for cylindrical texture wrap mode

If the texture priority field is 0.125 set the PROG_PARAM_BIT_CYL_WRAP
flag.  The gallium state tracker will look for this flag.

This feature is only for testing purposes and may be remove at some
point.  But if it's useful we could write a GL/Mesa extension to
expose it properly.
undefined
Brian Paul 15 лет назад
Родитель
Сommit
4a9f1eed2b
2 измененных файлов: 13 добавлений и 0 удалений
  1. 12
    0
      src/mesa/main/texenvprogram.c
  2. 1
    0
      src/mesa/shader/prog_parameter.h

+ 12
- 0
src/mesa/main/texenvprogram.c Просмотреть файл

@@ -113,6 +113,8 @@ struct state_key {
GLuint NumArgsA:3; /**< up to MAX_COMBINER_TERMS */
GLuint ModeA:5; /**< MODE_x */

GLuint texture_cyl_wrap:1; /**< For gallium test/debug only */

struct mode_opt OptRGB[MAX_COMBINER_TERMS];
struct mode_opt OptA[MAX_COMBINER_TERMS];
} unit[MAX_TEXTURE_UNITS];
@@ -464,6 +466,10 @@ static GLuint make_state_key( GLcontext *ctx, struct state_key *key )
key->unit[i].OptRGB[1].Operand = OPR_SRC_COLOR;
key->unit[i].OptRGB[1].Source = texUnit->BumpTarget - GL_TEXTURE0 + SRC_TEXTURE0;
}

/* this is a back-door for enabling cylindrical texture wrap mode */
if (texObj->Priority == 0.125)
key->unit[i].texture_cyl_wrap = 1;
}

/* _NEW_LIGHT | _NEW_FOG */
@@ -1302,6 +1308,12 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit )
}
else
p->src_texture[unit] = get_zero(p);

if (p->state->unit[unit].texture_cyl_wrap) {
/* set flag which is checked by Mesa->Gallium program translation */
p->program->Base.InputFlags[0] |= PROG_PARAM_BIT_CYL_WRAP;
}

}
}


+ 1
- 0
src/mesa/shader/prog_parameter.h Просмотреть файл

@@ -43,6 +43,7 @@
#define PROG_PARAM_BIT_INVARIANT 0x2 /**< for varying vars (GLSL 1.20) */
#define PROG_PARAM_BIT_FLAT 0x4 /**< for varying vars (GLSL 1.30) */
#define PROG_PARAM_BIT_LINEAR 0x8 /**< for varying vars (GLSL 1.30) */
#define PROG_PARAM_BIT_CYL_WRAP 0x10 /**< XXX gallium debug */
/*@}*/



Загрузка…
Отмена
Сохранить