Commit Graph

12 Commits

Author SHA1 Message Date
Alyssa Rosenzweig b7af56f2ad panfrost: Add blend helper packing the equation
This is more convenient for the Gallium driver and easier to test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Alyssa Rosenzweig 7eb2559198 panfrost: Use _PU for non-dithered formats
This is required to disable dithering on a per-draw basis when OPAQUE
output is used (bypassing the blender which normally uses the
round_to_framebuffer_precision flag to do the same).

This functionally reverts:

   ebc07f4b2f ("panfrost: Remove padded unorm blendable formats")
   fae90a7940 ("panfrost: Always pick dithered tb formats")

while adding the functionality to make them useful.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12152>
2021-08-11 18:15:52 +00:00
Boris Brezillon 6d2ed635c3 panfrost: Constify the constants pointers passed to pan_blend functions
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11139>
2021-06-22 14:07:33 +00:00
Alyssa Rosenzweig 9ad1403747 panfrost: Remove unused dither flag
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig d7590efd25 panfrost: Fix pan_blend_to_fixed_function_equation prototype
Doesn't need the whole state, just the equation itself.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig b2affb6cc5 panfrost: Fix blend fixed-function prototype
Needs to be broken up into different functions for disjoint state.
Simpler prototypes and allows matching to CSOs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 5d3e2b5e9e panfrost: Fix blend constant fetch prototype
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig c35194b945 panfrost: Fix is_opaque prototype
Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig a0592066b0 panfrost: Fix the reads_dest prototype
Takes too much state, only pass what we need.

Fixes: 93824b6451 ("panfrost: Move the blend logic out of the gallium driver")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>
2021-05-18 22:51:56 +00:00
Alyssa Rosenzweig 93a176b6cf panfrost: Key blend shaders to the input types
On Bifrost, fragment shaders might output either FP16 or FP32. The blend
shader will access the output as-is within the register, so depending on
the precision of the blend shader's logic, it may need to insert a
f2f16 or f2f32 conversion. This requires expanding the blend shader key.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Boris Brezillon bbff09b952 panfrost: Move the blend shader cache at the device level
So we can re-use it in the Vulkan driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831>
2021-03-29 06:53:50 +00:00
Boris Brezillon 93824b6451 panfrost: Move the blend logic out of the gallium driver
Most of it is API-independent, so let's move it out of the gallium
driver so it can be shared with the Vulkan driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8963>
2021-02-15 11:23:46 +00:00