summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_ureg.c
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-04-30 18:27:52 +0200
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:40 +0200
commit1279923d72942ee201fcc6ad40d552143f651f03 (patch)
tree73eb59a3e623c04a0344c8b57188e96d362ec197 /src/gallium/auxiliary/tgsi/tgsi_ureg.c
parent5f55cbc7d93c6568566893f9345e43fff311a32b (diff)
gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.
Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration to a separate token -- they only make sense for FS inputs and we need room for other flags in the top-level declaration token.
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.c')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 496b31a5d13..a5efd2a3152 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -46,6 +46,7 @@ union tgsi_any_token {
struct tgsi_declaration decl;
struct tgsi_declaration_range decl_range;
struct tgsi_declaration_dimension decl_dim;
+ struct tgsi_declaration_interp decl_interp;
struct tgsi_declaration_semantic decl_semantic;
struct tgsi_declaration_sampler_view decl_sampler_view;
struct tgsi_immediate imm;
@@ -1229,25 +1230,28 @@ emit_decl_fs(struct ureg_program *ureg,
unsigned cylindrical_wrap,
unsigned centroid)
{
- union tgsi_any_token *out = get_tokens(ureg, DOMAIN_DECL, 3);
+ union tgsi_any_token *out = get_tokens(ureg, DOMAIN_DECL, 4);
out[0].value = 0;
out[0].decl.Type = TGSI_TOKEN_TYPE_DECLARATION;
- out[0].decl.NrTokens = 3;
+ out[0].decl.NrTokens = 4;
out[0].decl.File = file;
out[0].decl.UsageMask = TGSI_WRITEMASK_XYZW; /* FIXME! */
- out[0].decl.Interpolate = interpolate;
+ out[0].decl.Interpolate = 1;
out[0].decl.Semantic = 1;
- out[0].decl.CylindricalWrap = cylindrical_wrap;
- out[0].decl.Centroid = centroid;
out[1].value = 0;
out[1].decl_range.First = index;
out[1].decl_range.Last = index;
out[2].value = 0;
- out[2].decl_semantic.Name = semantic_name;
- out[2].decl_semantic.Index = semantic_index;
+ out[2].decl_interp.Interpolate = interpolate;
+ out[2].decl_interp.CylindricalWrap = cylindrical_wrap;
+ out[2].decl_interp.Centroid = centroid;
+
+ out[3].value = 0;
+ out[3].decl_semantic.Name = semantic_name;
+ out[3].decl_semantic.Index = semantic_index;
}
@@ -1263,7 +1267,6 @@ static void emit_decl_range( struct ureg_program *ureg,
out[0].decl.NrTokens = 2;
out[0].decl.File = file;
out[0].decl.UsageMask = TGSI_WRITEMASK_XYZW;
- out[0].decl.Interpolate = TGSI_INTERPOLATE_CONSTANT;
out[0].decl.Semantic = 0;
out[1].value = 0;
@@ -1285,7 +1288,6 @@ emit_decl_range2D(struct ureg_program *ureg,
out[0].decl.NrTokens = 3;
out[0].decl.File = file;
out[0].decl.UsageMask = TGSI_WRITEMASK_XYZW;
- out[0].decl.Interpolate = TGSI_INTERPOLATE_CONSTANT;
out[0].decl.Dimension = 1;
out[1].value = 0;
@@ -1312,7 +1314,6 @@ emit_decl_sampler_view(struct ureg_program *ureg,
out[0].decl.NrTokens = 3;
out[0].decl.File = TGSI_FILE_SAMPLER_VIEW;
out[0].decl.UsageMask = 0xf;
- out[0].decl.Interpolate = TGSI_INTERPOLATE_CONSTANT;
out[1].value = 0;
out[1].decl_range.First = index;