summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple/i915_fpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_fpc.c')
-rw-r--r--src/mesa/pipe/i915simple/i915_fpc.c146
1 files changed, 0 insertions, 146 deletions
diff --git a/src/mesa/pipe/i915simple/i915_fpc.c b/src/mesa/pipe/i915simple/i915_fpc.c
index fd0bbbc482..3bf2231589 100644
--- a/src/mesa/pipe/i915simple/i915_fpc.c
+++ b/src/mesa/pipe/i915simple/i915_fpc.c
@@ -35,149 +35,3 @@
#include "i915_fpc.h"
-
-
-void
-i915_program_error(struct i915_fp_compile *p, const char *msg)
-{
- fprintf(stderr, "i915_program_error: %s", msg);
- p->fp->error = 1;
-}
-
-
-static struct i915_fp_compile *
-i915_init_compile(struct i915_context *i915, struct i915_fragment_program *fp)
-{
- struct i915_fp_compile *p = CALLOC_STRUCT(i915_fp_compile);
-
- p->fp = fp;
-#if 0
- p->env_param = NULL; /*i915->intel.ctx.FragmentProgram.Parameters;*/
-#endif
- p->constants = i915->fs.constants;
- p->nr_tex_indirect = 1; /* correct? */
- p->nr_tex_insn = 0;
- p->nr_alu_insn = 0;
- p->nr_decl_insn = 0;
-
- memset(p->constant_flags, 0, sizeof(p->constant_flags));
-
- p->csr = p->program;
- p->decl = p->declarations;
- p->decl_s = 0;
- p->decl_t = 0;
- p->temp_flag = 0xffff000;
- p->utemp_flag = ~0x7;
-
-#if 0
- p->fp->translated = 0;
- p->fp->error = 0;
- p->fp->nr_constants = 0;
-#endif
- p->fp->wpos_tex = -1;
- p->fp->nr_params = 0;
-
- *(p->decl++) = _3DSTATE_PIXEL_SHADER_PROGRAM;
-
- return p;
-}
-
-/* Copy compile results to the fragment program struct and destroy the
- * compilation context.
- */
-static void
-i915_fini_compile(struct i915_fp_compile *p)
-{
- uint program_size = p->csr - p->program;
- uint decl_size = p->decl - p->declarations;
-
- if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT)
- i915_program_error(p, "Exceeded max nr indirect texture lookups");
-
- if (p->nr_tex_insn > I915_MAX_TEX_INSN)
- i915_program_error(p, "Exceeded max TEX instructions");
-
- if (p->nr_alu_insn > I915_MAX_ALU_INSN)
- i915_program_error(p, "Exceeded max ALU instructions");
-
- if (p->nr_decl_insn > I915_MAX_DECL_INSN)
- i915_program_error(p, "Exceeded max DECL instructions");
-
- if (p->fp->error) {
- p->fp->NumNativeInstructions = 0;
- p->fp->NumNativeAluInstructions = 0;
- p->fp->NumNativeTexInstructions = 0;
- p->fp->NumNativeTexIndirections = 0;
- return;
- }
- else {
- p->fp->NumNativeInstructions = (p->nr_alu_insn +
- p->nr_tex_insn +
- p->nr_decl_insn);
- p->fp->NumNativeAluInstructions = p->nr_alu_insn;
- p->fp->NumNativeTexInstructions = p->nr_tex_insn;
- p->fp->NumNativeTexIndirections = p->nr_tex_indirect;
- }
-
- p->declarations[0] |= program_size + decl_size - 2;
-
- /* Copy compilation results to fragment program struct:
- */
- memcpy(p->fp->program,
- p->declarations,
- decl_size * sizeof(uint));
-
- memcpy(p->fp->program + decl_size,
- p->program,
- program_size * sizeof(uint));
-
- p->fp->program_size = program_size + decl_size;
-
- /* Release the compilation struct:
- */
- free(p);
-}
-
-
-/**
- * Find an unused texture coordinate slot to use for fragment WPOS.
- * Update p->fp->wpos_tex with the result (-1 if no used texcoord slot is found).
- */
-static void
-find_wpos_space(struct i915_fp_compile *p)
-{
- const uint inputs = p->shader->inputs_read;
- uint i;
-
- p->fp->wpos_tex = -1;
-
- if (inputs & FRAG_BIT_WPOS) {
- for (i = 0; i < I915_TEX_UNITS; i++) {
- if ((inputs & (FRAG_BIT_TEX0 << i)) == 0) {
- p->fp->wpos_tex = i;
- return;
- }
- }
-
- i915_program_error(p, "No free texcoord for wpos value");
- }
-}
-
-
-
-void i915_compile_fragment_program( struct i915_context *i915,
- struct i915_fragment_program *fp )
-{
- struct i915_fp_compile *p = i915_init_compile(i915, fp);
- struct tgsi_token *tokens = i915->fs.tokens;
-
- find_wpos_space(p);
-
- i915_translate_program(p, tokens);
- i915_fixup_depth_write(p);
-
- i915_fini_compile(p);
-#if 0
- fp->translated = 1;
-#endif
-}