From efaffcfbd49ed9bda155b8776bb91dcba4ba47ff Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 17 Mar 2023 22:57:25 -0400 Subject: [PATCH] nir: Add more system values for lowering XFB Add more system values for XFB. This should be good enough for lowering GL3.1 + transform_feedback2 + transform_feedback3. More will probably be needed for geom/tess but that will be easier to work with when I'm actually bringing up geom/tess. At any rate, we're splitting out XFB from the rasterization pipeline and since XFB happens only in the last shader pre-rasterization stage, VS+XFB is an orthogonal problem from e.g. VS+GS+XFB. Yeah, the combinatorics suck. These will be used by Asahi, and hopefully eventually Panfrost. Signed-off-by: Alyssa Rosenzweig Acked-by: Jesse Natalie Part-of: --- src/compiler/nir/nir_intrinsics.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 7474afb87a8..3c194ad7ea5 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -864,8 +864,15 @@ system_value("scratch_base_ptr", 0, bit_sizes=[32,64], indices=[BASE]) system_value("constant_base_ptr", 0, bit_sizes=[32,64]) system_value("shared_base_ptr", 0, bit_sizes=[32,64]) system_value("global_base_ptr", 0, bit_sizes=[32,64]) -# Address of a transform feedback buffer, indexed by BASE +# Address and size of a transform feedback buffer, indexed by BASE system_value("xfb_address", 1, bit_sizes=[32,64], indices=[BASE]) +system_value("xfb_size", 1, bit_sizes=[32], indices=[BASE]) + +# Address of the associated index buffer in a transform feedback program for an +# indexed draw. This will be used so transform feedback can pull the gl_VertexID +# from the index buffer. +system_value("xfb_index_buffer", 1, bit_sizes=[32,64]) + system_value("frag_size", 2) system_value("frag_invocation_count", 1)