summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_eu.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-04-02 14:03:08 -0700
committerKenneth Graunke <kenneth@whitecape.org>2012-04-09 10:17:27 -0700
commitf78f48b6d2c4034a62ab11a558c95901d2245c4a (patch)
tree20ab537cb179ec8fd38f3306cb6a2be94720d064 /src/mesa/drivers/dri/i965/brw_eu.c
parentc6532875493ffe7de9c37924c70ebf6d0472e23d (diff)
downloadexternal_mesa3d-f78f48b6d2c4034a62ab11a558c95901d2245c4a.zip
external_mesa3d-f78f48b6d2c4034a62ab11a558c95901d2245c4a.tar.gz
external_mesa3d-f78f48b6d2c4034a62ab11a558c95901d2245c4a.tar.bz2
i965: Remove vestiges of function call support from the old VS backend.
This never worked. brwProgramStringNotify also explicitly rejects programs that use CAL and RET. So there's no need for this to exist. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c124
1 files changed, 0 insertions, 124 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index 2b0593a..00b9671 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -218,127 +218,3 @@ const GLuint *brw_get_program( struct brw_compile *p,
*sz = p->nr_insn * sizeof(struct brw_instruction);
return (const GLuint *)p->store;
}
-
-
-
-/**
- * Subroutine calls require special attention.
- * Mesa instructions may be expanded into multiple hardware instructions
- * so the prog_instruction::BranchTarget field can't be used as an index
- * into the hardware instructions.
- *
- * The BranchTarget field isn't needed, however. Mesa's GLSL compiler
- * emits CAL and BGNSUB instructions with labels that can be used to map
- * subroutine calls to actual subroutine code blocks.
- *
- * The structures and function here implement patching of CAL instructions
- * so they jump to the right subroutine code...
- */
-
-
-/**
- * For each OPCODE_BGNSUB we create one of these.
- */
-struct brw_glsl_label
-{
- const char *name; /**< the label string */
- GLuint position; /**< the position of the brw instruction for this label */
- struct brw_glsl_label *next; /**< next in linked list */
-};
-
-
-/**
- * For each OPCODE_CAL we create one of these.
- */
-struct brw_glsl_call
-{
- GLuint call_inst_pos; /**< location of the CAL instruction */
- const char *sub_name; /**< name of subroutine to call */
- struct brw_glsl_call *next; /**< next in linked list */
-};
-
-
-/**
- * Called for each OPCODE_BGNSUB.
- */
-void
-brw_save_label(struct brw_compile *c, const char *name, GLuint position)
-{
- struct brw_glsl_label *label = CALLOC_STRUCT(brw_glsl_label);
- label->name = name;
- label->position = position;
- label->next = c->first_label;
- c->first_label = label;
-}
-
-
-/**
- * Called for each OPCODE_CAL.
- */
-void
-brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos)
-{
- struct brw_glsl_call *call = CALLOC_STRUCT(brw_glsl_call);
- call->call_inst_pos = call_pos;
- call->sub_name = name;
- call->next = c->first_call;
- c->first_call = call;
-}
-
-
-/**
- * Lookup a label, return label's position/offset.
- */
-static GLuint
-brw_lookup_label(struct brw_compile *c, const char *name)
-{
- const struct brw_glsl_label *label;
- for (label = c->first_label; label; label = label->next) {
- if (strcmp(name, label->name) == 0) {
- return label->position;
- }
- }
- abort(); /* should never happen */
- return ~0;
-}
-
-
-/**
- * When we're done generating code, this function is called to resolve
- * subroutine calls.
- */
-void
-brw_resolve_cals(struct brw_compile *c)
-{
- const struct brw_glsl_call *call;
-
- for (call = c->first_call; call; call = call->next) {
- const GLuint sub_loc = brw_lookup_label(c, call->sub_name);
- struct brw_instruction *brw_call_inst = &c->store[call->call_inst_pos];
- struct brw_instruction *brw_sub_inst = &c->store[sub_loc];
- GLint offset = brw_sub_inst - brw_call_inst;
-
- /* patch brw_inst1 to point to brw_inst2 */
- brw_set_src1(c, brw_call_inst, brw_imm_d(offset * 16));
- }
-
- /* free linked list of calls */
- {
- struct brw_glsl_call *call, *next;
- for (call = c->first_call; call; call = next) {
- next = call->next;
- free(call);
- }
- c->first_call = NULL;
- }
-
- /* free linked list of labels */
- {
- struct brw_glsl_label *label, *next;
- for (label = c->first_label; label; label = next) {
- next = label->next;
- free(label);
- }
- c->first_label = NULL;
- }
-}