X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fbrw_clip.c;h=4c9d5c56c121f03b8f2abc57975ef4903b01bd5f;hb=be095e11e41158f91bcb3f6fcbc2e2a91a5d9124;hp=07b10a2d1d934161eed49b2ca61ba4b1d7ac282d;hpb=639314d40e78b5b56c3fc840b2f416e7fc519a4d;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 07b10a2d1d9..4c9d5c56c12 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -29,7 +29,6 @@ * Keith Whitwell */ -#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; @@ -133,12 +132,23 @@ static void compile_clip_prog( struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static void +void brw_upload_clip_prog(struct brw_context *brw) { struct gl_context *ctx = &brw->ctx; struct brw_clip_prog_key key; + if (!brw_state_dirty(brw, + _NEW_BUFFERS | + _NEW_LIGHT | + _NEW_POLYGON | + _NEW_TRANSFORM, + BRW_NEW_BLORP | + BRW_NEW_INTERPOLATION_MAP | + BRW_NEW_REDUCED_PRIMITIVE | + BRW_NEW_VUE_MAP_GEOM_OUT)) + return; + memset(&key, 0, sizeof(key)); /* Populate the key: @@ -223,6 +233,7 @@ 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; } if (!ctx->Polygon._FrontBit) { @@ -252,17 +263,3 @@ brw_upload_clip_prog(struct brw_context *brw) compile_clip_prog( brw, &key ); } } - - -const struct brw_tracked_state brw_clip_prog = { - .dirty = { - .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 -};