wined3d: wined3d_device_set_pixel_shader() never fails.
This commit is contained in:
parent
4f2c93e248
commit
fc711d4955
|
@ -2422,7 +2422,6 @@ static HRESULT WINAPI d3d8_device_SetPixelShader(IDirect3DDevice8 *iface, DWORD
|
||||||
{
|
{
|
||||||
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
|
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
|
||||||
struct d3d8_pixel_shader *shader_impl;
|
struct d3d8_pixel_shader *shader_impl;
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
TRACE("iface %p, shader %#x.\n", iface, shader);
|
TRACE("iface %p, shader %#x.\n", iface, shader);
|
||||||
|
|
||||||
|
@ -2430,9 +2429,9 @@ static HRESULT WINAPI d3d8_device_SetPixelShader(IDirect3DDevice8 *iface, DWORD
|
||||||
|
|
||||||
if (!shader)
|
if (!shader)
|
||||||
{
|
{
|
||||||
hr = wined3d_device_set_pixel_shader(device->wined3d_device, NULL);
|
wined3d_device_set_pixel_shader(device->wined3d_device, NULL);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
return hr;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
|
if (!(shader_impl = d3d8_get_object(&device->handle_table, shader - (VS_HIGHESTFIXEDFXF + 1), D3D8_HANDLE_PS)))
|
||||||
|
@ -2443,10 +2442,10 @@ static HRESULT WINAPI d3d8_device_SetPixelShader(IDirect3DDevice8 *iface, DWORD
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Setting shader %p.\n", shader_impl);
|
TRACE("Setting shader %p.\n", shader_impl);
|
||||||
hr = wined3d_device_set_pixel_shader(device->wined3d_device, shader_impl->wined3d_shader);
|
wined3d_device_set_pixel_shader(device->wined3d_device, shader_impl->wined3d_shader);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI d3d8_device_GetPixelShader(IDirect3DDevice8 *iface, DWORD *shader)
|
static HRESULT WINAPI d3d8_device_GetPixelShader(IDirect3DDevice8 *iface, DWORD *shader)
|
||||||
|
|
|
@ -2564,16 +2564,15 @@ static HRESULT WINAPI d3d9_device_SetPixelShader(IDirect3DDevice9Ex *iface, IDir
|
||||||
{
|
{
|
||||||
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
|
||||||
struct d3d9_pixelshader *shader_obj = unsafe_impl_from_IDirect3DPixelShader9(shader);
|
struct d3d9_pixelshader *shader_obj = unsafe_impl_from_IDirect3DPixelShader9(shader);
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
TRACE("iface %p, shader %p.\n", iface, shader);
|
TRACE("iface %p, shader %p.\n", iface, shader);
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = wined3d_device_set_pixel_shader(device->wined3d_device,
|
wined3d_device_set_pixel_shader(device->wined3d_device,
|
||||||
shader_obj ? shader_obj->wined3d_shader : NULL);
|
shader_obj ? shader_obj->wined3d_shader : NULL);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI d3d9_device_GetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **shader)
|
static HRESULT WINAPI d3d9_device_GetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **shader)
|
||||||
|
|
|
@ -2831,39 +2831,33 @@ void device_update_tex_unit_map(struct wined3d_device *device)
|
||||||
device_map_vsamplers(device, ps, gl_info);
|
device_map_vsamplers(device, ps, gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader)
|
void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader)
|
||||||
{
|
{
|
||||||
struct wined3d_shader *prev = device->updateStateBlock->state.pixel_shader;
|
struct wined3d_shader *prev = device->updateStateBlock->state.pixel_shader;
|
||||||
|
|
||||||
TRACE("device %p, shader %p.\n", device, shader);
|
TRACE("device %p, shader %p.\n", device, shader);
|
||||||
|
|
||||||
device->updateStateBlock->state.pixel_shader = shader;
|
|
||||||
device->updateStateBlock->changed.pixelShader = TRUE;
|
|
||||||
|
|
||||||
if (device->isRecordingState)
|
|
||||||
{
|
|
||||||
if (shader)
|
|
||||||
wined3d_shader_incref(shader);
|
|
||||||
if (prev)
|
|
||||||
wined3d_shader_decref(prev);
|
|
||||||
TRACE("Recording... not performing anything.\n");
|
|
||||||
return WINED3D_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shader == prev)
|
|
||||||
{
|
|
||||||
TRACE("Application is setting the old shader over, nothing to do.\n");
|
|
||||||
return WINED3D_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shader)
|
if (shader)
|
||||||
wined3d_shader_incref(shader);
|
wined3d_shader_incref(shader);
|
||||||
if (prev)
|
if (prev)
|
||||||
wined3d_shader_decref(prev);
|
wined3d_shader_decref(prev);
|
||||||
|
|
||||||
device_invalidate_state(device, STATE_PIXELSHADER);
|
device->updateStateBlock->state.pixel_shader = shader;
|
||||||
|
device->updateStateBlock->changed.pixelShader = TRUE;
|
||||||
|
|
||||||
return WINED3D_OK;
|
if (device->isRecordingState)
|
||||||
|
{
|
||||||
|
TRACE("Recording... not performing anything.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shader == prev)
|
||||||
|
{
|
||||||
|
TRACE("Application is setting the old shader over, nothing to do.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_invalidate_state(device, STATE_PIXELSHADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wined3d_shader * CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
|
struct wined3d_shader * CDECL wined3d_device_get_pixel_shader(const struct wined3d_device *device)
|
||||||
|
|
|
@ -2209,7 +2209,7 @@ HRESULT __cdecl wined3d_device_set_light_enable(struct wined3d_device *device, U
|
||||||
void __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
|
void __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
|
||||||
void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
|
void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
|
||||||
HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
|
HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
|
||||||
HRESULT __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
void __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
||||||
void __cdecl wined3d_device_set_primitive_type(struct wined3d_device *device,
|
void __cdecl wined3d_device_set_primitive_type(struct wined3d_device *device,
|
||||||
enum wined3d_primitive_type primitive_topology);
|
enum wined3d_primitive_type primitive_topology);
|
||||||
HRESULT __cdecl wined3d_device_set_ps_consts_b(struct wined3d_device *device,
|
HRESULT __cdecl wined3d_device_set_ps_consts_b(struct wined3d_device *device,
|
||||||
|
|
Loading…
Reference in New Issue