diff options
author | Brian <[email protected]> | 2007-01-04 17:22:19 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-01-04 17:22:19 -0700 |
commit | c9db223f902ce9d7e9f3038e6baac6da7f231b34 (patch) | |
tree | bb7eb01bc607a19dd4af154a1173dea51fef0208 /src/mesa/shader | |
parent | 7edd2ecb55d4cdc4067303867453d7e534bfad38 (diff) |
move TexturesUsed[] into gl_program since vertex programs/shaders can use textures nowadays
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/arbprogparse.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/nvfragparse.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/program.c | 3 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 3 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 7a87bf015ff..80e342e40a0 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -4038,7 +4038,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.InputsRead = ap.Base.InputsRead; program->Base.OutputsWritten = ap.Base.OutputsWritten; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) - program->TexturesUsed[i] = ap.TexturesUsed[i]; + program->Base.TexturesUsed[i] = ap.TexturesUsed[i]; program->FogOption = ap.FogOption; if (program->Base.Instructions) diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0b48d408f9d..b4e19ce74de 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1563,7 +1563,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, program->Base.InputsRead = parseState.inputsRead; program->Base.OutputsWritten = parseState.outputsWritten; for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) - program->TexturesUsed[u] = parseState.texturesUsed[u]; + program->Base.TexturesUsed[u] = parseState.texturesUsed[u]; /* save program parameters */ program->Base.Parameters = parseState.parameters; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 351427365cd..a50f7cff057 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -358,6 +358,8 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog) prog->NumInstructions * sizeof(struct prog_instruction)); clone->InputsRead = prog->InputsRead; clone->OutputsWritten = prog->OutputsWritten; + memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed)); + if (prog->Parameters) clone->Parameters = _mesa_clone_parameter_list(prog->Parameters); memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams)); @@ -389,7 +391,6 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog) const struct gl_fragment_program *fp = (const struct gl_fragment_program *) prog; struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone; - memcpy(fpc->TexturesUsed, fp->TexturesUsed, sizeof(fp->TexturesUsed)); fpc->NumAluInstructions = fp->NumAluInstructions; fpc->NumTexInstructions = fp->NumTexInstructions; fpc->NumTexIndirections = fp->NumTexIndirections; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index ac92bdcece7..4e1606be318 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1034,7 +1034,6 @@ emit_jump(const char *target, struct gl_program *prog) static struct prog_instruction * emit_tex(slang_gen_context *gc, slang_ir_node *n, struct gl_program *prog) { - struct gl_fragment_program *fProg = (struct gl_fragment_program *) prog; struct prog_instruction *inst; if (n->Opcode == IR_TEX) { inst = new_instruction(prog, OPCODE_TEX); @@ -1052,7 +1051,7 @@ emit_tex(slang_gen_context *gc, slang_ir_node *n, struct gl_program *prog) inst->TexSrcTarget = n->TexTarget; inst->TexSrcUnit = 0; /* XXX temp */ - fProg->TexturesUsed[inst->TexSrcUnit] |= (1 << inst->TexSrcTarget); + prog->TexturesUsed[inst->TexSrcUnit] |= (1 << inst->TexSrcTarget); return inst; } |