#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ /*{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },*/
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
switch (pname)
{
+ case GL_FOG_COORDINATE_SOURCE_EXT:
+ current->hwFog &= ~MASK_FogMode;
+ switch (ctx->Fog.FogCoordinateSource)
+ {
+ case GL_FOG_COORDINATE_EXT:
+ current->hwFog &= ~MASK_FogZLookup;
+ break;
+ case GL_FRAGMENT_DEPTH_EXT:
+ current->hwFog |= MASK_FogZLookup;
+ break;
+ }
+ if (current->hwFog != prev->hwFog) {
+ prev->hwFog = current->hwFog;
+ smesa->GlobalFlag |= GFLAG_FOGSETTING;
+ }
+ break;
case GL_FOG_MODE:
current->hwFog &= ~MASK_FogMode;
switch (ctx->Fog.Mode)
#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset]
-#define VERT_SET_SPEC( v0, c ) \
+#define VERT_SET_SPEC( v, c ) \
do { \
if (specoffset != 0) { \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.red, (c)[0]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.green, (c)[1]); \
- UNCLAMPED_FLOAT_TO_UBYTE(v0->v.specular.blue, (c)[2]); \
+ sis_color_t *spec = (sis_color_t *)&((v)->ui[specoffset]); \
+ UNCLAMPED_FLOAT_TO_UBYTE(spec->red, (c)[0]); \
+ UNCLAMPED_FLOAT_TO_UBYTE(spec->green, (c)[1]); \
+ UNCLAMPED_FLOAT_TO_UBYTE(spec->blue, (c)[2]); \
} \
} while (0)
-#define VERT_COPY_SPEC( v0, v1 ) \
-do { \
- if (specoffset != 0) { \
- v0->v.specular.red = v1->v.specular.red; \
- v0->v.specular.green = v1->v.specular.green; \
- v0->v.specular.blue = v1->v.specular.blue; \
- } \
+#define VERT_COPY_SPEC( v0, v1 ) \
+do { \
+ if (specoffset != 0) { \
+ sis_color_t *spec0 = (sis_color_t *)&((v0)->ui[specoffset]); \
+ sis_color_t *spec1 = (sis_color_t *)&((v1)->ui[specoffset]); \
+ spec0->red = spec1->red; \
+ spec0->green = spec1->green; \
+ spec0->blue = spec1->blue; \
+ } \
} while (0)
#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
smesa->vertex_attrs[smesa->vertex_attr_count].offset = (N); \
smesa->vertex_attr_count++; \
} while (0)
-
-#define SIS_TCL_STATE_BITS \
- (_TNL_BITS_TEX_ANY | _TNL_BIT_COLOR1 | _TNL_BIT_FOG)
static void sisRenderStart( GLcontext *ctx )
{
EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA);
+ smesa->specoffset = 0;
if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) {
AGPParseSet |= SiS_PS_HAS_SPECULAR;
- smesa->specoffset = smesa->coloroffset + 1;
if (index & _TNL_BIT_COLOR1) {
EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR);
+ smesa->specoffset = smesa->coloroffset + 1;
} else {
EMIT_PAD(3);
}
} else {
EMIT_PAD(1);
}
- } else {
- smesa->specoffset = 0;
}
/* projective textures are not supported by the hardware */