Commit Graph

110721 Commits

Author SHA1 Message Date
Mathias Fröhlich c989661985 mesa: Leave aliasing of vertex and generic0 attribute to the dlist code.
Now that dlist compilation again knows if it is inside glBegin/glEnd,
we can leave the decision if aliasing should occur to the vertex attribute
setter functions instead of doing that at glArrayElement time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich c869387d8a mesa: Correct the is_vertex_position decision for dlists.
We have to use _mesa_inside_dlist_begin_end instead of
_mesa_inside_begin_end to see if we are inside a glBegin/glEnd block in
case of display lists.
So split the is_vertex_position function used in vertex attribute processing
into a imm and dlist variant and use the appropriate _mesa_inside_begin_end
variant.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich 5ad54217ff mesa: Set CurrentSavePrimitive in vbo_save_NotifyBegin.
That seems to be lost somewhere. Is needed for correct outside begin/end
detection in display list compilation. And is needed for correct aliasing
in dlists restablished in the next changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich 0ed7603d97 mesa: Remove the _glapi_table argument from _mesa_array_element.
The value is now unused.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich 3b6f32907f mesa: Constify static const array in api_arrayelt.c
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich 68aaf0a4e3 mesa: Remove the now unused _NEW_ARRAY state change flag.
Is no longer used, so we have less occasions where NewState is non zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich 7af047c373 mesa: Rip out now unused gl_context::aelt_context.
Now this part of gl_context state is unused and can be removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:35 +02:00
Mathias Fröhlich b9de48581a mesa: Implement _mesa_array_element by walking enabled arrays.
In glArrayElement, use the bitmask trick to just walk the enabled
vao arrays. This should be about equivalent in execution time to
walk the prepare aelt_context list. Finally this will allow us to
reduce the _mesa_update_state calls in a few patches.

v2: Add comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:40:19 +02:00
Mathias Fröhlich 7a5dea6320 mesa: Use glVertexAttrib*NV functions for fixed function attribs.
In the glArrayElement implementation, use glVertexAttrib*NV type
functions for fixed function attributes. We do the same in display
execution when the list is replayed using immediate mode attribute
functions. Using a single set of function pointers enables to
use a unified loop to walk the vertex array attributes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:39:42 +02:00
Mathias Fröhlich 60076a6171 mesa: Factor out index function that will have multiple use.
For access to glArrayElement methods factor out a function to
get the table lookup index for normalized/integer/double access.
The function will be used in the next patch at least twice.

