Commit Graph

135276 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 856f0abd2b pan/{mdg, bi}: Lower load_sample_pos
Conceptually same lowering as the DDK, although we're missing a number
of relevant compiler optimizations so the generated code is awful.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 00c1d5da34 pan/{mdg, bi}: Lower load_helper_invocation
Passes dEQP-GLES31.functional.shaders.helper_invocation.* on both
architectures

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 00df274586 pan/bi: Implement coverage mask updates
Impressive how simple this looks after dozens of patches of
sysval-related prepwork :)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig ae8b1fa7db pan/bi: Decouple sysval loading from NIR
Useful for builder-based sysvals.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 1e7b5f3826 pan/bi: Implement nir_intrinsic_load_sample_positions_pan
Just copy the FAU result.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig ca0f50ec6a pan/bi: Implement load_sample_mask_in
Preloaded.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 92569f5d6e pan/bi: Fix gl_SampleID read
Fixes dEQP-GLES31.functional.shaders.sample_variables.sample_id.default_framebuffer

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 56240f6e85 pan/bi: Lower ifind_msb
We have ufind_msb efficient, implement in terms of that.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig ad06e0592a pan/bi: Implement ufind_msb
Lowered to #(sz - 1) - clz(x), taking advantage of the machine's
8-bit and 16-bit variants of clz and the widening on the second argument
of ISUB to implement neatly in two instructions.

Note that in NIR, ufind_msb can take any integer type but always output
i32.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Alyssa Rosenzweig 2ef97a079a pan/bi: Implement bitfield_reverse
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:31 -05:00
Boris Brezillon 06d6dd1b40 pan/bi: Support bit_count()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Boris Brezillon 58e887f07e pan/bi: Add uclz() support
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 72c6173a85 pan/bi: Lower bitfield inserts/extracts
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig b0551cb0c2 pan/bi: Implement texture gathers
Passes all of dEQP-GLES31.functional.texture.gather.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig ab9650d5aa pan/bi: Remove redundant TEXC opcode check
Already checked in emit_tex

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 1079d7ccd6 pan/mdg: Lower stores from helpers
Required for correct behaviour of SSBOs in fragment shaders on Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 3c44671df3 pan/mdg: Stub load_barycentric_sample
Now parity with Bifrost for not failing over these intrinsics.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 4a2f128985 pan/mdg: Lower ufind_msb, poorly
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 36248dd448 pan/mdg: Implement uclz
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 887e391447 pan/mdg: Rename bitcount8 to popcnt, fixing the unit
Still doesn't seem to work correctly for negative values.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig e55af16bfe pan/mdg: Lower bitfield instructions
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 94b6d4e0ed pan/mdg: Remove unused pack_unorm_4x8 lowering
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:30 -05:00
Alyssa Rosenzweig 954623856c pan/mdg: Assert on bad 64-bit swizzle in disassembly
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 97a85c1071 panfrost: Add MULTISAMPLED sysval
To be used with Bifrost coverage mask updates.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 9f55657366 panfrost: Overhaul sysval handling
Don't preassign.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 4086b8980d panfrost: Implement get_sample_position
Easy now that we have the table.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig b01df1f9bf panfrost: Advertise MSAA 8x and 16x
On Bifrost. Could support Mali T760+ with additional debug.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 072cc5d5f1 panfrost: Ensure open_device has pandecode initialized
Requires reordering some calls.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig dd3bda22f4 panfrost: Use sample location LUT
Fixes multisampling issues on Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig a61fb62966 panfrost: Upload sample positions on device init
Needed to correctly implement multisampling on Bifrost, and used in
gl_SamplePosition  implementation on Midgard. These are architecturally
invariant, so it's fine to hard code.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 376c3fa4db panfrost: Set sample count/pattern for tiler FBD
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 555c17e2c6 panfrost: Remove batch_is_scanout
Unused since last commit.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 1a6fc40b99 panfrost: Remove PAN_REQ_DEPTH_WRITE
No consumers, garbage collect the whole thing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 37050ad62a panfrost: Remove PAN_REQ_MSAA
Neglible win for draw time overhead.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 1439f8db12 panfrost: Don't use PAN_REQ_MSAA in SFBD
We can also generalize a bit to eliminate the state dependence.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 7b5aa5fbf2 panfrost: Don't set REQ_MSAA in pan_mfbd
No remaining consumer.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig ccce5b922f panfrost: Generalize MSAA handling
This uses the framebuffer MSAA state directly and will generalize to
MSAA 8x/16x when somebody gets around to it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig bea7839c1e panfrost: Set tiler descriptor sampler pattern
Bifrost requires this to match the framebuffer descriptor's sample
pattern, but we were leaving the default (single-sampled)
unconditionally, leading to undefined behaviour.

It is unknown if this fixes any user-visible bugs, but without the
commit the descriptor is likely out-of-spec.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: 21.0 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig b08100fb96 panfrost: Add panfrost_sample_pattern helper
We always use rotated grids to preserve current behaviour.

Cc stable as it is required for the next commit. If deemed too invasive,
a simpler fix could be backported.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: 21.0 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig b6ad375bdf panfrost: Respect info.fs.uses_sample_shading
Now that this is a link-time property.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:29 -05:00
Alyssa Rosenzweig 55f8df6d36 panfrost: Refactor sample shading state
Moves the decision to evaluate per-sample to link time instead of
draw-time, with an explicit property. No functional change.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig 56bf3086fc panfrost: Push sample positions sysval for Midgard
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig beb7d66056 panfrost: Add sample positions sysval
For Midgard. On Bifrost, the hardware pushes this directly to FAU.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig f782983cfb panfrost: Preload sample mask if needed
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig 9d682ad7f9 pan/decode: Only print local storage for vertex jobs
It's convenient to group this with the framebuffer, but the other fields
are unused by the hardware for vertex jobs. They _are_ used for tiler
jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig b27d0164ee pan/decode: Cleanup sample locations decode
We know what this is now. I opted to leave it in ~fixed-point format to
avoid bikeshedding over precision.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Alyssa Rosenzweig 2afdcc187b nir: Add sample_positions_pan intrinsic
Facilites the gl_SamplePosition lowering on Bifrost, where the sample
positions are accessed directly in a packed in-memory format.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
2021-02-12 16:44:28 -05:00
Kenneth Graunke e7dc48c309 iris: Make a pin_scratch_space() helper
We need to (re-)pin the scratch buffer in four different places, and
it's going to get slightly more complicated on future platforms.  So,
make a helper function, allowing us to add the complexity in one spot.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9023>
2021-02-12 21:14:26 +00:00
Hoe Hao Cheng 93ff47eb19 zink: enable KHR_shader_draw_parameters on Vulkan <1.2
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021>
2021-02-12 21:04:24 +00:00
Hoe Hao Cheng efe6f00e34 zink/codegen: do not enable extensions that are now core
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021>
2021-02-12 21:04:24 +00:00