r600/sb: add LS/HS hw shader types.
authorDave Airlie <airlied@redhat.com>
Mon, 30 Nov 2015 00:52:23 +0000 (10:52 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 6 Dec 2015 23:59:00 +0000 (09:59 +1000)
This just adds printing for the hw shader types, and hooks it up.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_bc_parser.cpp
src/gallium/drivers/r600/sb/sb_shader.cpp

index b23d4820b19f52bb45521db95865584c346307c9..696160098b521afba1021e322a978cbbacd03172 100644 (file)
@@ -174,6 +174,8 @@ enum shader_target
        TARGET_GS_COPY,
        TARGET_COMPUTE,
        TARGET_FETCH,
+       TARGET_HS,
+       TARGET_LS,
 
        TARGET_NUM
 };
index 28ebfa2ce6283dba41c834c0a713cfac6a17c4da..65aa801fb79fb071ce799e2132550ecb7a7aece3 100644 (file)
@@ -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);
index 87e28e9815752c0f8e609f4c83a7bbfdeea97704..8c7b39bb03f0ef54297a5122d545511ccf0e531f 100644 (file)
@@ -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: