r600g: interpret integer texture types as ints.
[mesa.git] / src / gallium / drivers / nv50 / nv50_program.c
index a63f9d8a6d5c5acfdb9ea7bfa3884ff41ea6495e..c8b708c02b4e7042a11042a2c3765b38ba958beb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Chrsitoph Bumiller
+ * Copyright 2010 Christoph Bumiller
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -20,8 +20,6 @@
  * SOFTWARE.
  */
 
-/* #define NV50_PROGRAM_DEBUG */
-
 #include "nv50_program.h"
 #include "nv50_pc.h"
 #include "nv50_context.h"
@@ -31,6 +29,8 @@
 #include "tgsi/tgsi_util.h"
 #include "tgsi/tgsi_dump.h"
 
+#include "codegen/nv50_ir_driver.h"
+
 static INLINE unsigned
 bitcount4(const uint32_t val)
 {
@@ -397,6 +397,9 @@ nv50_vertprog_prepare(struct nv50_translation_info *ti)
       }
    }
 
+   p->vp.clpd = p->max_out;
+   p->max_out += p->vp.clpd_nr;
+
    for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
       switch (ti->sysval_map[i]) {
       case 2:
@@ -486,7 +489,7 @@ nv50_fragprog_prepare(struct nv50_translation_info *ti)
       ++nintp;
    }
 
-   p->fp.colors = (1 << 24) | 4; /* CLAMP, FFC0_ID = 4 */
+   p->fp.colors = 4 << NV50_3D_MAP_SEMANTIC_0_FFC0_ID__SHIFT; /* after HPOS */
 
    for (i = 0; i < p->in_nr; ++i) {
       int j = p->in[i].id;
@@ -564,7 +567,7 @@ nv50_prog_scan(struct nv50_translation_info *ti)
 
    tgsi_scan_shader(p->pipe.tokens, &ti->scan);
 
-#ifdef NV50_PROGRAM_DEBUG
+#if NV50_DEBUG & NV50_DEBUG_SHADER
    tgsi_dump(p->pipe.tokens, 0);
 #endif
 
@@ -624,6 +627,17 @@ nv50_prog_scan(struct nv50_translation_info *ti)
    return ret;
 }
 
+/* Temporary, need a reference to nv50_ir_generate_code in libnv50 or
+ * it "gets disappeared" and cannot be used in libnvc0 ...
+ */
+boolean
+nv50_program_translate_new(struct nv50_program *p)
+{
+   struct nv50_ir_prog_info info;
+
+   return nv50_ir_generate_code(&info);
+}
+
 boolean
 nv50_program_translate(struct nv50_program *p)
 {