wined3d: Texture fixes.

Set video memory capabilities, add some checks to SetTexture and
update some comments.
This commit is contained in:
Roderick Colenbrander 2006-02-06 20:57:42 +01:00 committed by Alexandre Julliard
parent 7000aca824
commit 694efd7c6f
3 changed files with 22 additions and 3 deletions

View File

@ -4436,6 +4436,17 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD Stage,
return D3DERR_INVALIDCALL;
}
if(pTexture != NULL) {
/* SetTexture isn't allowed on textures in D3DPOOL_SCRATCH; The same is
* the case for D3DPOOL_SYSTEMMEM textures unless D3DDEVCAPS_TEXTURESYSTEMMORY is set.
* We don't check the caps as GetDeviceCaps is inefficient and we don't set the cap anyway.
*/
if(((IWineD3DTextureImpl*)pTexture)->resource.pool == D3DPOOL_SCRATCH || ((IWineD3DTextureImpl*)pTexture)->resource.pool == D3DPOOL_SYSTEMMEM) {
WARN("(%p) Attempt to set scratch texture rejected\n", pTexture);
return D3DERR_INVALIDCALL;
}
}
oldTexture = This->updateStateBlock->textures[Stage];
TRACE("GL_LIMITS %d\n",GL_LIMITS(textures));
TRACE("(%p) : oldtexture(%p)\n", This,oldTexture);

View File

@ -1456,8 +1456,10 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT
*pCaps->DevCaps = D3DDEVCAPS_DRAWPRIMTLVERTEX |
D3DDEVCAPS_HWTRANSFORMANDLIGHT |
D3DDEVCAPS_EXECUTEVIDEOMEMORY |
D3DDEVCAPS_PUREDEVICE |
D3DDEVCAPS_HWRASTERIZATION;
D3DDEVCAPS_HWRASTERIZATION |
D3DDEVCAPS_TEXTUREVIDEOMEMORY;
*pCaps->PrimitiveMiscCaps = D3DPMISCCAPS_CULLCCW |

View File

@ -912,8 +912,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
This->Dirty = FALSE;
/* Resources are placed in system RAM and do not need to be recreated when a device is lost. These resources are not bound by device size or format restrictions. Because of this, these resources cannot be accessed by the Direct3D device nor set as textures or render targets. However, these resources can always be created, locked, and copied. */
if (This->resource.pool == D3DPOOL_SCRATCH || This->resource.pool == D3DPOOL_SYSTEMMEM) /*never store scratch or system mem textures in the video ram*/
/* Resources are placed in system RAM and do not need to be recreated when a device is lost.
* These resources are not bound by device size or format restrictions. Because of this,
* these resources cannot be accessed by the Direct3D device nor set as textures or render targets.
* However, these resources can always be created, locked, and copied.
* In general never store scratch or system mem textures in the video ram. However it is allowed
* for system memory textures when D3DDEVCAPS_TEXTURESYSTEMMEMORY is set but it isn't right now.
*/
if (This->resource.pool == D3DPOOL_SCRATCH || This->resource.pool == D3DPOOL_SYSTEMMEM)
{
FIXME("(%p) Operation not supported for scratch or SYSTEMMEM textures\n",This);
return D3DERR_INVALIDCALL;