[Mesa-dev] [PATCH 24/53] r600: add set_tess_state callback.
Dave Airlie
airlied at gmail.com
Sun Nov 29 22:20:33 PST 2015
From: Dave Airlie <airlied at redhat.com>
This just stores the values in the context to be used later
when emitting the constant buffers.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/gallium/drivers/r600/evergreen_state.c | 12 +++++++++++-
src/gallium/drivers/r600/r600_pipe.h | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 9bcd5cb..4d448d1 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -3598,6 +3598,16 @@ fallback:
src, src_level, src_box);
}
+static void evergreen_set_tess_state(struct pipe_context *ctx,
+ const float default_outer_level[4],
+ const float default_inner_level[2])
+{
+ struct r600_context *rctx = (struct r600_context *)ctx;
+
+ memcpy(rctx->tess_state, default_outer_level, sizeof(float) * 4);
+ memcpy(rctx->tess_state+4, default_inner_level, sizeof(float) * 2);
+}
+
void evergreen_init_state_functions(struct r600_context *rctx)
{
unsigned id = 1;
@@ -3680,7 +3690,7 @@ void evergreen_init_state_functions(struct r600_context *rctx)
rctx->b.b.set_polygon_stipple = evergreen_set_polygon_stipple;
rctx->b.b.set_min_samples = evergreen_set_min_samples;
rctx->b.b.set_scissor_states = evergreen_set_scissor_states;
-
+ rctx->b.b.set_tess_state = evergreen_set_tess_state;
if (rctx->b.chip_class == EVERGREEN)
rctx->b.b.get_sample_position = evergreen_get_sample_position;
else
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 66af81e..e23f7cf 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -521,6 +521,7 @@ struct r600_context {
void *sb_context;
struct r600_isa *isa;
float sample_positions[4 * 16];
+ float tess_state[8];
};
static inline void r600_emit_command_buffer(struct radeon_winsys_cs *cs,
--
2.5.0
More information about the mesa-dev
mailing list