diff options
author | Zack Rusin <[email protected]> | 2007-10-31 12:23:45 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2007-11-02 07:15:17 -0400 |
commit | 25d91c23ff834a129e537891ec3ad63197d37da5 (patch) | |
tree | 7c14a496c3095125d4f27e772a7165ac466566cf /src/mesa/pipe/softpipe | |
parent | 7ff0df6c2bf11a36bc6101e361484bde57595a79 (diff) |
Add basic entry points for fragment shaders.
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_fs.c | 35 | ||||
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_fs.c | 2 |
2 files changed, 11 insertions, 26 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c index 4bc604d682d..cd8d3370442 100644 --- a/src/mesa/pipe/softpipe/sp_quad_fs.c +++ b/src/mesa/pipe/softpipe/sp_quad_fs.c @@ -91,6 +91,11 @@ shade_quad( machine->SamplerUnits = softpipe->sampler_units; machine->InterpCoefs = quad->coef; + printf("COEF = [%f %f %f %f], [%f %f %f %f], [%f %f %f %f] %p\n", + quad->coef->a0[0], quad->coef->a0[1], quad->coef->a0[2], quad->coef->a0[3], + quad->coef->dadx[0], quad->coef->dadx[1], quad->coef->dadx[2], quad->coef->dadx[3], + quad->coef->dady[0], quad->coef->dady[1], quad->coef->dady[2], quad->coef->dady[3], + quad->coef); machine->Inputs[0].xyzw[0].f[0] = fx; machine->Inputs[0].xyzw[0].f[1] = fx + 1.0f; @@ -165,33 +170,13 @@ shade_quad_llvm(struct quad_stage *qs, struct softpipe_context *softpipe = qs->softpipe; const float fx = (float) quad->x0; const float fy = (float) quad->y0; + struct gallivm_prog *llvm = qss->llvm_prog; - /* Consts does not require 16 byte alignment. */ - machine->Consts = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT]; - - machine->SamplerUnits = softpipe->sampler_units; - machine->InterpCoefs = quad->coef; - - machine->Inputs[0].xyzw[0].f[0] = fx; - machine->Inputs[0].xyzw[0].f[1] = fx + 1.0f; - machine->Inputs[0].xyzw[0].f[2] = fx; - machine->Inputs[0].xyzw[0].f[3] = fx + 1.0f; - - machine->Inputs[0].xyzw[1].f[0] = fy; - machine->Inputs[0].xyzw[1].f[1] = fy; - machine->Inputs[0].xyzw[1].f[2] = fy + 1.0f; - machine->Inputs[0].xyzw[1].f[3] = fy + 1.0f; - /* run shader */ -#if defined(__i386__) || defined(__386__) - machine->Inputs, - machine->Outputs, - machine->Consts, - machine->Temps, - machine->InterpCoefs ); - quad->mask &= ~(machine->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0]); -#endif - ga_llvm_prog_exec(softpipe->fs->llvm_prog); + quad->mask = gallivm_fragment_shader_exec( + llvm, fx, fy, quad->coef, + softpipe->mapped_constants[PIPE_SHADER_FRAGMENT], + qss->samplers, softpipe->sampler_units); /* store result color */ if (qss->colorOutSlot >= 0) { diff --git a/src/mesa/pipe/softpipe/sp_state_fs.c b/src/mesa/pipe/softpipe/sp_state_fs.c index 92b775ae516..08a7b58a6fe 100644 --- a/src/mesa/pipe/softpipe/sp_state_fs.c +++ b/src/mesa/pipe/softpipe/sp_state_fs.c @@ -63,7 +63,7 @@ void * softpipe_create_fs_state(struct pipe_context *pipe, #ifdef MESA_LLVM fprintf(stderr, "+++++++++++++++++++++++++++++++++++++++++++++++++\n"); - state->llvm_prog = gallivm_from_tgsi(state->shader.tokens); + state->llvm_prog = gallivm_from_tgsi(state->shader.tokens, GALLIVM_FS); if (!gallivm_global_cpu_engine()) { gallivm_cpu_engine_create(state->llvm_prog); } |