Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / intel / compiler / brw_vue_map.c
index e14cba8f67d1aae6798ad7963d0ac41bf3949998..df5cf5908cc062c61ffbc8faec9da832d4126892 100644 (file)
@@ -41,7 +41,7 @@
 
 
 #include "brw_compiler.h"
-#include "common/gen_debug.h"
+#include "dev/gen_debug.h"
 
 static inline void
 assign_vue_slot(struct brw_vue_map *vue_map, int varying, int slot)
@@ -60,7 +60,8 @@ void
 brw_compute_vue_map(const struct gen_device_info *devinfo,
                     struct brw_vue_map *vue_map,
                     uint64_t slots_valid,
-                    bool separate)
+                    bool separate,
+                    uint32_t pos_slots)
 {
    /* Keep using the packed/contiguous layout on old hardware - we only need
     * the SSO layout when using geometry/tessellation shaders or 32 FS input
@@ -133,11 +134,27 @@ brw_compute_vue_map(const struct gen_device_info *devinfo,
        */
       assign_vue_slot(vue_map, VARYING_SLOT_PSIZ, slot++);
       assign_vue_slot(vue_map, VARYING_SLOT_POS, slot++);
+
+      /* When using Primitive Replication, multiple slots are used for storing
+       * positions for each view.
+       */
+      assert(pos_slots >= 1);
+      if (pos_slots > 1) {
+         for (int i = 1; i < pos_slots; i++) {
+            vue_map->slot_to_varying[slot++] = VARYING_SLOT_POS;
+         }
+      }
+
       if (slots_valid & BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST0))
          assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST0, slot++);
       if (slots_valid & BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST1))
          assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST1, slot++);
 
+      /* Vertex URB Formats table says: "Vertex Header shall be padded at the
+       * end so that the header ends on a 32-byte boundary".
+       */
+      slot += slot % 2;
+
       /* front and back colors need to be consecutive so that we can use
        * ATTRIBUTE_SWIZZLE_INPUTATTR_FACING to swizzle them when doing
        * two-sided color.
@@ -266,7 +283,7 @@ varying_name(brw_varying_slot slot)
    assume(slot < BRW_VARYING_SLOT_COUNT);
 
    if (slot < VARYING_SLOT_MAX)
-      return gl_varying_slot_name(slot);
+      return gl_varying_slot_name((gl_varying_slot)slot);
 
    static const char *brw_names[] = {
       [BRW_VARYING_SLOT_NDC - VARYING_SLOT_MAX] = "BRW_VARYING_SLOT_NDC",