-$(call UNLINK,swrast_setup/*.o)
-$(call UNLINK,tnl/*.o)
-$(call UNLINK,x86/*.o)
+ -$(call UNLINK,drivers/common/*.o)
-$(call UNLINK,drivers/dos/*.o)
-$(call UNLINK,drivers/glide/*.o)
-$(call UNLINK,swrast_setup/*.o)
-$(call UNLINK,tnl/*.o)
-$(call UNLINK,x86/*.o)
+ -$(call UNLINK,drivers/common/*.o)
-$(call UNLINK,drivers/windows/gdi/*.o)
-$(call UNLINK,drivers/glide/*.o)
-$(call UNLINK,drivers/glide/*.res)
tnl\t_vtx_exec.c
DRIVER_SOURCES =\
+ drivers\common\driverfuncs.c\
drivers\glide\fxapi.c\
drivers\glide\fxdd.c\
drivers\glide\fxddspan.c\
$(RM) swrast_setup\*.obj
$(RM) tnl\*.obj
$(RM) x86\*.obj
+ $(RM) drivers\common\*.obj
$(RM) drivers\glide\*.obj
$(RM) drivers\glide\*.res
$(RM) $(LIBDIR)\*.pdb
#if 1
_mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
#endif
+ /* not just yet */
+#if 0
+ _mesa_enable_extension(ctx, "GL_ARB_fragment_program");
+ _mesa_enable_extension(ctx, "GL_ARB_vertex_program");
+#endif
}
}
}
+ /* [dBorca]
+ * We could avoid this for certain `sfactor/dfactor'
+ * I do not think that is even worthwhile to check
+ * because if someone is using blending they use more
+ * interesting settings and also it would add more
+ * state tracking to a lot of the code.
+ */
if (ctx->Color.ColorLogicOpEnabled && (ctx->Color.LogicOp != GL_COPY)) {
return FX_FALLBACK_LOGICOP;
}
/* Unsupported texture/multitexture cases */
+ /* we can only do 1D/2D textures */
+ if (ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
+ return FX_FALLBACK_TEXTURE_MAP;
+
if (fxMesa->haveTwoTMUs) {
- /* we can only do 2D textures */
- if (ctx->Texture.Unit[0]._ReallyEnabled & ~TEXTURE_2D_BIT)
- return FX_FALLBACK_TEXTURE_1D_3D;
- if (ctx->Texture.Unit[1]._ReallyEnabled & ~TEXTURE_2D_BIT)
- return FX_FALLBACK_TEXTURE_1D_3D;
+ if (ctx->Texture.Unit[1]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT))
+ return FX_FALLBACK_TEXTURE_MAP;
- if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) {
+ if (ctx->Texture.Unit[0]._ReallyEnabled) {
if (fxMesa->type < GR_SSTTYPE_Voodoo2)
if (ctx->Texture.Unit[0].EnvMode == GL_BLEND &&
- (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT ||
+ (ctx->Texture.Unit[1]._ReallyEnabled ||
ctx->Texture.Unit[0].EnvColor[0] != 0 ||
ctx->Texture.Unit[0].EnvColor[1] != 0 ||
ctx->Texture.Unit[0].EnvColor[2] != 0 ||
return FX_FALLBACK_TEXTURE_BORDER;
}
- if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) {
+ if (ctx->Texture.Unit[1]._ReallyEnabled) {
if (fxMesa->type < GR_SSTTYPE_Voodoo2)
if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
return FX_FALLBACK_TEXTURE_ENV;
if (ctx->Texture._EnabledUnits == 0x3) {
/* Can't use multipass to blend a multitextured triangle - fall
* back to software.
+ * [dBorca] we hit this case only when we try to emulate
+ * multitexture by multipass!
*/
if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) {
return FX_FALLBACK_TEXTURE_MULTI;
}
if (fxMesa->type < GR_SSTTYPE_Voodoo2)
- if ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) &&
+ if (ctx->Texture.Unit[0]._ReallyEnabled &&
(ctx->Texture.Unit[0].EnvMode == GL_BLEND)) {
return FX_FALLBACK_TEXTURE_ENV;
}
ctx->Driver.Finish = fxDDFinish;
ctx->Driver.Flush = NULL;
ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat;
+ ctx->Driver.TexImage1D = fxDDTexImage1D;
ctx->Driver.TexImage2D = fxDDTexImage2D;
ctx->Driver.TexSubImage2D = fxDDTexSubImage2D;
ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D;
ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D;
ctx->Driver.IsCompressedFormat = fxDDIsCompressedFormat;
ctx->Driver.CompressedTextureSize = fxDDCompressedTextureSize;
+ ctx->Driver.TestProxyTexImage = fxDDTestProxyTexImage;
ctx->Driver.TexEnv = fxDDTexEnv;
ctx->Driver.TexParameter = fxDDTexParam;
ctx->Driver.BindTexture = fxDDTexBind;
fprintf(stderr, "fxDDTexBind(%d, %x)\n", tObj->Name, (GLuint)tObj->DriverData);
}
- if (target != GL_TEXTURE_2D)
+ if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
return;
if (!tObj->DriverData) {
_mesa_lookup_enum_by_nr(param));
}
- if (target != GL_TEXTURE_2D)
+ if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
return;
if (!tObj->DriverData)
fprintf(stderr, "fxDDTexPalette(%d, %x)\n",
tObj->Name, (GLuint) tObj->DriverData);
}
+ /* This might be a proxy texture. */
+ if (!tObj->Palette.Table)
+ return;
if (!tObj->DriverData)
tObj->DriverData = fxAllocTexObjData(fxMesa);
ti = fxTMGetTexInfo(tObj);
else {
fxMesa->haveGlobalPaletteTexture = 0;
+ /* [dBorca] tis beyond my comprehension */
if ((ctx->Texture.Unit[0]._Current == ctx->Texture.Unit[0].Current2D) &&
(ctx->Texture.Unit[0]._Current != NULL)) {
struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
fxIsTexSupported(GLenum target, GLint internalFormat,
const struct gl_texture_image *image)
{
- if (target != GL_TEXTURE_2D)
+ if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D))
return GL_FALSE;
#if 0
return;
}
}
+ ti = fxTMGetTexInfo(texObj);
if (!texImage->DriverData) {
texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel));
return;
}
}
- ti = fxTMGetTexInfo(texObj);
-
mml = FX_MIPMAP_DATA(texImage);
fxTexGetInfo(width, height, NULL, NULL, NULL, NULL,
return;
}
}
+ ti = fxTMGetTexInfo(texObj);
if (!texImage->DriverData) {
texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel));
return;
}
}
- ti = fxTMGetTexInfo(texObj);
mml = FX_MIPMAP_DATA(texImage);
fxTexGetInfo(width, height, NULL, NULL, NULL, NULL,
}
+void
+fxDDTexImage1D (GLcontext *ctx, GLenum target, GLint level,
+ GLint internalFormat, GLint width, GLint border,
+ GLenum format, GLenum type, const GLvoid *pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ fxDDTexImage2D(ctx, target, level,
+ internalFormat, width, 1, border,
+ format, type, pixels,
+ packing,
+ texObj,
+ texImage);
+}
+
+
+GLboolean
+fxDDTestProxyTexImage (GLcontext *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLenum format, GLenum type,
+ GLint width, GLint height,
+ GLint depth, GLint border)
+{
+ /* [dBorca]
+ * TODO - maybe through fxTexValidate()
+ */
+ return _mesa_test_proxy_teximage(ctx, target,
+ level, internalFormat,
+ format, type,
+ width, height,
+ depth, border);
+}
+
+
#else /* FX */
/*
GLsizei imageSize, const GLvoid *data,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage);
+extern void fxDDTexImage1D(GLcontext * ctx, GLenum target, GLint level,
+ GLint internalFormat, GLint width,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *packing,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+extern GLboolean fxDDTestProxyTexImage (GLcontext *ctx, GLenum target,
+ GLint level, GLint internalFormat,
+ GLenum format, GLenum type,
+ GLint width, GLint height,
+ GLint depth, GLint border);
extern void fxDDTexEnv(GLcontext *, GLenum, GLenum, const GLfloat *);
extern void fxDDTexParam(GLcontext *, GLenum, struct gl_texture_object *,
GLenum, const GLfloat *);
void fxSetupTexture (GLcontext *ctx);
/* Flags for software fallback cases */
-#define FX_FALLBACK_TEXTURE_1D_3D 0x0001
+#define FX_FALLBACK_TEXTURE_MAP 0x0001
#define FX_FALLBACK_DRAW_BUFFER 0x0002
#define FX_FALLBACK_SPECULAR 0x0004
#define FX_FALLBACK_STENCIL 0x0008
GLuint unitsmode;
GLint ifmt;
tfxTexInfo *ti;
- struct gl_texture_object *tObj = ctx->Texture.Unit[textureset].Current2D;
+ struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current;
int tmu;
if (TDFX_DEBUG & VERBOSE_DRIVER) {
struct tdfx_texcombine tex0, tex1;
GrCombineLocal_t localc, locala;
tfxTexInfo *ti0, *ti1;
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[1].Current2D;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[0].Current2D;
+ struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current;
+ struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current;
GLuint envmode, ifmt, unitsmode;
int tmu0 = 0, tmu1 = 1;
if (fxMesa->HaveCmbExt) {
/* Texture Combine, Color Combine and Alpha Combine. */
- if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
- ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT &&
+ if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
+ (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
fxMesa->haveTwoTMUs) {
fxSetupTextureDoubleTMUNapalm_NoLock(ctx);
}
- else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) {
+ else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
fxSetupTextureSingleTMUNapalm_NoLock(ctx, 0);
}
- else if (ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
+ else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
fxSetupTextureSingleTMUNapalm_NoLock(ctx, 1);
}
else {
}
} else {
/* Texture Combine, Color Combine and Alpha Combine. */
- if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
- ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT &&
+ if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
+ (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
fxMesa->haveTwoTMUs) {
fxSetupTextureDoubleTMU_NoLock(ctx);
}
- else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) {
+ else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
fxSetupTextureSingleTMU_NoLock(ctx, 0);
}
- else if (ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
+ else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) {
fxSetupTextureSingleTMU_NoLock(ctx, 1);
}
else {
case GL_LINE_STIPPLE:
case GL_POINT_SMOOTH:
case GL_POLYGON_SMOOTH:
+ case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
fxMesa->new_state |= FX_NEW_TEXTURING;
break;
GrCombineLocal_t localc, locala; /* fragmentColor/Alpha */
GLint ifmt;
tfxTexInfo *ti;
- struct gl_texture_object *tObj = texUnit->Current2D;
+ struct gl_texture_object *tObj = texUnit->_Current;
if (TDFX_DEBUG & VERBOSE_DRIVER) {
fprintf(stderr, "fxSetupTextureEnvNapalm_NoLock(unit %u, TMU %u, iterated %d)\n",
fxMesaContext fxMesa = FX_CONTEXT(ctx);
GLuint unitsmode;
tfxTexInfo *ti;
- struct gl_texture_object *tObj = ctx->Texture.Unit[textureset].Current2D;
+ struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current;
int tmu;
if (TDFX_DEBUG & VERBOSE_DRIVER) {
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
tfxTexInfo *ti0, *ti1;
- struct gl_texture_object *tObj0 = ctx->Texture.Unit[1].Current2D;
- struct gl_texture_object *tObj1 = ctx->Texture.Unit[0].Current2D;
+ struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current;
+ struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current;
GLuint unitsmode;
int tmu0 = 0, tmu1 = 1;
/**********************************************************************/
static char *fallbackStrings[] = {
- "1D/3D Texture map",
+ "3D/Rect/Cube Texture map",
"glDrawBuffer(GL_FRONT_AND_BACK)",
"Separate specular color",
"glEnable/Disable(GL_STENCIL_TEST)",
return (ret);
}
+static void wgl_error (long error)
+{
+#define WGL_INVALID_PIXELFORMAT ERROR_INVALID_PIXEL_FORMAT
+ SetLastError(0xC0000000 /* error severity */
+ |0x00070000 /* error facility (who we are) */
+ |error);
+}
+
GLAPI BOOL GLAPIENTRY
wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
{
}
if (curPFD == 0) {
- SetLastError(0);
+ wgl_error(WGL_INVALID_PIXELFORMAT);
return (NULL);
}