Re: [Mesa-dev] [Mesa-stable] [PATCH] i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used
Hi Emil, I posted a v2 of this patch because the v1 wouldn't work in combination with a fix for bug 84677. I think it would be better to wait for review on those two and land both of them instead of this patch. Neither of them are particulary urgent bugs so it's probably not worth worrying about too much. But of course a bug is a bug so it would be nice to land them at some point. http://patchwork.freedesktop.org/patch/54324/ http://patchwork.freedesktop.org/patch/54325/ Regards, - Neil Emil Velikov emil.l.veli...@gmail.com writes: Hello Neil, On 10 July 2015 at 18:04, Neil Roberts n...@linux.intel.com wrote: When the edge flag element is enabled then the elements are slightly reordered so that the edge flag is always the last one. This was confusing the code to upload the 3DSTATE_VF_INSTANCING state because that is uploaded with a separate loop which has an instruction for each element. The indices used in these instructions weren't taking into account the reordering so the state would be incorrect. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91292 Cc: 10.6 10.5 mesa-sta...@lists.freedesktop.org Based of Chris's response can you please confirm if there are any plans of pushing this patch or alternative approach will be used ? I'm going through the list of nominated patches and would like to know if we should keep or drop this one. Thanks Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [Mesa-stable] [PATCH] i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used
Hello Neil, On 10 July 2015 at 18:04, Neil Roberts n...@linux.intel.com wrote: When the edge flag element is enabled then the elements are slightly reordered so that the edge flag is always the last one. This was confusing the code to upload the 3DSTATE_VF_INSTANCING state because that is uploaded with a separate loop which has an instruction for each element. The indices used in these instructions weren't taking into account the reordering so the state would be incorrect. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91292 Cc: 10.6 10.5 mesa-sta...@lists.freedesktop.org Based of Chris's response can you please confirm if there are any plans of pushing this patch or alternative approach will be used ? I'm going through the list of nominated patches and would like to know if we should keep or drop this one. Thanks Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [Mesa-stable] [PATCH] i965/bdw: Fix 3DSTATE_VF_INSTANCING when the edge flag is used
Surely the *right* thing would be to have the correct order expressed in brw-vb.*, instead so you don't have this workaround in multiple places. As a minimal fix for stable though, this seems OK, so - Reviewed-by: Chris Forbes chr...@ijw.co.nz On Sat, Jul 11, 2015 at 5:04 AM, Neil Roberts n...@linux.intel.com wrote: When the edge flag element is enabled then the elements are slightly reordered so that the edge flag is always the last one. This was confusing the code to upload the 3DSTATE_VF_INSTANCING state because that is uploaded with a separate loop which has an instruction for each element. The indices used in these instructions weren't taking into account the reordering so the state would be incorrect. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91292 Cc: 10.6 10.5 mesa-sta...@lists.freedesktop.org --- src/mesa/drivers/dri/i965/gen8_draw_upload.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen8_draw_upload.c b/src/mesa/drivers/dri/i965/gen8_draw_upload.c index 1af90ec..65b7625 100644 --- a/src/mesa/drivers/dri/i965/gen8_draw_upload.c +++ b/src/mesa/drivers/dri/i965/gen8_draw_upload.c @@ -218,13 +218,24 @@ gen8_emit_vertices(struct brw_context *brw) } ADVANCE_BATCH(); - for (unsigned i = 0; i brw-vb.nr_enabled; i++) { + for (unsigned i = 0, j = 0; i brw-vb.nr_enabled; i++) { const struct brw_vertex_element *input = brw-vb.enabled[i]; const struct brw_vertex_buffer *buffer = brw-vb.buffers[input-buffer]; + unsigned element_index; + + /* The edge flag element is reordered to be the last one in the code + * above so we need to compensate for that in the element indices used + * below. + */ + if (input == gen6_edgeflag_input) + element_index = brw-vb.nr_enabled - 1; + else + element_index = j++; BEGIN_BATCH(3); OUT_BATCH(_3DSTATE_VF_INSTANCING 16 | (3 - 2)); - OUT_BATCH(i | (buffer-step_rate ? GEN8_VF_INSTANCING_ENABLE : 0)); + OUT_BATCH(element_index | +(buffer-step_rate ? GEN8_VF_INSTANCING_ENABLE : 0)); OUT_BATCH(buffer-step_rate); ADVANCE_BATCH(); } -- 1.9.3 ___ mesa-stable mailing list mesa-sta...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-stable ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev