Lines Matching refs:state

148     This->state.viewport.X = 0;
149 This->state.viewport.Y = 0;
150 This->state.viewport.Width = refSurf->desc.Width;
151 This->state.viewport.Height = refSurf->desc.Height;
153 nine_context_set_viewport(This, &This->state.viewport);
155 This->state.scissor.minx = 0;
156 This->state.scissor.miny = 0;
157 This->state.scissor.maxx = refSurf->desc.Width;
158 This->state.scissor.maxy = refSurf->desc.Height;
160 nine_context_set_scissor(This, &This->state.scissor);
164 This->state.rs_advertised[D3DRS_ZENABLE] = TRUE;
166 if (This->state.rs_advertised[D3DRS_ZENABLE])
271 /* Create first, it messes up our state. */
329 &This->state.rt[i]);
332 NineUnknown_ConvertRefToBind(NineUnknown(This->state.rt[i]));
333 nine_bind(&This->context.rt[i], This->state.rt[i]);
464 This->state.vs_const_f = CALLOC(NINE_MAX_CONST_F_SWVP * sizeof(float[4]),1);
468 This->state.vs_lconstf_temp = CALLOC(NINE_MAX_CONST_F_SWVP * sizeof(float[4]),1);
470 This->state.vs_const_i = CALLOC(NINE_MAX_CONST_I_SWVP * sizeof(int[4]), 1);
472 This->state.vs_const_b = CALLOC(NINE_MAX_CONST_B_SWVP * sizeof(BOOL), 1);
475 This->state.vs_const_f = CALLOC(NINE_MAX_CONST_F * sizeof(float[4]), 1);
477 This->state.vs_lconstf_temp = CALLOC(This->vs_const_size,1);
479 This->state.vs_const_i = CALLOC(NINE_MAX_CONST_I * sizeof(int[4]), 1);
481 This->state.vs_const_b = CALLOC(NINE_MAX_CONST_B * sizeof(BOOL), 1);
485 This->state.ps_const_f = CALLOC(This->ps_const_size, 1);
488 if (!This->state.vs_const_f || !This->context.vs_const_f ||
489 !This->state.ps_const_f || !This->context.ps_const_f ||
490 !This->state.vs_lconstf_temp || !This->context.vs_lconstf_temp ||
492 !This->state.vs_const_i || !This->context.vs_const_i ||
493 !This->state.vs_const_b || !This->context.vs_const_b)
579 This->update = &This->state;
623 FREE(This->state.vs_const_f);
625 FREE(This->state.ps_const_f);
627 FREE(This->state.vs_lconstf_temp);
630 FREE(This->state.vs_const_i);
632 FREE(This->state.vs_const_b);
688 This->update = &This->state;
697 This->update = &This->record->state;
1995 This->state.viewport.X = 0;
1996 This->state.viewport.Y = 0;
1997 This->state.viewport.Width = rt->desc.Width;
1998 This->state.viewport.Height = rt->desc.Height;
1999 This->state.viewport.MinZ = 0.0f;
2000 This->state.viewport.MaxZ = 1.0f;
2002 This->state.scissor.minx = 0;
2003 This->state.scissor.miny = 0;
2004 This->state.scissor.maxx = rt->desc.Width;
2005 This->state.scissor.maxy = rt->desc.Height;
2006 nine_context_set_viewport(This, &This->state.viewport);
2007 nine_context_set_scissor(This, &This->state.scissor);
2010 if (This->state.rt[i] != NineSurface9(pRenderTarget))
2011 nine_bind(&This->state.rt[i], pRenderTarget);
2027 *ppRenderTarget = (IDirect3DSurface9 *)This->state.rt[i];
2028 if (!This->state.rt[i])
2031 NineUnknown_AddRef(NineUnknown(This->state.rt[i]));
2045 if (This->state.ds != ds) {
2046 nine_bind(&This->state.ds, ds);
2058 *ppZStencilSurface = (IDirect3DSurface9 *)This->state.ds;
2059 if (!This->state.ds)
2062 NineUnknown_AddRef(NineUnknown(This->state.ds));
2107 struct NineSurface9 *zsbuf_surf = This->state.ds;
2112 user_assert(This->state.ds || !(Flags & NINED3DCLEAR_DEPTHSTENCIL),
2150 struct nine_state *state = This->update;
2151 D3DMATRIX *M = nine_state_access_transform(&state->ff, State, TRUE);
2161 state->ff.changed.transform[State / 32] |= 1 << (State % 32);
2162 state->changed.group |= NINE_STATE_FF_VSTRANSF;
2177 M = nine_state_access_transform(&This->state.ff, State, FALSE);
2189 struct nine_state *state = This->update;
2191 D3DMATRIX *M = nine_state_access_transform(&state->ff, State, TRUE);
2206 struct nine_state *state = This->update;
2213 state->viewport = *pViewport;
2224 *pViewport = This->state.viewport;
2232 struct nine_state *state = This->update;
2240 state->ff.material = *pMaterial;
2242 state->changed.group |= NINE_STATE_FF_MATERIAL;
2255 *pMaterial = This->state.ff.material;
2264 struct nine_state *state = This->update;
2276 hr = nine_state_set_light(&state->ff, Index, pLight);
2288 state->changed.group |= NINE_STATE_FF_LIGHTING;
2300 const struct nine_state *state = &This->state;
2304 user_assert(Index < state->ff.num_lights, D3DERR_INVALIDCALL);
2305 user_assert(state->ff.light[Index].Type < NINED3DLIGHT_INVALID,
2308 *pLight = state->ff.light[Index];
2318 struct nine_state *state = This->update;
2322 if (Index >= state->ff.num_lights ||
2323 state->ff.light[Index].Type == NINED3DLIGHT_INVALID) {
2335 nine_state_light_enable(&state->ff, Index, Enable);
2339 state->changed.group |= NINE_STATE_FF_LIGHTING;
2349 const struct nine_state *state = &This->state;
2354 user_assert(Index < state->ff.num_lights, D3DERR_INVALIDCALL);
2355 user_assert(state->ff.light[Index].Type < NINED3DLIGHT_INVALID,
2358 for (i = 0; i < state->ff.num_lights_active; ++i)
2359 if (state->ff.active_light[i] == Index)
2362 *pEnable = i != state->ff.num_lights_active ? 128 : 0; // Taken from wine
2372 struct nine_state *state = This->update;
2382 memcpy(&state->clip.ucp[Index][0], pPlane, sizeof(state->clip.ucp[0]));
2384 state->changed.ucp |= 1 << Index;
2396 const struct nine_state *state = &This->state;
2402 memcpy(pPlane, &state->clip.ucp[Index][0], sizeof(state->clip.ucp[0]));
2411 struct nine_state *state = This->update;
2419 state->rs_advertised[State] = Value;
2421 state->changed.rs[State / 32] |= 1 << (State % 32);
2425 if (state->rs_advertised[State] == Value)
2428 state->rs_advertised[State] = Value;
2447 *pValue = This->state.rs_advertised[State];
2481 dst = &nsb->state;
2490 /* TODO: texture/sampler state */
2501 if (This->state.ff.num_lights) {
2502 dst->ff.num_lights = This->state.ff.num_lights;
2506 dst->ff.light = CALLOC(This->state.ff.num_lights,
2556 /* TODO: fixed function state */
2575 This->update = &This->record->state;
2590 This->update = &This->state;
2643 *ppTexture = (IDirect3DBaseTexture9 *)This->state.texture[Stage];
2645 if (This->state.texture[Stage])
2646 NineUnknown_AddRef(NineUnknown(This->state.texture[Stage]));
2655 struct nine_state *state = This->update;
2672 state->changed.texture |= 1 << Stage;
2673 nine_bind(&state->texture[Stage], pTexture);
2677 old = state->texture[Stage];
2681 NineBindTextureToDevice(This, &state->texture[Stage], tex);
2694 const struct nine_state *state = &This->state;
2698 user_assert(Stage < ARRAY_SIZE(state->ff.tex_stage), D3DERR_INVALIDCALL);
2699 user_assert(Type < ARRAY_SIZE(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
2701 *pValue = state->ff.tex_stage[Stage][Type];
2712 struct nine_state *state = This->update;
2717 user_assert(Stage < ARRAY_SIZE(state->ff.tex_stage), D3DERR_INVALIDCALL);
2718 user_assert(Type < ARRAY_SIZE(state->ff.tex_stage[0]), D3DERR_INVALIDCALL);
2720 state->ff.tex_stage[Stage][Type] = Value;
2723 state->changed.group |= NINE_STATE_FF_PS_CONSTS;
2724 state->ff.changed.tex_stage[Stage][Type / 32] |= 1 << (Type % 32);
2747 *pValue = This->state.samp_advertised[Sampler][Type];
2757 struct nine_state *state = This->update;
2771 state->samp_advertised[Sampler][Type] = Value;
2772 state->changed.group |= NINE_STATE_SAMPLER;
2773 state->changed.sampler[Sampler] |= 1 << Type;
2777 if (state->samp_advertised[Sampler][Type] == Value)
2780 state->samp_advertised[Sampler][Type] = Value;
2790 const struct nine_state *state = &This->state;
2796 for (i = 0; i < ARRAY_SIZE(state->samp_advertised); ++i) {
2797 if (state->samp_advertised[i][D3DSAMP_MINFILTER] == D3DTEXF_NONE ||
2798 state->samp_advertised[i][D3DSAMP_MAGFILTER] == D3DTEXF_NONE)
2803 if (!state->rt[i])
2806 w = state->rt[i]->desc.Width;
2807 h = state->rt[i]->desc.Height;
2809 if (state->rt[i]->desc.Width != w || state->rt[i]->desc.Height != h) {
2813 if (state->ds &&
2814 (state->rs_advertised[D3DRS_ZENABLE] || state->rs_advertised[D3DRS_STENCILENABLE])) {
2816 (state->ds->desc.Width != w || state->ds->desc.Height != h))
2860 struct nine_state *state = This->update;
2867 state->scissor.minx = pRect->left;
2868 state->scissor.miny = pRect->top;
2869 state->scissor.maxx = pRect->right;
2870 state->scissor.maxy = pRect->bottom;
2873 state->changed.group |= NINE_STATE_SCISSOR;
2875 nine_context_set_scissor(This, &state->scissor);
2886 pRect->left = This->state.scissor.minx;
2887 pRect->top = This->state.scissor.miny;
2888 pRect->right = This->state.scissor.maxx;
2889 pRect->bottom = This->state.scissor.maxy;
2950 validate_textures(This); /* may clobber state */
2958 struct nine_state *state = &This->state;
2959 unsigned ps_mask = state->ps ? state->ps->rt_mask : 1;
2963 struct NineSurface9 *rt = state->rt[i];
3008 unsigned stride = This->state.vtxbuf[i].stride;
3009 if (IS_SYSTEMMEM_DYNAMIC((struct NineBuffer9*)This->state.stream[i])) {
3010 unsigned start = This->state.vtxbuf[i].buffer_offset + StartVertex * stride;
3011 unsigned full_size = This->state.stream[i]->base.size;
3016 NineTrackSystemmemDynamic(&This->state.stream[i]->base, start, size);
3042 user_assert(This->state.idxbuf, D3DERR_INVALIDCALL);
3043 user_assert(This->state.vdecl, D3DERR_INVALIDCALL);
3048 if (IS_SYSTEMMEM_DYNAMIC(&This->state.idxbuf->base))
3049 NineTrackSystemmemDynamic(&This->state.idxbuf->base,
3050 StartIndex * This->state.idxbuf->index_size,
3051 num_indices * This->state.idxbuf->index_size);
3054 if (IS_SYSTEMMEM_DYNAMIC((struct NineBuffer9*)This->state.stream[i])) {
3055 uint32_t stride = This->state.vtxbuf[i].stride;
3056 uint32_t full_size = This->state.stream[i]->base.size;
3059 start = MAX2(0, This->state.vtxbuf[i].buffer_offset+(MinVertexIndex+BaseVertexIndex)*stride);
3060 stop = This->state.vtxbuf[i].buffer_offset+(MinVertexIndex+NumVertices+BaseVertexIndex)*stride;
3062 NineTrackSystemmemDynamic(&This->state.stream[i]->base,
3227 bool programmable_vs = This->state.vs && !(This->state.vdecl && This->state.vdecl->position_t);
3246 vs = programmable_vs ? This->state.vs : This->ff.vs;
3368 struct nine_state *state = This->update;
3374 nine_bind(&state->vdecl, vdecl);
3375 state->changed.group |= NINE_STATE_VDECL;
3379 if (state->vdecl == vdecl)
3382 nine_bind(&state->vdecl, vdecl);
3395 *ppDecl = (IDirect3DVertexDeclaration9 *)This->state.vdecl;
3430 *pFVF = This->state.vdecl ? This->state.vdecl->fvf : 0;
3457 struct nine_state *state = This->update;
3463 nine_bind(&state->vs, vs_shader);
3464 state->changed.group |= NINE_STATE_VS;
3468 if (state->vs == vs_shader)
3471 nine_bind(&state->vs, vs_shader);
3483 nine_reference_set(ppShader, This->state.vs);
3493 struct nine_state *state = This->update;
3494 float *vs_const_f = state->vs_const_f;
3509 Vector4fCount * 4 * sizeof(state->vs_const_f[0]));
3511 nine_ranges_insert(&state->changed.vs_const_f,
3515 state->changed.group |= NINE_STATE_VS_CONST;
3521 Vector4fCount * 4 * sizeof(state->vs_const_f[0])))
3526 Vector4fCount * 4 * sizeof(state->vs_const_f[0]));
3529 Vector4fCount * 4 * sizeof(state->vs_const_f[0]),
3541 const struct nine_state *state = &This->state;
3549 &state->vs_const_f[StartRegister * 4],
3550 Vector4fCount * 4 * sizeof(state->vs_const_f[0]));
3561 struct nine_state *state = This->update;
3575 if (!memcmp(&state->vs_const_i[4 * StartRegister], pConstantData,
3579 memcpy(&state->vs_const_i[4 * StartRegister],
3584 state->vs_const_i[4 * (StartRegister + i)] = fui((float)(pConstantData[4 * i]));
3585 state->vs_const_i[4 * (StartRegister + i) + 1] = fui((float)(pConstantData[4 * i + 1]));
3586 state->vs_const_i[4 * (StartRegister + i) + 2] = fui((float)(pConstantData[4 * i + 2]));
3587 state->vs_const_i[4 * (StartRegister + i) + 3] = fui((float)(pConstantData[4 * i + 3]));
3592 nine_ranges_insert(&state->changed.vs_const_i,
3595 state->changed.group |= NINE_STATE_VS_CONST;
3609 const struct nine_state *state = &This->state;
3621 &state->vs_const_i[4 * StartRegister],
3625 pConstantData[4 * i] = (int32_t) uif(state->vs_const_i[4 * (StartRegister + i)]);
3626 pConstantData[4 * i + 1] = (int32_t) uif(state->vs_const_i[4 * (StartRegister + i) + 1]);
3627 pConstantData[4 * i + 2] = (int32_t) uif(state->vs_const_i[4 * (StartRegister + i) + 2]);
3628 pConstantData[4 * i + 3] = (int32_t) uif(state->vs_const_i[4 * (StartRegister + i) + 3]);
3641 struct nine_state *state = This->update;
3657 if (!!state->vs_const_b[StartRegister + i] != !!pConstantData[i])
3665 state->vs_const_b[StartRegister + i] = pConstantData[i] ? bool_true : 0;
3668 nine_ranges_insert(&state->changed.vs_const_b,
3671 state->changed.group |= NINE_STATE_VS_CONST;
3685 const struct nine_state *state = &This->state;
3696 pConstantData[i] = state->vs_const_b[StartRegister + i] != 0 ? TRUE : FALSE;
3708 struct nine_state *state = This->update;
3719 nine_bind(&state->stream[i], pStreamData);
3720 state->changed.vtxbuf |= 1 << StreamNumber;
3721 state->vtxbuf[i].stride = Stride;
3722 state->vtxbuf[i].buffer_offset = OffsetInBytes;
3726 if (state->stream[i] == NineVertexBuffer9(pStreamData) &&
3727 state->vtxbuf[i].stride == Stride &&
3728 state->vtxbuf[i].buffer_offset == OffsetInBytes)
3731 state->vtxbuf[i].stride = Stride;
3732 state->vtxbuf[i].buffer_offset = OffsetInBytes;
3735 (struct NineBuffer9 **)&state->stream[i],
3750 struct nine_state *state = This->update;
3754 state->vtxbuf[0].stride = 0;
3755 state->vtxbuf[0].buffer_offset = 0;
3757 if (!state->stream[0])
3761 (struct NineBuffer9 **)&state->stream[0],
3772 const struct nine_state *state = &This->state;
3778 nine_reference_set(ppStreamData, state->stream[i]);
3779 *pStride = state->vtxbuf[i].stride;
3780 *pOffsetInBytes = state->vtxbuf[i].buffer_offset;
3790 struct nine_state *state = This->update;
3804 state->stream_freq[StreamNumber] = Setting;
3805 state->changed.stream_freq |= 1 << StreamNumber;
3809 if (state->stream_freq[StreamNumber] == Setting)
3812 state->stream_freq[StreamNumber] = Setting;
3825 *pSetting = This->state.stream_freq[StreamNumber];
3833 struct nine_state *state = This->update;
3839 nine_bind(&state->idxbuf, idxbuf);
3840 state->changed.group |= NINE_STATE_IDXBUF;
3844 if (state->idxbuf == idxbuf)
3848 (struct NineBuffer9 **)&state->idxbuf,
3864 nine_reference_set(ppIndexData, This->state.idxbuf);
3891 struct nine_state *state = This->update;
3897 nine_bind(&state->ps, pShader);
3898 state->changed.group |= NINE_STATE_PS;
3902 if (state->ps == ps)
3905 nine_bind(&state->ps, ps);
3917 nine_reference_set(ppShader, This->state.ps);
3927 struct nine_state *state = This->update;
3940 memcpy(&state->ps_const_f[StartRegister * 4],
3942 Vector4fCount * 4 * sizeof(state->ps_const_f[0]));
3944 nine_ranges_insert(&state->changed.ps_const_f,
3948 state->changed.group |= NINE_STATE_PS_CONST;
3952 if (!memcmp(&state->ps_const_f[StartRegister * 4], pConstantData,
3953 Vector4fCount * 4 * sizeof(state->ps_const_f[0])))
3956 memcpy(&state->ps_const_f[StartRegister * 4],
3958 Vector4fCount * 4 * sizeof(state->ps_const_f[0]));
3961 Vector4fCount * 4 * sizeof(state->ps_const_f[0]),
3973 const struct nine_state *state = &This->state;
3981 &state->ps_const_f[StartRegister * 4],
3982 Vector4fCount * 4 * sizeof(state->ps_const_f[0]));
3993 struct nine_state *state = This->update;
4005 if (!memcmp(&state->ps_const_i[StartRegister][0], pConstantData,
4006 Vector4iCount * sizeof(state->ps_const_i[0])))
4009 memcpy(&state->ps_const_i[StartRegister][0],
4011 Vector4iCount * sizeof(state->ps_const_i[0]));
4014 state->ps_const_i[StartRegister+i][0] = fui((float)(pConstantData[4*i]));
4015 state->ps_const_i[StartRegister+i][1] = fui((float)(pConstantData[4*i+1]));
4016 state->ps_const_i[StartRegister+i][2] = fui((float)(pConstantData[4*i+2]));
4017 state->ps_const_i[StartRegister+i][3] = fui((float)(pConstantData[4*i+3]));
4022 state->changed.ps_const_i |= ((1 << Vector4iCount) - 1) << StartRegister;
4023 state->changed.group |= NINE_STATE_PS_CONST;
4026 sizeof(state->ps_const_i[0]) * Vector4iCount, Vector4iCount);
4037 const struct nine_state *state = &This->state;
4047 &state->ps_const_i[StartRegister][0],
4048 Vector4iCount * sizeof(state->ps_const_i[0]));
4051 pConstantData[4*i] = (int32_t) uif(state->ps_const_i[StartRegister+i][0]);
4052 pConstantData[4*i+1] = (int32_t) uif(state->ps_const_i[StartRegister+i][1]);
4053 pConstantData[4*i+2] = (int32_t) uif(state->ps_const_i[StartRegister+i][2]);
4054 pConstantData[4*i+3] = (int32_t) uif(state->ps_const_i[StartRegister+i][3]);
4067 struct nine_state *state = This->update;
4081 if (!!state->ps_const_b[StartRegister + i] != !!pConstantData[i])
4089 state->ps_const_b[StartRegister + i] = pConstantData[i] ? bool_true : 0;
4092 state->changed.ps_const_b |= ((1 << BoolCount) - 1) << StartRegister;
4093 state->changed.group |= NINE_STATE_PS_CONST;
4107 const struct nine_state *state = &This->state;
4116 pConstantData[i] = state->ps_const_b[StartRegister + i] ? TRUE : FALSE;