anv/icl: Set Enabled Texel Offset Precision Fix bit
authorAnuj Phogat <anuj.phogat@gmail.com>
Mon, 27 Aug 2018 23:16:58 +0000 (16:16 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Fri, 21 Sep 2018 21:40:04 +0000 (14:40 -0700)
h/w specification requires this bit to be always set.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/genxml/gen11.xml
src/intel/vulkan/genX_state.c

index 1b3befbbfc9f282716b39f780e81da4b3dedf9d3..c69d7dc89c2ee92d3e55598d72554099cf2efcf2 100644 (file)
     <field name="Headerless Message for Pre-emptable Contexts Mask" start="21" end="21" type="bool"/>
   </register>
 
+  <register name="HALF_SLICE_CHICKEN7" length="1" num="0x0e194">
+    <field name="Enabled Texel Offset Precision Fix" start="1" end="1" type="bool"/>
+    <field name="Enabled Texel Offset Precision Fix Mask" start="17" end="17" type="bool"/>
+  </register>
+
 </genxml>
index 4a175b9234d0842b0a6db1e5cee49ffe62aabf56..aa5bce5a801a1f58c8f8cec6395b8a20f52da755 100644 (file)
@@ -172,6 +172,20 @@ genX(init_device_state)(struct anv_device *device)
       lri.RegisterOffset = GENX(SAMPLER_MODE_num);
       lri.DataDWord      = sampler_mode;
    }
+
+   /* Bit 1 "Enabled Texel Offset Precision Fix" must be set in
+    * HALF_SLICE_CHICKEN7 register.
+    */
+   uint32_t half_slice_chicken7;
+   anv_pack_struct(&half_slice_chicken7, GENX(HALF_SLICE_CHICKEN7),
+                   .EnabledTexelOffsetPrecisionFix = true,
+                   .EnabledTexelOffsetPrecisionFixMask = true);
+
+    anv_batch_emit(&batch, GENX(MI_LOAD_REGISTER_IMM), lri) {
+      lri.RegisterOffset = GENX(HALF_SLICE_CHICKEN7_num);
+      lri.DataDWord      = half_slice_chicken7;
+   }
+
 #endif
 
    /* Set the "CONSTANT_BUFFER Address Offset Disable" bit, so