mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 18:50:10 +01:00
emit tgsi declarations for texture samplers
This commit is contained in:
parent
1e3b07f363
commit
814d4ff83a
1 changed files with 27 additions and 0 deletions
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue