From 9f96c5d619a478a61c809e88ef53e59005471054 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 21 Sep 2007 10:56:32 -0600 Subject: pass vs output semantics to tgsi_mesa_compile_vp_program() to generate output DECs --- src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c | 19 +++++++++++++++++-- src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src/mesa/pipe') diff --git a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c index ea6716f1a2..8a3fda2c63 100644 --- a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c +++ b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.c @@ -686,7 +686,10 @@ tgsi_mesa_compile_vp_program( const GLuint inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], + GLuint numOutputs, const GLuint outputMapping[], + const ubyte outputSemanticName[], + const ubyte outputSemanticIndex[], struct tgsi_token *tokens, GLuint maxTokens) { @@ -705,8 +708,7 @@ tgsi_mesa_compile_vp_program( ti = 3; - /* XXX todo: input/output declarations - */ + /* input decls */ for (i = 0; i < numInputs; i++) { struct tgsi_full_declaration fulldecl; fulldecl = make_input_decl(i, @@ -720,6 +722,19 @@ tgsi_mesa_compile_vp_program( maxTokens - ti ); } + /* output decls */ + for (i = 0; i < numOutputs; i++) { + struct tgsi_full_declaration fulldecl; + fulldecl = make_frag_output_decl(i, + outputSemanticName[i], + outputSemanticIndex[i], + TGSI_WRITEMASK_XYZW ); + ti += tgsi_build_full_declaration(&fulldecl, + &tokens[ti], + header, + maxTokens - ti ); + } + for( i = 0; i < program->Base.NumInstructions; i++ ) { if( compile_instruction( diff --git a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h index dc020cefaa..cf85eb9c0b 100644 --- a/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h +++ b/src/mesa/pipe/tgsi/mesa/mesa_to_tgsi.h @@ -26,7 +26,10 @@ tgsi_mesa_compile_vp_program( const GLuint inputMapping[], const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], + GLuint numOutputs, const GLuint outputMapping[], + const ubyte outputSemanticName[], + const ubyte outputSemanticIndex[], struct tgsi_token *tokens, GLuint maxTokens ); -- cgit v1.2.3