Commit Graph

47054 Commits

Author SHA1 Message Date
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
Kenneth Graunke 03df494ea4 mesa: Mark render-to-texture as unsafe if there's no pipe_resource
Let's be slightly more defensive here.  If a texture image doesn't have
an associated pipe_resource allocated, then render_texture() will pass
that along to _mesa_update_renderbuffer_surface(), which will crash on a
NULL pointer dereference.  So, if there isn't a pipe_resource, then we
should just skip this altogteher.

Today, this isn't an issue, because each gl_texture_image always
allocates a pipe_resource up front.  On a branch of mine, I prototyped
some improvements to the compressed texture fallback handling, where it
would defer resource allocation, examine the source image's block data,
and dynamically select a format based on that, then allocate it later.

With that prototype in place, we saw crashes the Android "My Talking
Tom" series of games, which appear to be attaching ASTC textures to a
framebuffer color attachment.  That FBO would be incomplete anyway, as
ASTC textures aren't renderable, but we got into a situation where the
render-to-texture code was crashing due to the lack of pt before it
could properly signal that it was incomplete and bailing.

Technically, we don't need this now, but I figure that being defensive
won't hurt and this would probably save whoever encounters such an issue
in the future a bunch of frustrating debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17508>
2022-07-26 18:38:43 +00:00
Adam Jackson 295a8b4464 mesa: Remove Purgeable fields from texture/buffer/renderbuffer objects
These are unused since !17425.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17745>
2022-07-25 16:28:40 -04:00
Emma Anholt f075376823 glsl: Use the same NIR path for shared mem lowering as SPIRV does.
Now that we have no non-NIR drivers, we can retire the old code.  We just
need to pass the variable accesses through to it.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17610>
2022-07-20 19:32:48 +00:00
Mike Blumenkrantz 48491386ff mesa/st: add implicit zeroing of clipdistance array
GL drivers have an implicit default of "in bounds" for unwritten clipdistance
values, but some (layered) drivers have to deal with api mismatch which
prevents that implicit value from being used after the shader
gets mangled by various compiler passes

to avoid issues here, write out all members of the clipdistance array
with zeroes at the very start of the shader such that any values the
shader actually writes will naturally overwrite the implicit zero and
any unwritten values will now be written as zero

fixes #6845

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17498>
2022-07-18 20:33:11 +00:00
Emma Anholt c7c265892a mesa/arbprog: Stop doing optimization in the ARB program IR.
You'll get all this and more anyway once you're in NIR.  This lets us GC a
bunch more ARB program transformation code.

No effect in shader-db on softpipe.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>
2022-07-16 04:08:32 +00:00
Emma Anholt c13dbf6ae9 mesa/arbprog: Use nir_lower_io_to_temporaries.
This replaces our mesa_remove_output_reads(), which in turn GCs some other
ARB program transformation code.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>
2022-07-16 04:08:32 +00:00
Emma Anholt 153f7b8852 mesa/arbprog: Move the GLSLFragCoordIsSysVal handling to prog_to_nir.
We don't need to go grubbing around in the ARB program when we can use the
right variable type at prog_to_nir time.  This does leave
fp->system_values_read/inputs_read as they were, but I don't see anywhere
that that matters (the NIR will have its info gathered appropriately, and
other lowering may also cause mismatch between the gl_program and the
NIR).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17528>
2022-07-16 04:08:32 +00:00
Mike Blumenkrantz 3ff058ed0b mesa: update GL_CLAMP emulation when binding/unbinding textures
binding/unbinding a texture affects the previously specified parameters,
so ensure the driver flag for clamp emulation is also set to perform
updates as needed

Fixes: e8f71f6ac4 ("mesa/st: add PIPE_CAP_GL_CLAMP")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
2022-07-15 18:58:15 +00:00
Mike Blumenkrantz 068239dad0 mesa: track which sampler wrap params use GL_CLAMP
this adds a bitmask to sampler objects for tracking whether GL_CLAMP
is active

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
2022-07-15 18:58:15 +00:00
Mike Blumenkrantz c17bfc5309 mesa: move is_wrap_gl_clamp() to samplerobj.h and deduplicate
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17459>
2022-07-15 18:58:15 +00:00
Jesse Natalie acba2bbb0e gallium, mesa: Support setting timeline semaphore values
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie cd01e71999 mesa: Implement ImportSemaphoreWin32NameEXT
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie c760f0e8b8 mesa: Support importing D3D12 fences as timeline semaphores
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 7c4fa79bfa gallium: Add 'name' field to Win32 semaphore import
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 51408dfec4 mesa: Implement ImportMemoryWin32NameEXT
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 8f11c0553c mapi: Add more EXT_external_objects_win32 functions/enums
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 78ba74cfda mesa: Support D3D11/D3D12 memory imports
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Emma Anholt 0f37e3c339 mesa: Fix the error check for VertexAttrib*.
It was checking "mesa's theoretical max attributes" rather than "the
driver's max attributes."

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>
2022-07-12 17:15:43 +00:00
Nanley Chery a07919edeb mesa: Follow ASTC decode mode extension for RGBA8 output
The GL extension, EXT_texture_compression_astc_decode_mode, enables
applications to specify the desired decoding precision when decoding
non-sRGB ASTC textures. The options for the channels are FP16 (the
default), UNORM8, and RGB9_E5.

The ASTC LDR decoder outputs to UNORM8 by doing the following
conversions: UNORM16 -> FP16 -> UNORM8. This doesn't seem to be defined
by any specification and is costly according to perf profiles. To
conform to the decode mode spec (and for better performance), we convert
UNORM16 to UNORM8 by simply storing/keeping the top 8 bits.

In a texture upload microbenchmark, this decreases the upload time for
textures in the linear color space by about 34%.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17195>
2022-07-11 21:59:42 +00:00
Nanley Chery dab0936141 mesa: Simplify UNORM8 conversions for sRGB ASTC textures
The ASTC extension specs state that a vector of UNORM8 values are
returned when decoding sRGB ASTC textures. For the alpha channel
however, they don't seem to specify how to get there from the UNORM16
produced after interpolation (or returned from a void-extent block).

The ASTC decoder in the VK-GL-CTS project treats the alpha channel like
the RGB channels and simply uses the top 8 bits of the UNORM16. For
better performance, we choose to do the same.

In a texture upload microbenchmark, this decreases the upload time for
textures in the sRGB color space by about 13%.

Ref: https://gitlab.khronos.org/egl/DataFormat/-/merge_requests/32
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17195>
2022-07-11 21:59:42 +00:00
Adam Jackson 81b0862642 mesa: Stub out GL_APPLE_object_purgeable
There's slots in the glapi static dispatch table (which is still
arguably ABI) which we need to preserve, but we can stop exposing the
extension string or doing anything in the added functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17425>
2022-07-11 16:37:34 -04:00
Mike Blumenkrantz 21b3a23404 mesa: fix SignalSemaphoreEXT behavior
the EXT_external_object spec originally was underspecified with regards
to this function, leaving room for synchronization errors where:
* app calls SignalSemaphoreEXT to signal a semaphore
* mesa defers pipe_context::fence_server_signal with threaded context
* driver defers gpu submission
* SignalSemaphoreEXT has long since returned, app submits vk cmdbuf waiting on semaphore
* spec violation / device lost

to prevent this, the spec is being changed to:
1) require an implicit flush when calling SignalSemaphoreEXT
2) require that this implicit flush also forces GPU submission before SignalSemaphoreEXT returns

all affected drivers have been updated

fixes #6568

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17376>
2022-07-10 16:15:17 +00:00
Emma Anholt 421aa5dfac mesa/st: Disable OES_texture_3D for PIPE_CAP_MAX_TEXTURE_3D_LEVELS==0.
This will be used for vc4, where incorrectly exposing 3D textures accounts
for most of the GLES2 conformance failures it has.  This leaves
EXT_texture3d exposed in the (already non-conformant) GL2.1 support it
exposes, which has always been a best-effort thing.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17350>
2022-07-10 02:50:09 +00:00
Marek Olšák 2f01a22fe4 util: remove our redefinition of assert
I think we can all agree that our own assert is unnecessary.

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

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:34 +00:00
Jason Ekstrand b2ab6d10e4 mesa,glsl,ttn: Set subgroup_size to UNIFORM
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
2022-07-08 22:47:22 +00:00
Mike Blumenkrantz c4e18cd4dd mesa/st: add PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO
this is for drivers (like freedreno) which need the format in the sampler
state in order to accurately handle border colors

