Commit Graph

157403 Commits

Author SHA1 Message Date
Yonggang Luo ae2947fbc5 ci: Building osmesa on OSX
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 6544cf4a2a dri: Trim trailing space in dri/dri_util.*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 9caa6bb71a glx: Convert tab to space in applegl_glx.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 73c51b5c57 util: thread_local doesn't support to be exported on OSX
The linkage error is:
Undefined symbols for architecture x86_64:
  "thread-local wrapper routine for _glapi_tls_Context", referenced from:
      __mesa_GetActiveUniform_impl in libmesa.a(main_uniform_query.cpp.o)

Fixes: a9e2c699aa ("util/c11: Update function u_thread_create to be c11 conformance")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6756

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 7d35d560ac glx: __glX_tls_Context should use __THREAD_INITIAL_EXEC
Error message on OSX:
../src/glx/tests/fake_glx_screen.cpp:101:20: error: thread-local declaration of '__glX_tls_Context' with dynamic initialization follows declaration with static initialization
thread_local void *__glX_tls_Context = &dummyContext;
                   ^
../src/glx/glxclient.h:655:36: note: previous declaration is here
extern __THREAD_INITIAL_EXEC void *__glX_tls_Context;

Fixes: be00a7c8ac ("glx: using C++11 keyword thread_local")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 14bbfee3bc gallium: Disable dri2 interface on OSX
Error message:
Undefined symbols for architecture x86_64:
  "_dri_kms_driver_extensions", referenced from:
      _swkmsCreateNewScreen in libdri.a(dri_util.c.o)
  "_galliumdrm_driver_extensions", referenced from:
      _dri2CreateNewScreen in libdri.a(dri_util.c.o)
ld: symbol(s) not found for architecture x86_64

Fixes: b6f7a4836a ("dri: Fill in the driver extensions for the legacy createNewScreen paths")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6519

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 48e72da0dd gallium: Rename macros HAVE_PIPE_LOADER*
Rename macro HAVE_PIPE_LOADER_DRI to HAVE_DRI
Rename macro HAVE_PIPE_LOADER_KMS to HAVE_DRISW_KMS

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 98fa0c3351 gallium: Do not call to pipe_loader_sw_probe_kms when not present
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 34572042c7 gallium: Move -DHAVE_PIPE_LOADER_DRI and -DHAVE_PIPE_LOADER_KMS to be pre_args
There is non pipe-loader source code depends on it.
After doing this, we found that shared library pipe_swrast depends on libswdri
The error message is:
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'dri_create_sw_winsys'
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'kms_dri_create_winsys'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Eric Engestrom 155c8bc964 ci: add `--print-errorlogs` to `meson test`
In order to avoid having to dig through artifacts to see what failed.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17804>
2022-07-29 12:06:13 +00:00
Karmjit Mahil 661440717a pvr: Fix cdm shared reg usage reported to fw.
For context switching we need to keep track of the max shared regs
used and report that to the fw.

Reported-by: Rajnesh Kanwal rajnesh.kanwal@imgtec.com
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>
2022-07-29 11:37:06 +00:00
Karmjit Mahil e1a0432dd2 pvr: Add compute pipeline barrier handling.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>
2022-07-29 11:37:06 +00:00
Karmjit Mahil b92c40d40a pvr: Add IDF/WDF program for compute pipeline barrier.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>
2022-07-29 11:37:05 +00:00
Karmjit Mahil 6d672e0336 pvr: Add initial vkCmdPipelineBarrier skeleton.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>
2022-07-29 11:37:05 +00:00
Karmjit Mahil c70924b20e pvr: Add static consts to hard coding infra.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>
2022-07-29 11:21:08 +01:00
Karmjit Mahil a278f7d21e pvr: Add static consts support in descriptor pds program.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>
2022-07-29 11:21:04 +01:00
Karmjit Mahil a4830eec53 pvr: Rename uniform pds program to descriptor pds program.
The program will handle more than just DMAing uniforms so renaming
it. E.g. it will handle push constants and compile time static
constants.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>
2022-07-29 11:20:53 +01:00
Eric Engestrom 438d5baa36 turnip: expose support for VK_EXT_acquire_drm_display
Turnip supports VK_EXT_direct_mode_display and can use the common
implementation of AcquireDrmDisplayEXT() & GetDrmDisplayEXT() (which use
wsi->can_present_on_device() that turnip implements).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17768>
2022-07-29 07:49:47 +00:00
Dylan Baker 42b89276e6 iris|anv: gfx version 12.5 data cache flush is not a workaround
This was not a workaround, it was simply missing from the documentation.
So remove the workaround language.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17797>
2022-07-28 22:08:46 +00:00
Dylan Baker 180af73101 anv: add gfx version 12.5 flushes to CCS path
This was already added to the MCS path in !17218, so this is just
adding it in the CCS path as well.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17797>
2022-07-28 22:08:46 +00:00
Kenneth Graunke fc02ce5713 intel/eu: Mark header present in URB memory fences on XeHP
Fixes the following EU validation error:

   ERROR: Header must be present for all URB messages.

