diff options
author | Axel Davy <[email protected]> | 2014-11-25 00:38:02 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-11-26 20:09:10 +0000 |
commit | 133b2087c5ba9942527bc1b218a32205fb7a10a6 (patch) | |
tree | 3c96b5bc16a1d23e286e0c022fdae4e7941d7331 /src/gallium/state_trackers/nine/basetexture9.c | |
parent | 104b5a81933b7a2f4fa24302a1d972ad3dd0dec6 (diff) |
st/nine: Rework Basetexture9 and Resource9.
Instead of having parts of the structures initialised by the parents,
have them initialised by the children.
Cc: "10.4" <[email protected]>
Tested-by: David Heidelberg <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/basetexture9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index 89f6269a742..6d415921799 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -41,25 +41,28 @@ HRESULT NineBaseTexture9_ctor( struct NineBaseTexture9 *This, struct NineUnknownParams *pParams, + struct pipe_resource *initResource, D3DRESOURCETYPE Type, - D3DPOOL Pool ) + D3DFORMAT format, + D3DPOOL Pool, + DWORD Usage) { - BOOL alloc = (Pool == D3DPOOL_DEFAULT) && !This->base.resource && - (This->format != D3DFMT_NULL); + BOOL alloc = (Pool == D3DPOOL_DEFAULT) && !initResource && + (format != D3DFMT_NULL); HRESULT hr; - DWORD usage = This->base.usage; - user_assert(!(usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL)) || + user_assert(!(Usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL)) || Pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL); - user_assert(!(usage & D3DUSAGE_DYNAMIC) || + user_assert(!(Usage & D3DUSAGE_DYNAMIC) || Pool != D3DPOOL_MANAGED, D3DERR_INVALIDCALL); - hr = NineResource9_ctor(&This->base, pParams, alloc, Type, Pool); + hr = NineResource9_ctor(&This->base, pParams, initResource, alloc, Type, Pool, Usage); if (FAILED(hr)) return hr; + This->format = format; This->pipe = pParams->device->pipe; - This->mipfilter = (This->base.usage & D3DUSAGE_AUTOGENMIPMAP) ? + This->mipfilter = (Usage & D3DUSAGE_AUTOGENMIPMAP) ? D3DTEXF_LINEAR : D3DTEXF_NONE; This->lod = 0; This->lod_resident = -1; |