when set, drivers MAY receive a format in the sampler state if the frontend
supports it (e.g., nine does not), and the cso sampler cache will include
the format member of the struct

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17189>
2022-07-07 20:39:30 +00:00
Mike Blumenkrantz ad0ee7ad42 mesa/st: make get_sampler_view_format() public
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17189>
2022-07-07 20:39:30 +00:00
Pierre-Eric Pelloux-Prayer 5791826b1a mesa: skip draws with invalid indices offset
It's easy to misuse glDrawElements and end up with an
invalid indices offset.
Since this can cause a hang, detect this case and skip
the draw.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6625
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16662>
2022-07-07 12:25:05 +00:00
Pierre-Eric Pelloux-Prayer 8856379a03 mesa/st: don't guess the internal format if it's known
This fixes tests using imageLoad/imageStore on texture
created using glEGLImageTargetTexture2DOES.

Before this change, the format was guessed as GL_RGBA,
which would be rejected by _mesa_get_shader_image_format.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16662>
2022-07-07 12:25:05 +00:00
Mike Blumenkrantz 0070dd2fa9 mesa: remove incomplete texture warning
ETOOSPAMMY

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17362>
2022-07-06 15:35:46 +00:00
Jason Ekstrand a307bc8556 mesa/bptc: Use util_sign_extend
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17214>
2022-07-06 11:23:18 +00:00
Timothy Arceri 4e797ac530 st/glsl: fix broken vertex attrib mapping
Here we move the nir_get_single_slot_attribs_mask() call that sets the
inputs_read mask after NIR optimisations have finished and after
st_nir_assign_vs_in_locations() has been called.

Besides fixing a bug where the mappings would be missaligned if
further NIR optimisations resulted in less inputs being read, it
also allows us to drop an additional nir gather info call.

Fixes: 0909a57b63 ("radeonsi/nir: Set vs_inputs_dual_locations and let NIR do the remap")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6240

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17326>
2022-07-04 03:33:38 +00:00
Connor Abbott 75724fe119 mesa/st: Fix border color type for stencil sampling
When the stencil aspect of a depth+stencil texture is sampled, it's
actually integer. Also fixup st_translate_color() that assumed it was
float. This fixes the border color on zink+turnip.

v2: Add "|| texBaseFormat == GL_STENCIL_INDEX" to catch the case where
S8 is emulated as D24S8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17177>
2022-06-29 03:00:56 +00:00
Timothy Arceri 5f686bfc85 util: add dri config option to disable GL_MAP_UNSYNCHRONIZED_BIT
GL_MAP_UNSYNCHRONIZED_BIT depends on the app having its threading
handled correctly. This allows us to force disable the bit when
they get it wrong.

CC: 22.1 22.0 <mesa-stable>

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17199>
2022-06-24 00:29:24 +00:00
Mike Blumenkrantz 90586f812c mesa: explicitly disallow multiple pointsize exports from generating
for the fixedfunc vertex case this is important since the fixedfunc shader
may have already added an (attenuated) pointsize

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
2022-06-22 13:27:29 +00:00
Mike Blumenkrantz 096c5aa34a mesa: enforce pointsize exports if pointsize is being clamped
min/max pointsize clamping affects the value that must be used,
meaning that it may not be 1.0

