DXT1/3/5 support was broken, but unnoticeable since we also indicated
it wasn't supported.
This commit is contained in:
parent
5546a02ef6
commit
beb4ac8fe1
|
@ -50,6 +50,7 @@ IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion)
|
|||
IDirect3D8Impl *object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
|
||||
|
||||
object->lpVtbl = &Direct3D8_Vtbl;
|
||||
object->direct3d8 = object;
|
||||
object->ref = 1;
|
||||
|
||||
TRACE("SDKVersion = %x, Created Direct3D object at %p\n", SDKVersion, object);
|
||||
|
|
|
@ -249,6 +249,7 @@ struct IDirect3D8Impl
|
|||
|
||||
/* IDirect3D8 fields */
|
||||
GL_Info gl_info;
|
||||
IDirect3D8Impl *direct3d8;
|
||||
};
|
||||
|
||||
/* IUnknown: */
|
||||
|
|
|
@ -2813,8 +2813,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD
|
|||
/* If Alpha arg1 is texture then handle the special case when there changes between a
|
||||
texture and no texture - See comments in set_tex_op */
|
||||
if ((This->StateBlock->texture_state[Stage][D3DTSS_ALPHAARG1] == D3DTA_TEXTURE) &&
|
||||
((oldTxt == NULL) && (pTexture != NULL)) ||
|
||||
((pTexture == NULL) && (oldTxt != NULL)))
|
||||
(((oldTxt == NULL) && (pTexture != NULL)) || ((pTexture == NULL) && (oldTxt != NULL))))
|
||||
{
|
||||
reapplyFlags |= REAPPLY_ALPHAOP;
|
||||
}
|
||||
|
@ -3096,6 +3095,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 ifa
|
|||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_GEN_R);
|
||||
checkGLcall("glDisable(GL_TEXTURE_GEN_S,T,R)");
|
||||
break;
|
||||
|
||||
case D3DTSS_TCI_CAMERASPACEPOSITION:
|
||||
|
|
|
@ -320,6 +320,15 @@ HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 iface,
|
|||
RType, debug_d3dressourcetype(RType),
|
||||
CheckFormat, debug_d3dformat(CheckFormat));
|
||||
|
||||
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
|
||||
switch (CheckFormat) {
|
||||
case D3DFMT_DXT1:
|
||||
case D3DFMT_DXT3:
|
||||
case D3DFMT_DXT5:
|
||||
return D3D_OK;
|
||||
}
|
||||
}
|
||||
|
||||
switch (CheckFormat) {
|
||||
case D3DFMT_UYVY:
|
||||
case D3DFMT_YUY2:
|
||||
|
|
|
@ -409,8 +409,21 @@ SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
|
|||
}
|
||||
|
||||
GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
|
||||
GLint retVal;
|
||||
GLint retVal = 0;
|
||||
|
||||
#if defined(GL_EXT_texture_compression_s3tc)
|
||||
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
|
||||
switch (fmt) {
|
||||
case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break;
|
||||
case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break;
|
||||
case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break;
|
||||
default:
|
||||
/* stupid compiler */
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (retVal == 0) {
|
||||
switch (fmt) {
|
||||
case D3DFMT_P8: retVal = GL_COLOR_INDEX8_EXT; break;
|
||||
case D3DFMT_A8P8: retVal = GL_COLOR_INDEX8_EXT; break;
|
||||
|
@ -425,18 +438,7 @@ GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
|
|||
FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
|
||||
retVal = GL_RGB8;
|
||||
}
|
||||
#if defined(GL_EXT_texture_compression_s3tc)
|
||||
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
|
||||
switch (fmt) {
|
||||
case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break;
|
||||
case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break;
|
||||
case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break;
|
||||
default:
|
||||
/* stupid compiler */
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
TRACE("fmt2glintFmt for fmt(%u,%s) = %x\n", fmt, debug_d3dformat(fmt), retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue