panfrost: enable DrawTransformFeedback* This is needed for ARB_transform_feedback2, which I plan on requiring for ES3. Also update docs/features.txt Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6247>
panfrost: XMLify invocations Not so bad :) Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: XMLify primitive information This is grouped as the latter part of the prefix. Some kludges around a magic field for compute jobs that we'll deal with later. (I hope.) Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Drop point sprite from shader key It's not implemented on Bifrost, and not needed on Midgard. For Bifrost this will belong in mesa/st anyway. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Simplify ZSA bind void* casts are implicit. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Use pack for draw descriptor Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Detangle postfix from varying emits Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Inline panfrost_vt_set_draw_info Not happy about the monster routine, but we'll get simplification having everything together. (I hope.) Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Inline panfrost_vt_init Again, we'd like to keep the routines filling out the postfix together, and this has a single remaining caller (once for vertex then immediately for tiler). By keeping them together we can avoid uploading the shared memory/framebuffer structures twice in a row, saving a bit of memory in the process. We also fix a bug where bit 2 of gl_enables is incorrectly set on Bifrost. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Avoid postfix dep for vertex_data We need to thread some extra data through the context but still gets us a bit closer. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Remove postfix parameter from UBO upload Need to signal push constants via a side channel. I tried to disentangle this code, but there are a number of stacked issues here: * We need to upload sysvals. Currently we prefix UBO #0 with sysvals, but this requires a memcpy() of the entire contents of UBO #0. We could create a synthetic UBO instead with sysvals at the end. * We want to push uniforms/sysvals. Currently we push UBO #0 as much as we can, which pushes sysvals automatically by point 1. * We want to optimize out f2f16(uniform). We don't currently handle this. * We want to optimize out uniform-on-uniform/constant operations. Mesa doesn't currently have good support for this. The real solution will look something like: * Create a separate UBO for sysvals. * Let the compiler allocate push constant space as it sees fit ("copy word 12:15 of UBO 1 to word 2:3 of push constant space, as fp16"). * Somehow handle uniform folding when NIR gains support. For now, let's not block the depostfixening. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Separate postfix from emits This is the easy subset, where we have functions that take in a postfix pointer but only to use as a return address. We can use an actual return instead, which is a bit simpler and helps prepare for condensed postfix packing. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
panfrost: Use pack for fragment shaders The heart of the series! Build up all the structures separately and combine with an OPAQUE pack. Groups state naturally and eliminates the memcpy. And a nice cleanup too. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Use preuploaded shader descriptors For non-fragment shaders, we can just use the preuploaded BO as-is and do no packing/copying at draw-time. Fragment shaders are still a bit of an edge case, in having rasterizer/zsa/blend state in the same descriptor, but now we can specialize that path further for fragment-only. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Upload shader descriptors at CSO create Now that we've fixed all the implicit state dependencies, these don't change after the variant is created. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Allocate a state uploader We'd like to uploader some descriptors at CSO time. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Ensure shader-db state is zero-initialized Otherwise the next commit will invoke undefined behaviour. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Derive UBO count from shader_info Rather than checking against the bound constant buffers. Like with num_textures, this eliminates a dependency of the shader descriptor on the context, which matters especially for vertex/compute shaders. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
panfrost: Share tiler_heap across batches/contexts There's only one tiler, so this is safe. (The blob does the same optimization.) This avoids allocating multiple heaps for multiple batches, which wastes memory and CPU time. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
panfrost: Hoist assert from bind to create Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6327>