[Mesa-dev] [PATCH 11/29] radv: emit vertex shader to correct hw block.

Dave Airlie airlied at gmail.com
Mon Jan 30 06:02:45 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This emits the shader to the ES block in the correct case.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_cmd_buffer.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 1e51d14..c351636 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -515,6 +515,22 @@ radv_emit_hw_vs(struct radv_cmd_buffer *cmd_buffer,
 }
 
 static void
+radv_emit_hw_es(struct radv_cmd_buffer *cmd_buffer,
+		struct radv_shader_variant *shader)
+{
+	struct radeon_winsys *ws = cmd_buffer->device->ws;
+	uint64_t va = ws->buffer_get_va(shader->bo);
+
+	ws->cs_add_buffer(cmd_buffer->cs, shader->bo, 8);
+
+	radeon_set_sh_reg_seq(cmd_buffer->cs, R_00B320_SPI_SHADER_PGM_LO_ES, 4);
+	radeon_emit(cmd_buffer->cs, va >> 8);
+	radeon_emit(cmd_buffer->cs, va >> 40);
+	radeon_emit(cmd_buffer->cs, shader->rsrc1);
+	radeon_emit(cmd_buffer->cs, shader->rsrc2);
+}
+
+static void
 radv_emit_vertex_shader(struct radv_cmd_buffer *cmd_buffer,
 			struct radv_pipeline *pipeline)
 {
@@ -524,7 +540,10 @@ radv_emit_vertex_shader(struct radv_cmd_buffer *cmd_buffer,
 
 	vs = pipeline->shaders[MESA_SHADER_VERTEX];
 
-	radv_emit_hw_vs(cmd_buffer, pipeline, vs);
+	if (vs->info.vs.as_es)
+		radv_emit_hw_es(cmd_buffer, vs);
+	else
+		radv_emit_hw_vs(cmd_buffer, pipeline, vs);
 
 	radeon_set_context_reg(cmd_buffer->cs, R_028A84_VGT_PRIMITIVEID_EN, 0);
 }
-- 
2.9.3



More information about the mesa-dev mailing list