Mesa (master): i965/vec4: Always split uniforms in array_access_to_pull_constants

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Apr 20 16:20:28 UTC 2016


Module: Mesa
Branch: master
Commit: 87a4fb516eeebd6be0441db5aeffc705f16bef86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=87a4fb516eeebd6be0441db5aeffc705f16bef86

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Mon Apr 18 18:57:07 2016 -0700

i965/vec4: Always split uniforms in array_access_to_pull_constants

Normally, we split uniforms at the end but in Vulkan, we bail because we
don't want pull constants.  However, we still need them split because
pack_uniforms relies on it.

I really don't like this patch not because it doesn't work (it does) but
because now that we're using MOV_INDIRECT, uniform numbers and sizes don't
really matter anymore.  In the FS backend, uniform splitting and packing is
handled all at once (actual re-assignment of locations happens later) and
we really should do it that way in vec4 eventually as well.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94998
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95001

---

 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 4b12a72..507f2ee 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1632,8 +1632,10 @@ vec4_visitor::move_uniform_array_access_to_pull_constants()
    /* The vulkan dirver doesn't support pull constants other than UBOs so
     * everything has to be pushed regardless.
     */
-   if (stage_prog_data->pull_param == NULL)
+   if (stage_prog_data->pull_param == NULL) {
+      split_uniform_registers();
       return;
+   }
 
    int pull_constant_loc[this->uniforms];
    memset(pull_constant_loc, -1, sizeof(pull_constant_loc));




More information about the mesa-commit mailing list