The message header is ignored for URB fence messages, so I doubt that
this actually matters in practice.  But we should probably mark it as
present, because you have to send something, and according to the
documentation, there is a message header, it's just ignored.

Fixes: e6a9501aa2 ("intel/fs: Add the URB fence message")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
Kenneth Graunke 986b49a56d intel/eu: Clarify spec citations for XeHP region restrictions
When this rule started causing issues, I looked it up in the
documentation, and found the rule for 64-bit destinations and
integer DWord multiplication, but there was no mention of floating
point destinations, as the text in brackets suggested.  The actual
restriction text had been updated, so this led to some confusion
where I thought the conditions had been changed in newer docs.

However, what's actually going on is that there are two separate
conditions, each listed in separate rows of the table.  One lists
64-bit destinations or integer DWord multiplication, and the other
mentions floating-point destinations.  In both cases, the actual
restrictions are identical, so we handle them together in the code.

Try to update the comment to avoid future confusion.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
Kenneth Graunke 5c88488a64 intel/eu: Fix XeHP register region validation for hstride == 0
Recently, we started using <1;1,0> register regions for consecutive
channels, rather than the <8;8,1> we've traditionally used, as the
<1;1,0> encoding can be compacted on XeHP.  Since then, one of the
EU validator rules has been flagging tons of instructions as errors:

   mov(16)   g114<1>F   g112<1,1,0>UD   { align1 1H I@2 compacted };
   ERROR: Register Regioning patterns where register data bit locations are changed between source and destination are not supported except for broadcast of a scalar.

Our code for this restriction checked three things:

   #1: vstride != width * hstride ||
   #2: src_stride != dst_stride ||
   #3: subreg != dst_subreg

Destination regions are always linear (no replicated values, nor
any overlapping components), as they only have hstride.  Rule #1 is
requiring that the source region be linear as well.  Rules #2-3 are
straightforward: the subregister must match (for the first channel to
line up), and the source/destination strides must match (for any
subsequent channels to line up).

Unfortunately, rules #1-2 weren't working when horizontal stride was 0.
In that case, regions are linear if width == 1, and the stride between
consecutive channels is given by vertical stride instead.

So we adjust our src_stride calculation from

   src_stride = hstride * type_size;

to:

   src_stride = (hstride ? hstride : vstride) * type_size;

and adjust rule #1 to allow hstride == 0 as long as width == 1.

While here, we also update the text of the rule to match the latest
documentation, which apparently clarifies that it's the location of
the LSB of the channel which matters.

