i965/wm: use binding size for ubo/ssbo when automatic size is unset
[mesa.git] / src / mesa / drivers / dri / i965 / brw_clip.c
index d6ccfa42fa262028213b3720b37e0183eec7da75..9db35ce3467cd55bee92b671801e50b33c2605c4 100644 (file)
@@ -29,7 +29,6 @@
   *   Keith Whitwell <keithw@vmware.com>
   */
 
-#include "main/glheader.h"
 #include "main/macros.h"
 #include "main/enums.h"
 
@@ -62,7 +61,7 @@ static void compile_clip_prog( struct brw_context *brw,
 
    /* Begin the compilation:
     */
-   brw_init_compile(brw, &c.func, mem_ctx);
+   brw_init_codegen(brw->intelScreen->devinfo, &c.func, mem_ctx);
 
    c.func.single_program_flow = 1;
 
@@ -117,12 +116,13 @@ static void compile_clip_prog( struct brw_context *brw,
 
    if (unlikely(INTEL_DEBUG & DEBUG_CLIP)) {
       fprintf(stderr, "clip:\n");
-      brw_disassemble(brw, c.func.store, 0, program_size, stderr);
+      brw_disassemble(brw->intelScreen->devinfo, c.func.store,
+                      0, program_size, stderr);
       fprintf(stderr, "\n");
    }
 
    brw_upload_cache(&brw->cache,
-                   BRW_CLIP_PROG,
+                   BRW_CACHE_CLIP_PROG,
                    &c.key, sizeof(c.key),
                    program, program_size,
                    &c.prog_data, sizeof(c.prog_data),
@@ -222,10 +222,10 @@ brw_upload_clip_prog(struct brw_context *brw)
               /* _NEW_POLYGON, _NEW_BUFFERS */
               key.offset_units = ctx->Polygon.OffsetUnits * ctx->DrawBuffer->_MRD * 2;
               key.offset_factor = ctx->Polygon.OffsetFactor * ctx->DrawBuffer->_MRD;
+              key.offset_clamp = ctx->Polygon.OffsetClamp * ctx->DrawBuffer->_MRD;
            }
 
-           switch (ctx->Polygon.FrontFace) {
-           case GL_CCW:
+           if (!ctx->Polygon._FrontBit) {
               key.fill_ccw = fill_front;
               key.fill_cw = fill_back;
               key.offset_ccw = offset_front;
@@ -233,8 +233,7 @@ brw_upload_clip_prog(struct brw_context *brw)
               if (ctx->Light.Model.TwoSide &&
                   key.fill_cw != CLIP_CULL)
                  key.copy_bfc_cw = 1;
-              break;
-           case GL_CW:
+           } else {
               key.fill_cw = fill_front;
               key.fill_ccw = fill_back;
               key.offset_cw = offset_front;
@@ -242,13 +241,12 @@ brw_upload_clip_prog(struct brw_context *brw)
               if (ctx->Light.Model.TwoSide &&
                   key.fill_ccw != CLIP_CULL)
                  key.copy_bfc_ccw = 1;
-              break;
            }
         }
       }
    }
 
-   if (!brw_search_cache(&brw->cache, BRW_CLIP_PROG,
+   if (!brw_search_cache(&brw->cache, BRW_CACHE_CLIP_PROG,
                         &key, sizeof(key),
                         &brw->clip.prog_offset, &brw->clip.prog_data)) {
       compile_clip_prog( brw, &key );
@@ -258,13 +256,13 @@ brw_upload_clip_prog(struct brw_context *brw)
 
 const struct brw_tracked_state brw_clip_prog = {
    .dirty = {
-      .mesa  = (_NEW_LIGHT |
-               _NEW_TRANSFORM |
-               _NEW_POLYGON |
-               _NEW_BUFFERS),
-      .brw   = (BRW_NEW_REDUCED_PRIMITIVE |
-                BRW_NEW_VUE_MAP_GEOM_OUT |
-                BRW_NEW_INTERPOLATION_MAP)
+      .mesa  = _NEW_BUFFERS |
+               _NEW_LIGHT |
+               _NEW_POLYGON |
+               _NEW_TRANSFORM,
+      .brw   = BRW_NEW_INTERPOLATION_MAP |
+               BRW_NEW_REDUCED_PRIMITIVE |
+               BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = brw_upload_clip_prog
 };