[Mesa-dev] [PATCH 14/53] r600: add functions to update ls/hs state.

Dave Airlie airlied at gmail.com
Sun Nov 29 22:20:23 PST 2015


From: Dave Airlie <airlied at redhat.com>

This just adds the two functions, these will get hooked up
later in the shader code.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/drivers/r600/evergreen_state.c | 25 +++++++++++++++++++++++++
 src/gallium/drivers/r600/r600_pipe.h       |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index fd4c8b5..7467925 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -3186,6 +3186,31 @@ void evergreen_update_vs_state(struct pipe_context *ctx, struct r600_pipe_shader
 		S_02881C_USE_VTX_RENDER_TARGET_INDX(rshader->vs_out_layer);
 }
 
+void evergreen_update_hs_state(struct pipe_context *ctx, struct r600_pipe_shader *shader)
+{
+	struct r600_command_buffer *cb = &shader->command_buffer;
+	struct r600_shader *rshader = &shader->shader;
+
+	r600_init_command_buffer(cb, 32);
+	r600_store_context_reg(cb, R_0288BC_SQ_PGM_RESOURCES_HS,
+			       S_0288BC_NUM_GPRS(rshader->bc.ngpr) |
+			       S_0288BC_STACK_SIZE(rshader->bc.nstack));
+	r600_store_context_reg(cb, R_0288B8_SQ_PGM_START_HS,
+			       shader->bo->gpu_address >> 8);
+}
+
+void evergreen_update_ls_state(struct pipe_context *ctx, struct r600_pipe_shader *shader)
+{
+	struct r600_command_buffer *cb = &shader->command_buffer;
+	struct r600_shader *rshader = &shader->shader;
+
+	r600_init_command_buffer(cb, 32);
+	r600_store_context_reg(cb, R_0288D4_SQ_PGM_RESOURCES_LS,
+			       S_0288D4_NUM_GPRS(rshader->bc.ngpr) |
+			       S_0288D4_STACK_SIZE(rshader->bc.nstack));
+	r600_store_context_reg(cb, R_0288D0_SQ_PGM_START_LS,
+			       shader->bo->gpu_address >> 8);
+}
 void *evergreen_create_resolve_blend(struct r600_context *rctx)
 {
 	struct pipe_blend_state blend;
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 0ca4052..f351996 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -603,6 +603,8 @@ void evergreen_update_ps_state(struct pipe_context *ctx, struct r600_pipe_shader
 void evergreen_update_es_state(struct pipe_context *ctx, struct r600_pipe_shader *shader);
 void evergreen_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader *shader);
 void evergreen_update_vs_state(struct pipe_context *ctx, struct r600_pipe_shader *shader);
+void evergreen_update_ls_state(struct pipe_context *ctx, struct r600_pipe_shader *shader);
+void evergreen_update_hs_state(struct pipe_context *ctx, struct r600_pipe_shader *shader);
 void *evergreen_create_db_flush_dsa(struct r600_context *rctx);
 void *evergreen_create_resolve_blend(struct r600_context *rctx);
 void *evergreen_create_decompress_blend(struct r600_context *rctx);
-- 
2.5.0



More information about the mesa-dev mailing list