[Mesa-dev] [PATCH 20/53] r600/sb: add LS/HS hw shader types.

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


From: Dave Airlie <airlied at redhat.com>

This just adds printing for the hw shader types, and hooks it up.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/drivers/r600/sb/sb_bc.h          | 2 ++
 src/gallium/drivers/r600/sb/sb_bc_parser.cpp | 6 ++++--
 src/gallium/drivers/r600/sb/sb_shader.cpp    | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h
index d2e8da0..34e1e58 100644
--- a/src/gallium/drivers/r600/sb/sb_bc.h
+++ b/src/gallium/drivers/r600/sb/sb_bc.h
@@ -174,6 +174,8 @@ enum shader_target
 	TARGET_GS_COPY,
 	TARGET_COMPUTE,
 	TARGET_FETCH,
+	TARGET_HS,
+	TARGET_LS,
 
 	TARGET_NUM
 };
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 28ebfa2..65aa801 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -58,10 +58,12 @@ int bc_parser::decode() {
 		switch (bc->type) {
 		case TGSI_PROCESSOR_FRAGMENT: t = TARGET_PS; break;
 		case TGSI_PROCESSOR_VERTEX:
-			t = pshader->vs_as_es ? TARGET_ES : TARGET_VS;
+			t = pshader->vs_as_ls ? TARGET_LS : (pshader->vs_as_es ? TARGET_ES : TARGET_VS);
 			break;
 		case TGSI_PROCESSOR_GEOMETRY: t = TARGET_GS; break;
 		case TGSI_PROCESSOR_COMPUTE: t = TARGET_COMPUTE; break;
+		case TGSI_PROCESSOR_TESS_CTRL: t = TARGET_HS; break;
+		case TGSI_PROCESSOR_TESS_EVAL: t = pshader->tes_as_es ? TARGET_ES : TARGET_VS; break;
 		default: assert(!"unknown shader target"); return -1; break;
 		}
 	} else {
@@ -146,7 +148,7 @@ int bc_parser::parse_decls() {
 		}
 	}
 
-	if (sh->target == TARGET_VS || sh->target == TARGET_ES)
+	if (sh->target == TARGET_VS || sh->target == TARGET_ES || sh->target == TARGET_HS)
 		sh->add_input(0, 1, 0x0F);
 	else if (sh->target == TARGET_GS) {
 		sh->add_input(0, 1, 0x0F);
diff --git a/src/gallium/drivers/r600/sb/sb_shader.cpp b/src/gallium/drivers/r600/sb/sb_shader.cpp
index 87e28e9..8c7b39b 100644
--- a/src/gallium/drivers/r600/sb/sb_shader.cpp
+++ b/src/gallium/drivers/r600/sb/sb_shader.cpp
@@ -215,7 +215,7 @@ void shader::init() {
 void shader::init_call_fs(cf_node* cf) {
 	unsigned gpr = 0;
 
-	assert(target == TARGET_VS || target == TARGET_ES);
+	assert(target == TARGET_LS || target == TARGET_VS || target == TARGET_ES);
 
 	for(inputs_vec::const_iterator I = inputs.begin(),
 			E = inputs.end(); I != E; ++I, ++gpr) {
@@ -436,6 +436,8 @@ const char* shader::get_shader_target_name() {
 		case TARGET_ES: return "ES";
 		case TARGET_PS: return "PS";
 		case TARGET_GS: return "GS";
+		case TARGET_HS: return "HS";
+		case TARGET_LS: return "LS";
 		case TARGET_COMPUTE: return "COMPUTE";
 		case TARGET_FETCH: return "FETCH";
 		default:
-- 
2.5.0



More information about the mesa-dev mailing list