Dave Airlie [Thu, 19 Mar 2020 05:40:31 +0000 (15:40 +1000)]
llvmpipe: add per-sample interpolation.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 05:24:11 +0000 (15:24 +1000)]
llvmpipe: add centroid interpolation support.
This just adds the implementation and API to the interpolation builders.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:41:22 +0000 (14:41 +1000)]
llvmpipe: pass interp location into interpolation code.
This just tracks the attribute interpolation location into the
interp code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:25:25 +0000 (14:25 +1000)]
nir/tgsi: translate the interp location
translate sample and centroid locations.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:10:31 +0000 (14:10 +1000)]
gallivm: add mask api to force mask
For per-sample shading the mask needs to be forced for each
iteration of the fragment shader.
Just adds the API for now.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Thu, 19 Mar 2020 04:04:47 +0000 (14:04 +1000)]
gallivm: add sample id/pos intrinsic support
The sample position is looked up in an incoming array using the
sample id.
(These are mostly for ARB_sample_shading support)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:44:40 +0000 (08:44 +1000)]
llvmpipe: add cbuf/zsbuf + coverage samples to the fragment shader key.
These will cause different fragment shaders to be generated.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:23:10 +0000 (08:23 +1000)]
llvmpipe: change mask input to fragment shader to 64-bit.
In order to handle a 4xMSAA mask (16-bits per sample) increase
the fragment shader API to be 64-bit.
v2: drop pointless if (Roland)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:11:31 +0000 (08:11 +1000)]
llvmpipe: add multisample bit to fragment shader key.
The fragment shader needs to be regenerated when multisample changes.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 22:09:22 +0000 (08:09 +1000)]
llvmpipe: plumb multisample state bit into setup code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 05:28:02 +0000 (15:28 +1000)]
llvmpipe/rast: fix tile clearing for multisample color and depth tiles
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 05:09:37 +0000 (15:09 +1000)]
llvmpipe: record sample info for color/depth buffers in scene
This adds the nr_samples + sample_stride to the scene records
for cbufs and zsbuf.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 7 Apr 2020 23:49:47 +0000 (09:49 +1000)]
llvmpipe: pass color and depth sample strides into fragment shader.
This just adds the interface and passes the depth and sample strides
into the fragment shader, nothing uses them yet.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:51:24 +0000 (13:51 +1000)]
draw: disable point/line smoothing for multisample (v2)
When MSAA is enabled smoothing is ignored
v2: As pointed out by Roland I got this completely wrong,
fix this to work the other way
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 24 Mar 2020 06:18:46 +0000 (16:18 +1000)]
llvmpipe: handle multisample render target clears
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:37:07 +0000 (13:37 +1000)]
llvmpipe: add clear texture support for multisample textures.
This adds the clear paths for multisample textures.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:36:36 +0000 (13:36 +1000)]
llvmpipe: add multisample resource copy region support.
This allows direct copies of all samples between two resources.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:34:33 +0000 (13:34 +1000)]
llvmpipe: add internal multisample texture mapping path.
For clearing and copying textures llvmpipe needs to internally
access the per-sample data.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:21:48 +0000 (13:21 +1000)]
llvmpipe: pass incoming sample_mask into fragment shader context.
This links up the api changing the sample mask to passing it into
the fragment shader.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:06:30 +0000 (13:06 +1000)]
llvmpipe/jit: pass fragment sample mask via jit context.
The incoming sample mask for the fragment shader can be passed
via the jit context
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 03:04:01 +0000 (13:04 +1000)]
llvmpipe: add get_sample_position support (v2)
This just adds the sample values for 4xmsaa, and hooks them
up to the get_sample_position API
v2: move to vulkan standard sample positions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 02:55:31 +0000 (12:55 +1000)]
llvmpipe: fix race between draw and setting fragment shader.
There is a race with u_blitter shaders + pipeline shaders (aaline/aapoint)
where the draw bind can cause a pipeline flush which can use bind_fs_state to
be reenters and llvmpipe->fs gets the wrong value. Fix this by only
setting the llvmpipe->fs value after the draw binding is complete.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 02:46:02 +0000 (12:46 +1000)]
gallium/util: split out zstencil clearing code.
llvmpipe will want to reuse this for it's multisample clears.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:50:49 +0000 (10:50 +1000)]
llvmpipe: add a max samples define set to 4.
I doubt I'll care about much higher MSAA levels, so 4 it is.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:30:13 +0000 (10:30 +1000)]
llvmpipe: add multisample support to texture allocator.
This adds a sample stride field and allocates enough memory for
each sample storage. Hook up the sample_stride field to draw
and jit textures and images
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 30 Dec 2019 21:03:26 +0000 (07:03 +1000)]
util: add a resource wrapper to get resource samples
This return 1 as a baseline and should be used in allocator paths.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:11:37 +0000 (15:11 +1000)]
llvmpipe: add samples support to image jit
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:22:49 +0000 (10:22 +1000)]
llvmpipe: add num_samples/sample_stride support to jit textures
This adds the support for num_samples/sample_stride retrieval to the
jit texture infrastructure.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:07:11 +0000 (15:07 +1000)]
draw: add support for num_samples + sample_stride to the image paths
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Tue, 10 Mar 2020 00:15:21 +0000 (10:15 +1000)]
draw: introduce sampler num samples + stride members
This adds the num samples + sampler stride into the texture mapping paths,
currently drivers just pass 0 for now.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:15:51 +0000 (15:15 +1000)]
gallivm/nir: add multisample image operations
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 03:55:08 +0000 (13:55 +1000)]
gallivm/nir: add multisample support to image size
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 9 Mar 2020 23:51:17 +0000 (09:51 +1000)]
gallivm/nir/tgsi: add multisample texture sampling.
Both paths are required as u_blitter needs the TGSI path.
This just hooks the instructions up to the sampling code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 23 Mar 2020 05:15:27 +0000 (15:15 +1000)]
gallivm/sample: add multisample image operation support
Just adds in the sample stride.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Dave Airlie [Mon, 9 Mar 2020 23:38:07 +0000 (09:38 +1000)]
gallivm/sample: add multisample support for texel fetch
This adds a new callback to get the stride between the per-sample
images, adds a new value for the per-sample index to lookup,
and a flag to use multisampling.
gallivm/sample: add num samples interface for dynamic samplers
This will be used for getting number of samples in jit code.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
Tomeu Vizoso [Mon, 27 Apr 2020 07:16:49 +0000 (09:16 +0200)]
virgl: Properly check for encode_stride when encoding transfers
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4763>
Dave Airlie [Thu, 26 Mar 2020 02:06:34 +0000 (12:06 +1000)]
llvmpipe: simple texture barrier implementation.
Just flush.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4774>
Dave Airlie [Tue, 5 May 2020 06:03:34 +0000 (16:03 +1000)]
llvmpipo/nir: free compute shader NIR
I forgot this in the last round.
Fixes: 18f896e55d96 (llvmpipe: add initial nir support)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4899>
Dave Airlie [Tue, 5 May 2020 06:02:39 +0000 (16:02 +1000)]
draw/tess: free tessellation control shader i/o memory.
Fixes: 0d02a7b8ca79 (draw: add main tessellation code)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4899>
Rhys Perry [Mon, 4 May 2020 17:54:11 +0000 (18:54 +0100)]
nir: add missing group_memory_barrier handling
Totals from 2 (0.00% of 127638) affected shaders:
VGPRs: 164 -> 168 (+2.44%)
CodeSize: 18420 -> 18756 (+1.82%)
Instrs: 3658 -> 3700 (+1.15%)
Cycles: 82912 -> 83080 (+0.20%)
VMEM: 70 -> 69 (-1.43%)
PreVGPRs: 155 -> 168 (+8.39%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
CC: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4889>
Eric Anholt [Mon, 4 May 2020 21:10:40 +0000 (14:10 -0700)]
freedreno/ir3: Disable sin/cos range reduction for mediump.
robclark noted that the blob wasn't doing range reduction in the mediump
case, and I confirmed it on
dEQP-GLES3.functional.shaders.operator.angle_and_trigonometry.sin.mediump_float_fragment
vs
dEQP-GLES3.functional.shaders.operator.angle_and_trigonometry.sin.highp_float_fragment.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4893>
Axel Davy [Mon, 4 May 2020 20:40:08 +0000 (22:40 +0200)]
st/nine: Set correctly blend max_rt
Currently nine_convert_blend_state has no way
of knowing the number of rts.
For now set to an upper bound.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4891>
Marek Olšák [Sat, 2 May 2020 21:58:15 +0000 (17:58 -0400)]
radeonsi: enable TC-compatible HTILE on demand for best Z/S performance
I haven't measured this, but it can only help.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4866>
Marek Olšák [Sat, 2 May 2020 21:34:16 +0000 (17:34 -0400)]
radeonsi: allow tc_compatible_htile to be mutable
Move the relevant code from si_init_depth_surface to
si_emit_framebuffer_state, so that it can be changed after a pipe_surface
is initialized.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4866>
Marek Olšák [Sat, 2 May 2020 20:35:16 +0000 (16:35 -0400)]
radeonsi/gfx9: always use IMG_DATA_FORMAT_S8_32 for 8-bit stencil
I wanna remove dependency on tc_compatible_htile from non-dynamic states.
This should be the same as 8_UINT if HTILE is disabled.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4866>
Marek Olšák [Sat, 2 May 2020 20:19:00 +0000 (16:19 -0400)]
ac/surface: unset RADEON_SURF_TC_COMPATIBLE_HTILE if HTILE hasn't been computed
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4866>
Marek Olšák [Mon, 4 May 2020 21:41:41 +0000 (17:41 -0400)]
radeonsi: don't wait for idle at the end of gfx IBs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4894>
Pierre-Eric Pelloux-Prayer [Tue, 28 Apr 2020 14:34:49 +0000 (16:34 +0200)]
ac/nir: export some undef as zero
NIR already optimizes undef usage.
If undef reaches llvm, it's probably because of a broken shader.
In this situation, rather than letting llvm use the undef values
to do more optimization and probably produce incorrect results,
we replace undef values by 0.
"undef" values that are directly used in exports are kept as undef,
because this allows llvm to optimize them away.
This is only enabled for radeonsi.
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2689
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 16:14:40 +0000 (18:14 +0200)]
gallium: add a new cap PIPE_CAP_GLSL_ZERO_INIT
Allows driver to select a zero init mode between the 3 possible values.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 16:32:02 +0000 (18:32 +0200)]
mesa: extend GLSLZeroInit semantics
This commit introduces a new way to zero-init variables but keep the
old one to not break any existing behavior.
With this change GLSLZeroInit becomes an integer, with the following
possible values:
- 0: no 0 init
- 1: current behavior
- 2: new behavior. Similar to 1, except ir_var_function_out type are
0 initialized but ir_var_shader_out.
The rationale behind 2 is: zero initializing ir_var_shader_out can
prevent some optimization where out variables are completely eliminated
when not written to.
On the other hand, zero initializing "ir_var_function_out" has no
effect on correct shaders but typically helps shadertoy since the main
function is:
void mainImage(out vec4 fragColor) { ... }
So with this change we're sure that fragColor will always get a value.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Thu, 30 Apr 2020 13:06:08 +0000 (15:06 +0200)]
glsl: add a is_implicit_initializer flag
Shared globals and glsl_zero_init can cause linker errors if the
variable is only initialized in 1 place.
This commit adds a flag to variables that have been implicitely
initialized to be able in this situation to keep the explicit
initialization value.
Without this change the global-single-initializer-2-shaders piglit
test fails when using glsl_zero_init.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 15:55:38 +0000 (17:55 +0200)]
glsl: rework zero initialization
This commit makes zero_init a bitfield of types of variables to zeroinit.
This will allow some flexibility that will be used in the next commit.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 10:17:14 +0000 (12:17 +0200)]
glsl: init gl_FragColor if zero_init=true
This fixes shaders doing "gl_FragColor += ..." and doesn't hurt correct
shaders, because the zero init is discarded.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 10:17:04 +0000 (12:17 +0200)]
radeonsi: don't print gs_copy_shader stats for shaderdb
Fixes: dbc86fa3de6 ("radeonsi: dump shader stats when hitting the live cache")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
Samuel Pitoiset [Mon, 4 May 2020 10:01:41 +0000 (12:01 +0200)]
radv: enable shaderInt16 unconditionally with LLVM and only GFX8+ with ACO
The Vulkan spec says:
"shaderInt16 specifies whether 16-bit integers (signed and unsigned)
are supported in shader code. If this feature is not enabled, 16-bit
integer types must not be used in shader code."
I think it's just safe to enable it because 16-bit integers should
be fully supported with LLVM and also with ACO and GFX8+. On GFX8
and earlier generations, throughput of 16-bit int is same as 32-bit
but that should't change anything.
For GFX6-GFX7 ACO support, we have to implement conversions without
SDWA.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4874>
Pierre-Eric Pelloux-Prayer [Fri, 24 Apr 2020 09:58:12 +0000 (11:58 +0200)]
radeonsi: add workaround for issue 2647
For unknown reasons pixel shaders in KSP game get executed with
infinite interpolation coefficients and this causes an infinite
loop in the shader.
This commit adds a hacky workaround that kills pixel shaders if
invalid interp coeffs are detected and enables it for KSP.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2174
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2647
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4700>
Erik Faye-Lund [Fri, 24 Apr 2020 15:13:45 +0000 (17:13 +0200)]
zink: use nir_lower_uniforms_to_ubo
Instead of open-coding uniform -> UBO lowering, let's instead use the
one that already exists. This should make things a bit simpler going
forward.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
Louis-Francis Ratté-Boulianne [Fri, 14 Feb 2020 07:14:07 +0000 (02:14 -0500)]
nir: Always create UBO variable when lowering uniforms to ubo
Zink needs to know the sizes of UBOs, and for normal UBOs we get this
from the nir_var_mem_ubo variables. This allows us to treat all of these
the same way.
We're about to need the same information for the in-progress D3D12
driver, so let's do this in a central location instead of in the driver.
This version is also a bit more careful than the Zink version. In
particular, for two reasons:
1. We increase the variable bindings when we adjust the pre-existing
UBOs.
2. We increase shader->info.num_ubos when we insert a new UBO variable.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
Erik Faye-Lund [Wed, 29 Apr 2020 10:29:46 +0000 (12:29 +0200)]
mesa/st: consider NumUniformBlocks instead of num_ubos when binding
This is the number of uniform blocks at linking time, not after
finalizing shaders.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
Erik Faye-Lund [Tue, 28 Apr 2020 11:28:16 +0000 (13:28 +0200)]
compiler/glsl: explicitly store NumUniformBlocks
It's not great to use shader_info for this information, because it
might have gone through lowering of uniforms to UBOs, which can change
the number of UBOs. So let's make sure we know the size of the
UniformBlocks array from when the shader was linked instead.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
Danylo Piliaiev [Mon, 4 May 2020 14:49:26 +0000 (17:49 +0300)]
glsl: rename has_implicit_uint_to_int_conversion to *_int_to_uint_*
There is no uint to int implicit conversion in glsl, this is just
a typo in the name of this function. The correct one would be:
has_implicit_int_to_uint_conversion.
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4884>
Pierre-Eric Pelloux-Prayer [Mon, 20 Apr 2020 12:20:28 +0000 (14:20 +0200)]
driconf: add force_integer_tex_nearest option
And enable it for "GRID Autosport" and "DIRT: Showdown" games.
CC: 20.1 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1258
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
Pierre-Eric Pelloux-Prayer [Mon, 20 Apr 2020 12:17:53 +0000 (14:17 +0200)]
mesa: add gl_coontext::ForceIntegerTexNearest
Some applications incorrectly use GL_LINEAR* values for integers texture.
copyimage.c already implemented a tolerance for such app in prepare_target_err.
This commit adds a boolean that will treat GL_LINEAR* filters as
GL_NEAREST for integer textures.
CC: 20.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
Samuel Pitoiset [Mon, 4 May 2020 12:40:56 +0000 (14:40 +0200)]
aco: remove unecessary p_split_vector with v2b reg class
Should be fine now that RA take full registers for v2b if it's
not an SDWA instruction.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4879>
Joshua Ashton [Mon, 4 May 2020 12:33:42 +0000 (13:33 +0100)]
vulkan: Update Vulkan XML and headers to 1.2.140
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4878>
Joshua Ashton [Mon, 4 May 2020 12:36:41 +0000 (13:36 +0100)]
turnip: Remove RANGE_SIZE usage
These were removed from the latest Vulkan headers
https://github.com/KhronosGroup/Vulkan-Docs/issues/1230
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4878>
Joshua Ashton [Mon, 4 May 2020 10:53:03 +0000 (11:53 +0100)]
radv: Remove RANGE_SIZE usage
These were removed from the latest Vulkan headers
https://github.com/KhronosGroup/Vulkan-Docs/issues/1230
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4878>
Joshua Ashton [Mon, 4 May 2020 10:52:55 +0000 (11:52 +0100)]
anv: Remove RANGE_SIZE usage
These were removed from the latest Vulkan headers
https://github.com/KhronosGroup/Vulkan-Docs/issues/1230
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4878>
Mauro Rossi [Sat, 2 May 2020 07:31:02 +0000 (09:31 +0200)]
android: iris: add iris_seqno.{c,h} to Makefile.sources
Fixes the following undefined symbol building errors:
ld.lld: error: undefined symbol: iris_seqno_init
>>> referenced by iris_batch.c:187 (external/mesa/src/gallium/drivers/iris/iris_batch.c:187)
>>> iris_batch.o:(iris_init_batch) in archive out/target/product/x86_64/obj/STATIC_LIBRARIES/libmesa_pipe_iris_intermediates/libmesa_pipe_iris.a
Fixes: e31b703c ("iris: Place a seqno at the end of every batch")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Marek Olšák [Sat, 2 May 2020 14:56:20 +0000 (10:56 -0400)]
ac/surface: fix MSAA crash with FORCE_SWIZZLE_MODE on gfx9
Fixes: 3dc2ccc14c0e035 "ac/surface: replace RADEON_SURF_OPTIMIZE_FOR_SPACE with !FORCE_SWIZZLE_MODE"
Closes: #2884
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4862>
Alyssa Rosenzweig [Mon, 4 May 2020 18:40:26 +0000 (14:40 -0400)]
pan/bit: Add IMATH packing tests
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:13:29 +0000 (14:13 -0400)]
pan/bit: Factor out identity swizzle helper
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:09:39 +0000 (14:09 -0400)]
pan/bit: Use swizzle helper for round
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:07:53 +0000 (14:07 -0400)]
pan/bit: Remove test names
We already have the disasm which is authoritative.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:37:21 +0000 (14:37 -0400)]
pan/bit: Interpret v4i8 ops
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:29:03 +0000 (14:29 -0400)]
pan/bit: Interpret IMATH
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:40:09 +0000 (14:40 -0400)]
pan/bi: Don't schedule <32-bit IMATH to FMA
The ops don't exist.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:38:12 +0000 (14:38 -0400)]
pan/bi: Add SUB.v2i16/SUB.v4i8 opcodes to disasm
Like their ADD counterparts. Only on ADD.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:37:04 +0000 (14:37 -0400)]
pan/bi: Pack ADD IADD/ISUB for 8/16/32
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:28:47 +0000 (14:28 -0400)]
pan/bi: Pack FMA IADD/ISUB 32
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:04:35 +0000 (14:04 -0400)]
pan/bi: Use IMATH for nir_op_iadd
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Alyssa Rosenzweig [Mon, 4 May 2020 18:00:13 +0000 (14:00 -0400)]
pan/bi: Rename BI_ISUB to BI_IMATH
We'll use this for iadd, etc too which share similar characteristics.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Eric Anholt [Fri, 1 May 2020 23:26:24 +0000 (16:26 -0700)]
freedreno/ir3: Define the bindful uniform/nonuniform desc modes for cat6 a6xx.
These come from the disasm tests, and fix our disasm of blob's
uniform/nonuniform cat6 operands. We also now include human-readable names
for all the modes we know about (though bindless gets distinguished by its
.baseN, like Connor's original disasm).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4857>
Eric Anholt [Fri, 1 May 2020 21:37:27 +0000 (14:37 -0700)]
freedreno/ir3: Sync some new changes from envytools.
With this I also brought in a few new control flow instruction disasm
tests that I'd made back when I wrote the disasm test, but which were too
far from correct to include until now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4857>
Eric Anholt [Fri, 24 Apr 2020 20:44:40 +0000 (13:44 -0700)]
freedreno/ir3: Add some more tests of cat6 disasm.
I put these together from traces I had while trying to do LDC for GL.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4857>
Marek Olšák [Thu, 30 Apr 2020 07:57:50 +0000 (03:57 -0400)]
Revert "ac: reassociate FP expressions for inexact instructions for radeonsi"
This reverts commit
cf2f3c27533d8721abed4cdd4dfb00d4d53e8a0f.
It breaks shadows in Unigine Superposition.
Fixes: cf2f3c27533d8721abed4cdd4dfb00d4d53e8a0f
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4837>
Alyssa Rosenzweig [Sat, 2 May 2020 01:39:23 +0000 (21:39 -0400)]
pan/bit: Add ICMP tests
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 20:38:23 +0000 (16:38 -0400)]
pan/bit: Add more 16-bit fmod tests
Swizzles and more abs.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 20:13:09 +0000 (16:13 -0400)]
pan/bit: Add swizzles to round tests
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Sat, 2 May 2020 01:42:53 +0000 (21:42 -0400)]
pan/bi: Don't pack ICMP on FMA
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Sat, 2 May 2020 01:37:59 +0000 (21:37 -0400)]
pan/bi: Pack ADD ICMP 16
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Sat, 2 May 2020 00:58:45 +0000 (20:58 -0400)]
pan/bi: Pack ADD ICMP 32
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Sat, 2 May 2020 00:48:51 +0000 (20:48 -0400)]
pan/bi: Structify ADD ICMP 16
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:53:25 +0000 (18:53 -0400)]
pan/bi: Pack ADD.DISCARD
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:36:51 +0000 (18:36 -0400)]
pan/bi: Handle discard/branch in get_component_count
No dest requires special handling.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:36:42 +0000 (18:36 -0400)]
pan/bi: Fuse conditions into discard_if
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:31:22 +0000 (18:31 -0400)]
pan/bi: Add float-only mode to condition fusing
Useful for discards.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:26:18 +0000 (18:26 -0400)]
pan/bi: Emit discard (not if)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:24:11 +0000 (18:24 -0400)]
pan/bi: Handle discard_if in NIR->BIR naively
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Alyssa Rosenzweig [Fri, 1 May 2020 22:13:54 +0000 (18:13 -0400)]
pan/bi: Unwrap BRANCH into CONDITIONAL class
We can simplify the IR considerably and unify more conditions, which
gives conditional discard for free.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>