{
struct NineDevice9 *device;
struct nine_shader_info info;
+ struct pipe_context *pipe;
HRESULT hr;
DBG("This=%p pParams=%p pFunction=%p cso=%p\n", This, pParams, pFunction, cso);
info.projected = 0;
info.process_vertices = false;
- hr = nine_translate_shader(device, &info);
+ pipe = nine_context_get_pipe_acquire(device);
+ hr = nine_translate_shader(device, &info, pipe);
+ nine_context_get_pipe_release(device);
if (FAILED(hr))
return hr;
This->byte_code.version = info.version;
DBG("This=%p\n", This);
if (This->base.device) {
- struct pipe_context *pipe = This->base.device->pipe;
+ struct pipe_context *pipe = nine_context_get_pipe_multithread(This->base.device);
struct nine_shader_variant *var = &This->variant;
do {
if (var->cso) {
- if (This->base.device->state.cso.ps == var->cso)
+ if (This->base.device->context.cso_shader.ps == var->cso)
pipe->bind_fs_state(pipe, NULL);
pipe->delete_fs_state(pipe, var->cso);
}
} while (var);
if (This->ff_cso) {
- if (This->ff_cso == This->base.device->state.cso.ps)
+ if (This->ff_cso == This->base.device->context.cso_shader.ps)
pipe->bind_fs_state(pipe, NULL);
pipe->delete_fs_state(pipe, This->ff_cso);
}
void *
NinePixelShader9_GetVariant( struct NinePixelShader9 *This )
{
+ /* GetVariant is called from nine_context, thus we can
+ * get pipe directly */
+ struct pipe_context *pipe = This->base.device->context.pipe;
void *cso;
uint64_t key;
info.const_b_base = NINE_CONST_B_BASE(device->max_ps_const_f) / 16;
info.byte_code = This->byte_code.tokens;
info.sampler_mask_shadow = key & 0xffff;
- info.sampler_ps1xtypes = key;
- info.fog_enable = device->state.rs[D3DRS_FOGENABLE];
- info.fog_mode = device->state.rs[D3DRS_FOGTABLEMODE];
+ info.sampler_ps1xtypes = (key >> 16) & 0xffff;
+ info.fog_enable = device->context.rs[D3DRS_FOGENABLE];
+ info.fog_mode = device->context.rs[D3DRS_FOGTABLEMODE];
info.force_color_in_centroid = key >> 34 & 1;
info.projected = (key >> 48) & 0xffff;
info.process_vertices = false;
- hr = nine_translate_shader(This->base.device, &info);
+ hr = nine_translate_shader(This->base.device, &info, pipe);
if (FAILED(hr))
return NULL;
nine_shader_variant_add(&This->variant, key, info.cso);
struct NinePixelShader9 **ppOut,
const DWORD *pFunction, void *cso )
{
- NINE_DEVICE_CHILD_NEW(PixelShader9, ppOut, pDevice, pFunction, cso);
+ if (cso) { /* ff shader. Needs to start with bind count */
+ NINE_DEVICE_CHILD_BIND_NEW(PixelShader9, ppOut, pDevice, pFunction, cso);
+ } else {
+ NINE_DEVICE_CHILD_NEW(PixelShader9, ppOut, pDevice, pFunction, cso);
+ }
}