diff options
author | Christoph Bumiller <[email protected]> | 2010-09-07 15:40:34 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-09-09 19:21:34 +0200 |
commit | d91b8865ec2bb41f9b58ad5ce2df7f6f48f98281 (patch) | |
tree | bc6ff85f2f891b9b05124cc1f8ec874159a3ace0 /src/gallium/drivers/nv50/nv50_program.h | |
parent | 217542a061ef31150b1b04f1b45b6099bcc153fe (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_program.h')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.h b/src/gallium/drivers/nv50/nv50_program.h index 3c3f1f7f970..918baf325f5 100644 --- a/src/gallium/drivers/nv50/nv50_program.h +++ b/src/gallium/drivers/nv50/nv50_program.h @@ -27,6 +27,8 @@ #include "tgsi/tgsi_scan.h" #include "nouveau/nouveau_class.h" +#define NV50_CAP_MAX_PROGRAM_TEMPS (128 / 4) + struct nv50_varying { uint8_t id; /* tgsi index */ uint8_t hw; /* hw index, nv50 wants flat FP inputs last */ @@ -92,13 +94,13 @@ struct nv50_program { #define NV50_INTERP_FLAT (1 << 1) #define NV50_INTERP_CENTROID (1 << 2) -#define NV50_PROG_MAX_SUBROUTINES 8 - /* analyze TGSI and see which TEMP[] are used as subroutine inputs/outputs */ struct nv50_subroutine { - int id; - uint32_t argv[4][1]; /* 4 bitmasks, for each of xyzw, only allow 32 TEMPs */ - uint32_t retv[4][1]; + unsigned id; + unsigned pos; + /* function inputs and outputs */ + uint32_t argv[NV50_CAP_MAX_PROGRAM_TEMPS][4]; + uint32_t retv[NV50_CAP_MAX_PROGRAM_TEMPS][4]; }; struct nv50_translation_info { @@ -119,8 +121,8 @@ struct nv50_translation_info { unsigned immd32_nr; ubyte *immd32_ty; ubyte edgeflag_out; - struct nv50_subroutine subr[NV50_PROG_MAX_SUBROUTINES]; - int subr_nr; + struct nv50_subroutine *subr; + unsigned subr_nr; }; int nv50_generate_code(struct nv50_translation_info *ti); |