if (FAILED(hr)) { return hr; }
+ list_inithead(&This->update_buffers);
list_inithead(&This->update_textures);
+ list_inithead(&This->managed_buffers);
list_inithead(&This->managed_textures);
This->screen = pScreen;
templ.u.tex.last_layer = 0;
templ.u.tex.first_level = 0;
templ.u.tex.last_level = 0;
- templ.swizzle_r = PIPE_SWIZZLE_ZERO;
- templ.swizzle_g = PIPE_SWIZZLE_ZERO;
- templ.swizzle_b = PIPE_SWIZZLE_ZERO;
- templ.swizzle_a = PIPE_SWIZZLE_ONE;
+ templ.swizzle_r = PIPE_SWIZZLE_0;
+ templ.swizzle_g = PIPE_SWIZZLE_0;
+ templ.swizzle_b = PIPE_SWIZZLE_0;
+ templ.swizzle_a = PIPE_SWIZZLE_1;
templ.target = This->dummy_texture->target;
This->dummy_sampler_view = This->pipe->create_sampler_view(This->pipe, This->dummy_texture, &templ);
}
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_TestCooperativeLevel( struct NineDevice9 *This )
{
if (NineSwapChain9_GetOccluded(This->swapchains[0])) {
return D3D_OK;
}
-UINT WINAPI
+UINT NINE_WINAPI
NineDevice9_GetAvailableTextureMem( struct NineDevice9 *This )
{
return This->available_texture_mem;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_EvictManagedResources( struct NineDevice9 *This )
{
struct NineBaseTexture9 *tex;
+ struct NineBuffer9 *buf;
DBG("This=%p\n", This);
LIST_FOR_EACH_ENTRY(tex, &This->managed_textures, list2) {
NineBaseTexture9_UnLoad(tex);
}
+ /* Vertex/index buffers don't take a lot of space and aren't accounted
+ * for d3d memory usage. Instead of actually freeing from memory,
+ * just mark the buffer dirty to trigger a re-upload later. We
+ * could just ignore, but some bad behaving apps could rely on it (if
+ * they write outside the locked regions typically). */
+ LIST_FOR_EACH_ENTRY(buf, &This->managed_buffers, managed.list2) {
+ NineBuffer9_SetDirty(buf);
+ }
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetDirect3D( struct NineDevice9 *This,
IDirect3D9 **ppD3D9 )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetDeviceCaps( struct NineDevice9 *This,
D3DCAPS9 *pCaps )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetDisplayMode( struct NineDevice9 *This,
UINT iSwapChain,
D3DDISPLAYMODE *pMode )
return NineSwapChain9_GetDisplayMode(This->swapchains[iSwapChain], pMode);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetCreationParameters( struct NineDevice9 *This,
D3DDEVICE_CREATION_PARAMETERS *pParameters )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetCursorProperties( struct NineDevice9 *This,
UINT XHotSpot,
UINT YHotSpot,
return D3D_OK;
}
-void WINAPI
+void NINE_WINAPI
NineDevice9_SetCursorPosition( struct NineDevice9 *This,
int X,
int Y,
This->cursor.software = ID3DPresent_SetCursorPos(swap->present, &This->cursor.pos) != D3D_OK;
}
-BOOL WINAPI
+BOOL NINE_WINAPI
NineDevice9_ShowCursor( struct NineDevice9 *This,
BOOL bShow )
{
return old;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateAdditionalSwapChain( struct NineDevice9 *This,
D3DPRESENT_PARAMETERS *pPresentationParameters,
IDirect3DSwapChain9 **pSwapChain )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetSwapChain( struct NineDevice9 *This,
UINT iSwapChain,
IDirect3DSwapChain9 **pSwapChain )
return D3D_OK;
}
-UINT WINAPI
+UINT NINE_WINAPI
NineDevice9_GetNumberOfSwapChains( struct NineDevice9 *This )
{
return This->nswapchains;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_Reset( struct NineDevice9 *This,
D3DPRESENT_PARAMETERS *pPresentationParameters )
{
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_Present( struct NineDevice9 *This,
const RECT *pSourceRect,
const RECT *pDestRect,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetBackBuffer( struct NineDevice9 *This,
UINT iSwapChain,
UINT iBackBuffer,
iBackBuffer, Type, ppBackBuffer);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetRasterStatus( struct NineDevice9 *This,
UINT iSwapChain,
D3DRASTER_STATUS *pRasterStatus )
pRasterStatus);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetDialogBoxMode( struct NineDevice9 *This,
BOOL bEnableDialogs )
{
STUB(D3DERR_INVALIDCALL);
}
-void WINAPI
+void NINE_WINAPI
NineDevice9_SetGammaRamp( struct NineDevice9 *This,
UINT iSwapChain,
DWORD Flags,
}
}
-void WINAPI
+void NINE_WINAPI
NineDevice9_GetGammaRamp( struct NineDevice9 *This,
UINT iSwapChain,
D3DGAMMARAMP *pRamp )
*pRamp = This->swapchains[iSwapChain]->gamma;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateTexture( struct NineDevice9 *This,
UINT Width,
UINT Height,
D3DUSAGE_SOFTWAREPROCESSING | D3DUSAGE_TEXTAPI;
*ppTexture = NULL;
- user_assert(Width && Height, D3DERR_INVALIDCALL);
- user_assert(!pSharedHandle || This->ex, D3DERR_INVALIDCALL);
- /* When is used shared handle, Pool must be
- * SYSTEMMEM with Levels 1 or DEFAULT with any Levels */
- user_assert(!pSharedHandle || Pool != D3DPOOL_SYSTEMMEM || Levels == 1,
- D3DERR_INVALIDCALL);
- user_assert(!pSharedHandle || Pool == D3DPOOL_SYSTEMMEM || Pool == D3DPOOL_DEFAULT,
- D3DERR_INVALIDCALL);
- user_assert((Usage != D3DUSAGE_AUTOGENMIPMAP || Levels <= 1), D3DERR_INVALIDCALL);
hr = NineTexture9_new(This, Width, Height, Levels, Usage, Format, Pool,
&tex, pSharedHandle);
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateVolumeTexture( struct NineDevice9 *This,
UINT Width,
UINT Height,
D3DUSAGE_SOFTWAREPROCESSING;
*ppVolumeTexture = NULL;
- user_assert(Width && Height && Depth, D3DERR_INVALIDCALL);
- user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL);
hr = NineVolumeTexture9_new(This, Width, Height, Depth, Levels,
Usage, Format, Pool, &tex, pSharedHandle);
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateCubeTexture( struct NineDevice9 *This,
UINT EdgeLength,
UINT Levels,
D3DUSAGE_SOFTWAREPROCESSING;
*ppCubeTexture = NULL;
- user_assert(EdgeLength, D3DERR_INVALIDCALL);
- user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL);
hr = NineCubeTexture9_new(This, EdgeLength, Levels, Usage, Format, Pool,
&tex, pSharedHandle);
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateVertexBuffer( struct NineDevice9 *This,
UINT Length,
DWORD Usage,
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateIndexBuffer( struct NineDevice9 *This,
UINT Length,
DWORD Usage,
}
templ.format = d3d9_to_pipe_format_checked(screen, Format, templ.target,
templ.nr_samples, templ.bind,
- FALSE);
+ FALSE, Pool == D3DPOOL_SCRATCH);
+
+ if (templ.format == PIPE_FORMAT_NONE && Format != D3DFMT_NULL)
+ return D3DERR_INVALIDCALL;
desc.Format = Format;
desc.Type = D3DRTYPE_SURFACE;
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateRenderTarget( struct NineDevice9 *This,
UINT Width,
UINT Height,
Lockable, ppSurface, pSharedHandle);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateDepthStencilSurface( struct NineDevice9 *This,
UINT Width,
UINT Height,
Discard, ppSurface, pSharedHandle);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_UpdateSurface( struct NineDevice9 *This,
IDirect3DSurface9 *pSourceSurface,
const RECT *pSourceRect,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_UpdateTexture( struct NineDevice9 *This,
IDirect3DBaseTexture9 *pSourceTexture,
IDirect3DBaseTexture9 *pDestinationTexture )
struct NineBaseTexture9 *dstb = NineBaseTexture9(pDestinationTexture);
struct NineBaseTexture9 *srcb = NineBaseTexture9(pSourceTexture);
unsigned l, m;
- unsigned last_level = dstb->base.info.last_level;
+ unsigned last_src_level, last_dst_level;
RECT rect;
DBG("This=%p pSourceTexture=%p pDestinationTexture=%p\n", This,
pSourceTexture, pDestinationTexture);
+ user_assert(pSourceTexture && pDestinationTexture, D3DERR_INVALIDCALL);
user_assert(pSourceTexture != pDestinationTexture, D3DERR_INVALIDCALL);
user_assert(dstb->base.pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL);
user_assert(srcb->base.pool == D3DPOOL_SYSTEMMEM, D3DERR_INVALIDCALL);
-
- if (dstb->base.usage & D3DUSAGE_AUTOGENMIPMAP) {
- /* Only the first level is updated, the others regenerated. */
- last_level = 0;
- /* if the source has D3DUSAGE_AUTOGENMIPMAP, we have to ignore
- * the sublevels, thus level 0 has to match */
- user_assert(!(srcb->base.usage & D3DUSAGE_AUTOGENMIPMAP) ||
- (srcb->base.info.width0 == dstb->base.info.width0 &&
- srcb->base.info.height0 == dstb->base.info.height0 &&
- srcb->base.info.depth0 == dstb->base.info.depth0),
- D3DERR_INVALIDCALL);
- } else {
- user_assert(!(srcb->base.usage & D3DUSAGE_AUTOGENMIPMAP), D3DERR_INVALIDCALL);
- }
-
user_assert(dstb->base.type == srcb->base.type, D3DERR_INVALIDCALL);
+ user_assert(!(srcb->base.usage & D3DUSAGE_AUTOGENMIPMAP) ||
+ dstb->base.usage & D3DUSAGE_AUTOGENMIPMAP, D3DERR_INVALIDCALL);
+
+ /* Spec: Failure if
+ * . Different formats
+ * . Fewer src levels than dst levels (if the opposite, only matching levels
+ * are supposed to be copied)
+ * . Levels do not match
+ * DDI: Actually the above should pass because of legacy applications
+ * Do what you want about these, but you shouldn't crash.
+ * However driver can expect that the top dimension is greater for src than dst.
+ * Wine tests: Every combination that passes the initial checks should pass.
+ * . Different formats => conversion driver and format dependent.
+ * . 1 level, but size not matching => copy is done (and even crash if src bigger
+ * than dst. For the case where dst bigger, wine doesn't test if a stretch is applied
+ * or if a subrect is copied).
+ * . 8x8 4 sublevels -> 7x7 2 sublevels => driver dependent, On NV seems to be 4x4 subrect
+ * copied to 7x7.
+ *
+ * From these, the proposal is:
+ * . Different formats -> use util_format_translate to translate if possible for surfaces.
+ * Accept ARGB/XRGB for Volumes. Do nothing for the other combinations
+ * . First level copied -> the first level such that src is smaller or equal to dst first level
+ * . number of levels copied -> as long as it fits and textures have levels
+ * That should satisfy the constraints (and instead of crashing for some cases we return D3D_OK)
+ */
- /* Find src level that matches dst level 0: */
- user_assert(srcb->base.info.width0 >= dstb->base.info.width0 &&
- srcb->base.info.height0 >= dstb->base.info.height0 &&
- srcb->base.info.depth0 >= dstb->base.info.depth0,
- D3DERR_INVALIDCALL);
- for (m = 0; m <= srcb->base.info.last_level; ++m) {
+ last_src_level = (srcb->base.usage & D3DUSAGE_AUTOGENMIPMAP) ? 0 : srcb->base.info.last_level;
+ last_dst_level = (dstb->base.usage & D3DUSAGE_AUTOGENMIPMAP) ? 0 : dstb->base.info.last_level;
+
+ for (m = 0; m <= last_src_level; ++m) {
unsigned w = u_minify(srcb->base.info.width0, m);
unsigned h = u_minify(srcb->base.info.height0, m);
unsigned d = u_minify(srcb->base.info.depth0, m);
- if (w == dstb->base.info.width0 &&
- h == dstb->base.info.height0 &&
- d == dstb->base.info.depth0)
+ if (w <= dstb->base.info.width0 &&
+ h <= dstb->base.info.height0 &&
+ d <= dstb->base.info.depth0)
break;
}
- user_assert(m <= srcb->base.info.last_level, D3DERR_INVALIDCALL);
+ user_assert(m <= last_src_level, D3D_OK);
- last_level = MIN2(last_level, srcb->base.info.last_level - m);
+ last_dst_level = MIN2(srcb->base.info.last_level - m, last_dst_level);
if (dstb->base.type == D3DRTYPE_TEXTURE) {
struct NineTexture9 *dst = NineTexture9(dstb);
for (l = 0; l < m; ++l)
rect_minify_inclusive(&rect);
- for (l = 0; l <= last_level; ++l, ++m) {
+ for (l = 0; l <= last_dst_level; ++l, ++m) {
fit_rect_format_inclusive(dst->base.base.info.format,
&rect,
dst->surfaces[l]->desc.Width,
for (l = 0; l < m; ++l)
rect_minify_inclusive(&rect);
- for (l = 0; l <= last_level; ++l, ++m) {
+ for (l = 0; l <= last_dst_level; ++l, ++m) {
fit_rect_format_inclusive(dst->base.base.info.format,
&rect,
dst->surfaces[l * 6 + z]->desc.Width,
if (src->dirty_box.width == 0)
return D3D_OK;
- for (l = 0; l <= last_level; ++l, ++m)
+ for (l = 0; l <= last_dst_level; ++l, ++m)
NineVolume9_CopyMemToDefault(dst->volumes[l],
src->volumes[m], 0, 0, 0, NULL);
u_box_3d(0, 0, 0, 0, 0, 0, &src->dirty_box);
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetRenderTargetData( struct NineDevice9 *This,
IDirect3DSurface9 *pRenderTarget,
IDirect3DSurface9 *pDestSurface )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetFrontBufferData( struct NineDevice9 *This,
UINT iSwapChain,
IDirect3DSurface9 *pDestSurface )
pDestSurface);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_StretchRect( struct NineDevice9 *This,
IDirect3DSurface9 *pSourceSurface,
const RECT *pSourceRect,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_ColorFill( struct NineDevice9 *This,
IDirect3DSurface9 *pSurface,
const RECT *pRect,
y = pRect->top;
w = pRect->right - pRect->left;
h = pRect->bottom - pRect->top;
+ /* Wine tests: */
+ if (compressed_format(surf->desc.Format)) {
+ const unsigned bw = util_format_get_blockwidth(surf->base.info.format);
+ const unsigned bh = util_format_get_blockheight(surf->base.info.format);
+
+ user_assert(!(x % bw) && !(y % bh) && !(w % bw) && !(h % bh),
+ D3DERR_INVALIDCALL);
+ }
} else{
x = 0;
y = 0;
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateOffscreenPlainSurface( struct NineDevice9 *This,
UINT Width,
UINT Height,
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetRenderTarget( struct NineDevice9 *This,
DWORD RenderTargetIndex,
IDirect3DSurface9 *pRenderTarget )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetRenderTarget( struct NineDevice9 *This,
DWORD RenderTargetIndex,
IDirect3DSurface9 **ppRenderTarget )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetDepthStencilSurface( struct NineDevice9 *This,
IDirect3DSurface9 *pNewZStencil )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetDepthStencilSurface( struct NineDevice9 *This,
IDirect3DSurface9 **ppZStencilSurface )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_BeginScene( struct NineDevice9 *This )
{
DBG("This=%p\n", This);
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_EndScene( struct NineDevice9 *This )
{
DBG("This=%p\n", This);
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_Clear( struct NineDevice9 *This,
DWORD Count,
const D3DRECT *pRects,
for (i = 0; i < This->caps.NumSimultaneousRTs; ++i) {
rt = This->state.rt[i];
if (!rt || rt->desc.Format == D3DFMT_NULL ||
- !(Flags & D3DCLEAR_TARGET))
+ !(bufs & PIPE_CLEAR_COLOR))
continue; /* save space, compiler should hoist this */
cbuf = NineSurface9_GetSurface(rt, sRGB);
for (r = 0; r < Count; ++r) {
x1, y1, x2 - x1, y2 - y1);
}
}
- if (!(Flags & NINED3DCLEAR_DEPTHSTENCIL))
+ if (!(bufs & PIPE_CLEAR_DEPTHSTENCIL))
return D3D_OK;
bufs &= PIPE_CLEAR_DEPTHSTENCIL;
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetTransform( struct NineDevice9 *This,
D3DTRANSFORMSTATETYPE State,
const D3DMATRIX *pMatrix )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetTransform( struct NineDevice9 *This,
D3DTRANSFORMSTATETYPE State,
D3DMATRIX *pMatrix )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_MultiplyTransform( struct NineDevice9 *This,
D3DTRANSFORMSTATETYPE State,
const D3DMATRIX *pMatrix )
return NineDevice9_SetTransform(This, State, &T);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetViewport( struct NineDevice9 *This,
const D3DVIEWPORT9 *pViewport )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetViewport( struct NineDevice9 *This,
D3DVIEWPORT9 *pViewport )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetMaterial( struct NineDevice9 *This,
const D3DMATERIAL9 *pMaterial )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetMaterial( struct NineDevice9 *This,
D3DMATERIAL9 *pMaterial )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetLight( struct NineDevice9 *This,
DWORD Index,
const D3DLIGHT9 *pLight )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetLight( struct NineDevice9 *This,
DWORD Index,
D3DLIGHT9 *pLight )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_LightEnable( struct NineDevice9 *This,
DWORD Index,
BOOL Enable )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetLightEnable( struct NineDevice9 *This,
DWORD Index,
BOOL *pEnable )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetClipPlane( struct NineDevice9 *This,
DWORD Index,
const float *pPlane )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetClipPlane( struct NineDevice9 *This,
DWORD Index,
float *pPlane )
#define ALPHA_TO_COVERAGE_ENABLE MAKEFOURCC('A', '2', 'M', '1')
#define ALPHA_TO_COVERAGE_DISABLE MAKEFOURCC('A', '2', 'M', '0')
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetRenderState( struct NineDevice9 *This,
D3DRENDERSTATETYPE State,
DWORD Value )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetRenderState( struct NineDevice9 *This,
D3DRENDERSTATETYPE State,
DWORD *pValue )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateStateBlock( struct NineDevice9 *This,
D3DSTATEBLOCKTYPE Type,
IDirect3DStateBlock9 **ppSB )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_BeginStateBlock( struct NineDevice9 *This )
{
HRESULT hr;
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_EndStateBlock( struct NineDevice9 *This,
IDirect3DStateBlock9 **ppSB )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetClipStatus( struct NineDevice9 *This,
const D3DCLIPSTATUS9 *pClipStatus )
{
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetClipStatus( struct NineDevice9 *This,
D3DCLIPSTATUS9 *pClipStatus )
{
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetTexture( struct NineDevice9 *This,
DWORD Stage,
IDirect3DBaseTexture9 **ppTexture )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetTexture( struct NineDevice9 *This,
DWORD Stage,
IDirect3DBaseTexture9 *pTexture )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetTextureStageState( struct NineDevice9 *This,
DWORD Stage,
D3DTEXTURESTAGESTATETYPE Type,
{
const struct nine_state *state = &This->state;
- user_assert(Stage < Elements(state->ff.tex_stage), D3DERR_INVALIDCALL);
- user_assert(Type < Elements(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
+ user_assert(Stage < ARRAY_SIZE(state->ff.tex_stage), D3DERR_INVALIDCALL);
+ user_assert(Type < ARRAY_SIZE(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
*pValue = state->ff.tex_stage[Stage][Type];
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetTextureStageState( struct NineDevice9 *This,
DWORD Stage,
D3DTEXTURESTAGESTATETYPE Type,
DBG("Stage=%u Type=%u Value=%08x\n", Stage, Type, Value);
nine_dump_D3DTSS_value(DBG_FF, Type, Value);
- user_assert(Stage < Elements(state->ff.tex_stage), D3DERR_INVALIDCALL);
- user_assert(Type < Elements(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
+ user_assert(Stage < ARRAY_SIZE(state->ff.tex_stage), D3DERR_INVALIDCALL);
+ user_assert(Type < ARRAY_SIZE(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
state->ff.tex_stage[Stage][Type] = Value;
switch (Type) {
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetSamplerState( struct NineDevice9 *This,
DWORD Sampler,
D3DSAMPLERSTATETYPE Type,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetSamplerState( struct NineDevice9 *This,
DWORD Sampler,
D3DSAMPLERSTATETYPE Type,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_ValidateDevice( struct NineDevice9 *This,
DWORD *pNumPasses )
{
DBG("This=%p pNumPasses=%p\n", This, pNumPasses);
- for (i = 0; i < Elements(state->samp); ++i) {
+ for (i = 0; i < ARRAY_SIZE(state->samp); ++i) {
if (state->samp[i][D3DSAMP_MINFILTER] == D3DTEXF_NONE ||
state->samp[i][D3DSAMP_MAGFILTER] == D3DTEXF_NONE)
return D3DERR_UNSUPPORTEDTEXTUREFILTER;
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetPaletteEntries( struct NineDevice9 *This,
UINT PaletteNumber,
const PALETTEENTRY *pEntries )
STUB(D3D_OK); /* like wine */
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetPaletteEntries( struct NineDevice9 *This,
UINT PaletteNumber,
PALETTEENTRY *pEntries )
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetCurrentTexturePalette( struct NineDevice9 *This,
UINT PaletteNumber )
{
STUB(D3D_OK); /* like wine */
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetCurrentTexturePalette( struct NineDevice9 *This,
UINT *PaletteNumber )
{
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetScissorRect( struct NineDevice9 *This,
const RECT *pRect )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetScissorRect( struct NineDevice9 *This,
RECT *pRect )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetSoftwareVertexProcessing( struct NineDevice9 *This,
BOOL bSoftware )
{
STUB(D3DERR_INVALIDCALL);
}
-BOOL WINAPI
+BOOL NINE_WINAPI
NineDevice9_GetSoftwareVertexProcessing( struct NineDevice9 *This )
{
return !!(This->params.BehaviorFlags & D3DCREATE_SOFTWARE_VERTEXPROCESSING);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetNPatchMode( struct NineDevice9 *This,
float nSegments )
{
STUB(D3DERR_INVALIDCALL);
}
-float WINAPI
+float NINE_WINAPI
NineDevice9_GetNPatchMode( struct NineDevice9 *This )
{
STUB(0);
info->indirect = NULL;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawPrimitive( struct NineDevice9 *This,
D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawIndexedPrimitive( struct NineDevice9 *This,
D3DPRIMITIVETYPE PrimitiveType,
INT BaseVertexIndex,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawPrimitiveUP( struct NineDevice9 *This,
D3DPRIMITIVETYPE PrimitiveType,
UINT PrimitiveCount,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 *This,
D3DPRIMITIVETYPE PrimitiveType,
UINT MinVertexIndex,
/* TODO: Write to pDestBuffer directly if vertex declaration contains
* only f32 formats.
*/
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_ProcessVertices( struct NineDevice9 *This,
UINT SrcStartIndex,
UINT DestIndex,
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateVertexDeclaration( struct NineDevice9 *This,
const D3DVERTEXELEMENT9 *pVertexElements,
IDirect3DVertexDeclaration9 **ppDecl )
return hr;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetVertexDeclaration( struct NineDevice9 *This,
IDirect3DVertexDeclaration9 *pDecl )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetVertexDeclaration( struct NineDevice9 *This,
IDirect3DVertexDeclaration9 **ppDecl )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetFVF( struct NineDevice9 *This,
DWORD FVF )
{
This, (IDirect3DVertexDeclaration9 *)vdecl);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetFVF( struct NineDevice9 *This,
DWORD *pFVF )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateVertexShader( struct NineDevice9 *This,
const DWORD *pFunction,
IDirect3DVertexShader9 **ppShader )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetVertexShader( struct NineDevice9 *This,
IDirect3DVertexShader9 *pShader )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetVertexShader( struct NineDevice9 *This,
IDirect3DVertexShader9 **ppShader )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetVertexShaderConstantF( struct NineDevice9 *This,
UINT StartRegister,
const float *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetVertexShaderConstantF( struct NineDevice9 *This,
UINT StartRegister,
float *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetVertexShaderConstantI( struct NineDevice9 *This,
UINT StartRegister,
const int *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetVertexShaderConstantI( struct NineDevice9 *This,
UINT StartRegister,
int *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetVertexShaderConstantB( struct NineDevice9 *This,
UINT StartRegister,
const BOOL *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetVertexShaderConstantB( struct NineDevice9 *This,
UINT StartRegister,
BOOL *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetStreamSource( struct NineDevice9 *This,
UINT StreamNumber,
IDirect3DVertexBuffer9 *pStreamData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetStreamSource( struct NineDevice9 *This,
UINT StreamNumber,
IDirect3DVertexBuffer9 **ppStreamData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetStreamSourceFreq( struct NineDevice9 *This,
UINT StreamNumber,
UINT Setting )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetStreamSourceFreq( struct NineDevice9 *This,
UINT StreamNumber,
UINT *pSetting )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetIndices( struct NineDevice9 *This,
IDirect3DIndexBuffer9 *pIndexData )
{
/* XXX: wine/d3d9 doesn't have pBaseVertexIndex, and it doesn't make sense
* here because it's an argument passed to the Draw calls.
*/
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetIndices( struct NineDevice9 *This,
- IDirect3DIndexBuffer9 **ppIndexData /*,
- UINT *pBaseVertexIndex */ )
+ IDirect3DIndexBuffer9 **ppIndexData)
{
user_assert(ppIndexData, D3DERR_INVALIDCALL);
nine_reference_set(ppIndexData, This->state.idxbuf);
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreatePixelShader( struct NineDevice9 *This,
const DWORD *pFunction,
IDirect3DPixelShader9 **ppShader )
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetPixelShader( struct NineDevice9 *This,
IDirect3DPixelShader9 *pShader )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetPixelShader( struct NineDevice9 *This,
IDirect3DPixelShader9 **ppShader )
{
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetPixelShaderConstantF( struct NineDevice9 *This,
UINT StartRegister,
const float *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetPixelShaderConstantF( struct NineDevice9 *This,
UINT StartRegister,
float *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetPixelShaderConstantI( struct NineDevice9 *This,
UINT StartRegister,
const int *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetPixelShaderConstantI( struct NineDevice9 *This,
UINT StartRegister,
int *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_SetPixelShaderConstantB( struct NineDevice9 *This,
UINT StartRegister,
const BOOL *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_GetPixelShaderConstantB( struct NineDevice9 *This,
UINT StartRegister,
BOOL *pConstantData,
return D3D_OK;
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawRectPatch( struct NineDevice9 *This,
UINT Handle,
const float *pNumSegs,
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DrawTriPatch( struct NineDevice9 *This,
UINT Handle,
const float *pNumSegs,
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_DeletePatch( struct NineDevice9 *This,
UINT Handle )
{
STUB(D3DERR_INVALIDCALL);
}
-HRESULT WINAPI
+HRESULT NINE_WINAPI
NineDevice9_CreateQuery( struct NineDevice9 *This,
D3DQUERYTYPE Type,
IDirect3DQuery9 **ppQuery )