Commit a1364d11 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wined3d: Don't use texture_rectangle for paletted textures.

parent 29bbc694
......@@ -894,9 +894,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
}
/** FIXME: add support for real non-power-two if it's provided by the video card **/
/* Precalculated scaling for 'faked' non power of two texture coords */
/* Precalculated scaling for 'faked' non power of two texture coords.
Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE
doesn't work in combination with ARB_TEXTURE_RECTANGLE.
*/
if(GL_SUPPORT(ARB_TEXTURE_RECTANGLE) &&
(Width != pow2Width || Height != pow2Height)) {
(Width != pow2Width || Height != pow2Height) &&
!((Format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE) && (wined3d_settings.rendertargetlock_mode == RTL_READTEX || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX)))
{
object->baseTexture.pow2Matrix[0] = (float)Width;
object->baseTexture.pow2Matrix[5] = (float)Height;
object->baseTexture.pow2Matrix[10] = 1.0;
......
......@@ -3463,8 +3463,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
This->glRect.right = 0;
This->glRect.bottom = 0;
} else {
/* Check this after the oversize check - do not make an oversized surface a texture_rectangle one */
if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE)) {
/* Check this after the oversize check - do not make an oversized surface a texture_rectangle one.
Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE
doesn't work in combination with ARB_TEXTURE_RECTANGLE.
*/
if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE) &&
!((This->resource.format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE) && (wined3d_settings.rendertargetlock_mode == RTL_READTEX || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX)))
{
This->glDescription.target = GL_TEXTURE_RECTANGLE_ARB;
This->pow2Width = This->currentDesc.Width;
This->pow2Height = This->currentDesc.Height;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment