wined3d: Remove some redundant s3tc extension checks.
If the extension isn't available to surface shouldn't have been created. We don't do extension checks for all the other formats either.
This commit is contained in:
parent
ea09e4afe8
commit
b052c6e8aa
|
@ -5987,22 +5987,24 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
|
||||||
WINED3DFMT_DXT3 == destFormat ||
|
WINED3DFMT_DXT3 == destFormat ||
|
||||||
WINED3DFMT_DXT4 == destFormat ||
|
WINED3DFMT_DXT4 == destFormat ||
|
||||||
WINED3DFMT_DXT5 == destFormat) {
|
WINED3DFMT_DXT5 == destFormat) {
|
||||||
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
|
|
||||||
if (destSurfaceHeight != srcHeight || destSurfaceWidth != srcWidth) {
|
if (destSurfaceHeight != srcHeight || destSurfaceWidth != srcWidth)
|
||||||
/* FIXME: The easy way to do this is to lock the destination, and copy the bits across */
|
{
|
||||||
FIXME("Updating part of a compressed texture is not supported at the moment\n");
|
/* FIXME: The easy way to do this is to lock the destination, and copy the bits across. */
|
||||||
} if (destFormat != srcFormat) {
|
FIXME("Updating part of a compressed texture is not supported.\n");
|
||||||
FIXME("Updating mixed format compressed texture is not curretly support\n");
|
|
||||||
} else {
|
|
||||||
GL_EXTCALL(glCompressedTexImage2DARB(glDescription->target, glDescription->level,
|
|
||||||
dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
FIXME("Attempting to update a DXT compressed texture without hardware support\n");
|
|
||||||
}
|
}
|
||||||
|
if (destFormat != srcFormat)
|
||||||
|
{
|
||||||
} else {
|
FIXME("Updating mixed format compressed textures is not supported.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GL_EXTCALL(glCompressedTexImage2DARB(glDescription->target, glDescription->level,
|
||||||
|
dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
glTexSubImage2D(glDescription->target, glDescription->level, destLeft, destTop,
|
glTexSubImage2D(glDescription->target, glDescription->level, destLeft, destTop,
|
||||||
srcWidth, srcHeight, dst_format_desc->glFormat, dst_format_desc->glType, data);
|
srcWidth, srcHeight, dst_format_desc->glFormat, dst_format_desc->glType, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,25 +150,26 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
|
||||||
|| format_desc->format == WINED3DFMT_DXT3 || format_desc->format == WINED3DFMT_DXT4
|
|| format_desc->format == WINED3DFMT_DXT3 || format_desc->format == WINED3DFMT_DXT4
|
||||||
|| format_desc->format == WINED3DFMT_DXT5 || format_desc->format == WINED3DFMT_ATI2N)
|
|| format_desc->format == WINED3DFMT_DXT5 || format_desc->format == WINED3DFMT_ATI2N)
|
||||||
{
|
{
|
||||||
if (!GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { /* We can assume this as the texture would not have been created otherwise */
|
TRACE("(%p) : Calling glGetCompressedTexImageARB level %d, format %#x, type %#x, data %p.\n",
|
||||||
FIXME("(%p) : Attempting to lock a compressed texture when texture compression isn't supported by opengl\n", This);
|
This, This->glDescription.level, format_desc->glFormat, format_desc->glType,
|
||||||
} else {
|
This->resource.allocatedMemory);
|
||||||
TRACE("(%p) : Calling glGetCompressedTexImageARB level %d, format %#x, type %#x, data %p\n",
|
|
||||||
This, This->glDescription.level, format_desc->glFormat, format_desc->glType,
|
|
||||||
This->resource.allocatedMemory);
|
|
||||||
|
|
||||||
if(This->Flags & SFLAG_PBO) {
|
if (This->Flags & SFLAG_PBO)
|
||||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
|
{
|
||||||
checkGLcall("glBindBufferARB");
|
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
|
||||||
GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, NULL));
|
checkGLcall("glBindBufferARB");
|
||||||
checkGLcall("glGetCompressedTexImageARB()");
|
GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, NULL));
|
||||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0));
|
checkGLcall("glGetCompressedTexImageARB()");
|
||||||
checkGLcall("glBindBufferARB");
|
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0));
|
||||||
} else {
|
checkGLcall("glBindBufferARB");
|
||||||
GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target, This->glDescription.level, This->resource.allocatedMemory));
|
|
||||||
checkGLcall("glGetCompressedTexImageARB()");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GL_EXTCALL(glGetCompressedTexImageARB(This->glDescription.target,
|
||||||
|
This->glDescription.level, This->resource.allocatedMemory));
|
||||||
|
checkGLcall("glGetCompressedTexImageARB()");
|
||||||
|
}
|
||||||
|
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
} else {
|
} else {
|
||||||
void *mem;
|
void *mem;
|
||||||
|
@ -297,35 +298,41 @@ static void surface_upload_data(IWineD3DSurfaceImpl *This, GLenum internal, GLsi
|
||||||
|| format_desc->format == WINED3DFMT_DXT3 || format_desc->format == WINED3DFMT_DXT4
|
|| format_desc->format == WINED3DFMT_DXT3 || format_desc->format == WINED3DFMT_DXT4
|
||||||
|| format_desc->format == WINED3DFMT_DXT5 || format_desc->format == WINED3DFMT_ATI2N)
|
|| format_desc->format == WINED3DFMT_DXT5 || format_desc->format == WINED3DFMT_ATI2N)
|
||||||
{
|
{
|
||||||
if (!GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
|
/* glCompressedTexSubImage2D() for uploading and glTexImage2D() for
|
||||||
FIXME("Using DXT1/3/5 without advertized support\n");
|
* allocating does not work well on some drivers (r200 dri, MacOS ATI
|
||||||
} else {
|
* driver). glCompressedTexImage2D() does not accept NULL pointers. So
|
||||||
/* glCompressedTexSubImage2D for uploading and glTexImage2D for allocating does not work well on some drivers(r200 dri, MacOS ATI driver)
|
* for compressed textures surface_allocate_surface() does nothing,
|
||||||
* glCompressedTexImage2D does not accept NULL pointers. So for compressed textures surface_allocate_surface does nothing, and this
|
* and this function uses glCompressedTexImage2D() instead of
|
||||||
* function uses glCompressedTexImage2D instead of the SubImage call
|
* glCompressedTexSubImage2D(). */
|
||||||
*/
|
TRACE("(%p) : Calling glCompressedTexImage2DARB w %u, h %u, data %p.\n", This, width, height, data);
|
||||||
TRACE("(%p) : Calling glCompressedTexSubImage2D w %d, h %d, data %p\n", This, width, height, data);
|
|
||||||
ENTER_GL();
|
|
||||||
|
|
||||||
if(This->Flags & SFLAG_PBO) {
|
ENTER_GL();
|
||||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, This->pbo));
|
|
||||||
checkGLcall("glBindBufferARB");
|
|
||||||
TRACE("(%p) pbo: %#x, data: %p\n", This, This->pbo, data);
|
|
||||||
|
|
||||||
GL_EXTCALL(glCompressedTexImage2DARB(This->glDescription.target, This->glDescription.level, internal,
|
if (This->Flags & SFLAG_PBO)
|
||||||
width, height, 0 /* border */, This->resource.size, NULL));
|
{
|
||||||
checkGLcall("glCompressedTexSubImage2D");
|
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, This->pbo));
|
||||||
|
checkGLcall("glBindBufferARB");
|
||||||
|
|
||||||
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
TRACE("(%p) pbo: %#x, data: %p.\n", This, This->pbo, data);
|
||||||
checkGLcall("glBindBufferARB");
|
|
||||||
} else {
|
GL_EXTCALL(glCompressedTexImage2DARB(This->glDescription.target, This->glDescription.level,
|
||||||
GL_EXTCALL(glCompressedTexImage2DARB(This->glDescription.target, This->glDescription.level, internal,
|
internal, width, height, 0 /* border */, This->resource.size, NULL));
|
||||||
width, height, 0 /* border */, This->resource.size, data));
|
checkGLcall("glCompressedTexImage2DARB");
|
||||||
checkGLcall("glCompressedTexSubImage2D");
|
|
||||||
}
|
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
|
||||||
LEAVE_GL();
|
checkGLcall("glBindBufferARB");
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
|
GL_EXTCALL(glCompressedTexImage2DARB(This->glDescription.target, This->glDescription.level,
|
||||||
|
internal, width, height, 0 /* border */, This->resource.size, data));
|
||||||
|
checkGLcall("glCompressedTexSubImage2D");
|
||||||
|
}
|
||||||
|
|
||||||
|
LEAVE_GL();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TRACE("(%p) : Calling glTexSubImage2D w %d, h %d, data, %p\n", This, width, height, data);
|
TRACE("(%p) : Calling glTexSubImage2D w %d, h %d, data, %p\n", This, width, height, data);
|
||||||
ENTER_GL();
|
ENTER_GL();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue