summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-03-18 19:21:36 +0100
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:41 +0200
commit2644952bd4dfa3b75112dee8dfd287a12d770705 (patch)
treeff396f175da391108bf3f3d994383fde3ee3dcc2 /src/gallium/include
parentc2d31a83a8104acba05f92b025bc9b145ca34974 (diff)
gallium/tgsi: Introduce the "LOCAL" register declaration modifier.
This change will be useful to implement function parameter passing on top of TGSI. As we don't have a proper stack, a register-based calling convention will be used instead, which isn't necessarily a bad thing given that GPUs often have plenty of registers to spare. Using the same register space for local temporaries and inter-procedural communication caused some inefficiencies, because in some cases the register allocator would lose the freedom to merge temporary values together into the same physical register, leading to suboptimal register (and sometimes, as a side effect, instruction) usage. The LOCAL declaration modifier specifies that the value isn't intended for parameter passing and as a result the compiler doesn't have to give any guarantees of it being preserved across function boundaries. Ignoring the LOCAL flag doesn't change the semantics of a valid program in any way, because local variables are just supposed to get a more relaxed treatment. IOW, this should be a backwards-compatible change.
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 2579112a25b..5325e43896c 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -120,7 +120,8 @@ struct tgsi_declaration
unsigned Semantic : 1; /**< BOOL, any semantic info? */
unsigned Interpolate : 1; /**< any interpolation info? */
unsigned Invariant : 1; /**< invariant optimization? */
- unsigned Padding : 8;
+ unsigned Local : 1; /**< optimize as subroutine local variable? */
+ unsigned Padding : 7;
};
struct tgsi_declaration_range