summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2008-01-30 10:43:23 -0800
committerIan Romanick <idr@us.ibm.com>2008-01-30 20:14:51 -0800
commitfcf944177325cdf8bf6e4f1b70296c19476e2375 (patch)
tree01e5262601a17cd8c2b02530a8340c8f5d650002 /src/mesa
parent3d13605ee5fc92a1e3d82f1dbbcb8342066d8af0 (diff)
Pass ptr to local memory copy instead of main memory to exec_instruction
This was essentially a cut-and-paste bug when the instruction fetcher was added. Also, the test for TGSI_PROCESSOR_FRAGMENT was moved outside the loop for exec_declaration.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/pipe/cell/spu/spu_exec.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesa/pipe/cell/spu/spu_exec.c b/src/mesa/pipe/cell/spu/spu_exec.c
index f43278198e..b3db6716d5 100644
--- a/src/mesa/pipe/cell/spu/spu_exec.c
+++ b/src/mesa/pipe/cell/spu/spu_exec.c
@@ -2332,17 +2332,19 @@ spu_exec_machine_run( struct spu_exec_machine *mach )
/* execute declarations (interpolants) */
- for (i = 0; i < mach->NumDeclarations; i++) {
- uint8_t buffer[sizeof(struct tgsi_full_declaration) + 32] ALIGN16_ATTRIB;
- struct tgsi_full_declaration decl;
- unsigned long decl_addr = (unsigned long) (mach->Declarations+i);
- unsigned size = ((sizeof(decl) + (decl_addr & 0x0f) + 0x0f) & ~0x0f);
+ if( mach->Processor == TGSI_PROCESSOR_FRAGMENT ) {
+ for (i = 0; i < mach->NumDeclarations; i++) {
+ uint8_t buffer[sizeof(struct tgsi_full_declaration) + 32] ALIGN16_ATTRIB;
+ struct tgsi_full_declaration decl;
+ unsigned long decl_addr = (unsigned long) (mach->Declarations+i);
+ unsigned size = ((sizeof(decl) + (decl_addr & 0x0f) + 0x0f) & ~0x0f);
- mfc_get(buffer, decl_addr & ~0x0f, size, TAG_INSTRUCTION_FETCH, 0, 0);
- wait_on_mask(1 << TAG_INSTRUCTION_FETCH);
+ mfc_get(buffer, decl_addr & ~0x0f, size, TAG_INSTRUCTION_FETCH, 0, 0);
+ wait_on_mask(1 << TAG_INSTRUCTION_FETCH);
- memcpy(& decl, buffer + (decl_addr & 0x0f), sizeof(decl));
- exec_declaration( mach, mach->Declarations+i );
+ memcpy(& decl, buffer + (decl_addr & 0x0f), sizeof(decl));
+ exec_declaration( mach, decl );
+ }
}
/* execute instructions, until pc is set to -1 */
@@ -2357,7 +2359,7 @@ spu_exec_machine_run( struct spu_exec_machine *mach )
wait_on_mask(1 << TAG_INSTRUCTION_FETCH);
memcpy(& inst, buffer + (inst_addr & 0x0f), sizeof(inst));
- exec_instruction( mach, mach->Instructions + pc, &pc );
+ exec_instruction( mach, & inst, &pc );
}
#if 0