Emil Velikov [Tue, 22 Aug 2017 10:39:37 +0000 (11:39 +0100)]
mapi/gen: remove shebang from the marshal generator scripts
The scripts are invoked with the correct version of python and are
missing the execute bit.
Follow the rest of Mesa and drop the shebang line.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Emil Velikov [Tue, 22 Aug 2017 10:39:36 +0000 (11:39 +0100)]
dri_interface.h: add missing stdint.h include
Required for uint32_t and friends.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Emil Velikov [Tue, 22 Aug 2017 10:39:35 +0000 (11:39 +0100)]
xmlconfig: use the portable __VA_ARGS__
Follow the example used through mesa and use "..." + "__VA_ARGS__".
The former tends to be more common and portable.
v2: use ##__VA_ARGS__ (Eric)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Brian Paul [Thu, 24 Aug 2017 16:40:28 +0000 (10:40 -0600)]
gallium/vbuf: fix buffer reference bugs
In two places we called pipe_resource_reference() to remove a reference
to a vertex buffer resource. But we neglected to check if the buffer was
a user buffer and not a pipe_resource. This caused us to pass an invalid
pipe_resource pointer to pipe_resource_reference().
Instead of calling pipe_resource_reference(&vbuf->resource, NULL), use
pipe_vertex_buffer_unreference(&vbuf) which checks the is_user_buffer
field and does the right thing.
Also, explicity set the is_user_buffer field to false after setting the
vbuf->resource pointer to out_buffer.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102377
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Bruce Cherniak <bruce.cherniak@intel.com>
Andres Gomez [Fri, 25 Aug 2017 11:40:26 +0000 (14:40 +0300)]
docs: add an additional final cycle for 17.1
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Andres Gomez [Fri, 25 Aug 2017 11:40:25 +0000 (14:40 +0300)]
docs: remove released and extend the calendar until the end of 2017
Completed the 17.2 cycle and added the beginning of the 17.3 one.
v2: Add 17.2-rc6 as tentative final version to be promoted to 17.2.0
final (Eric).
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Bas Nieuwenhuizen [Fri, 25 Aug 2017 20:18:24 +0000 (22:18 +0200)]
radv: Fix sparse BO mapping merging.
If we merge a mapping with the mapping before it, we also need
to not only change the offset, but also the bo offset.
Fixes: 715df30a4e2 "radv/amdgpu: Add winsys implementation of virtual buffers."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Fri, 25 Aug 2017 12:14:12 +0000 (14:14 +0200)]
radv: Fix off by one in MAX_VBS assert.
e.g. 0 + 32 <= 32 should be valid.
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Thu, 24 Aug 2017 22:29:03 +0000 (00:29 +0200)]
radv: Don't set a new subpass on compute resolve.
We don't use the render path so totally unneeded.
Fixes: 19be95f71e6 "radv: add subpass resolve compute path"
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Thu, 24 Aug 2017 22:26:44 +0000 (00:26 +0200)]
radv: Remove some intel comments from the resolve code.
These are clearly not applicable to radv.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Adam Jackson [Thu, 24 Aug 2017 18:52:14 +0000 (14:52 -0400)]
egl/drm: Don't "fall back" to /dev/dri/card0 if the first open fails
The snprintf stuff here already constructs the right name for the device
node, and if it doesn't, you configured Mesa wrong, don't do that.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Kenneth Graunke [Thu, 24 Aug 2017 07:25:21 +0000 (00:25 -0700)]
i965: Use GEN_GEN and GEN_IS_HASWELL in genX_state_upload.c code.
We were using brw->gen, brw->is_haswell, and devinfo->gen in a few
places, when we could just use GEN_GEN and GEN_IS_HASWELL, which are
evaluated at compile time.
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Rafael Antognolli [Wed, 23 Aug 2017 21:13:05 +0000 (14:13 -0700)]
i965: Do not store SRC after 0 on component control.
The PRM SKL-Vol 2b-05.16 says:
"Within a VERTEX_ELEMENT_STATE structure, if a Component Control
field is set to something other than VFCOMP_STORE_SRC, no
higher-numbered Component Control fields may be set to
VFCOMP_STORE_SRC. In other words, only trailing components can be set
to something other than VFCOMP_STORE_SRC."
Since we set the component 1 to VFCOMP_STORE_0 on gen8+, and
VFCOMP_STORE_IID on gen5+, and we are not using components 2 and 3,
let's also set them to VFCOMP_STORE_0.
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Adam Jackson [Thu, 24 Aug 2017 21:00:43 +0000 (17:00 -0400)]
mesa: Implement GL_ARB_polygon_offset_clamp
Semantically identical to the EXT version (whose string is still valid
for GLES), so rename the bit but expose both extension strings.
(Suggested by Ilia Mirkin and Ian Romanick.)
v3: Fix the entrypoint alias in GL4x.xml (Ilia)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Adam Jackson [Thu, 24 Aug 2017 18:40:32 +0000 (14:40 -0400)]
mesa: Implement GL_ARB_texture_filter_anisotropic
The only difference from the EXT version is bumping the minmax to 16, so
just hit all the drivers at once.
v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Fri, 25 Aug 2017 13:34:00 +0000 (15:34 +0200)]
gallium/u_threaded: fix a typo
Eric Engestrom [Thu, 24 Aug 2017 12:31:09 +0000 (13:31 +0100)]
khronos/egl: remove dependency on Android NDK header
Khronos: https://github.com/KhronosGroup/EGL-Registry/pull/22
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Eric Engestrom [Fri, 25 Aug 2017 13:03:48 +0000 (14:03 +0100)]
Revert "egl/android: add missing include"
This reverts commit
688d866eca8943f09cd846ffb045e18f6ec0677c.
The include I added in
688d866eca isn't actually useful, as it only
declares the opaque struct ANativeWindow.
However, this caused build issues for android-x86 [1] due to the header
being moved in Android O.
[1] https://lists.freedesktop.org/archives/mesa-dev/2017-August/167626.html
Fixes: 688d866eca8943f09cd8 "egl/android: add missing include"
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:36:45 +0000 (11:36 +0200)]
mesa: add KHR_no_error support to glBindBufferOffsetEXT()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:34:38 +0000 (11:34 +0200)]
mesa: add bind_buffer_offset() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 12:50:11 +0000 (14:50 +0200)]
mesa: add KHR_no_error support to glTransformFeedbackVaryings()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 12:47:15 +0000 (14:47 +0200)]
mesa: add transform_feedback_varyings() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:10:57 +0000 (12:10 +0200)]
mesa: add KHR_no_error support to glResumeTransformFeedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:09:23 +0000 (12:09 +0200)]
mesa: add resume_transform_feedback() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:06:26 +0000 (12:06 +0200)]
mesa: add KHR_no_error support to glPauseTransformFeedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:29:50 +0000 (12:29 +0200)]
mesa: add pause_transform_feedback() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:02:40 +0000 (12:02 +0200)]
mesa: add KHR_no_error support to glEndTransformFeedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 10:01:27 +0000 (12:01 +0200)]
mesa: add end_transform_feedback() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:57:55 +0000 (11:57 +0200)]
mesa: add KHR_no_error support to glBeginTransformFeedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:55:44 +0000 (11:55 +0200)]
mesa: add begin_transform_feedback() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:41:15 +0000 (11:41 +0200)]
mesa: add KHR_no_error support to glBindTransformFeedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 09:39:59 +0000 (11:39 +0200)]
mesa: add bind_transform_feedback() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 13:53:34 +0000 (15:53 +0200)]
mesa: port the LastLookedUpVAO optimisation to _mesa_lookup_vao()
It was only used in the errors path.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 11:44:21 +0000 (13:44 +0200)]
mesa: don't error check the default buffer object in glBindBufferOffsetEXT()
An allocation check is already done when the buffer is created at
context creation.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 11:43:21 +0000 (13:43 +0200)]
mesa: add _fallback suffix to the default transform feedback functions
In preparation for KHR_no_error support.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 11:43:20 +0000 (13:43 +0200)]
mesa: remove unnecessary check in _mesa_init_transform_feedback_object()
All callers already check that, and the common behaviour is to
check in the _mesa_new_XXX() helpers anyway.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 11:43:19 +0000 (13:43 +0200)]
mesa: check allocation failures in new_transform_feedback()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Thu, 24 Aug 2017 11:43:18 +0000 (13:43 +0200)]
mesa: remove unused _mesa_validate_transform_feedback_buffers()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Kai Chen [Mon, 7 Aug 2017 15:34:51 +0000 (08:34 -0700)]
egl/wayland: Use roundtrips when awaiting buffer release
In get_back_bo, we use wl_display_dispatch_queue() to block and wait for
a buffer release event. However, not all Wayland compositors flush the
client socket on posting a buffer-release event, so by only blocking
client-side, we may block indefinitely, or at least need to wait for an
input event / frame completion to arrive for the compositor to flush.
We now use dispatch_queue as a first pass, but if our entire buffer pool
is exhausted, use a roundtrip (an immediately-triggered wl_callback) to
ensure that the compositor flushes out our release event immediately.
[daniels: Modified comment and commit message.]
Signed-off-by: Kai Chen <kai.chen@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
CC: <mesa-stable@lists.freedesktop.org>
Nicolai Hähnle [Thu, 24 Aug 2017 13:41:08 +0000 (15:41 +0200)]
glsl: fix glsl_struct_field size calculations for shader cache
Found by address sanitizer:
==22621==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61400000cbd8 at pc 0x7f561610a4ff bp 0x7ffca85f9d50 sp 0x7ffca85f94f8
READ of size 344 at 0x61400000cbd8 thread T0
#0 0x7f561610a4fe (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5f4fe)
#1 0x7f560bb305a5 in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53
#2 0x7f560bb305a5 in blob_write_bytes ../../../mesa-src/src/compiler/glsl/blob.c:136
#3 0x7f560be7d7ff in encode_type_to_blob ../../../mesa-src/src/compiler/glsl/shader_cache.cpp:153
#4 0x7f560be81222 in write_program_resource_data ../../../mesa-src/src/compiler/glsl/shader_cache.cpp:950
#5 0x7f560be81222 in write_program_resource_list ../../../mesa-src/src/compiler/glsl/shader_cache.cpp:1118
#6 0x7f560be81222 in shader_cache_write_program_metadata(gl_context*, gl_shader_program*) ../../../mesa-src/src/compiler/glsl/shader_cache.cpp:1407
#7 0x7f560b825fdb in link_program ../../../mesa-src/src/mesa/main/shaderapi.c:1163
Fixes: 073a84ff60db ("glsl: stop adding pointers from glsl_struct_field to the cache")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Ilia Mirkin [Fri, 25 Aug 2017 04:13:32 +0000 (00:13 -0400)]
a2xx: fix DST_ALPHA blending for non-alpha formats
If we're rendering to a format without alpha, convert DST_ALPHA blend to
a ONE so that factors are properly computed. This same workaround is
done on a3xx+ as well.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Fri, 25 Aug 2017 04:03:46 +0000 (00:03 -0400)]
a2xx: set constant blend color
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Timothy Arceri [Thu, 24 Aug 2017 12:46:57 +0000 (22:46 +1000)]
radeonsi: set IF_THRESHOLD to 4
In
74e39de9324d it was set to 3 and it was reported that 4 caused
tesseract to start spilling VGPRs. This no longer seems to be the
case.
Totals:
SGPRS:
2787844 ->
2787764 (-0.00 %)
VGPRS:
1713121 ->
1712717 (-0.02 %)
Spilled SGPRs: 7532 -> 7532 (0.00 %)
Spilled VGPRs: 49 -> 33 (-32.65 %)
Private memory VGPRs: 2060 -> 2060 (0.00 %)
Scratch size: 2200 -> 2180 (-0.91 %) dwords per thread
Code Size:
79265520 ->
79248360 (-0.02 %) bytes
LDS: 436 -> 436 (0.00 %) blocks
Max Waves: 670535 -> 670608 (0.01 %)
Wait states: 0 -> 0 (0.00 %)
Before:
VGPR SPILLING APPS Shaders SpillVGPR PrivVGPR ScratchSize
EffectsCaveDemo 301 0 256 264
ReflectionsSubwayDemo 264 0 256 264
VehicleGame 295 0 128 132
bioshock-infinite 1140 0 448 516
dirt-showdown 453 33 0 28
gang-beasts 364 0 500 496
kerbal-space-program 1228 0 472 480
tomb-raider-ultra 1199 16 0 20
After:
VGPR SPILLING APPS Shaders SpillVGPR PrivVGPR ScratchSize
EffectsCaveDemo 301 0 256 264
ReflectionsSubwayDemo 264 0 256 264
VehicleGame 295 0 128 132
bioshock-infinite 1140 0 448 516
dirt-showdown 453 33 0 28
gang-beasts 364 0 500 496
kerbal-space-program 1228 0 472 480
The only change in VGPR spills is the elimination of all spills
in Tomb Raider at Ultra settings. Closer examination shows that
the shaders go over the limit because they contain three
expressions a mul, rcp and ubo load. The ubo load is actually
used elsewhere and is therefore stored in a temp already in IR
such as tgsi but glsl ir counts it agaist the if cost.
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Timothy Arceri [Mon, 31 Jul 2017 03:00:35 +0000 (13:00 +1000)]
util/disk_cache: write cache item metadata to disk
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Timothy Arceri [Wed, 23 Aug 2017 06:33:00 +0000 (16:33 +1000)]
glsl: pass shader source keys to the disk cache
We don't actually write them to disk here. That will happen in the
following commit.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Timothy Arceri [Wed, 23 Aug 2017 06:32:59 +0000 (16:32 +1000)]
util/disk_cache: add struct cache_item_metadata
This will be used to store more information about the cache item
in it's header. This information is intended for 3rd party and
cache analysis use but can also be used for detecting the unlikely
scenario of cache collisions.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Timothy Arceri [Wed, 23 Aug 2017 06:32:58 +0000 (16:32 +1000)]
disk_cache: enable limited hash collision detection in release builds
It really doesn't cost us much and will stop strange crashes should
the stars align.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Timothy Arceri [Thu, 24 Aug 2017 01:11:40 +0000 (11:11 +1000)]
util/disk_cache: rename mesa cache dir and introduce cache versioning
Steam is already analysing cache items, unfortunatly we did not
introduce a versioning mechanism for identifying structural changes
to cache entries earlier so the only way to do so is to rename the
cache directory.
Since we are renaming it we take the opportunity to give the directory
a more meaningful name.
Adding a version field to the header of cache entries will help us to
avoid having to rename the directory in future. Please note this is
versioning for the internal structure of the entries as defined in
disk_cache.{c,h} as opposed to the structure of the data provided to
the disk cache by the GLSL compiler and the various driver backends.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Dave Airlie [Thu, 17 Aug 2017 01:08:46 +0000 (02:08 +0100)]
radv: don't crash if we have no framebuffer
Recording secondaries with no framebuffer attachment may
make this happen, though this might not be the complete solution.
(esp if someone does meta stuff in there, would we have to
save things, not sure).
Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 24 Aug 2017 01:47:14 +0000 (02:47 +0100)]
radv/gfx9: gfx9 has buffer sizing rules like pre-VI.
This fixes:
dEQP-VK.robustness.buffer_access.* on GFX9.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Thu, 24 Aug 2017 01:12:12 +0000 (02:12 +0100)]
radv: fix predication on gfx9
When I added gfx9 I did it wrong, this fixes it.
Fixes: 5247b311e9 "radv/gfx9: fix set predication packet."
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jason Ekstrand [Tue, 22 Aug 2017 00:41:28 +0000 (17:41 -0700)]
anv,i965: Move CS shared lowering into anv
Right now, OpenGL uses the GLSL lowering for shared variables and anv
uses NIR to lower them. For a long time, we've done this weird thing
where we do the NIR lowering unconditionally and then add the SLM sizes
from the two together. This works because one of them will always be 0
but it's a bit sketchy. Let's just move the NIR-based lowering into
anv_pipeline and get rid of the sketch.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Mauro Rossi [Thu, 24 Aug 2017 21:52:20 +0000 (23:52 +0200)]
ac/debug: use util_strchrnul() to fix android build error
Similar to
e09d04cd56 "radeonsi: use util_strchrnul() to fix android build error"
Android Bionic does not support strchrnul() string function,
gallium auxiliary util/u_string.h provides util_strchrnul()
This change avoids the following warning and error:
external/mesa/src/amd/common/ac_debug.c:501:15: warning: implicit declaration of function 'strchrnul' is invalid in C99
char *end = strchrnul(out, '\n');
^
external/mesa/src/amd/common/ac_debug.c:501:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int'
char *end = strchrnul(out, '\n');
^ ~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
Fixes: c2c3912410 "ac/debug: annotate IB dumps with the raw values"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Marek Olšák [Wed, 23 Aug 2017 14:07:35 +0000 (16:07 +0200)]
radeonsi: get the raster config from AMDGPU on SI
Not sure yet if we wanna do this on CIK and VI too.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Wed, 23 Aug 2017 13:51:54 +0000 (15:51 +0200)]
radeonsi: clean up setting GRBM_GFX_INDEX
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Marek Olšák [Wed, 23 Aug 2017 13:38:18 +0000 (15:38 +0200)]
radeonsi: move PA_SC_RASTER_CONFIG emission into a separate function
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Rob Herring [Wed, 23 Aug 2017 17:20:52 +0000 (12:20 -0500)]
Android: fix Android O version check for LLVM
With the release of O, the MESA_ANDROID_MAJOR_VERSION has changed to 8.
Change the LLVM check to match. There's no point to continue to support 'O'
as no one is going to use an old AOSP master.
Presumably, we'll be back here again to fix things again for P (or 9).
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Rob Herring <robh@kernel.org>
Adam Jackson [Tue, 8 Aug 2017 15:52:42 +0000 (11:52 -0400)]
include: Sync Khronos headers for OpenGL 4.6
Taken from
c21e602b9fda1d3bbaecb08194592f67e6a0649b from
OpenGL-Registry. (This time without breaking glext.h.)
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 07:20:53 +0000 (09:20 +0200)]
radv: Expose VK_KHX_multiview.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 07:20:26 +0000 (09:20 +0200)]
radv: Implement multiview draws.
v2: - Use for_each_bit.
- split emitting the draw packets out to separate functions.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 07:19:33 +0000 (09:19 +0200)]
radv: Implement determining the has_multiview_view_index key.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 07:09:56 +0000 (09:09 +0200)]
ac/nir: Add shader support for multiviews.
It uses an user SGPR to pass the view index to the shaders, except
for the fragment shader where we use layer=view (which comes in
handy when we want to do the NV ext that allows us to execute pre-FS
stages once instead of per view).
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 06:59:41 +0000 (08:59 +0200)]
radv: Add multiview clears.
v2: Use for_each_bit.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Sun, 2 Jul 2017 17:20:47 +0000 (19:20 +0200)]
radv: Store multiview info in renderpass.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Sun, 2 Jul 2017 00:48:41 +0000 (02:48 +0200)]
ac/nir: Make shader key a struct.
Some bits can be passed to almost every shader, and I don't like
adding 5 variables.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Thu, 17 Aug 2017 22:32:41 +0000 (00:32 +0200)]
radv: Use 0 for the layer id if the vertex shader does not export it.
To use when we have e.g. input attachments, but there is no layer
export in the previous shader and hence no layered rendering.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Thu, 17 Aug 2017 22:29:20 +0000 (00:29 +0200)]
ac/nir: Implement input attachments with layered rendering.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 16 Aug 2017 19:57:29 +0000 (21:57 +0200)]
ac/nir: Determine if input attachments are used in the info pass.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Bas Nieuwenhuizen [Wed, 23 Aug 2017 20:28:06 +0000 (22:28 +0200)]
ac/nir: Cast sources of integer ops to int.
The int32->float semantic conversion got dropped in a testcase,
because the src was already float. On closer inspection I decided
to add a few more casts for integer op operands to be safe too.
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Adam Jackson [Thu, 24 Aug 2017 17:15:15 +0000 (13:15 -0400)]
Revert "include: Sync Khronos headers for OpenGL 4.6"
Broke the BUILDING_MESA bit, oops.
This reverts commit
ef1e87e6cdbd80e74a8bc6d48b0b174a0812fe69.
Adam Jackson [Tue, 8 Aug 2017 15:52:42 +0000 (11:52 -0400)]
include: Sync Khronos headers for OpenGL 4.6
Taken from
c21e602b9fda1d3bbaecb08194592f67e6a0649b from
OpenGL-Registry.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Eric Engestrom [Thu, 17 Aug 2017 09:09:21 +0000 (10:09 +0100)]
dri: fix typo
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Eric Engestrom [Fri, 18 Aug 2017 10:25:13 +0000 (11:25 +0100)]
i965: add missing `const` in function signature
Gets rid of a few warnings of the form:
src/mesa/drivers/dri/i965/intel_screen.c:918:49: warning: passing argument 2 of ‘modifier_is_supported’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
!modifier_is_supported(&screen->devinfo, f, 0, modifier))
^
src/mesa/drivers/dri/i965/intel_screen.c:301:1: note: expected ‘struct intel_image_format *’ but argument is of type ‘const struct intel_image_format *’
Fixes: 1efd73df39b39589d26f "i965: Advertise the CCS modifier"
Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Eric Engestrom [Thu, 24 Aug 2017 14:14:16 +0000 (15:14 +0100)]
egl/android: add missing include
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Brian Paul [Sat, 19 Aug 2017 03:03:16 +0000 (21:03 -0600)]
vbo: fix glVertexAttrib(index=0)
Depending on which extension or GL spec you read the behavior of
glVertexAttrib(index=0) either sets the current value for generic
attribute 0, or it emits a vertex just like glVertex(). I believe
it should do either, depending on context (see below).
The piglit gl-2.0-vertex-const-attr test declares two vertex attributes:
attribute vec2 vertex;
attribute vec4 attr;
and the GLSL linker assigns "vertex" to location 0 and "attr" to location 1.
The test passes.
But if the declarations were reversed such that "attr" was location 0 and
"vertex" was location 1, the test would fail to draw properly.
The problem is the call to glVertexAttrib(index=0) to set attr's value
was interpreted as glVertex() and did not set generic attribute[0]'s value.
Interesting, calling glVertex() outside glBegin/End (which is effectively
what the piglit test does) does not generate a GL error.
I believe the behavior of glVertexAttrib(index=0) should depend on
whether it's called inside or outside of glBegin/glEnd(). If inside
glBegin/End(), it should act like glVertex(). Else, it should behave
like glVertexAttrib(index > 0). This seems to be what NVIDIA does.
This patch makes two changes:
1. Check if we're inside glBegin/End for glVertexAttrib()
2. Fix the vertex array binding for recalculate_input_bindings(). As it was,
we were using &vbo->currval[VBO_ATTRIB_POS], but that's interpreted
as a zero-stride attribute and doesn't make sense for array drawing.
No Piglit regressions. Fixes updated gl-2.0-vertex-const-attr test and
passes new gl-2.0-vertex-attrib-0 test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101941
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Brian Paul [Thu, 24 Aug 2017 13:35:49 +0000 (07:35 -0600)]
gallivm: remove unused variable
Trivial.
Brian Paul [Tue, 22 Aug 2017 03:44:22 +0000 (21:44 -0600)]
st/mesa: add const qualifiers in st_extensions.c
Trivial.
Brian Paul [Tue, 22 Aug 2017 17:42:38 +0000 (11:42 -0600)]
st/mesa: whitespace/indentation fixes in st_init_extensions()
Brian Paul [Tue, 22 Aug 2017 17:10:20 +0000 (11:10 -0600)]
pipe-loader: use MAYBE_UNUSED to silence warning
Trivial.
Ilia Mirkin [Thu, 24 Aug 2017 03:15:48 +0000 (23:15 -0400)]
nv50/ir: properly set sType for TXF ops to U32
All of the coordinates and LOD args are integers for TXF. This mostly
doesn't matter, except for converting into a levelZero=true operation by
removing an explicit zero LOD. For the comparison against zero to work
properly, the sType of the instruction has to be set correctly.
Fixes: KHR-GL45.robust_buffer_access_behavior.texel_fetch
Reported-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Samuel Pitoiset [Wed, 23 Aug 2017 14:43:33 +0000 (16:43 +0200)]
mesa: remove duplicate assignments in bind_xfb_buffers()
Useless to do that before checking errors. It's now similar to
the other bind_XXX_buffers() helpers.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Samuel Pitoiset [Wed, 23 Aug 2017 14:43:32 +0000 (16:43 +0200)]
mesa: fix debug/error messages in glColorMaski()
Trivial. While we are at it, adjust indentation.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Timothy Arceri [Sun, 13 Aug 2017 23:23:41 +0000 (09:23 +1000)]
glsl: stop adding pointers from bindless structs to the cache
This is so we always create reproducible cache entries. Consistency
is required for verification of any third party distributed shaders.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 05:13:38 +0000 (15:13 +1000)]
glsl: stop adding pointers from shader_info to the cache
This is so we always create reproducible cache entries. Consistency
is required for verification of any third party distributed shaders.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Tue, 22 Aug 2017 23:10:27 +0000 (09:10 +1000)]
compiler: move pointers to the start of shader_info
This will allow us to easily skip them when writting the struct
to disk cache.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 04:59:02 +0000 (14:59 +1000)]
glsl: always write a name/label string to the cache
In the following patch we will stop writing the pointer to cache.
Unfortunately adding empty strings to that cache seems to be the
only thing we can do here once we no longer have the pointers.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 04:22:07 +0000 (14:22 +1000)]
glsl: don't write uniform storage offset if there isn't one
This is so we always create reproducible cache entries. Consistency
is required for verification of any third party distributed shaders.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 04:17:24 +0000 (14:17 +1000)]
glsl: add has_uniform_storage() helper to shader cache
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 04:01:34 +0000 (14:01 +1000)]
glsl: stop adding pointers from glsl_struct_field to the cache
This is so we always create reproducible cache entries. Consistency
is required for verification of any third party distributed shaders.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 03:55:13 +0000 (13:55 +1000)]
glsl: stop adding pointers from gl_shader_variable to the cache
This is so we always create reproducible cache entries. Consistency
is required for verification of any third party distributed shaders.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Timothy Arceri [Fri, 11 Aug 2017 03:53:18 +0000 (13:53 +1000)]
glsl: allow NULL to be passed to encode_type_to_blob()
This will be used by the following commit.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Dave Airlie [Mon, 21 Aug 2017 04:11:04 +0000 (14:11 +1000)]
radv/gfx9: don't expose linear depth on vega.
This just zeros out the linear flags for gfx9 + depth formats.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 04:10:21 +0000 (14:10 +1000)]
radv: don't degrade tiling mode for small compressed or depth texture.
This is what radeonsi does, so we should do the same, also vega
doesn't support linear depth textures anyways.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 04:04:02 +0000 (14:04 +1000)]
radv/gfx9: only minify image view width/height/depth before gfx9.
For gfx9 the addressing for images has changed, so we need to
provide the hw with the level0, however we still need to scale
for format block differences (so our compressed upload paths still
work).
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 03:58:27 +0000 (13:58 +1000)]
radv/image: don't rescale width/height if the format isn't changing
If the image view has the same format, we don't need to rescale
the w/h.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 03:56:33 +0000 (13:56 +1000)]
radv: cleanup some image view descriptor setup.
Avoid passing the vulkan image creation into the image view descriptor
setup. This cleans up the usage of range inside the init, instead
using the properly inited values in the image view.
This is just a cleanup but some future vega changes will depend on it.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 06:17:27 +0000 (07:17 +0100)]
radv/gfx9: emit sx_mrt_blend registers
GFX9 needs the SX MRT blend registers programmed, port over
the code from radeonsi to workout the values from the blend
state, and program the registers on rbplus systems.
This fixes lots of:
dEQP-VK.pipeline.blend.*
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 06:28:14 +0000 (07:28 +0100)]
radv: bump space check for indexed draw.
For the GFX9 packet we need one more dword.
Fixes an assert in:
dEQP-VK.draw.shader_draw_parameters.base_vertex.draw_indexed
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 05:00:49 +0000 (06:00 +0100)]
radv/gfx9: fixup db/stencil disable.
This fixes disabled Z/stencil.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 21 Aug 2017 07:28:27 +0000 (08:28 +0100)]
radv/gfx9: fix level count in color register setup.
There was an off by one here.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>