From aea7a019ef67a4a5cb83f97aceafac098275171c Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sun, 16 Oct 2016 17:49:09 +0200 Subject: [PATCH] st/nine: Move stream_usage_mask to nine_context Part of the refactor to move all gallium calls to nine_state.c, and have all internal states required for those calls in nine_context. Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/nine_state.c | 6 +++--- src/gallium/state_trackers/nine/nine_state.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c index a4d84a0..0733d6e 100644 --- a/src/gallium/state_trackers/nine/nine_state.c +++ b/src/gallium/state_trackers/nine/nine_state.c @@ -607,7 +607,7 @@ update_vertex_elements(struct NineDevice9 *device) BOOL need_dummy_vbo = FALSE; struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS]; - state->stream_usage_mask = 0; + context->stream_usage_mask = 0; memset(vdecl_index_map, -1, 16); memset(used_streams, 0, device->caps.MaxStreams); vs = state->programmable_vs ? device->state.vs : device->ff.vs; @@ -650,7 +650,7 @@ update_vertex_elements(struct NineDevice9 *device) if (index >= 0) { ve[n] = vdecl->elems[index]; b = ve[n].vertex_buffer_index; - state->stream_usage_mask |= 1 << b; + context->stream_usage_mask |= 1 << b; /* XXX wine just uses 1 here: */ if (state->stream_freq[b] & D3DSTREAMSOURCE_INSTANCEDATA) ve[n].instance_divisor = state->stream_freq[b] & 0x7FFFFF; @@ -1438,7 +1438,7 @@ init_draw_info(struct pipe_draw_info *info, info->count = prim_count_to_vertex_count(type, count); info->start_instance = 0; info->instance_count = 1; - if (dev->state.stream_instancedata_mask & dev->state.stream_usage_mask) + if (dev->state.stream_instancedata_mask & dev->context.stream_usage_mask) info->instance_count = MAX2(dev->state.stream_freq[0] & 0x7FFFFF, 1); info->primitive_restart = FALSE; info->restart_index = 0; diff --git a/src/gallium/state_trackers/nine/nine_state.h b/src/gallium/state_trackers/nine/nine_state.h index 71a5293..7711a2b 100644 --- a/src/gallium/state_trackers/nine/nine_state.h +++ b/src/gallium/state_trackers/nine/nine_state.h @@ -181,7 +181,6 @@ struct nine_state struct pipe_vertex_buffer vtxbuf[PIPE_MAX_ATTRIBS]; UINT stream_freq[PIPE_MAX_ATTRIBS]; uint32_t stream_instancedata_mask; /* derived from stream_freq */ - uint32_t stream_usage_mask; /* derived from VS and vdecl */ struct pipe_clip_state clip; @@ -225,6 +224,8 @@ struct nine_context { uint8_t rt_mask; + uint32_t stream_usage_mask; /* derived from VS and vdecl */ + DWORD rs[NINED3DRS_COUNT]; struct NineBaseTexture9 *texture[NINE_MAX_SAMPLERS]; -- 2.7.4