v2: Use vertex_format_to_index instead of NORM_IDX.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-05-04 07:39:18 +02:00
Jason Ekstrand 91899495a1 nir: Add a SSA type gathering pass
This new pass (which isn't even compile-tested) attempts to determine
the ALU type of all the SSA values in a function impl.  It takes a
greedy approach and assigns intness or floatness to everything it thinks
can possibly contain an int or a float.  Some values will be labled as
both int and float and some will be labled as neither and it is up to
the caller to decide what to do with this information.  However, for a
"nice" shader where the original source contained no bit-casts and no
implicit bit-casts were introduced by optimizations, there shouldn't be
any overlap in the two sets save for the odd CSEd zero constant.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
2019-05-04 03:52:05 +00:00
Kenneth Graunke 694d1a08d3 iris: Delete bucketing allocators
These add a lot of complexity, and I currently can't measure any
performance benefit from having them.  In the past, I seem to recall
seeing a benefit in drawoverhead scores, but currently it looks like
dropping them is either a wash or 1-2% faster.

Drop them to simplify allocations.
2019-05-03 19:50:26 -07:00
Kenneth Graunke bd4b18d255 iris: Force VMA alignment to be a multiple of the page size.
This should happen regardless, but let's be paranoid.
2019-05-03 19:48:37 -07:00
Kenneth Graunke 068a700195 iris: leave the top 4Gb of the high heap VMA unused
This ports commit 9e7b0988d6 from anv
to iris.  Thanks to Lionel for noticing that it was missing!
2019-05-03 19:48:37 -07:00
Kenneth Graunke 21062e21d9 iris: Fix 4GB memory zone heap sizes.
The STATE_BASE_ADDRESS "Size" fields can only hold 0xfffff in pages,
and 0xfffff * 4096 = 4294963200, which is 1 page shy of 4GB.

So we can't use the top page.
2019-05-03 19:48:37 -07:00
Julien Isorce 8cd71f399e st/va: check resource_get_info nullity in vlVaDeriveImage
This pipe_screen function is not implemented by all backends.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110443
Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2019-05-03 16:11:55 -07:00
Jason Ekstrand 30fa15e36b anv,i965: Stop warning about incomplete gen11 support
Both drivers are feature-complete and should be running more-or-less at
perf at this point.  Drop the warning.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2019-05-03 22:57:35 +00:00
Connor Abbott d0ea9877b8 nir/algebraic: Don't emit empty initializers for MSVC
Just don't emit the transform array at all if there are no transforms

v2:
- Don't use len(array) > 0 (Dylan)
- Keep using ARRAY_SIZE to make the generated C code easier to read
(Jason).
2019-05-04 00:13:21 +02:00
Kenneth Graunke 8987152ac1 iris: Resolve textures used by the program, not merely bound textures
st/mesa's PBO upload path binds a vertex shader that doesn't use any
textures, but leaves the existing sampler views bound in place.  This
was tricking us into thinking the PBO destination might be bound for
texturing in some cases.  In Civilization VI, this fixes a false self-
dependency issue that was preventing CCS_E compression on upload.
Fixing this slightly improves frame times.
2019-05-03 13:03:22 -07:00
Dylan Baker c613861b23 meson: Don't build glsl cache_test when shader cache is disabled
v2: - Use new with_shader_cache variable instead of
      host_machine.system() == 'windows'

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:31 -07:00
Dylan Baker a216aea7af tests/vma: fix build with MSVC
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:27 -07:00
Dylan Baker 5eb0f33e4f glsl/tests: define ssize_t on windows
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:24 -07:00
Dylan Baker 76338933e9 util/tests: Use define instead of VLA
To allow the this test to be built with MSVC, which doesn't support
VLAs.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:17 -07:00
Dylan Baker ff9bf223c2 meson: make nm binary optional
This makes nm not required, but used if found. In general I imagine that
this means that on windows nm wont be found, and on other platforms it
will.

v2: - fix gbm and egl symbols check tests to only be run if nm is found
    - reword commit message to reflect the code change

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:05 -07:00
Dylan Baker f5eafc2dc6 meson: Make shader-cache a trillean instead of boolean
So that it can be implicitly disabled on windows, where it doesn't
compile.

v2: - Use an auto-option rather than automagic.
    - fix shader_cache check (== -> !=)
v4: - Use new with_shader_cache instead of get_option('shader-cache')
      elsewhere in the meson build

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:57:36 -07:00
Dylan Baker ddc15fba2b meson: switch gles1 and gles2 to auto options
This allows them to default to false on windows, but default to true
elsewhere. As a side effect turning off shared-glapi now automatically
turns off gles. Shared glapi remains a boolean defaulting to true.

v5: - new in this version

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:57:19 -07:00
Dylan Baker 113bb8d448 glsl: fix general_ir_test with mingw
Somewhere down in the depths of the mingw headers 'interface' is
defined, change it to iface like a similar patch did.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:57:17 -07:00
Dylan Baker f1d5f2aff3 meson: always define libglapi
This allows the identifier to be used even if shared-glapi isn't build,
which simplifies a bunch of things.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:57:10 -07:00
Chuck Atkins a381dbf253 meson: Fix missing glproto dependency for gallium-glx
Signed-off-by: Chuck Atkins <chuck.atkins@kitware.com>
Cc: mesa-stable <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-05-03 13:36:25 -04:00
Samuel Pitoiset 4f18c43d1d radv: apply the indexing workaround for atomic buffer operations on GFX9
Because the new raw/struct intrinsics are buggy with LLVM 8
(they weren't marked as source of divergence), we fallback to the
old instrinsics for atomic buffer operations only. This means we need
to apply the indexing workaround for GFX9. The load/store
operations still use the new LLVM 8 intrinsics.

The fact that we need another workaround is painful but we should
be able to clean up that a bit once LLVM 7 support will be dropped.

This fixes a GPU hang with AC Odyssey and some rendering problems
with Nioh.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110573
Fixes: 31164cf5f7 ("ac/nir: only use the new raw/struct image atomic intrinsics with LLVM 9+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-05-03 17:59:12 +02:00
Alyssa Ross e340d7beef get_reviewer.pl: improve portability
Not all package managers / users will install perl into /usr/bin,
but /usr/bin/env /should/ always be present.

Using /usr/bin/env means that we can't give the -w argument to Perl,
so I added `use warnings' in the script.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-05-03 14:32:44 +01:00
Lionel Landwerlin 80dc78407d anv: fix crash when application does not provide push constants
Found while running Talos Principle.

As far as I can tell running a draw call with a pipeline having push
constants without the application having called vkCmdPushConstants
gives undefined push constant values.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
2019-05-03 10:21:40 +01:00
Samuel Pitoiset e68d7bec67 radv: fix radv_get_aspect_format() for D+S formats
This restores the previous behaviour before YCBCR landed. For D+S
formats, it returns the depth format.

This fixes an assertion with Thrones of Britannia.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110540
Fixes: 66507cc656 ("radv: Add single plane image views & meta operations")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-05-03 09:01:10 +02:00
Caio Marcelo de Oliveira Filho aa675cef5e intel/fs: Assert when brw_fs_nir sees a nir_deref_instr
Since 09f1de97a7 "anv,i965: Lower away image derefs in the driver"
the backend compiler is not expected to handle any derefs, so let's
assert on it.

This helps identifying problems when a deref is not lowered and
"leaks" into the backend compiler.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-05-02 23:25:30 -07:00
Julien Isorce a77512635e r600: implement resource_get_info
Factoring code with resource_get_handle.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110443
Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Dave Airlie airlied@redhat.com
2019-05-03 05:54:28 +00:00
Dave Airlie 512a31a412 util/bitset: fix bitset range mask calculations.
The MASK macro is used in the RANGE macro, and it should
return the pre-bitset word mask for the (b) value.

i.e.
BITSET_MASK(0) should be undefined since it's meaningless.
BITSET_MASK(31) should give 0x7fffffff
BITSET_MASK(32) should give 0xffffffff
BITSET_MASK(33) should give 0x00000001
BITSET_MASK(64) should give 0xffffffff

However then BITSET_RANGE ends up broken for cases where
it's (b) value is the 0,32,64 value as in that case the lower
mask would be 0 not 0xffffffff.

This fixes the unit tests that I've added, and my code that
uses bitsets.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: bb38cadb1c "More GLSL code"
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-05-03 15:23:04 +10:00
Dave Airlie 18973a450e util/tests: add basic unit tests for bitset
The last test here currently fails as there is a bug in bitset.h

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-05-03 15:23:04 +10:00
Dave Airlie 6fd6246d92 nir: fix lower vars to ssa for larger vector sizes.
This has a couple of hardcoded vec4 limits in it, change them
to the proper sizing to avoid future issues.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-05-03 15:23:00 +10:00
Dave Airlie 2774d39366 spirv: fix SpvOpBitSize return value.
The spir-v spec says this returns a bool.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-05-03 15:22:57 +10:00
Kenneth Graunke 5ff5d0a895 iris: Disable dual source blending when shader doesn't handle it
This is a port of Danylo's eca4a6548d
which fixed the hang on i965.  It fixes GPU hangs in his new Piglit
test, arb_blend_func_extended-dual-src-blending-discard-without-src1.

I avoided my own review feedback here, and decided to simply adjust
3DSTATE_PS_BLEND rather than BLEND_STATE_ENTRY[0].  It has never been
clear to me which the hardware uses in every case.  However, whacking
the enable in 3DSTATE_PS_BLEND seems to be sufficient to fix the hang,
and that packet is already dynamic, so it's easy to handle.  I'd rather
avoid making BLEND_STATE_ENTRY[0] dynamic unless I have to.
2019-05-02 21:14:49 -07:00
Jason Ekstrand be7e9870d6 anv: Stop including POS in FS input limits
It is an input but it comes in as part of the shader payload and doesn't
count towards the limits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-05-02 18:56:51 -05:00
Rob Clark b73dd91f60 nir: fix nir tex print harder
Fixes: 691d5a825a nir: rework tex instruction printing
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-05-02 15:06:01 -07:00
Erik Faye-Lund 96924aa92e docs: fixup mistake in contents
During a rebase, it seems I accidentally broke the contents-menu,
leading to a duplicate link to freedesktop.org. This was obviously not
intended. Let's fix this.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 7eee13c467 ("docs: use dl/dd instead of blockquote for
       freedesktop link")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-05-02 23:23:15 +02:00
Erico Nunes 568e8fc736 lima/ppir: support nir_op_ftrunc
Support nir_op_ftrunc by turning it into a mov with a round to integer
output modifier.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
2019-05-02 20:55:56 +00:00
Eric Engestrom 1291c68c9c gitlab-ci: merge meson-glvnd into meson-swr
There's no need to have a whole build just for that flag, we can add it
to any build.

v2: Add a note about why we put glvnd where we did (by anholt).

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v2)
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2019-05-02 20:39:12 +00:00
Eric Engestrom 043b54a35d gitlab-ci: simplify meson job names
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2019-05-02 20:39:12 +00:00
Eric Engestrom 43f1546420 gitlab-ci: meson-gallium-radeonsi was a subset of meson-gallium-clover-llvm
Let's just drop it.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2019-05-02 20:39:12 +00:00
Eric Engestrom 41407c602c gitlab-ci: merge several meson jobs
Merge the following into `meson-main`/`meson-loader-classic-dri`/
`meson-gallium-swr`:
- meson-vulkan
- meson-gallium-drivers-other
- meson-gallium-st-other

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>

[ Michel Dänzer ]
* Rebase and fix up commit log.
* Don't set VULKAN_DRIVERS in meson-loader-classic-dri.
* Remove extraneous whitespace.
* Squash in follow-up fixes.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

[ anholt]
* Add a note why nine and swrast landed where they did.
* Switch from s/meson-vulkan/meson-main/ to
  s/meson-loader-classic-dri/meson-main/ which I think was the original
  intent

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Eric Engestrom <eric.engestrom@intel.com> (anholt changes)
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2019-05-02 20:39:12 +00:00
Heinrich 9b80322532 gbm: Improve documentation of BO import
- Add GBM_BO_IMPORT_FD_MODIFIER to documentation of supported foreign
object types

- Add newline before documentation block

- Improve language

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2019-05-02 20:36:38 +00:00
Samuel Pitoiset 62001f3dff radv: only need to force emit the TCS regs on Vega10 and Raven1
Other GFX9 chips aren't affected.

Cc: "19.0" "19.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-05-02 22:29:01 +02:00