summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ddebug/dd_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-07-13 16:00:06 +0200
committerMarek Olšák <[email protected]>2016-07-26 23:06:46 +0200
commit95c3025a4163128584900b8f377d299c8e707d17 (patch)
tree4e8a230f2239fca236b0ce51607edc994e119980 /src/gallium/drivers/ddebug/dd_context.c
parentf7720948cca971606c90b96c67128b93737af09d (diff)
ddebug: move all states into a separate structure
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ddebug/dd_context.c')
-rw-r--r--src/gallium/drivers/ddebug/dd_context.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c
index 77fb9ae726c..96fea3a80c3 100644
--- a/src/gallium/drivers/ddebug/dd_context.c
+++ b/src/gallium/drivers/ddebug/dd_context.c
@@ -164,11 +164,12 @@ dd_context_render_condition(struct pipe_context *_pipe,
{
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
+ struct dd_draw_state *dstate = &dctx->draw_state;
pipe->render_condition(pipe, dd_query_unwrap(query), condition, mode);
- dctx->render_cond.query = dd_query(query);
- dctx->render_cond.condition = condition;
- dctx->render_cond.mode = mode;
+ dstate->render_cond.query = dd_query(query);
+ dstate->render_cond.condition = condition;
+ dstate->render_cond.mode = mode;
}
@@ -199,7 +200,7 @@ dd_context_render_condition(struct pipe_context *_pipe,
struct pipe_context *pipe = dctx->pipe; \
struct dd_state *hstate = state; \
\
- dctx->shortname = hstate; \
+ dctx->draw_state.shortname = hstate; \
pipe->bind_##name##_state(pipe, hstate ? hstate->cso : NULL); \
}
@@ -234,7 +235,7 @@ dd_context_bind_sampler_states(struct pipe_context *_pipe, unsigned shader,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- memcpy(&dctx->sampler_states[shader][start], states,
+ memcpy(&dctx->draw_state.sampler_states[shader][start], states,
sizeof(void*) * count);
if (states) {
@@ -284,7 +285,7 @@ DD_CSO_DELETE(vertex_elements)
struct pipe_context *pipe = dctx->pipe; \
struct dd_state *hstate = state; \
\
- dctx->shaders[PIPE_SHADER_##NAME] = hstate; \
+ dctx->draw_state.shaders[PIPE_SHADER_##NAME] = hstate; \
pipe->bind_##name##_state(pipe, hstate ? hstate->cso : NULL); \
} \
\
@@ -354,7 +355,7 @@ DD_SHADER_NOCREATE(COMPUTE, compute)
struct dd_context *dctx = dd_context(_pipe); \
struct pipe_context *pipe = dctx->pipe; \
\
- dctx->name = deref; \
+ dctx->draw_state.name = deref; \
pipe->set_##name(pipe, ref); \
}
@@ -374,8 +375,8 @@ dd_context_set_constant_buffer(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->constant_buffers[shader][index], constant_buffer,
- sizeof(*constant_buffer));
+ safe_memcpy(&dctx->draw_state.constant_buffers[shader][index],
+ constant_buffer, sizeof(*constant_buffer));
pipe->set_constant_buffer(pipe, shader, index, constant_buffer);
}
@@ -387,7 +388,7 @@ dd_context_set_scissor_states(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->scissors[start_slot], states,
+ safe_memcpy(&dctx->draw_state.scissors[start_slot], states,
sizeof(*states) * num_scissors);
pipe->set_scissor_states(pipe, start_slot, num_scissors, states);
}
@@ -400,7 +401,7 @@ dd_context_set_viewport_states(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->viewports[start_slot], states,
+ safe_memcpy(&dctx->draw_state.viewports[start_slot], states,
sizeof(*states) * num_viewports);
pipe->set_viewport_states(pipe, start_slot, num_viewports, states);
}
@@ -412,8 +413,10 @@ static void dd_context_set_tess_state(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- memcpy(dctx->tess_default_levels, default_outer_level, sizeof(float) * 4);
- memcpy(dctx->tess_default_levels+4, default_inner_level, sizeof(float) * 2);
+ memcpy(dctx->draw_state.tess_default_levels, default_outer_level,
+ sizeof(float) * 4);
+ memcpy(dctx->draw_state.tess_default_levels+4, default_inner_level,
+ sizeof(float) * 2);
pipe->set_tess_state(pipe, default_outer_level, default_inner_level);
}
@@ -509,7 +512,7 @@ dd_context_set_sampler_views(struct pipe_context *_pipe, unsigned shader,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->sampler_views[shader][start], views,
+ safe_memcpy(&dctx->draw_state.sampler_views[shader][start], views,
sizeof(views[0]) * num);
pipe->set_sampler_views(pipe, shader, start, num, views);
}
@@ -522,7 +525,7 @@ dd_context_set_shader_images(struct pipe_context *_pipe, unsigned shader,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->shader_images[shader][start], views,
+ safe_memcpy(&dctx->draw_state.shader_images[shader][start], views,
sizeof(views[0]) * num);
pipe->set_shader_images(pipe, shader, start, num, views);
}
@@ -535,7 +538,7 @@ dd_context_set_shader_buffers(struct pipe_context *_pipe, unsigned shader,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->shader_buffers[shader][start], buffers,
+ safe_memcpy(&dctx->draw_state.shader_buffers[shader][start], buffers,
sizeof(buffers[0]) * num_buffers);
pipe->set_shader_buffers(pipe, shader, start, num_buffers, buffers);
}
@@ -548,7 +551,7 @@ dd_context_set_vertex_buffers(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->vertex_buffers[start], buffers,
+ safe_memcpy(&dctx->draw_state.vertex_buffers[start], buffers,
sizeof(buffers[0]) * num_buffers);
pipe->set_vertex_buffers(pipe, start, num_buffers, buffers);
}
@@ -560,7 +563,7 @@ dd_context_set_index_buffer(struct pipe_context *_pipe,
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
- safe_memcpy(&dctx->index_buffer, ib, sizeof(*ib));
+ safe_memcpy(&dctx->draw_state.index_buffer, ib, sizeof(*ib));
pipe->set_index_buffer(pipe, ib);
}
@@ -572,10 +575,11 @@ dd_context_set_stream_output_targets(struct pipe_context *_pipe,
{
struct dd_context *dctx = dd_context(_pipe);
struct pipe_context *pipe = dctx->pipe;
+ struct dd_draw_state *dstate = &dctx->draw_state;
- dctx->num_so_targets = num_targets;
- safe_memcpy(dctx->so_targets, tgs, sizeof(*tgs) * num_targets);
- safe_memcpy(dctx->so_offsets, offsets, sizeof(*offsets) * num_targets);
+ dstate->num_so_targets = num_targets;
+ safe_memcpy(dstate->so_targets, tgs, sizeof(*tgs) * num_targets);
+ safe_memcpy(dstate->so_offsets, offsets, sizeof(*offsets) * num_targets);
pipe->set_stream_output_targets(pipe, num_targets, tgs, offsets);
}
@@ -706,7 +710,7 @@ dd_context_emit_string_marker(struct pipe_context *_pipe,
struct pipe_context *pipe = dctx->pipe;
pipe->emit_string_marker(pipe, string, len);
- dd_parse_apitrace_marker(string, len, &dctx->apitrace_call_number);
+ dd_parse_apitrace_marker(string, len, &dctx->draw_state.apitrace_call_number);
}
static void
@@ -821,6 +825,6 @@ dd_context_create(struct dd_screen *dscreen, struct pipe_context *pipe)
dd_init_draw_functions(dctx);
- dctx->sample_mask = ~0;
+ dctx->draw_state.sample_mask = ~0;
return &dctx->base;
}