wined3d: Pass a wined3d_device_context to wined3d_device_get_blend_state().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-04-16 10:49:22 -05:00 committed by Alexandre Julliard
parent 99a5ef720c
commit ff5e133b1b
4 changed files with 10 additions and 9 deletions

View File

@ -2137,7 +2137,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargetsAndUnord
static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetBlendState(ID3D11DeviceContext1 *iface,
ID3D11BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask)
{
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface);
struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
struct wined3d_blend_state *wined3d_state;
struct d3d_blend_state *blend_state_impl;
@ -2145,7 +2145,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetBlendState(ID3D11Devi
iface, blend_state, blend_factor, sample_mask);
wined3d_mutex_lock();
if ((wined3d_state = wined3d_device_get_blend_state(device->wined3d_device,
if ((wined3d_state = wined3d_device_context_get_blend_state(context->wined3d_context,
(struct wined3d_color *)blend_factor, sample_mask)))
{
blend_state_impl = wined3d_blend_state_get_parent(wined3d_state);

View File

@ -1603,12 +1603,12 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device,
wined3d_device_context_set_blend_state(&device->cs->c, blend_state, blend_factor, sample_mask);
}
struct wined3d_blend_state * CDECL wined3d_device_get_blend_state(const struct wined3d_device *device,
struct wined3d_blend_state * CDECL wined3d_device_context_get_blend_state(const struct wined3d_device_context *context,
struct wined3d_color *blend_factor, unsigned int *sample_mask)
{
const struct wined3d_state *state = device->cs->c.state;
const struct wined3d_state *state = context->state;
TRACE("device %p, blend_factor %p, sample_mask %p.\n", device, blend_factor, sample_mask);
TRACE("context %p, blend_factor %p, sample_mask %p.\n", context, blend_factor, sample_mask);
*blend_factor = state->blend_factor;
*sample_mask = state->sample_mask;
@ -3921,6 +3921,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
const struct wined3d_saved_states *changed = &stateblock->changed;
const unsigned int word_bit_count = sizeof(DWORD) * CHAR_BIT;
struct wined3d_device_context *context = &device->cs->c;
unsigned int i, j, start, idx;
struct wined3d_range range;
uint32_t map;
@ -4153,7 +4154,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR))
wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]);
else
wined3d_device_get_blend_state(device, &colour, &sample_mask);
wined3d_device_context_get_blend_state(context, &colour, &sample_mask);
if ((entry = wine_rb_get(&device->blend_states, &desc)))
{

View File

@ -55,7 +55,6 @@
@ cdecl wined3d_device_end_scene(ptr)
@ cdecl wined3d_device_evict_managed_resources(ptr)
@ cdecl wined3d_device_get_available_texture_mem(ptr)
@ cdecl wined3d_device_get_blend_state(ptr ptr)
@ cdecl wined3d_device_get_clip_status(ptr ptr)
@ cdecl wined3d_device_get_compute_shader(ptr)
@ cdecl wined3d_device_get_creation_parameters(ptr ptr)
@ -170,6 +169,7 @@
@ cdecl wined3d_device_context_dispatch_indirect(ptr ptr long)
@ cdecl wined3d_device_context_flush(ptr)
@ cdecl wined3d_device_context_generate_mipmaps(ptr ptr)
@ cdecl wined3d_device_context_get_blend_state(ptr ptr ptr)
@ cdecl wined3d_device_context_get_constant_buffer(ptr long long)
@ cdecl wined3d_device_context_get_shader(ptr long)
@ cdecl wined3d_device_context_issue_query(ptr ptr long)

View File

@ -2375,8 +2375,6 @@ HRESULT __cdecl wined3d_device_end_scene(struct wined3d_device *device);
void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device);
void __cdecl wined3d_device_flush(struct wined3d_device *device);
UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_device *device);
struct wined3d_blend_state * __cdecl wined3d_device_get_blend_state(const struct wined3d_device *device,
struct wined3d_color *blend_factor, unsigned int *sample_mask);
HRESULT __cdecl wined3d_device_get_clip_status(const struct wined3d_device *device,
struct wined3d_clip_status *clip_status);
struct wined3d_shader * __cdecl wined3d_device_get_compute_shader(const struct wined3d_device *device);
@ -2565,6 +2563,8 @@ void __cdecl wined3d_device_context_draw_indirect(struct wined3d_device_context
void __cdecl wined3d_device_context_flush(struct wined3d_device_context *context);
void __cdecl wined3d_device_context_generate_mipmaps(struct wined3d_device_context *context,
struct wined3d_shader_resource_view *view);
struct wined3d_blend_state * __cdecl wined3d_device_context_get_blend_state(
const struct wined3d_device_context *context, struct wined3d_color *blend_factor, unsigned int *sample_mask);
struct wined3d_buffer * __cdecl wined3d_device_context_get_constant_buffer(const struct wined3d_device_context *context,
enum wined3d_shader_type shader_type, unsigned int idx);
struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct wined3d_device_context *context,