summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_pc.h
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-09-07 15:40:34 +0200
committerChristoph Bumiller <[email protected]>2010-09-09 19:21:34 +0200
commitd91b8865ec2bb41f9b58ad5ce2df7f6f48f98281 (patch)
treebc6ff85f2f891b9b05124cc1f8ec874159a3ace0 /src/gallium/drivers/nv50/nv50_pc.h
parent217542a061ef31150b1b04f1b45b6099bcc153fe (diff)
nv50: prepare for having multiple functions
At some point we'll want to support real subroutines instead of just inlining them into the main shader. Since recursive calls are forbidden, we can just save all used registers to a fixed local memory region and restore them on a return, no need for a stack pointer.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc.h')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc.h b/src/gallium/drivers/nv50/nv50_pc.h
index 703d32d334e..d9cc775572e 100644
--- a/src/gallium/drivers/nv50/nv50_pc.h
+++ b/src/gallium/drivers/nv50/nv50_pc.h
@@ -282,7 +282,7 @@ struct nv_basic_block {
ubyte in_kind[8];
int id;
- struct nv_basic_block *last_visitor;
+ int subroutine;
uint priv;
uint pass_seq;
@@ -314,10 +314,10 @@ nv_fixup_apply(uint32_t *bin, struct nv_fixup *fixup, uint32_t data)
bin[fixup->offset / 4] = val;
}
-struct nv_pc {
- struct nv50_translation_info *ti;
+struct nv50_translation_info;
- struct nv_basic_block *root;
+struct nv_pc {
+ struct nv_basic_block **root;
struct nv_basic_block *current_block;
struct nv_basic_block *parent_block;
@@ -332,6 +332,7 @@ struct nv_pc {
int num_instructions;
int num_refs;
int num_blocks;
+ int num_subroutines;
int max_reg[4];
@@ -463,7 +464,8 @@ void nv_print_instruction(struct nv_instruction *);
/* nv50_pc.c */
-void nv_print_program(struct nv_basic_block *b);
+void nv_print_function(struct nv_basic_block *root);
+void nv_print_program(struct nv_pc *);
boolean nv_op_commutative(uint opcode);
int nv50_indirect_opnd(struct nv_instruction *);