Mesa (android-radeonsi-build-fix): iris: Add restriction to 3DSTATE_CONSTANT_ packets.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 4 21:08:29 UTC 2019


Module: Mesa
Branch: android-radeonsi-build-fix
Commit: 50f60d69e45d5bac2aa44aeaddb6e2b5436f01d4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50f60d69e45d5bac2aa44aeaddb6e2b5436f01d4

Author: Rafael Antognolli <rafael.antognolli at intel.com>
Date:   Tue Dec  3 11:15:38 2019 -0800

iris: Add restriction to 3DSTATE_CONSTANT_ packets.

The following programming note shows up in all 3DSTATE_CONSTANT_*
packets:

   "The sum of all four read length fields must be less than or equal to
   the size of 64."

The backend compiler should guarantee this for us, so let's just add a
check here.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

---

 src/gallium/drivers/iris/iris_state.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 8ea79f722a3..3e0bedddfd7 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -5108,6 +5108,8 @@ setup_constant_buffers(struct iris_context *ice,
    struct iris_compiled_shader *shader = ice->shaders.prog[stage];
    struct brw_stage_prog_data *prog_data = (void *) shader->prog_data;
 
+   uint32_t push_range_sum = 0;
+
    int n = 0;
    for (int i = 0; i < 4; i++) {
       const struct brw_ubo_range *range = &prog_data->ubo_ranges[i];
@@ -5115,6 +5117,8 @@ setup_constant_buffers(struct iris_context *ice,
       if (range->length == 0)
          continue;
 
+      push_range_sum += range->length;
+
       if (range->length > push_bos->max_length)
          push_bos->max_length = range->length;
 
@@ -5135,6 +5139,13 @@ setup_constant_buffers(struct iris_context *ice,
       n++;
    }
 
+   /* From the 3DSTATE_CONSTANT_XS and 3DSTATE_CONSTANT_ALL programming notes:
+    *
+    *    "The sum of all four read length fields must be less than or
+    *    equal to the size of 64."
+    */
+   assert(push_range_sum <= 64);
+
    push_bos->buffer_count = n;
 }
 




More information about the mesa-commit mailing list