Fixes: 3f50dde8b3 ("intel/eu: Teach EU validator about FP/DP pipeline regioning restrictions.")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
Jason Ekstrand 0772242feb intel/eu: Don't throw validation errors on float MOV_INDIRECT
Fixes: 3f50dde8b3 ("intel/eu: Teach EU validator about FP/DP pipeline regioning restrictions.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
Kenneth Graunke 82ee30e558 intel/eu: Handle compaction when inserting validation errors
When the EU validator encountered an error, it would add an annotation
to the disassembly.  Unfortunately, the code to insert an error assumed
that the next instruction would start at (offset + sizeof(brw_inst)),
which is not true if the instruction with an error is compacted.

This could lead to cascading disassembly errors, where we started trying
to decode the next instruction at the wrong offset, and getting lots of
scary looking output:

   ERROR: Register Regioning patterns where [...]
   (-f0.1.any16h) illegal(*** invalid execution size value 6 )      { align1 $7.src atomic };
   (+f0.1.any16h) illegal.sat(*** invalid execution size value 6 )  { align1 $9.src AccWrEnable };
   illegal(*** invalid execution size value 6 )                     { align1 $11.src };
   (+f0.1) illegal.sat(*** invalid execution size value 6 )         { align1 F@2 AccWrEnable };
   (+f0.1) illegal.sat(*** invalid execution size value 6 )         { align1 F@2 AccWrEnable };
   (+f0.1) illegal.sat(*** invalid execution size value 6 )         { align1 $15.src AccWrEnable };
   illegal(*** invalid execution size value 6 )                     { align1 $15.src };
   (+f0.1) illegal.sat.g.f0.1(*** invalid execution size value 6 )  { align1 $13.src AccWrEnable };

Only the first instruction was actually wrong - the rest are just a
result of starting the disassembler at the wrong offset.  Trash ensues!

To fix this, just pass the instruction size in a few layers so we can
record the next offset properly.

Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>
2022-07-28 21:31:45 +00:00
Gert Wollny ce42fc4fa1 virgL: lower fneg and fabs
The host doesn't currently handle source mods on immediate values
correctly, so lower the ops that would create these source mods.

v2: update trace checksum

Fixes:  c5cc9ed29b
    virgl: Switch to nir-to-tgsi by default.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6929

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17765>
2022-07-28 21:20:20 +00:00
Dave Airlie 9ba62ea8fb util/reallocarray: add errno.h include.
Might fix OSX

Fixes: 419b52f1de ("util: add reallocarray wrapper for win32")
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17779>
2022-07-29 06:47:28 +10:00
Eric Engestrom d5dec00e94 docs/ci: fix Emma's name
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17795>
2022-07-28 17:12:37 +00:00
TSnake41 a02c026eb7 zink: print result code string on vulkan failure
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17726>
2022-07-28 16:06:50 +00:00
Gert Wollny 91c0d46afd r600: Don't set TES_EVAL UCP dirty when it is not supported
Fixes: 3340c7ce35
    r600/sfn: lower CLIPVERTEX to clip planes

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17793>
2022-07-28 17:32:27 +02:00
Iago Toral Quiroga 97708505d7 v3dv: expose Vulkan 1.2
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Iago Toral Quiroga 46d43b1ca1 broadcom/ci: update list of slow tests
These showed up in some runs for me.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Iago Toral Quiroga 15bf6d08c5 v3dv: enable missing mandatory Vulkan 1.2 features
For some reason the Vulkan spec required that these features must be
supported even though they only affect features that are optional
in Vulkan 1.2 and that we don't support, so enabling them doesn't
have any practical implications for us.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Iago Toral Quiroga 6a48d38196 v3dv: enable missing Vulkan 1.2 features for supported extensions
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Iago Toral Quiroga 366534768a v3dv: fill in Vulkan 1.2 missing device properties
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Iago Toral Quiroga efb17fc4f1 v3dv: explicitly set sampler min/max filter properties to false
Our hardware doesn't support min/max filtering.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17786>
2022-07-28 11:18:57 +00:00
Eric Engestrom d6986e95d7 docs/features.txt: mark VK_ANDROID_native_buffer as supported on v3dv
Fixes: 2686c5419d ("v3dv: add Android support")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17767>
2022-07-28 10:46:25 +00:00
Eric Engestrom bb75e353e6 docs/features.txt: mark VK_ANDROID_native_buffer as supported on turnip
Fixes: 5789505ab3 ("turnip: Make Android platform build")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17767>
2022-07-28 10:46:25 +00:00
Eric Engestrom 065691e299 nouveau: use existing list_first_entry() macro instead of re-writing it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17772>
2022-07-28 10:10:44 +00:00
Eric Engestrom 2c67457e5e util/list: rename LIST_ENTRY() to list_entry()
This follows the Linux kernel convention, and avoids collision with
macOS header macro.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6751
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6840
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17772>
2022-07-28 10:10:44 +00:00
Danylo Piliaiev a9ebf55d02 turnip: Simple breadcrumbs implementation to debug hangs
A simple implementations of breadcrumbs tracking of GPU progress
intended to be the last resort when debugging unrecoverable hangs.
For best results use Vulkan traces to have a predictable place of hang.

Requires compilation with TU_BREADCRUMBS_ENABLED=1. See tu_cs_breadcrumbs.c
for details on how to use this feature.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15452>
2022-07-28 08:48:39 +00:00
Marek Olšák 83d820973c util/u_threaded: fix a CPU storage crash due to an invalid codepath taken
Fixes: 3df9d8ed80 - gallium/u_threaded: implement pipelined partial buffer uploads using CPU storage

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6837
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6594
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6613

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17556>
2022-07-28 01:11:01 +00:00
Dave Airlie 62207cf885 lavapipe: enable VK_EXT_depth_range_unrestricted.
This passes all the VK CTS tests.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:36:01 +10:00
Dave Airlie 876db77bae llvmpipe/fs: handle unrestricted depth values.
It moves the explicit clamping of incoming Z from vertex stages
after interp, to the depth clamp function.

It adds support to the depth clamp function to restrict incoming
Z values to 0..1 range.

It fixes the depth test conversions to allow unrestricted depth
values.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:36:00 +10:00
Dave Airlie 189755a9ac util/pack_color: clamp depth values outside range for unorm formats.
For unrestricted depth ranges, depth clear values for unorm buffers
need to be explicitly clamped. However this has to happen in the
driver when we know the depth buffer format, not at the API level.

Just add clamps to the non-f32 cases and separate it out.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:35:04 +10:00
Dave Airlie 171e35de91 mesa/st: disable unrestricted fragment depth values for GL/GLES
GLES always clamps for 32-bit float buffers, GL doesn't require
it but setting this per API causes virgl to fail some tests.

To fix is properly we'd need to introduce a CAP to expose
this between host/guest.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:35:04 +10:00
Dave Airlie 0e38db0146 gallium: add a rasterizer state bit for unrestricted depth values.
This tells the drivers to expect depth values outside the 0..1 range.

This is used for support VK_EXT_depth_range_unrestricted, but could
also be used for GL_NV_depth_buffer_float in GL.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:35:04 +10:00
Dave Airlie 7d8942846d llvmpipe: Allocate scene tiles dynamically
If you allocate this statically it's 1.5MB because the framebuffer might
be 16k x 16k, that's excessive.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17746>
2022-07-27 23:00:28 +00:00
Adam Jackson b611195490 llvmpipe: Indentation fix
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17746>
2022-07-27 23:00:28 +00:00
Dave Airlie 419b52f1de util: add reallocarray wrapper for win32
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17746>
2022-07-27 23:00:28 +00:00