Mesa (main): ir3: update ir3_const_state comment

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 26 01:44:09 UTC 2022


Module: Mesa
Branch: main
Commit: 76ea28b9d0d9782dcd1774ff91c20361c8cb56af
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76ea28b9d0d9782dcd1774ff91c20361c8cb56af

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Fri Jul 22 13:49:59 2022 -0700

ir3: update ir3_const_state comment

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17570>

---

 src/freedreno/ir3/ir3_shader.h | 48 +++++++++++++++---------------------------
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h
index 1288e0644e3..8611dee4503 100644
--- a/src/freedreno/ir3/ir3_shader.h
+++ b/src/freedreno/ir3/ir3_shader.h
@@ -135,41 +135,27 @@ struct ir3_ubo_analysis_state {
 };
 
 /**
- * Describes the layout of shader consts.  This includes:
- *   + User consts + driver lowered UBO ranges
- *   + SSBO sizes
- *   + Image sizes/dimensions
- *   + Driver params (ie. IR3_DP_*)
- *   + TFBO addresses (for generations that do not have hardware streamout)
- *   + Lowered immediates
- *
- * For consts needed to pass internal values to shader which may or may not
- * be required, rather than allocating worst-case const space, we scan the
- * shader and allocate consts as-needed:
- *
- *   + SSBO sizes: only needed if shader has a get_ssbo_size intrinsic
- *     for a given SSBO
- *
- *   + Image dimensions: needed to calculate pixel offset, but only for
- *     images that have a image_store intrinsic
+ * Describes the layout of shader consts in the const register file.
  *
  * Layout of constant registers, each section aligned to vec4.  Note
  * that pointer size (ubo, etc) changes depending on generation.
  *
- *    user consts
- *    preamble consts
- *    UBO addresses
- *    SSBO sizes
- *    image dimensions
- *    if (vertex shader) {
- *        driver params (IR3_DP_VS_COUNT)
- *        if (stream_output.num_outputs > 0)
- *           stream-out addresses
- *    } else if (compute_shader) {
- *        kernel params
- *        driver params (IR3_DP_CS_COUNT)
- *    }
- *    immediates
+ *   + user consts: only used for turnip push consts
+ *   + lowered UBO ranges
+ *   + preamble consts
+ *   + UBO addresses: turnip is bindless and these are wasted
+ *   + image dimensions: a5xx only; needed to calculate pixel offset, but only
+ *     for images that have image_{load,store,size,atomic*} intrinsics
+ *   + kernel params: cl only
+ *   + driver params: these are stage-dependent; see ir3_driver_param
+ *   + TFBO addresses: only for vs on a3xx/a4xx
+ *   + primitive params: these are stage-dependent
+ *       vs, gs: uvec4(primitive_stride, vertex_stride, 0, 0)
+ *       hs, ds: uvec4(primitive_stride, vertex_stride,
+ *                     patch_stride, patch_vertices_in)
+ *               uvec4(tess_param_base, tess_factor_base)
+ *   + primitive map
+ *   + lowered immediates
  *
  * Immediates go last mostly because they are inserted in the CP pass
  * after the nir -> ir3 frontend.



More information about the mesa-commit mailing list