This, pPresentationParameters, pSwapChain);
user_assert(pPresentationParameters, D3DERR_INVALIDCALL);
+ user_assert(pSwapChain != NULL, D3DERR_INVALIDCALL);
user_assert(tmplt->params.Windowed && pPresentationParameters->Windowed, D3DERR_INVALIDCALL);
/* TODO: this deserves more tests */
DBG("This=%p pPresentationParameters=%p\n", This, pPresentationParameters);
+ user_assert(pPresentationParameters != NULL, D3DERR_INVALIDCALL);
+
if (NineSwapChain9_GetOccluded(This->swapchains[0])) {
This->device_needs_reset = TRUE;
return D3DERR_DEVICELOST;
nine_D3DUSAGE_to_str(Usage), d3dformat_to_string(Format),
nine_D3DPOOL_to_str(Pool), ppTexture, pSharedHandle);
+ user_assert(ppTexture != NULL, D3DERR_INVALIDCALL);
+
Usage &= D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_DEPTHSTENCIL | D3DUSAGE_DMAP |
D3DUSAGE_DYNAMIC | D3DUSAGE_NONSECURE | D3DUSAGE_RENDERTARGET |
D3DUSAGE_SOFTWAREPROCESSING | D3DUSAGE_TEXTAPI;
nine_D3DUSAGE_to_str(Usage), d3dformat_to_string(Format),
nine_D3DPOOL_to_str(Pool), ppVolumeTexture, pSharedHandle);
+ user_assert(ppVolumeTexture != NULL, D3DERR_INVALIDCALL);
+
Usage &= D3DUSAGE_DYNAMIC | D3DUSAGE_NONSECURE |
D3DUSAGE_SOFTWAREPROCESSING;
nine_D3DUSAGE_to_str(Usage), d3dformat_to_string(Format),
nine_D3DPOOL_to_str(Pool), ppCubeTexture, pSharedHandle);
+ user_assert(ppCubeTexture != NULL, D3DERR_INVALIDCALL);
+
Usage &= D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_DEPTHSTENCIL | D3DUSAGE_DYNAMIC |
D3DUSAGE_NONSECURE | D3DUSAGE_RENDERTARGET |
D3DUSAGE_SOFTWAREPROCESSING;
DBG("This=%p Length=%u Usage=%x FVF=%x Pool=%u ppOut=%p pSharedHandle=%p\n",
This, Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
+ user_assert(ppVertexBuffer != NULL, D3DERR_INVALIDCALL);
user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT, D3DERR_NOTAVAILABLE);
desc.Format = D3DFMT_VERTEXDATA;
"pSharedHandle=%p\n", This, Length, Usage,
d3dformat_to_string(Format), Pool, ppIndexBuffer, pSharedHandle);
+ user_assert(ppIndexBuffer != NULL, D3DERR_INVALIDCALL);
user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT, D3DERR_NOTAVAILABLE);
desc.Format = Format;
IDirect3DSurface9 **ppSurface,
HANDLE *pSharedHandle )
{
+ user_assert(ppSurface != NULL, D3DERR_INVALIDCALL);
*ppSurface = NULL;
return create_zs_or_rt_surface(This, 0, D3DPOOL_DEFAULT,
Width, Height, Format,
IDirect3DSurface9 **ppSurface,
HANDLE *pSharedHandle )
{
+ user_assert(ppSurface != NULL, D3DERR_INVALIDCALL);
*ppSurface = NULL;
if (!depth_stencil_format(Format))
return D3DERR_NOTAVAILABLE;
struct pipe_screen *screen = This->screen;
struct NineSurface9 *dst = NineSurface9(pDestSurface);
struct NineSurface9 *src = NineSurface9(pSourceSurface);
- struct pipe_resource *dst_res = NineSurface9_GetResource(dst);
- struct pipe_resource *src_res = NineSurface9_GetResource(src);
+ struct pipe_resource *dst_res, *src_res;
boolean zs;
struct pipe_blit_info blit;
boolean scaled, clamped, ms, flip_x = FALSE, flip_y = FALSE;
DBG("pDestRect=(%u,%u)-(%u,%u)\n", pDestRect->left, pDestRect->top,
pDestRect->right, pDestRect->bottom);
+ user_assert(pSourceSurface && pDestSurface, D3DERR_INVALIDCALL);
user_assert(dst->base.pool == D3DPOOL_DEFAULT &&
src->base.pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL);
+
+ dst_res = NineSurface9_GetResource(dst);
+ src_res = NineSurface9_GetResource(src);
zs = util_format_is_depth_or_stencil(dst_res->format);
user_assert(!zs || !This->in_scene, D3DERR_INVALIDCALL);
user_assert(!zs || !pSourceRect ||
DBG("pRect=(%u,%u)-(%u,%u)\n", pRect->left, pRect->top,
pRect->right, pRect->bottom);
+ user_assert(pSurface != NULL, D3DERR_INVALIDCALL);
+
user_assert(surf->base.pool == D3DPOOL_DEFAULT, D3DERR_INVALIDCALL);
user_assert((surf->base.usage & D3DUSAGE_RENDERTARGET) ||
Width, Height, d3dformat_to_string(Format), Format, Pool,
ppSurface, pSharedHandle);
+ user_assert(ppSurface != NULL, D3DERR_INVALIDCALL);
*ppSurface = NULL;
user_assert(!pSharedHandle || Pool == D3DPOOL_DEFAULT
|| Pool == D3DPOOL_SYSTEMMEM, D3DERR_INVALIDCALL);
DBG("This=%p State=%d pMatrix=%p\n", This, State, pMatrix);
+ user_assert(pMatrix, D3DERR_INVALIDCALL);
user_assert(M, D3DERR_INVALIDCALL);
nine_D3DMATRIX_print(pMatrix);
user_assert(!This->pure, D3DERR_INVALIDCALL);
M = nine_state_access_transform(&This->state.ff, State, FALSE);
+ user_assert(pMatrix, D3DERR_INVALIDCALL);
user_assert(M, D3DERR_INVALIDCALL);
*pMatrix = *M;
return D3D_OK;
DBG("This=%p State=%d pMatrix=%p\n", This, State, pMatrix);
+ user_assert(pMatrix, D3DERR_INVALIDCALL);
user_assert(M, D3DERR_INVALIDCALL);
nine_d3d_matrix_matrix_mul(&T, pMatrix, M);
pViewport->X, pViewport->Y, pViewport->Width, pViewport->Height,
pViewport->MinZ, pViewport->MaxZ);
+ user_assert(pViewport != NULL, D3DERR_INVALIDCALL);
state->viewport = *pViewport;
nine_context_set_viewport(This, pViewport);
NineDevice9_GetViewport( struct NineDevice9 *This,
D3DVIEWPORT9 *pViewport )
{
+ user_assert(pViewport != NULL, D3DERR_INVALIDCALL);
*pViewport = This->state.viewport;
return D3D_OK;
}
unsigned i;
user_assert(!This->pure, D3DERR_INVALIDCALL);
+ user_assert(pEnable != NULL, D3DERR_INVALIDCALL);
user_assert(Index < state->ff.num_lights, D3DERR_INVALIDCALL);
user_assert(state->ff.light[Index].Type < NINED3DLIGHT_INVALID,
D3DERR_INVALIDCALL);
const struct nine_state *state = &This->state;
user_assert(!This->pure, D3DERR_INVALIDCALL);
+ user_assert(pPlane != NULL, D3DERR_INVALIDCALL);
user_assert(Index < PIPE_MAX_CLIP_PLANES, D3DERR_INVALIDCALL);
memcpy(pPlane, &state->clip.ucp[Index][0], sizeof(state->clip.ucp[0]));
DWORD *pValue )
{
user_assert(!This->pure, D3DERR_INVALIDCALL);
+ user_assert(pValue != NULL, D3DERR_INVALIDCALL);
/* TODO: This needs tests */
if (State >= D3DRS_COUNT) {
*pValue = 0;
DBG("This=%p Type=%u ppSB=%p\n", This, Type, ppSB);
+ user_assert(ppSB != NULL, D3DERR_INVALIDCALL);
user_assert(Type == D3DSBT_ALL ||
Type == D3DSBT_VERTEXSTATE ||
Type == D3DSBT_PIXELSTATE, D3DERR_INVALIDCALL);
DBG("This=%p ppSB=%p\n", This, ppSB);
user_assert(This->record, D3DERR_INVALIDCALL);
+ user_assert(ppSB != NULL, D3DERR_INVALIDCALL);
This->update = &This->state;
This->is_recording = FALSE;
const struct nine_state *state = &This->state;
user_assert(!This->pure, D3DERR_INVALIDCALL);
+ user_assert(pValue != NULL, 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);
DWORD *pValue )
{
user_assert(!This->pure, D3DERR_INVALIDCALL);
+ user_assert(pValue != NULL, D3DERR_INVALIDCALL);
user_assert(Sampler < NINE_MAX_SAMPLERS_PS ||
Sampler == D3DDMAPSAMPLER ||
(Sampler >= D3DVERTEXTEXTURESAMPLER0 &&
{
struct nine_state *state = This->update;
+ user_assert(pRect != NULL, D3DERR_INVALIDCALL);
+
DBG("x=(%u..%u) y=(%u..%u)\n",
pRect->left, pRect->top, pRect->right, pRect->bottom);
NineDevice9_GetScissorRect( struct NineDevice9 *This,
RECT *pRect )
{
+ user_assert(pRect != NULL, D3DERR_INVALIDCALL);
+
pRect->left = This->state.scissor.minx;
pRect->top = This->state.scissor.miny;
pRect->right = This->state.scissor.maxx;
This, SrcStartIndex, DestIndex, VertexCount, pDestBuffer,
pVertexDecl, Flags);
+ user_assert(pDestBuffer && pVertexDecl, D3DERR_INVALIDCALL);
+
if (!screen_sw->get_param(screen_sw, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS)) {
DBG("ProcessVertices not supported\n");
return D3DERR_INVALIDCALL;
DBG("This=%p pVertexElements=%p ppDecl=%p\n",
This, pVertexElements, ppDecl);
+ user_assert(pVertexElements && ppDecl, D3DERR_INVALIDCALL);
+
HRESULT hr = NineVertexDeclaration9_new(This, pVertexElements, &vdecl);
if (SUCCEEDED(hr))
*ppDecl = (IDirect3DVertexDeclaration9 *)vdecl;
NineDevice9_GetFVF( struct NineDevice9 *This,
DWORD *pFVF )
{
+ user_assert(pFVF != NULL, D3DERR_INVALIDCALL);
*pFVF = This->state.vdecl ? This->state.vdecl->fvf : 0;
return D3D_OK;
}
DBG("This=%p pFunction=%p ppShader=%p\n", This, pFunction, ppShader);
+ user_assert(pFunction && ppShader, D3DERR_INVALIDCALL);
+
hr = NineVertexShader9_new(This, &vs, pFunction, NULL);
if (FAILED(hr))
return hr;
const unsigned i = StreamNumber;
user_assert(StreamNumber < This->caps.MaxStreams, D3DERR_INVALIDCALL);
- user_assert(ppStreamData, D3DERR_INVALIDCALL);
+ user_assert(ppStreamData && pOffsetInBytes && pStride, D3DERR_INVALIDCALL);
nine_reference_set(ppStreamData, state->stream[i]);
*pStride = state->vtxbuf[i].stride;
UINT StreamNumber,
UINT *pSetting )
{
+ user_assert(pSetting != NULL, D3DERR_INVALIDCALL);
user_assert(StreamNumber < This->caps.MaxStreams, D3DERR_INVALIDCALL);
*pSetting = This->state.stream_freq[StreamNumber];
return D3D_OK;
DBG("This=%p pFunction=%p ppShader=%p\n", This, pFunction, ppShader);
+ user_assert(pFunction && ppShader, D3DERR_INVALIDCALL);
+
hr = NinePixelShader9_new(This, &ps, pFunction, NULL);
if (FAILED(hr))
return hr;