<div dir="ltr">On 7 June 2013 03:17, Chris Forbes <span dir="ltr"><<a href="mailto:chrisf@ijw.co.nz" target="_blank">chrisf@ijw.co.nz</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The PRM suggests a larger layout, mostly to support having<br>
gl_ClipDistance[] somewhere predictable for the fixed-function clipper<br>
-- but it didn't actually arrive in Gen5.<br>
<br>
Just use the same layout for both Gen4 and Gen5.<br>
<br>
No Piglit regressions.<br>
<br>
Improves performance in CS:S Video Stress Test by ~3%.<br>
<br>
Signed-off-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_sf_state.c | 5 +----<br>
src/mesa/drivers/dri/i965/brw_vs.c | 23 +++--------------------<br>
2 files changed, 4 insertions(+), 24 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c<br>
index 7c29ba2..e9b7e66 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_sf_state.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_sf_state.c<br>
@@ -131,10 +131,7 @@ const struct brw_tracked_state brw_sf_vp = {<br>
int<br>
brw_sf_compute_urb_entry_read_offset(struct intel_context *intel)<br>
{<br>
- if (intel->gen == 5)<br>
- return 3;<br>
- else<br>
- return 1;<br>
+ return 1;<br>
}<br></blockquote><div><br></div><div>How about just turning this into #define BRW_SF_URB_ENTRY_READ_OFFSET 1 in a header somewhere? It seems silly to have a function whose only job is to return a constant. <br></div><div>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
static void upload_sf_unit( struct brw_context *brw )<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c<br>
index 720325d..d173d2e 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vs.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_vs.c<br>
@@ -85,34 +85,17 @@ brw_compute_vue_map(struct brw_context *brw, struct brw_vue_map *vue_map,<br>
*/<br>
switch (intel->gen) {<br>
case 4:<br>
+ case 5:<br>
/* There are 8 dwords in VUE header pre-Ironlake:<br>
* dword 0-3 is indices, point width, clip flags.<br>
* dword 4-7 is ndc position<br>
* dword 8-11 is the first vertex data.<br>
- */<br>
- assign_vue_slot(vue_map, VARYING_SLOT_PSIZ);<br>
- assign_vue_slot(vue_map, BRW_VARYING_SLOT_NDC);<br>
- assign_vue_slot(vue_map, VARYING_SLOT_POS);<br>
- break;<br>
- case 5:<br>
- /* There are 20 DWs (D0-D19) in VUE header on Ironlake:<br>
- * dword 0-3 of the header is indices, point width, clip flags.<br>
- * dword 4-7 is the ndc position<br>
- * dword 8-11 of the vertex header is the 4D space position<br>
- * dword 12-19 of the vertex header is the user clip distance.<br>
- * dword 20-23 is a pad so that the vertex element data is aligned<br>
- * dword 24-27 is the first vertex data we fill.<br>
*<br>
- * Note: future pipeline stages expect 4D space position to be<br>
- * contiguous with the other varyings, so we make dword 24-27 a<br>
- * duplicate copy of the 4D space position.<br>
+ * On Ironlake the VUE header is nominally 20 dwords, but the hardware<br>
+ * will accept the same header layout as Gen4 [and should be a bit faster]<br>
*/<br>
assign_vue_slot(vue_map, VARYING_SLOT_PSIZ);<br>
assign_vue_slot(vue_map, BRW_VARYING_SLOT_NDC);<br>
- assign_vue_slot(vue_map, BRW_VARYING_SLOT_POS_DUPLICATE);<br></blockquote><div><br></div><div>This was the last use of BRW_VARYING_SLOT_POS_DUPLICATE. We ought to be able to remove that from the enum now (and from the switch statement in vec4_visitor::emit_urb_slot()).<br>
<br></div><div>With those changes, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST0);<br>
- assign_vue_slot(vue_map, VARYING_SLOT_CLIP_DIST1);<br>
- assign_vue_slot(vue_map, BRW_VARYING_SLOT_PAD);<br>
assign_vue_slot(vue_map, VARYING_SLOT_POS);<br>
break;<br>
case 6:<br>
<span class=""><font color="#888888">--<br>
1.8.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>