i965: Add support for ARB_depth_clamp.
This commit is contained in:
@@ -39,12 +39,14 @@
|
||||
|
||||
static void prepare_cc_vp( struct brw_context *brw )
|
||||
{
|
||||
GLcontext *ctx = &brw->intel.ctx;
|
||||
struct brw_cc_viewport ccv;
|
||||
|
||||
memset(&ccv, 0, sizeof(ccv));
|
||||
|
||||
ccv.min_depth = 0.0;
|
||||
ccv.max_depth = 1.0;
|
||||
/* _NEW_VIEWPORT */
|
||||
ccv.min_depth = ctx->Viewport.Near;
|
||||
ccv.max_depth = ctx->Viewport.Far;
|
||||
|
||||
dri_bo_unreference(brw->cc.vp_bo);
|
||||
brw->cc.vp_bo = brw_cache_data( &brw->cache, BRW_CC_VP, &ccv, NULL, 0 );
|
||||
@@ -52,7 +54,7 @@ static void prepare_cc_vp( struct brw_context *brw )
|
||||
|
||||
const struct brw_tracked_state brw_cc_vp = {
|
||||
.dirty = {
|
||||
.mesa = 0,
|
||||
.mesa = _NEW_VIEWPORT,
|
||||
.brw = BRW_NEW_CONTEXT,
|
||||
.cache = 0
|
||||
},
|
||||
|
@@ -43,11 +43,14 @@ struct brw_clip_unit_key {
|
||||
unsigned int curbe_offset;
|
||||
|
||||
unsigned int nr_urb_entries, urb_size;
|
||||
|
||||
GLboolean depth_clamp;
|
||||
};
|
||||
|
||||
static void
|
||||
clip_unit_populate_key(struct brw_context *brw, struct brw_clip_unit_key *key)
|
||||
{
|
||||
GLcontext *ctx = &brw->intel.ctx;
|
||||
memset(key, 0, sizeof(*key));
|
||||
|
||||
/* CACHE_NEW_CLIP_PROG */
|
||||
@@ -62,6 +65,9 @@ clip_unit_populate_key(struct brw_context *brw, struct brw_clip_unit_key *key)
|
||||
/* BRW_NEW_URB_FENCE */
|
||||
key->nr_urb_entries = brw->urb.nr_clip_entries;
|
||||
key->urb_size = brw->urb.vsize;
|
||||
|
||||
/* _NEW_TRANSOFORM */
|
||||
key->depth_clamp = ctx->Transform.DepthClamp;
|
||||
}
|
||||
|
||||
static dri_bo *
|
||||
@@ -117,6 +123,7 @@ clip_unit_create_from_key(struct brw_context *brw,
|
||||
clip.clip5.userclip_enable_flags = 0x7f;
|
||||
clip.clip5.userclip_must_clip = 1;
|
||||
clip.clip5.guard_band_enable = 0;
|
||||
if (!key->depth_clamp)
|
||||
clip.clip5.viewport_z_clip_enable = 1;
|
||||
clip.clip5.viewport_xy_clip_enable = 1;
|
||||
clip.clip5.vertex_position_space = BRW_CLIP_NDCSPACE;
|
||||
@@ -168,7 +175,7 @@ static void upload_clip_unit( struct brw_context *brw )
|
||||
|
||||
const struct brw_tracked_state brw_clip_unit = {
|
||||
.dirty = {
|
||||
.mesa = 0,
|
||||
.mesa = _NEW_TRANSFORM,
|
||||
.brw = (BRW_NEW_CURBE_OFFSETS |
|
||||
BRW_NEW_URB_FENCE),
|
||||
.cache = CACHE_NEW_CLIP_PROG
|
||||
|
@@ -139,6 +139,7 @@ static const struct dri_extension i915_extensions[] = {
|
||||
|
||||
/** i965-only extensions */
|
||||
static const struct dri_extension brw_extensions[] = {
|
||||
{ "GL_ARB_depth_clamp", NULL },
|
||||
{ "GL_ARB_depth_texture", NULL },
|
||||
{ "GL_ARB_fragment_program", NULL },
|
||||
{ "GL_ARB_fragment_program_shadow", NULL },
|
||||
|
Reference in New Issue
Block a user