in the case where clamping changes the value from 1.0, ensure the shader
export path is used if attenuation isn't enabled

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
2022-06-22 13:27:29 +00:00
Mike Blumenkrantz 3e2c132eb8 mesa: skip pointsize exports if pointsize attenuation is enabled
attenuation has its own method of exporting pointsize in fixedfunc shaders,
so ensure the attenuated size isn't overwritten

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
2022-06-22 13:27:29 +00:00
Mike Blumenkrantz de732cf61b mesa: rename PointSizeIsOne -> PointSizeIsSet
this will better convey the meaning of the value

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
2022-06-22 13:27:29 +00:00
Mike Blumenkrantz b2155a044d mesa: break out PointSizeIsOne setting to util function
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17145>
2022-06-22 13:27:29 +00:00
Pavel Asyutchenko 41f22a1823 gallium: add PIPE_CAP_FBFETCH_ZS and expose extension
st/mesa will expose GL_ARM_shader_framebuffer_fetch_depth_stencil
if this new capability is supported by the driver.

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13979>
2022-06-22 04:32:44 +00:00
Mike Blumenkrantz 9ca0c0b4b4 mesa/st: increment num_uniforms for hw accel select shaders
this otherwise breaks nir_lower_uniforms_to_ubo() and probably lots
of drivers

Fixes: 9b22ab4167 ("mesa/st: implement hardware accelerated GL_SELECT")

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17092>
2022-06-18 20:18:18 +00:00
Mike Blumenkrantz 371660b877 mesa/st: add PIPE_CAP_DITHERING
this is for drivers like zink that may or may not
handle dithering and so getting blend state changes
when this state changes isn't useful

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17043>
2022-06-18 17:56:28 +00:00
Andres Calderon Jaramillo cd04679a08 mesa/st: Account for YUV color space and range.
This patch plumbs the YUV color space and range provided through
EGL_EXT_image_dma_buf_import all the way to nir_lower_tex().

NIR already accounts for the YUV color space courtesy of commit
d8fdb8da. However, the color space was wired only for i965/i915 (see
6c11a799) and not for Gallium.

Tested-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16651>
2022-06-17 17:25:44 +00:00
Ken Johnson 2866ae32da mesa/main: Correct alloca() use without #include "c99_alloca.h"
Fixes: d231f95591 ("mesa: add hw select name stack code path")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17073>
2022-06-17 14:24:47 +00:00
Qiang Yu fd27d5157f gallium: disable hardware select for crocus
piglit select tests fail, so add a gallium cap to disable
for crocus explicitly.

crocus may choose to enable hardware select only for GPU
SKU which tested to be OK again.

Fixes: 6489af145c ("mesa: enable HardwareAcceleratedSelect")
Closes: #6644

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16955>
2022-06-15 03:01:58 +00:00
Jesse Natalie c378bbab75 mesa: Use C11 alignas for cross-platform SSE support
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>
2022-06-14 15:08:38 +00:00
Emma Anholt cf265c6606 nir: Rename is_arb_asm to use_legacy_math_rules and document its meaning.
On iris and crocus, this flag is used to set "alt mode" math on the shader
as a whole.  Some other drivers have a similar mode for DX9/ARB-program
behavior, so document what it does so we can start using it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16176>
2022-06-10 03:26:32 +00:00
Emma Anholt d2677cb6d7 mesa/st: Abort the linking on driver link failure.
If the driver said it can't do the shader, then listen to it and don't ask
it to create the shaders anyway.  Fixes a bunch of spam on i915/r300 (with
!16878) about unsupported opcodes during dEQP runs.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16895>
2022-06-09 22:28:01 +00:00
Alyssa Rosenzweig e749f67f89 mesa,gallium: Make point coord origin a CAP
When lower_wpos_pntc is used, the state tracker inserts code to
transform gl_PointCoord.y according to a uniform, to account for
API-requested point coordinate origin and framebuffer orientation. With
the transformation, driver-supplied point coordinates are expected to
have an upper left origin.

If the hardware point coordinate supports (only) a lower left origin,
the backend has to use lower_wpos_pntc and then lower *again* to flip
back. This ends up transforming twice, which is wasteful:

   a = load point coord Y with lower left origin
   a' = 1.0 - a
   a'' = uniform_transform(a')

However, lower_wpos_pntc is quite capable of transforming for a lower
left origin too, it just needs to flip the transformation. Add a CAP
specifying the point coordinate origin convention, rather than assuming
upper-left. This simplifies the Asahi code greatly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16829>
2022-06-08 14:10:50 +00:00