mesa/src/gallium/drivers/virgl
Roland Scheidegger 92550b106c llvmpipe: fix incorrect scissor planes
The scissor planes we were setting up did not actually correspond to scissor
with widths / heights being a multiple of full pixels, rather they had an
excess width / height of (nearly) half a pixel (at the x0 and y0 edges).
(Note it's not an actual scissor as in graphics APIs terms, it's the
intersection of fb/viewport/scissor.)
Without multisampling that was still fine (since we always test at pixel
center) however vk cts complained (for some reason only when using 8 samples
(not announced by lavapipe yet) - no idea why it doesn't fail when using 4
samples), in tests such as
dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_17_1.samples_8.s8_uint.depth_zero_stencil_zero_testing_stencil_samplemask,
which uses scissor and noted that the result for some pixels which are outside
the rendering area don't contain the clear color. And actually a llvmpipe
test was failing as well.

There is in fact no need for separate adjustments for msaa at all, as long
as we ensure that x0, y0, x1, y1 all are exactly on their respective plane
edges (inclusive for x0/y0, exclusive for x1/y1). So the logic is mostly
reverted to what it was before this was adjusted for msaa (albeit the original
code then had an excess adjustment of nearly a full pixel at the x0 and y0
edges which is probably why it didn't work for msaa).

Fixes a couple cases of clip-and-scissor-blit tests in llvmpipe and various
other drivers hitting this indirectly. Interestingly though not quite all cases
are fixed and even more odd is that not exactly the same cases are fixed for
all drivers, so maybe there's more to it (need to respect bottom_edge_rule or
something similar?)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37181>
2025-09-20 01:57:04 +00:00
..
ci llvmpipe: fix incorrect scissor planes 2025-09-20 01:57:04 +00:00
tests mesa: stop using inc_mesa in most places that have nothing to do with GL 2025-08-06 20:35:26 +00:00
meson.build mesa: stop using inc_mesa in most places that have nothing to do with GL 2025-08-06 20:35:26 +00:00
virgl_buffer.c
virgl_context.c gallium: add pipe_context::resource_release to eliminate buffer refcounting 2025-09-09 20:47:38 +00:00
virgl_context.h all: rename PIPE_SHADER_TYPES to MESA_SHADER_STAGES 2025-08-06 10:28:39 +08:00
virgl_driinfo.h.in freedreno/loader: Switch over to probe_nctx 2024-05-23 20:02:04 +00:00
virgl_encode.c all: rename pipe_shader_type to mesa_shader_stage 2025-08-06 10:28:40 +08:00
virgl_encode.h all: rename pipe_shader_type to mesa_shader_stage 2025-08-06 10:28:40 +08:00
virgl_public.h
virgl_query.c virgl: Implement PIPE_QUERY_GPU_FINISHED 2024-02-05 08:41:23 +00:00
virgl_resource.c virgl: Allow importing resources without known templ 2024-02-05 08:41:23 +00:00
virgl_resource.h
virgl_screen.c pipe: Remove PIPE_VIDEO_CAP_PREFERS/SUPPORTS_INTERLACED 2025-09-10 12:33:57 +00:00
virgl_screen.h all: rename pipe_shader_type to mesa_shader_stage 2025-08-06 10:28:40 +08:00
virgl_staging_mgr.c virgl: Fix compilation on MSVC 2024-02-05 08:41:22 +00:00
virgl_staging_mgr.h virgl: Fix compilation on MSVC 2024-02-05 08:41:22 +00:00
virgl_streamout.c gallium: pass XFB primitive mode to set_stream_output_targets 2024-12-20 08:22:52 +00:00
virgl_texture.c virgl: Fix compilation on MSVC 2024-02-05 08:41:22 +00:00
virgl_tgsi.c all: rename PIPE_SHADER_FRAGMENT to MESA_SHADER_FRAGMENT 2025-08-06 10:28:39 +08:00
virgl_transfer_queue.c util: import pipe_box and its helpers 2024-04-22 01:42:52 +00:00
virgl_transfer_queue.h
virgl_video.c pipe/video: Remove st_rps_bits and UseStRpsBits 2025-05-12 13:12:05 +00:00
virgl_video.h virgl/video: Add support for H.264 encoding 2022-11-18 07:46:11 +00:00
virgl_winsys.h all: rename PIPE_SHADER_TYPES to MESA_SHADER_STAGES 2025-08-06 10:28:39 +08:00