diff options
author | Brian <[email protected]> | 2007-12-14 11:17:48 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-12-14 11:17:48 -0700 |
commit | 814d4ff83a515fe161cfb86c8b1492e2218051fe (patch) | |
tree | 5bca74f9739ec4990a848828393e11e0559451f2 /src/mesa/state_tracker | |
parent | 1e3b07f363e6bf512ab1a5c620656985aece40fd (diff) |
emit tgsi declarations for texture samplers
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 27dab5b9c06..bccabd8004d 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -585,6 +585,20 @@ make_temp_decl( } +static struct tgsi_full_declaration +make_sampler_decl(GLuint index) +{ + struct tgsi_full_declaration decl; + decl = tgsi_default_full_declaration(); + decl.Declaration.File = TGSI_FILE_SAMPLER; + decl.Declaration.Declare = TGSI_DECLARE_RANGE; + decl.u.DeclarationRange.First = index; + decl.u.DeclarationRange.Last = index; + return decl; +} + + + /** * Find the temporaries which are used in the given program. */ @@ -788,6 +802,19 @@ tgsi_translate_mesa_program( } } + /* texture samplers */ + for (i = 0; i < 8; i++) { + if (program->SamplersUsed & (1 << i)) { + struct tgsi_full_declaration fulldecl; + fulldecl = make_sampler_decl( i ); + ti += tgsi_build_full_declaration(&fulldecl, + &tokens[ti], + header, + maxTokens - ti ); + } + } + + for( i = 0; i < program->NumInstructions; i++ ) { compile_instruction( &program->Instructions[i], |