Compare commits

...

86 Commits

Author SHA1 Message Date
Dylan Baker
f57f37f3ba docs: Add 18.1.9 release notes 2018-09-24 08:43:25 -07:00
Dylan Baker
634f4f98ac Bump version to 18.1.9 2018-09-21 09:02:55 -07:00
Bas Nieuwenhuizen
a76c43fc19 radv: Fix driver UUID SHA1 init.
Was missing the init, found by Emil.

Fixes: d17443a459 "radv: Use build ID if available for cache UUID."
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 0a77e70d10)
2018-09-20 14:53:59 -07:00
Dylan Baker
6819121e67 cherry-ignore: one final update 2018-09-20 13:30:54 -07:00
Mauro Rossi
309945ec49 android: broadcom/cle: export the broadcom top level path headers
Fixes the following building error in vc4 build:

In file included from external/mesa/src/gallium/drivers/vc4/kernel/vc4_render_cl.c:34:
In file included from external/mesa/src/gallium/drivers/vc4/kernel/vc4_drv.h:27:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_simulator_validate.h:34:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_context.h:39:
In file included from external/mesa/src/gallium/drivers/vc4/vc4_cl.h:56:
out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h:12:10:
fatal error: 'cle/v3d_packet_helpers.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
2018-09-20 13:29:41 -07:00
Mauro Rossi
9b850150c0 android: broadcom/cle: add gallium include path
Fixes the following building error:

In file included from external/mesa/src/broadcom/cle/v3d_decoder.c:38:
In file included from external/mesa/src/broadcom/cle/v3d_packet_helpers.h:29:
external/mesa/src/gallium/auxiliary/util/u_math.h:42:10:
fatal error: 'pipe/p_compiler.h' file not found
         ^~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
2018-09-20 13:29:40 -07:00
Mauro Rossi
80d2139e4a android: broadcom/genxml: fix collision with intel/genxml header-gen macro
Backport to mesa 18.1
Fixes the following building error, happening when building both intel and broadcom:

Gen Header: libmesa_broadcom_genxml_32 <= v3d_packet_v21_pack.h
FAILED: out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h
/bin/bash -c "python external/mesa/src/broadcom/cle/gen_pack_header.py \
external/mesa/src/broadcom/cle/v3d_packet_v21.xml \
> out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h"
Traceback (most recent call last):
  File "external/mesa/src/broadcom/cle/gen_pack_header.py", line 626, in <module>
    p = Parser(sys.argv[2])
IndexError: list index out of range

header-gen macro is already defined by Intel genxml building rules
and the existing header-gen does not have the $(PRIVATE_VER) argument,
infact the bash command line logged in the building error is missing
exactly $(PRIVATE_VER) argument

Renaming the macro as pack-header-gen in src/broadcom/Android.genxml.mk
solves the building error, another possible way is to keep the gen rules
commands expanded and not use the macros.

Fixes: 7f80a9ff13 ("vc4: Introduce XML-based packet header generation like Intel's.")
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
2018-09-20 13:29:39 -07:00
Michal Srb
0be61a9f17 st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does not implement it
This is equivalent to commit a65db0ad1c, but for dri_kms_init_screen. Without
this gbm_dri_is_format_supported always returns false.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104926
Fixes: e14fe41e0b ("st/dri: implement createImageFromRenderbuffer(2)")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Tested-by: Adam Williamson <adamwill@fedoraproject.org>
(cherry picked from commit 194bf0a2e0)
2018-09-20 08:51:22 -07:00
Bas Nieuwenhuizen
59c708ff8a radv: Set the user SGPR MSB for Vega.
Otherwise using 32 user SGPRs would be broken.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit d97c892584)
Conflicts resolved by Dylan

Conflicts:
	src/amd/vulkan/radv_shader.c
2018-09-18 16:43:55 -07:00
Bas Nieuwenhuizen
b38445b218 radv: Only allow 16 user SGPRs for compute on GFX9+.
Apparently for compute there are only 16 instead of the 32 for the
graphics path.

Fixes dEQP-VK.binding_model.descriptorset_random.sets16.noarray.ubolimitlow.sbolimitlow.imglimitlow.noiub.comp.0

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 0dd8189f15)
Conflicts Resolved by Dylan

Conflicts:
	src/amd/vulkan/radv_nir_to_llvm.c
2018-09-18 16:40:19 -07:00
Dylan Baker
e402a7efa5 cherry-ignore: add a patch that was reverted on master 2018-09-18 16:37:34 -07:00
Jason Ekstrand
551b07abba anv/query: Write both dwords in emit_zero_queries
Each query slot is a uint64_t and we were only zeroing half of it.

Fixes: 7ec6e4e689 "anv/query: implement multiview interactions"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 07e214f1ce)
2018-09-18 16:31:51 -07:00
Kenneth Feng
3366da58f4 amd: Add Picasso device id
No changes here compared to Raven.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4490fce166)
2018-09-18 16:31:32 -07:00
Bas Nieuwenhuizen
da9fc5c189 radv: Use build ID if available for cache UUID.
To get an useful UUID for systems that have a non-useful mtime
for the binaries.

I started using SHA1 to ensure we get reasonable mixing in the
various possibilities and the various build id lengths.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit d17443a459)
2018-09-17 13:32:39 -07:00
Josh Pieper
3a34419cb2 st/mesa: Validate the result of pipe_transfer_map in make_texture (v2)
When using Freecad, I was getting intermittent segfaults inside of
mesa.  I traced it down to this path in st_cb_drawpixels.c where the
result of pipe_transfer_map wasn't being checked.  In my case, it was
returning NULL because nouveau_bo_new returned ENOENT.  I'm by no
means a mesa developer, but this patch solves the problem for me and
seems reasonable enough.

v2: Marek - also unmap the PBO and release the texture, and call
    the make_texture function sooner for less cleanup

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 936e0dcd61)
2018-09-17 13:31:51 -07:00
Pierre Moreau
649aff1a87 nvir: Always split 64-bit IMAD/IMUL operations
Those operations do not map to actual hardware instructions, therefore
those should always be lowered to 32-bit instructions.

Fixes: 009c54aa7a "nv50/ir: Split 64-bit integer MAD/MUL operations"

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
(cherry picked from commit 21b92b3464)
Conflicts resolved by Dylan

Conflicts:
	src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
2018-09-14 09:12:08 -07:00
Erik Faye-Lund
cf54d5f47c virgl: adjust strides when mapping temp-resources
When we're mapping temp-resources, we clip the resource to the
transfer-box, which means the stride might not be correct any more.

So let's update the stride from the temp-resource, and recompute the
layer-stride.

This fixes crashes when running dEQP with --deqp-gl-config-name=rgba8888d24s8ms4

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: a8987b88ff "virgl: add driver for virtio-gpu 3D (v2)"
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit fa5e9f1f73)
2018-09-14 09:09:32 -07:00
Dylan Baker
33f5a21c1f cherry-ignore: add 18.2 patchs 2018-09-14 09:09:14 -07:00
Erik Faye-Lund
1816f280c4 winsys/virgl: avoid unintended behavior
If we end up never taking the loop that writes ret, we can end up with
an uninitialized value, and if we're *really* unlucky, that value can
be -1, causing us to go down an error-path instead of a success path.

This was obviously not intended, so let's just initialize this to zero.

Noticed by Valgrind:

Conditional jump or move depends on uninitialised value(s)
   at 0xBA640A0: virgl_drm_winsys_resource_cache_create (virgl_drm_winsys.c:348)
   by 0xBA62FCF: virgl_buffer_create (virgl_buffer.c:170)
   by 0xBA605AC: virgl_resource_create (virgl_resource.c:60)
   by 0xBCF816F: bufferobj_data (st_cb_bufferobjects.c:344)
   by 0xBCF816F: st_bufferobj_data (st_cb_bufferobjects.c:390)
   by 0xBB7E836: vbo_use_buffer_objects (vbo_exec_api.c:1136)
   by 0xBCFCC6E: st_create_context_priv (st_context.c:414)
   by 0xBCFD3CD: st_create_context (st_context.c:590)
   by 0xBBB30CA: st_api_create_context (st_manager.c:896)
   by 0xB981E76: dri_create_context (dri_context.c:155)
   by 0xB97BDCE: driCreateContextAttribs (dri_util.c:473)
   by 0x5288331: dri3_create_context_attribs (dri3_glx.c:309)
   by 0x5264D64: glXCreateContextAttribsARB (create_context.c:78)

Fixes: a8987b88ff ("virgl: add driver for virtio-gpu 3D (v2)")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit eaa718588e)
2018-09-12 08:46:47 -07:00
Michel Dänzer
e89a4589c0 loader/dri3: Only wait for back buffer fences in dri3_get_buffer
We don't need to wait before drawing to the fake front buffer, as front
buffer rendering by definition is allowed to produce artifacts.

Fixes hangs in some cases when re-using the fake front buffer, due to it
still being busy (i.e. in use for presentation).

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/106404
Bugzilla: https://bugs.freedesktop.org/107757
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
(cherry picked from commit aefac10fec)
2018-09-12 08:46:26 -07:00
Dylan Baker
eb6abe40f0 cherry-ignore: Add more 18.2 patches 2018-09-11 08:19:39 -07:00
Christopher Egert
3a23ba5acb radeon: fix ColorMask
Since commit af3685d149 various OpenGL applications regressed
on the classic mesa radeon driver.

Signed-off-by: Christopher Egert <cme3000@gmail.com>
CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 51995f6920)
2018-09-11 08:19:02 -07:00
Marek Olšák
09196d4b66 radeonsi: fix printing a BO list into ddebug reports
important for debugging

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
(cherry picked from commit 662db03577)
2018-09-11 08:18:28 -07:00
Marek Olšák
517c2f1e0f r600: fix HTILE for NPOT textures with mipmapping
Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
(cherry picked from commit da72b6296c)
2018-09-11 08:18:16 -07:00
Marek Olšák
aeb8b00661 radeonsi: fix HTILE for NPOT textures with mipmapping on SI/CI
VI uses addrlib so it's unaffected.

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
(cherry picked from commit a1b9a00f82)
Conflicts resolved by Dylan

Conflicts:
	src/gallium/drivers/radeonsi/si_texture.c
2018-09-11 08:17:31 -07:00
Dave Airlie
4670daa12d virgl: don't send a shader create with no data. (v2)
This fixes the situation where we'd send a shader with just the
header and no data.

piglit/glsl-max-varyings test was causing this to happen, and
the renderer fix was breaking it.

v2: drop fprintf

Fixes: a8987b88ff "virgl: add driver for virtio-gpu 3D (v2)"
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit 240af61494)
2018-09-10 10:13:34 -07:00
Jason Ekstrand
05985a643d anv: Clamp scissors to the framebuffer boundary
The Vulkan 1.1.81 spec says:

    "It is legal for offset.x + extent.width or offset.y + extent.height
    to exceed the dimensions of the framebuffer - the scissor test still
    applies as defined above. Rasterization does not produce fragments
    outside of the framebuffer, so such fragments never have the scissor
    test performed on them."

Elsewhere, the Vulkan 1.1.81 spec says:

    "The application must ensure (using scissor if necessary) that all
    rendering is contained within the render area, otherwise the pixels
    outside of the render area become undefined and shader side effects
    may occur for fragments outside the render area. The render area
    must be contained within the framebuffer dimensions."

Unfortunately, there's some room for interpretation here as to what the
consequences are of having the render area set to exactly the
framebuffer dimensions and having a scissor that is larger than the
framebuffer.  Given that GL and other APIs provide automatic clipping to
the framebuffer, it makes sense that applications would assume that
Vulkan does this as well.  It costs us very little to play it safe and
just clamp client-provided scissors to the framebuffer dimensions.
Fortunately, the user is required to provide us with at least one
scissor so we don't need to handle the case where they don't.

Fixes: fb2a5ceb32 "anv: Emit DRAWING_RECTANGLE once at driver..."
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 465e5a868c)
2018-09-10 10:13:27 -07:00
Jason Ekstrand
3bfed07f09 anv: Disable the vertex cache when tessellating on SKL GT4
I have no idea if I'm correct about what's going wrong or if this is the
correct fix.  However, in my multiple weeks of banging my head on this
hang, a VUE reference counting bug seems to match all the symptoms and
it definitely fixes the hang.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107280
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b08b4b2b25)
2018-09-10 10:12:20 -07:00
Jason Ekstrand
9f08ea8c0a anv: Re-emit vertex buffers when the pipeline changes
Some of the bits of VERTEX_BUFFER_STATE such as access type, instance
data step rate, and pitch come from the pipeline.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c643c5e18d)
2018-09-10 10:12:09 -07:00
Jason Ekstrand
08e3909c6c i965: Workaround the gen9 hw astc5x5 sampler bug
gen9 hardware has a bug in the sampler cache that can cause GPU hangs
whenever an texture with aux compression enabled is in the sampler cache
together with an ASTC5x5 texture.  Because we can't control what the
client binds at any given time, we have two options: resolve the CCS or
decompresss the ASTC.  Doing a CCS or HiZ resolve is far less drastic
and will likely have a smaller performance impact.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit f9e630e23d)
2018-09-10 10:12:04 -07:00
Dylan Baker
99ecc5fc20 cherry-ignore: Add patches that don't apply cleanly and are for developer tools 2018-09-07 10:16:55 -07:00
Andrii Simiklit
ea7df5b7c0 mesa/util: add missing va_end() after va_copy()
MSDN:
"va_end must be called on each argument list that's initialized
 with va_start or va_copy before the function returns."

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107810
Fixes: c6267ebd6c "gallium/util: Stop bundling our snprintf implementation."
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
(cherry picked from commit 2930b76cfe)
2018-09-07 10:16:55 -07:00
Andrii Simiklit
a17aed452d mesa/util: don't ignore NULL returned from 'malloc'
We should exit from the function 'util_vasprintf'
with error code -1 for case where 'malloc'
returns NULL

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 864148d69e "util: add util_vasprintf() for Windows (v2)"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
(cherry picked from commit 65cfe698b0)
2018-09-07 10:16:55 -07:00
Andrii Simiklit
4a44ff8bad mesa/util: don't use the same 'va_list' instance twice
The first usage of the 'va_list' instance could change it.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 864148d69e "util: add util_vasprintf() for Windows (v2)"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
(cherry picked from commit 570cacba7a)
2018-09-07 10:16:55 -07:00
Andrii Simiklit
019ff6b453 apple/glx/log: added missing va_end() after va_copy()
Each invocation of va_copy() must be matched by a
corresponding invocation of va_end()

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 51691f0767 "darwin: Use ASL for logging"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
(cherry picked from commit 267ed29288)
2018-09-07 10:16:55 -07:00
Dylan Baker
b14c2b467d cherry-ignore: add another 18.2 patch 2018-09-07 10:16:55 -07:00
Sergii Romantsov
b5e03decbb intel: compiler option msse2 and mstackrealign
Seems in case of 32-bit library, usage of msse2 makes
some stack corruption or incorrect instructions.
Usage with mstackrealign fixes that case.

v2: Fixed meson.

v3: Definition of c_sse2_args moved on the top (L.Landwerlin).
    Added mstackrealign for Android's mks where msee4.1 is used.

v4: Added for Vulkan also.

v5: Commit message correction.

CC: <mesa-stable@lists.freedesktop.org>
Fixes: 6b05c080f2 (i965: Compile with -msse3)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107779
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit d709f12792)
2018-09-07 10:16:55 -07:00
Jason Ekstrand
6f43390dd2 anv/pipeline: Only consider double elements which actually exist
The brw_vs_prog_data::double_inputs_read field comes directly from
shader_info::double_inputs which may contain inputs which are not
actually read.  Instead of using it directly, AND it with inputs_read
which is only things which are read.  Otherwise, we may end up
subtracting too many elements when computing elem_count.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103241
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 7b26741806)
2018-09-07 10:16:55 -07:00
Timothy Arceri
67cfeb1686 glsl: fixer lexer for unreachable defines
If we have something like:

   #ifdef NOT_DEFINED
   #define A_MACRO(x) \
	if (x)
   #endif

The # on the #define is not skipped but the define itself is so
this then gets recognised as #if.

Until 28a3731e3f this didn't happen because we ended up in
<HASH>{NONSPACE} where BEGIN INITIAL was called stopping the
problem from happening.

This change makes sure we never call RETURN_TOKEN_NEVER_SKIP for
if/else/endif when processing a define.

Cc: Ian Romanick <idr@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107772
2018-09-07 10:16:55 -07:00
Mathias Fröhlich
06579faa9d tnl: Fix green gun regression in xonotic.
Fix an other regression of
mesa: Make gl_vertex_array contain pointers to first order VAO members.
The regression showed up with drivers using the tnl module and
was reproducible using xonotic-glx -benchmark demos/the-big-keybench.dem.

Fixes: 64d2a20480
    mesa: Make gl_vertex_array contain pointers to first order VAO members.
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
(cherry picked from commit a6232b6932)
Conflicts resolved by Dylan

Conflicts:
	src/mesa/tnl/t_split_copy.c
2018-09-07 10:16:55 -07:00
Dylan Baker
527813b222 meson: Print a message about why a libdrm version was selected
We require a single version of libdrm for all of our libdrm
dependencies (core and driver), but the way this is structured can make
the error message less than helpful, as one driver might be the one
setting the libdrm requirement, while another might be the one that
generates the version failure.

This adds a simple message to the output announcing which libdrm module
set the version, which might be more helpful.

v2: - Use message suggested by Eric Engstrom

Fixes: c445b1d56f
       ("meson: Use the same version for all libdrm checks")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit d25a27ec56)
2018-09-07 10:16:55 -07:00
Gert Wollny
37fd626925 winsys/virgl: correct resource and handle allocation (v2)
Fixes crash with
  piglit/bin/map_buffer_range-invalidate CopyBufferSubData \
                               increment-offset -auto -fbo

* Resize the resource storage already when the count is equal to the
  allocated size, fixes:

  Invalid write of size 8
  at 0xB72E4CF: virgl_drm_add_res (virgl_drm_winsys.c:629)
  by 0xB72E4CF: virgl_drm_emit_res (virgl_drm_winsys.c:663)
  by 0xB72A44A: virgl_encode_resource_copy_region (virgl_encode.c:776)
  by 0xB40CD12: st_copy_buffer_subdata (st_cb_bufferobjects.c:585)
  by 0xB244A3B: _mesa_CopyBufferSubData (bufferobj.c:2940)
  by 0x109A1E: upload (invalidate.c:169)
  by 0x109C2F: piglit_display (invalidate.c:215)
  by 0x4F80FBE: run_test (piglit_fbo_framework.c:52)
  by 0x4F66E5F: piglit_gl_test_run (piglit-framework-gl.c:229)
  by 0x10949D: main (invalidate.c:47)
  Address 0xbe07d30 is 0 bytes after a block of size 4,096 alloc'd
  at 0x4C31B25: calloc (in
       /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0xB72DAAF: virgl_drm_cmd_buf_create (virgl_drm_winsys.c:567)

* Also resize the space allocated for the handles, fixes:

  Invalid write of size 4
  at 0xB72E4F0: virgl_drm_add_res (virgl_drm_winsys.c:631)
  by 0xB72E4F0: virgl_drm_emit_res (virgl_drm_winsys.c:663)
  by 0xB72A44A: virgl_encode_resource_copy_region (virgl_encode.c:776)
  by 0xB40CD12: st_copy_buffer_subdata (st_cb_bufferobjects.c:585)
  by 0xB244A3B: _mesa_CopyBufferSubData (bufferobj.c:2940)
  by 0x109A1E: upload (invalidate.c:169)
  by 0x109C2F: piglit_display (invalidate.c:215)
  by 0x4F80FBE: run_test (piglit_fbo_framework.c:52)
  by 0x4F66E5F: piglit_gl_test_run (piglit-framework-gl.c:229)
  by 0x10949D: main (invalidate.c:47)
  Address 0xbe08570 is 0 bytes after a block of size 2,048 alloc'd
  at 0x4C2FB0F: malloc (
    in /usr/lib/valgrind/vgpreload_memcheck-amd64- linux.so)
  by 0xB72DAC8: virgl_drm_cmd_buf_create (virgl_drm_winsys.c:572)

Fixes: 4b15b5e803 ("virgl: resize resource bo allocation if we need to.")

v2: - Use REALLOC macro and avoid memory leak when re-allocation fails
    - add Fixes tag (both Emil Velikov)
    - reorder commit message

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
(cherry picked from commit 9b0e8d8723)
2018-09-07 10:16:55 -07:00
Dylan Baker
2620eb8e06 cherry-ignore: Add additional 18.2 patch 2018-09-07 10:16:55 -07:00
Marek Olšák
a985f18ef4 st/mesa: help fix stencil border color for GL_DEPTH_STENCIL textures
GL_STENCIL_INDEX uses GL_INTENSITY for the border color, which is nicer
to hardware that doesn't read the stencil border value from the X channel.

This fixes a bunch of dEQP tests on Vega & Raven.

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 725e8ad559)
2018-09-07 10:16:55 -07:00
Dylan Baker
ad47840009 docs/relnotes: Add sha256 sums for mesa 18.1.8 2018-09-07 10:10:13 -07:00
Dylan Baker
92497d659b docs: Add release notes for 18.1.8 2018-09-07 08:27:26 -07:00
Dylan Baker
9743fd241b Bump version to 18.1.8 2018-09-07 08:22:13 -07:00
Juan A. Suarez Romero
01967a97bf egl/wayland: do not leak wl_buffer when it is locked
If color buffer is locked, do not set its wayland buffer to NULL;
otherwise it can not be freed later.

Rather, flag it in order to destroy it later on the release event.

v2: instruct release event to unlock only or free wl_buffer too (Daniel)

This also fixes dEQP-EGL.functional.swap_buffers_with_damage.* tests.

CC: Daniel Stone <daniel@fooishbar.org>
2018-09-04 14:24:02 -07:00
Dylan Baker
99082b93b6 cherry-ignore: Add patch that needs more significant patches to function
In this case the patch is fine for 18.2 as the required patches are
already present, but they're not in 18.1 and they're too big to be
pulled back.
2018-09-04 09:00:11 -07:00
Dylan Baker
9622c17ec0 cherry-ignore: Add a couple of two fixes warning patches 2018-09-04 08:59:29 -07:00
Christian Gmeiner
88bbbe8503 tegra: fix memory leak
Fixes: 1755f608f5 ("tegra: Initial support")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit d0b09e2dfe)
2018-09-04 08:59:29 -07:00
Daniel Stone
104c598bfb st/dri: Don't expose sRGB formats to clients
Though the SARGB8888 format is used internally through its FourCC value,
it is not a real format as defined by drm_fourcc.h; it cannot be used
with KMS or other interfaces expecting drm_fourcc.h format codes.

Ensure we don't advertise it through the dmabuf format/modifier query
interfaces, preventing us from tripping over an assert.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Michel Dänzer <michel.daenzer@amd.com>
Fixes: 8c1b9882b2 ("egl/dri2: Guard against invalid fourcc formats")
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 01c0aa9f05)
2018-09-04 08:59:29 -07:00
Samuel Pitoiset
1ec6ba931b radv: fix passing clip/cull distances from VS to PS
CTS doesn't test input clip/cull distances for the fragment
shader stage, which explains why this was totally broken. I
wrote a simple test locally that works now.

This fixes a crash with GTA V and DXVK.

Note that we are exporting unused parameters from the vertex
shader now, but this can't be optimized easily because we don't
keep the fragment shader info...

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107477
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 6f47df3129)
Very minor conflicts resolved by Dylan

Conflicts:
	src/amd/vulkan/radv_nir_to_llvm.c
2018-09-04 08:59:29 -07:00
Nanley Chery
b0838037b4 i965/gen7_urb: Re-emit PUSH_CONSTANT_ALLOC on some gen9
According to internal docs, some gen9 platforms have a pixel shader push
constant synchronization issue. Although not listed among said
platforms, this issue seems to be present on the GeminiLake 2x6's we've
tested.

We consider the available workarounds to be too detrimental on
performance. Instead, we mitigate the issue by applying part of one of
the workarounds. Re-emit PUSH_CONSTANT_ALLOC at the top of every batch
(as suggested by Ken).

Fixes ext_framebuffer_multisample-accuracy piglit test failures with the
following options:
* 6 depth_draw small depthstencil
* 8 stencil_draw small depthstencil
* 6 stencil_draw small depthstencil
* 8 depth_resolve small
* 6 stencil_resolve small depthstencil
* 4 stencil_draw small depthstencil
* 16 stencil_draw small depthstencil
* 16 depth_draw small depthstencil
* 2 stencil_resolve small depthstencil
* 6 stencil_draw small
* all_samples stencil_draw small
* 2 depth_draw small depthstencil
* all_samples depth_draw small depthstencil
* all_samples stencil_resolve small
* 4 depth_draw small depthstencil
* all_samples depth_draw small
* all_samples stencil_draw small depthstencil
* 4 stencil_resolve small depthstencil
* 4 depth_resolve small depthstencil
* all_samples stencil_resolve small depthstencil

v2: Include more platforms in WA (Ken).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106865
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93355
Cc: <mesa-stable@lists.freedesktop.org>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 904c2a617d)
2018-09-04 08:59:29 -07:00
Ian Romanick
a144518f34 i965/vec4: Correctly handle uniform sources in generate_tes_add_indirect_urb_offset
Fixes failure in the new piglit test
tes-patch-input-array-vec2-index-invalid-rd.shader_test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 75666605c9)
2018-09-04 08:59:29 -07:00
Ian Romanick
de445b36ba i965/vec4: Clamp indirect tes input array reads with 0x0fffffff
Page 190 of "Volume 7: 3D Media GPGPU Engine (Haswell)" says the valid
range of the offset is [0, 0FFFFFFFh].

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 82530ce1b5)
2018-09-04 08:59:29 -07:00
Jason Ekstrand
e5a2bf8f94 anv/blorp: Do more flushing around HiZ clears
We make the flush after a HiZ clear unconditional and add a flush/stall
before the clear as well.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107760
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
(cherry picked from commit 62378c5e9e)
2018-09-04 08:59:29 -07:00
Bas Nieuwenhuizen
1063fbe6cc radv: Use a lower max offchip buffer count.
No clue what gets fixed by this but both radeonsi and amdvlk do it.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit ab64891f4c)
2018-09-04 08:50:14 -07:00
Bas Nieuwenhuizen
5872b1522a radv: Fix CMASK dimensions.
Mirrors

1e40f69483 "ac/surface: fix CMASK fast clear for NPOT textures with mipmapping on SI/CI/VI"

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 233718a199)
2018-09-04 08:50:09 -07:00
Jason Ekstrand
f58f2f6754 egl/dri2: Guard against invalid fourcc formats
We already reject attempts to import images with invalid fourcc formats
but don't really guard the queries all that well.  This makes us error
out in any calls to eglQueryDmaBufModifiersEXT if the given format is
not a valid fourcc format.  We also add an assert to ensure that drivers
don't advertise any non-fourcc formats.

Cc: mesa-stable@lists.freedesktop.org
Tested-By: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 8c1b9882b2)
2018-08-31 08:36:56 -07:00
Jason Ekstrand
74a671d019 egl/dri2: Add a helper for the number of planes for a FOURCC format
This also serves as a convenient "is this a fourcc format" check as well
which we'll take advantage of in the next commit.

Cc: mesa-stable@lists.freedesktop.org
Tested-By: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit b95896f492)
2018-08-31 08:36:56 -07:00
Dave Airlie
6a854c5620 ac/radeonsi: fix CIK copy max size
While adding transfer queues to radv, I started writing some tests,
the first test I wrote fell over copying a buffer larger than this
limit.

Checked AMDVLK and found the correct limit.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 2c1f249f2b)
2018-08-31 08:36:07 -07:00
Jason Ekstrand
16d44d1e98 nir/algebraic: Be more careful converting ushr to extract_u8/16
If it's not the right bit-size, it may not actually be the correct
extraction.  For now, we'll only worry about 32-bit versions.

Fixes: 905ff86198 "nir: Recognize open-coded extract_u16"
Fixes: 76289fbfa8 "nir: Recognize open-coded extract_u8"
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 116b47fe3c)
2018-08-30 08:32:47 -07:00
Bas Nieuwenhuizen
8c3aee4038 radv: Add missing checks in radv_get_image_format_properties.
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 4738b6ac81)
2018-08-30 08:31:41 -07:00
Dylan Baker
229d0854e0 cherry-ignore: Add patch that doesn't apply to 18.1 2018-08-30 08:31:12 -07:00
Andrii Simiklit
8aba522f49 i965/gen6/xfb: handle case where transform feedback is not active
When the SVBI Payload Enable is false I guess the register R1.4
which contains the Maximum Streamed Vertex Buffer Index is filled by zero
and GS stops to write transform feedback when the transform feedback
is not active.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107579
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
(cherry picked from commit 1b0df8a460)
2018-08-30 08:28:36 -07:00
Lionel Landwerlin
7a9b95bd7e anv: blorp: support multiple aspect blits
Newer blit tests are enabling depth&stencils blits. We currently don't
support it but can do by iterating over the aspects masks (copy some
logic from the CopyImage function).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9f44745eca ("anv: Use blorp to implement VkBlitImage")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 5a1c23d150)
2018-08-30 08:25:54 -07:00
Dylan Baker
d7065dc401 cherry-ignore: Add additional patch 2018-08-29 08:30:29 -07:00
Dylan Baker
e7eb574075 cherry-ignore: Add more 18.2 patches 2018-08-29 08:23:55 -07:00
vadym.shovkoplias
bdc842a092 glsl/linker: Allow unused in blocks which are not declated on previous stage
>From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:

    "Only the input variables that are actually read need to be written
     by the previous stage; it is allowed to have superfluous
     declarations of input variables."

Fixes:
    * interstage-multiple-shader-objects.shader_test

v2:
  Update comment in ir.h since the usage of "used" field
  has been extended.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101247
Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit 4a8444d5bc)
2018-08-28 09:02:44 -07:00
Dylan Baker
850e1259e1 meson: Actually load translation files
Currently we run the script but don't actually load any files, even in a
tarball where they exist.

Fixes: 3218056e0e
       ("meson: Build i965 and dri stack")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 7c00db9527)
2018-08-28 08:59:23 -07:00
Dylan Baker
cd10b797c4 cherry-ignore: Add more 18.2 only patches 2018-08-28 08:58:41 -07:00
Jason Ekstrand
5163f96905 anv: Fill holes in the VF VUE to zero
This fixes a GPU hang in DOOM 2016 running under wine.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104809
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 76b0e4d8c9)
2018-08-27 08:56:28 -07:00
Marek Olšák
9517387144 glapi: actually implement GL_EXT_robustness for GLES
The extension was exposed but not the functions.

This fixes:
    dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.readn_pixels
    dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformfv
    dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformiv

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 37eee90df7)
2018-08-24 09:33:23 -07:00
Dylan Baker
280be5067d cherry-ignore: add a patch 2018-08-24 09:33:23 -07:00
Emil Velikov
745be98a7d docs: update required mako version
The requirement was bumped a while back, but we forgot to update the
docs.

Fixes: ed871af91c ("configure.ac: raise Mako required version to
0.8.0")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit e39b916d0c)
2018-08-24 09:33:23 -07:00
Gurchetan Singh
d180c8d785 meson: fix egl build for android
Haven't tested this, but we do include loader.h
in platform_android.c

Fixes: c5ec155685 ("meson: wire up egl/android")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit c731508b98)
2018-08-24 09:33:23 -07:00
Gurchetan Singh
529eda0aad meson: fix egl build for surfaceless
Without this, I get:

 > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
 > #include "loader.h"
 >      ^~~~~~~~~~
 > 1 error generated.

Fixes: 108d257a16 ("meson: build libEGL")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>

v2: Split up patches, modify commit message (Dylan)
(cherry picked from commit ec6cb01e21)
2018-08-24 09:33:23 -07:00
Nanley Chery
fc1a21da40 i965/miptree: Fix can_blit_slice()
Check the destination's row pitch against the BLT engine's row pitch
limitation as well.

Fixes: 0288fe8d04
("i965/miptree: Use the correct BLT pitch")

v2: Fix the Fixes tag (Dylan).
    Check the destination row pitch (Chris).

Reported-by: Dylan Baker <dylan@pnwbakers.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit b041fc0649)
2018-08-24 09:33:23 -07:00
Nanley Chery
af3c8a4c01 i965/miptree: Use miptree_map in map_blit functions
This struct contains all the data of interest. can_blit_slice() will use
it in the next patch to calculate the correct pitch.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 030b6efcfd)
2018-08-24 09:33:23 -07:00
Nanley Chery
a9dbc4b3f4 i965/miptree: Use the correct BLT pitch
Retile miptrees to a linear tiling less often. Retiling can cause issues
with imported BOs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106738
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 0288fe8d04)
2018-08-24 09:33:23 -07:00
Nanley Chery
32331a3efc i965/miptree: Drop an if case from retile_as_linear
Drop an if statement whose predicate never evaluates to true. row_pitch
belongs to a surface with non-linear tiling. According to
isl_calc_tiled_min_row_pitch, the pitch is a multiple of the tile width.
By looking at isl_tiling_get_info, we see that non-linear tilings have
widths greater than or equal to 128B.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 3df201e3e8)
2018-08-24 09:33:23 -07:00
Nanley Chery
b9c903b406 i965: Make blt_pitch public
We'd like to reuse this helper.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 0ab2541943)
2018-08-24 09:33:23 -07:00
Nanley Chery
b727e1ff10 intel/isl: Avoid tiling some 16K-wide render targets
Fix rendering issues on BDW and SKL.

Fixes: 0288fe8d04
("i965/miptree: Use the correct BLT pitch")

Fixes the following regressions seen

exclusively on SKL:
* KHR-GL46.texture_barrier_ARB.disjoint-texels
* KHR-GL46.texture_barrier_ARB.overlapping-texels
* KHR-GL46.texture_barrier.disjoint-texels
* KHR-GL46.texture_barrier.overlapping-texels

and both on BDW and SKL:
* GTF-GL46.gtf21.GL2FixedTests.buffer_corners.buffer_corners
* GTF-GL46.gtf21.GL2FixedTests.stencil_plane_corners.stencil_plane_corners

v2: Note the fixed tests (Andres).
    Don't cause failures with multisampled buffers (Andres).
    Don't hamper SKL GT4 (Ken).
v3: Fix the Fixes tag (Dylan).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107359
Cc: <mesa-stable@lists.freedesktop.org>
Tested-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 6d80b0b4ba)
2018-08-24 09:33:23 -07:00
Grazvydas Ignotas
e6fdf98a79 radv: place pointer length into cache uuid
Thanks to reproducible builds, binary file timestamps may be identical
for both 32bit and 64bit packages when built from the same source.
This means radv will use the same cache for both 32 and 64 bit
processes, which leads to crashes.

Conveniently there is a spare byte in cache_uuid, let's place the
pointer size there.

Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107601
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105904
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 356f6673d6)
2018-08-24 09:33:23 -07:00
Dylan Baker
4a844b54d0 docs: Add mesa 18.1.7 notes 2018-08-24 09:29:07 -07:00
71 changed files with 1197 additions and 251 deletions

View File

@@ -1 +1 @@
18.1.7
18.1.9

View File

@@ -66,8 +66,64 @@ f9e8456c39136aa41f85f82758a00e5aa2aab334
a4a104fc81e93555899050efac23c3cd6ba762ab
24ee53231da84a1be5ec08abebe8a2ff6aa019ca
4c43ec461de4f122d5d6566361d064c816e4ef69
743e11c10b180247488ae0cc24900560e0a74e2b
4ffb575da59fd3aece02734ca4fd3212d5002d55
8c048af5890d43578ca41eb9dcfa60cb9cc3fc9c
c92a463d2341dd7893dd8b54775930ed9be72ac0
ea1e50cc166ae855f9fa91ca6a4f944123298e4e
f73f748323ef5a421ffd8fa0f02afd9627e31023
d4e52281aa9c1acc92619736da8b67d8c02ce380
a5f35aa742c3f1e2fae6a6c2fb53f92822f0cb70
f6e09db2e613c215257b80f40957d580165b5ddf
d4bf954fe61ec231be2bfa5e059f0fb7f6150bd1
abdf396cbeaec2bfe9da2fd773d42fa3022ca8b5
b9f6521157ab55073eec528cacc1f3b567e49503
aa3020592964344c7032396d159e4ab2df743587
063264db5be2941746fa58f164cdc803362753a9
748f4cce183007587a6688ef25ad5f9dbea5c33c
9de062ef207c6062d1fabb70209f4bbc9dc4732d
7d1d1208c2b38890fe065b6431ef2e3b7166bae4
0796c3934ebfe3448acf2d63f478f51c08e33046
864c780566b8782c4fc69b4337db768223717bd8
# These have more than one fixes tag and generate a warning
#
24839663a40257e0468406d72c48d431b5ae2bd4
6ff1c479968819b93c46d24bd898e89ce14ac401
ac0856ae4100a05dcd1fd932d9fd10200f8f7a7c
c9f54486959716762e6818dabb0a73a8cd46df67
# This patch requires patches that would require python 3, the thing they're
# fixing isn't really even a bug, it's more of a style choice, so I'm not going
# to pull them.
#
48820ed8da0ad50d51a58f26e156d82b685492e2
# This patch doesn't apply and either needs to be backported or can just be
# ignored
#
1e40f6948310be07abb2d0198e6602769892cdac
# This patch isn't necessary, since the patch it fixes is not present in 18.1
#
a72dbc461bdb7714656e62cd8f4b00a404c2e6e0
# This requires a much more significant patch not present in 18.1
#
4dc244eb447b1fa4e39d67a58328ed774395c901
# This patches were dropped since they only fix developer tools, which aren't
# built by default and should be of no use to end users or distros
#
97fcccb25ed5f55139c03ebc1c71742f0f25f683
4aec44c0d9c4c0649c362199fac97efe0a3b38a4
# This patch was reverted on master shortly after merging.
#
90819abb56f6b1a0cd4946b13b6caf24fb46e500
# These were supreceeded by patches backported to 18.1
#
3341429d74099b436c3824164837eebd47029ded
9158e0bd82ffdad4baf46221bccbbb3fe4764c11
cc3b99bb48769ccd018b781338b548306af5046b

View File

@@ -75,7 +75,7 @@ you think you've spotted a bug let developers know by filing a
Version 2.6.4 or later should work.
</li>
<li><a href="http://www.makotemplates.org/">Python Mako module</a> -
Python Mako module is required. Version 0.3.4 or later should work.
Python Mako module is required. Version 0.8.0 or later should work.
</li>
<li>lex / yacc - for building the Mesa IR and GLSL compiler.
<div>

View File

@@ -31,7 +31,8 @@ Compatibility contexts may report a lower version depending on each driver.
<h2>SHA256 checksums</h2>
<pre>
TBD
0c3c240bcd1352d179e65993214f9d55a399beac852c3ab4433e8df9b6c51c83 mesa-18.1.7.tar.gz
655e3b32ce3bdddd5e6e8768596e5d4bdef82d0dd37067c324cc4b2daa207306 mesa-18.1.7.tar.xz
</pre>

180
docs/relnotes/18.1.8.html Normal file
View File

@@ -0,0 +1,180 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 18.1.8 Release Notes / September 7 2018</h1>
<p>
Mesa 18.1.8 is a bug fix release which fixes bugs found since the 18.1.7 release.
</p>
<p>
Mesa 18.1.8 implements the OpenGL 4.5 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
4.5 is <strong>only</strong> available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
</p>
<h2>SHA256 checksums</h2>
<pre>
8ec62f215dd1bb3910987f9941c6fc31632a0874e618815cf1e8e29445c86e0a mesa-18.1.8.tar.gz
bd1be67fe9c73b517765264ac28911c84144682d28dbff140e1c2deb2f44c21b mesa-18.1.8.tar.xz
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93355">Bug 93355</a> - [BXT,SKLGT4e] intermittent ext_framebuffer_multisample.accuracy fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101247">Bug 101247</a> - Mesa fails to link GLSL programs with unused output blocks</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=104809">Bug 104809</a> - anv: DOOM 2016 and Wolfenstein II:The New Colossus crash due to not having depthBoundsTest</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=105904">Bug 105904</a> - Needed to delete mesa shader cache after driver upgrade for 32 bit wine vulkan programs to work.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=106738">Bug 106738</a> - No test for miptrees with DRI modifiers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=106865">Bug 106865</a> - [GLK] piglit.spec.ext_framebuffer_multisample.accuracy stencil tests fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107359">Bug 107359</a> - [Regression] [bisected] [OpenGL CTS] [SKL,BDW] KHR-GL46.texture_barrier*-texels, GTF-GL46.gtf21.GL2FixedTests.buffer_corners.buffer_corners, and GTF-GL46.gtf21.GL2FixedTests.stencil_plane_corners.stencil_plane_corners fail with some configuration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107477">Bug 107477</a> - [DXVK] Setting high shader quality in GTA V results in LLVM error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107579">Bug 107579</a> - [SNB] The graphic corruption when we reuse the GS compiled and used for TFB when statebuffer contain magic trash in the unused space</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107601">Bug 107601</a> - Rise of the Tomb Raider Segmentation Fault when the game starts</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107760">Bug 107760</a> - GPU Hang when Playing DiRT 3 Complete Edition using Steam Play with DXVK</li>
</ul>
<h2>Changes</h2>
<p>Andrii Simiklit (1):</p>
<ul>
<li>i965/gen6/xfb: handle case where transform feedback is not active</li>
</ul>
<p>Bas Nieuwenhuizen (3):</p>
<ul>
<li>radv: Add missing checks in radv_get_image_format_properties.</li>
<li>radv: Fix CMASK dimensions.</li>
<li>radv: Use a lower max offchip buffer count.</li>
</ul>
<p>Christian Gmeiner (1):</p>
<ul>
<li>tegra: fix memory leak</li>
</ul>
<p>Daniel Stone (1):</p>
<ul>
<li>st/dri: Don't expose sRGB formats to clients</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>ac/radeonsi: fix CIK copy max size</li>
</ul>
<p>Dylan Baker (10):</p>
<ul>
<li>docs: Add mesa 18.1.7 notes</li>
<li>cherry-ignore: add a patch</li>
<li>cherry-ignore: Add more 18.2 only patches</li>
<li>meson: Actually load translation files</li>
<li>cherry-ignore: Add more 18.2 patches</li>
<li>cherry-ignore: Add additional patch</li>
<li>cherry-ignore: Add patch that doesn't apply to 18.1</li>
<li>cherry-ignore: Add a couple of two fixes warning patches</li>
<li>cherry-ignore: Add patch that needs more significant patches to function</li>
<li>Bump version to 18.1.8</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>docs: update required mako version</li>
</ul>
<p>Grazvydas Ignotas (1):</p>
<ul>
<li>radv: place pointer length into cache uuid</li>
</ul>
<p>Gurchetan Singh (2):</p>
<ul>
<li>meson: fix egl build for surfaceless</li>
<li>meson: fix egl build for android</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>i965/vec4: Clamp indirect tes input array reads with 0x0fffffff</li>
<li>i965/vec4: Correctly handle uniform sources in generate_tes_add_indirect_urb_offset</li>
</ul>
<p>Jason Ekstrand (5):</p>
<ul>
<li>anv: Fill holes in the VF VUE to zero</li>
<li>nir/algebraic: Be more careful converting ushr to extract_u8/16</li>
<li>egl/dri2: Add a helper for the number of planes for a FOURCC format</li>
<li>egl/dri2: Guard against invalid fourcc formats</li>
<li>anv/blorp: Do more flushing around HiZ clears</li>
</ul>
<p>Juan A. Suarez Romero (1):</p>
<ul>
<li>egl/wayland: do not leak wl_buffer when it is locked</li>
</ul>
<p>Lionel Landwerlin (1):</p>
<ul>
<li>anv: blorp: support multiple aspect blits</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>glapi: actually implement GL_EXT_robustness for GLES</li>
</ul>
<p>Nanley Chery (7):</p>
<ul>
<li>intel/isl: Avoid tiling some 16K-wide render targets</li>
<li>i965: Make blt_pitch public</li>
<li>i965/miptree: Drop an if case from retile_as_linear</li>
<li>i965/miptree: Use the correct BLT pitch</li>
<li>i965/miptree: Use miptree_map in map_blit functions</li>
<li>i965/miptree: Fix can_blit_slice()</li>
<li>i965/gen7_urb: Re-emit PUSH_CONSTANT_ALLOC on some gen9</li>
</ul>
<p>Samuel Pitoiset (1):</p>
<ul>
<li>radv: fix passing clip/cull distances from VS to PS</li>
</ul>
<p>vadym.shovkoplias (1):</p>
<ul>
<li>glsl/linker: Allow unused in blocks which are not declated on previous stage</li>
</ul>
</div>
</body>
</html>

177
docs/relnotes/18.1.9.html Normal file
View File

@@ -0,0 +1,177 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 18.1.8 Release Notes / September 24 2018</h1>
<p>
Mesa 18.1.9 is a bug fix release which fixes bugs found since the 18.1.8 release.
</p>
<p>
Mesa 18.1.9 implements the OpenGL 4.5 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
4.5 is <strong>only</strong> available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
</p>
<h2>SHA256 checksums</h2>
<pre>
TBD
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=103241">Bug 103241</a> - Anv crashes when using 64-bit vertex inputs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=104926">Bug 104926</a> - swrast: Mesa 17.3.3 produces: HW cursor for format 875713089 not supported</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107280">Bug 107280</a> - [DXVK] Batman: Arkham City with tessellation enabled hangs on SKL GT4</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107772">Bug 107772</a> - Mesa preprocessor matches if(def)s &amp; endifs incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107779">Bug 107779</a> - Access violation with some games</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=107810">Bug 107810</a> - The 'va_end' call is missed after 'va_copy' in 'util_vsnprintf' function under windows</li>
</ul>
<h2>Changes</h2>
<p>Andrii Simiklit (4):</p>
<ul>
<li>apple/glx/log: added missing va_end() after va_copy()</li>
<li>mesa/util: don't use the same 'va_list' instance twice</li>
<li>mesa/util: don't ignore NULL returned from 'malloc'</li>
<li>mesa/util: add missing va_end() after va_copy()</li>
</ul>
<p>Bas Nieuwenhuizen (4):</p>
<ul>
<li>radv: Use build ID if available for cache UUID.</li>
<li>radv: Only allow 16 user SGPRs for compute on GFX9+.</li>
<li>radv: Set the user SGPR MSB for Vega.</li>
<li>radv: Fix driver UUID SHA1 init.</li>
</ul>
<p>Christopher Egert (1):</p>
<ul>
<li>radeon: fix ColorMask</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>virgl: don't send a shader create with no data. (v2)</li>
</ul>
<p>Dylan Baker (10):</p>
<ul>
<li>docs/relnotes: Add sha256 sums for mesa 18.1.8</li>
<li>cherry-ignore: Add additional 18.2 patch</li>
<li>meson: Print a message about why a libdrm version was selected</li>
<li>cherry-ignore: add another 18.2 patch</li>
<li>cherry-ignore: Add patches that don't apply cleanly and are for developer tools</li>
<li>cherry-ignore: Add more 18.2 patches</li>
<li>cherry-ignore: add 18.2 patchs</li>
<li>cherry-ignore: add a patch that was reverted on master</li>
<li>cherry-ignore: one final update</li>
<li>Bump version to 18.1.9</li>
</ul>
<p>Erik Faye-Lund (2):</p>
<ul>
<li>winsys/virgl: avoid unintended behavior</li>
<li>virgl: adjust strides when mapping temp-resources</li>
</ul>
<p>Gert Wollny (1):</p>
<ul>
<li>winsys/virgl: correct resource and handle allocation (v2)</li>
</ul>
<p>Jason Ekstrand (6):</p>
<ul>
<li>anv/pipeline: Only consider double elements which actually exist</li>
<li>i965: Workaround the gen9 hw astc5x5 sampler bug</li>
<li>anv: Re-emit vertex buffers when the pipeline changes</li>
<li>anv: Disable the vertex cache when tessellating on SKL GT4</li>
<li>anv: Clamp scissors to the framebuffer boundary</li>
<li>anv/query: Write both dwords in emit_zero_queries</li>
</ul>
<p>Josh Pieper (1):</p>
<ul>
<li>st/mesa: Validate the result of pipe_transfer_map in make_texture (v2)</li>
</ul>
<p>Kenneth Feng (1):</p>
<ul>
<li>amd: Add Picasso device id</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>st/mesa: help fix stencil border color for GL_DEPTH_STENCIL textures</li>
<li>radeonsi: fix HTILE for NPOT textures with mipmapping on SI/CI</li>
<li>r600: fix HTILE for NPOT textures with mipmapping</li>
<li>radeonsi: fix printing a BO list into ddebug reports</li>
</ul>
<p>Mathias Fröhlich (1):</p>
<ul>
<li>tnl: Fix green gun regression in xonotic.</li>
</ul>
<p>Mauro Rossi (3):</p>
<ul>
<li>android: broadcom/genxml: fix collision with intel/genxml header-gen macro</li>
<li>android: broadcom/cle: add gallium include path</li>
<li>android: broadcom/cle: export the broadcom top level path headers</li>
</ul>
<p>Michal Srb (1):</p>
<ul>
<li>st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does not implement it</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>loader/dri3: Only wait for back buffer fences in dri3_get_buffer</li>
</ul>
<p>Pierre Moreau (1):</p>
<ul>
<li>nvir: Always split 64-bit IMAD/IMUL operations</li>
</ul>
<p>Sergii Romantsov (1):</p>
<ul>
<li>intel: compiler option msse2 and mstackrealign</li>
</ul>
<p>Timothy Arceri (1):</p>
<ul>
<li>glsl: fixer lexer for unreachable defines</li>
</ul>
</div>
</body>
</html>

View File

@@ -236,3 +236,4 @@ CHIPSET(0x69A3, VEGA12)
CHIPSET(0x69AF, VEGA12)
CHIPSET(0x15DD, RAVEN)
CHIPSET(0x15D8, RAVEN)

View File

@@ -1068,12 +1068,17 @@ _libdrm_checks = [
# Loop over the enables versions and get the highest libdrm requirement for all
# active drivers.
_drm_blame = ''
foreach d : _libdrm_checks
ver = get_variable('_drm_@0@_ver'.format(d[0]))
if d[1] and ver.version_compare('>' + _drm_ver)
_drm_ver = ver
_drm_blame = d[0]
endif
endforeach
if _drm_blame != ''
message('libdrm @0@ needed because @1@ has the highest requirement'.format(_drm_ver, _drm_blame))
endif
# Then get each libdrm module
foreach d : _libdrm_checks

View File

@@ -9123,7 +9123,9 @@
#define CIK_SDMA_PACKET_SEMAPHORE 0x7
#define CIK_SDMA_PACKET_CONSTANT_FILL 0xb
#define CIK_SDMA_PACKET_SRBM_WRITE 0xe
#define CIK_SDMA_COPY_MAX_SIZE 0x3fffe0
/* There is apparently an undocumented HW "feature" that
prevents the HW from copying past 256 bytes of (1 << 22) */
#define CIK_SDMA_COPY_MAX_SIZE 0x3fff00
enum amd_cmp_class_flags {
S_NAN = 1 << 0, // Signaling NaN

View File

@@ -45,22 +45,51 @@
#include "sid.h"
#include "gfx9d.h"
#include "addrlib/gfx9/chip/gfx9_enum.h"
#include "util/build_id.h"
#include "util/debug.h"
#include "util/mesa-sha1.h"
static bool
radv_get_build_id(void *ptr, struct mesa_sha1 *ctx)
{
uint32_t timestamp;
#ifdef HAVE_DL_ITERATE_PHDR
const struct build_id_note *note = NULL;
if ((note = build_id_find_nhdr_for_addr(ptr))) {
_mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
} else
#endif
if (disk_cache_get_function_timestamp(ptr, &timestamp)) {
if (!timestamp) {
fprintf(stderr, "radv: The provided filesystem timestamp for the cache is bogus!\n");
}
_mesa_sha1_update(ctx, &timestamp, sizeof(timestamp));
} else
return false;
return true;
}
static int
radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
{
uint32_t mesa_timestamp, llvm_timestamp;
uint16_t f = family;
struct mesa_sha1 ctx;
unsigned char sha1[20];
unsigned ptr_size = sizeof(void*);
memset(uuid, 0, VK_UUID_SIZE);
if (!disk_cache_get_function_timestamp(radv_device_get_cache_uuid, &mesa_timestamp) ||
!disk_cache_get_function_timestamp(LLVMInitializeAMDGPUTargetInfo, &llvm_timestamp))
_mesa_sha1_init(&ctx);
if (!radv_get_build_id(radv_device_get_cache_uuid, &ctx) ||
!radv_get_build_id(LLVMInitializeAMDGPUTargetInfo, &ctx))
return -1;
memcpy(uuid, &mesa_timestamp, 4);
memcpy((char*)uuid + 4, &llvm_timestamp, 4);
memcpy((char*)uuid + 8, &f, 2);
snprintf((char*)uuid + 10, VK_UUID_SIZE - 10, "radv");
_mesa_sha1_update(&ctx, &family, sizeof(family));
_mesa_sha1_update(&ctx, &ptr_size, sizeof(ptr_size));
_mesa_sha1_final(&ctx, sha1);
memcpy(uuid, sha1, VK_UUID_SIZE);
return 0;
}
@@ -1860,10 +1889,30 @@ radv_get_hs_offchip_param(struct radv_device *device, uint32_t *max_offchip_buff
device->physical_device->rad_info.family != CHIP_CARRIZO &&
device->physical_device->rad_info.family != CHIP_STONEY;
unsigned max_offchip_buffers_per_se = double_offchip_buffers ? 128 : 64;
unsigned max_offchip_buffers = max_offchip_buffers_per_se *
device->physical_device->rad_info.max_se;
unsigned max_offchip_buffers;
unsigned offchip_granularity;
unsigned hs_offchip_param;
/*
* Per RadeonSI:
* This must be one less than the maximum number due to a hw limitation.
* Various hardware bugs in SI, CIK, and GFX9 need this.
*
* Per AMDVLK:
* Vega10 should limit max_offchip_buffers to 508 (4 * 127).
* Gfx7 should limit max_offchip_buffers to 508
* Gfx6 should limit max_offchip_buffers to 126 (2 * 63)
*
* Follow AMDVLK here.
*/
if (device->physical_device->rad_info.family == CHIP_VEGA10 ||
device->physical_device->rad_info.chip_class == CIK ||
device->physical_device->rad_info.chip_class == SI)
--max_offchip_buffers_per_se;
max_offchip_buffers = max_offchip_buffers_per_se *
device->physical_device->rad_info.max_se;
switch (device->tess_offchip_block_dw_size) {
default:
assert(0);

View File

@@ -1180,6 +1180,25 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
}
}
if (info->usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT)) {
goto unsupported;
}
}
if (info->usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) {
goto unsupported;
}
}
if (info->usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
if (!(format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))) {
goto unsupported;
}
}
*pImageFormatProperties = (VkImageFormatProperties) {
.maxExtent = maxExtent,
.maxMipLevels = maxMipLevels,

View File

@@ -830,8 +830,8 @@ radv_image_get_cmask_info(struct radv_device *device,
unsigned base_align = num_pipes * pipe_interleave_bytes;
unsigned width = align(image->info.width, cl_width*8);
unsigned height = align(image->info.height, cl_height*8);
unsigned width = align(image->surface.u.legacy.level[0].nblk_x, cl_width*8);
unsigned height = align(image->surface.u.legacy.level[0].nblk_y, cl_height*8);
unsigned slice_elements = (width * height) / (8*8);
/* Each element of CMASK is a nibble. */

View File

@@ -583,7 +583,7 @@ static void allocate_user_sgprs(struct radv_shader_context *ctx,
if (ctx->shader_info->info.loads_push_constants)
user_sgpr_info->sgpr_count += 2;
uint32_t available_sgprs = ctx->options->chip_class >= GFX9 ? 32 : 16;
uint32_t available_sgprs = ctx->options->chip_class >= GFX9 && stage != MESA_SHADER_COMPUTE ? 32 : 16;
uint32_t remaining_sgprs = available_sgprs - user_sgpr_info->sgpr_count;
if (remaining_sgprs / 2 < util_bitcount(ctx->shader_info->info.desc_set_used_mask)) {
@@ -1944,9 +1944,10 @@ handle_fs_input_decl(struct radv_shader_context *ctx,
int idx = variable->data.location;
unsigned attrib_count = glsl_count_attribute_slots(variable->type, false);
LLVMValueRef interp;
uint64_t mask;
variable->data.driver_location = idx * 4;
ctx->input_mask |= ((1ull << attrib_count) - 1) << variable->data.location;
mask = ((1ull << attrib_count) - 1) << variable->data.location;
if (glsl_get_base_type(glsl_without_array(variable->type)) == GLSL_TYPE_FLOAT) {
unsigned interp_type;
@@ -1964,6 +1965,15 @@ handle_fs_input_decl(struct radv_shader_context *ctx,
for (unsigned i = 0; i < attrib_count; ++i)
ctx->inputs[ac_llvm_reg_index_soa(idx + i, 0)] = interp;
if (idx == VARYING_SLOT_CLIP_DIST0) {
/* Do not account for the number of components inside the array
* of clip/cull distances because this might wrongly set other
* bits like primitive ID or layer.
*/
mask = 1ull << VARYING_SLOT_CLIP_DIST0;
}
ctx->input_mask |= mask;
}
static void
@@ -2028,6 +2038,17 @@ handle_fs_inputs(struct radv_shader_context *ctx,
if (!interp_param)
ctx->shader_info->fs.flat_shaded_mask |= 1u << index;
++index;
} else if (i == VARYING_SLOT_CLIP_DIST0) {
int length = ctx->shader_info->info.ps.num_input_clips_culls;
for (unsigned j = 0; j < length; j += 4) {
inputs = ctx->inputs + ac_llvm_reg_index_soa(i, j);
interp_param = *inputs;
interp_fs_input(ctx, index, interp_param,
ctx->abi.prim_mask, inputs);
++index;
}
} else if (i == VARYING_SLOT_POS) {
for(int i = 0; i < 3; ++i)
inputs[i] = ctx->abi.frag_pos[i];
@@ -2295,6 +2316,13 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
memcpy(&pos_args[target - V_008DFC_SQ_EXP_POS],
&args, sizeof(args));
/* Export the clip/cull distances values to the next stage. */
radv_export_param(ctx, param_count, &slots[0], 0xf);
outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST0] = param_count++;
if (ctx->num_output_clips + ctx->num_output_culls > 4) {
radv_export_param(ctx, param_count, &slots[4], 0xf);
outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST1] = param_count++;
}
}
LLVMValueRef pos_values[4] = {ctx->ac.f32_0, ctx->ac.f32_0, ctx->ac.f32_0, ctx->ac.f32_1};

View File

@@ -3050,6 +3050,23 @@ radv_pipeline_generate_ps_inputs(struct radeon_winsys_cs *cs,
ps_offset++;
}
if (ps->info.info.ps.num_input_clips_culls) {
unsigned vs_offset;
vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST0];
if (vs_offset != AC_EXP_PARAM_UNDEFINED) {
ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true);
++ps_offset;
}
vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_CLIP_DIST1];
if (vs_offset != AC_EXP_PARAM_UNDEFINED &&
ps->info.info.ps.num_input_clips_culls > 4) {
ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true);
++ps_offset;
}
}
for (unsigned i = 0; i < 32 && (1u << i) <= ps->info.fs.input_mask; ++i) {
unsigned vs_offset;
bool flat_shade;

View File

@@ -379,7 +379,8 @@ radv_fill_shader_variant(struct radv_device *device,
variant->code_size = binary->code_size;
variant->rsrc2 = S_00B12C_USER_SGPR(variant->info.num_user_sgprs) |
S_00B12C_SCRATCH_EN(scratch_enabled);
S_00B12C_USER_SGPR_MSB(variant->info.num_user_sgprs >> 5) |
S_00B12C_SCRATCH_EN(scratch_enabled);
variant->rsrc1 = S_00B848_VGPRS((variant->config.num_vgprs - 1) / 4) |
S_00B848_SGPRS((variant->config.num_sgprs - 1) / 8) |

View File

@@ -171,6 +171,7 @@ struct radv_shader_info {
bool has_pcoord;
bool prim_id_input;
bool layer_input;
uint8_t num_input_clips_culls;
} ps;
struct {
bool uses_grid_size;

View File

@@ -293,6 +293,7 @@ static void
gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
struct radv_shader_info *info)
{
unsigned attrib_count = glsl_count_attribute_slots(var->type, false);
const struct glsl_type *type = glsl_without_array(var->type);
int idx = var->data.location;
@@ -306,6 +307,9 @@ gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
case VARYING_SLOT_LAYER:
info->ps.layer_input = true;
break;
case VARYING_SLOT_CLIP_DIST0:
info->ps.num_input_clips_culls = attrib_count;
break;
default:
break;
}

View File

@@ -29,6 +29,10 @@ LOCAL_SRC_FILES := $(BROADCOM_DECODER_FILES)
LOCAL_STATIC_LIBRARIES := libmesa_broadcom_genxml
LOCAL_C_INCLUDES += $(MESA_TOP)/src/gallium/include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := libexpat libz
include $(MESA_COMMON_MK)

View File

@@ -39,7 +39,7 @@ $(intermediates)/dummy.c:
# This is the list of auto-generated files headers
LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/broadcom/, $(BROADCOM_GENXML_GENERATED_FILES))
define header-gen
define pack-header-gen
@mkdir -p $(dir $@)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(PRIVATE_SCRIPT) $(PRIVATE_SCRIPT_FLAGS) $(PRIVATE_XML) > $@
@@ -48,22 +48,22 @@ endef
$(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
$(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: PRIVATE_XML := $(LOCAL_PATH)/cle/v3d_packet_v21.xml
$(intermediates)/broadcom/cle/v3d_packet_v21_pack.h: $(LOCAL_PATH)/cle/v3d_packet_v21.xml $(LOCAL_PATH)/cle/gen_pack_header.py
$(call header-gen)
$(call pack-header-gen)
$(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
$(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: PRIVATE_XML := $(LOCAL_PATH)/cle/v3d_packet_v33.xml
$(intermediates)/broadcom/cle/v3d_packet_v33_pack.h: $(LOCAL_PATH)/cle/v3d_packet_v33.xml $(LOCAL_PATH)/cle/gen_pack_header.py
$(call header-gen)
$(call pack-header-gen)
$(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
$(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: PRIVATE_XML := $(LOCAL_PATH)/cle/v3d_packet_v41.xml
$(intermediates)/broadcom/cle/v3d_packet_v41_pack.h: $(LOCAL_PATH)/cle/v3d_packet_v41.xml $(LOCAL_PATH)/cle/gen_pack_header.py
$(call header-gen)
$(call pack-header-gen)
$(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/cle/gen_pack_header.py
$(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: PRIVATE_XML := $(LOCAL_PATH)/cle/v3d_packet_v42.xml
$(intermediates)/broadcom/cle/v3d_packet_v42_pack.h: $(LOCAL_PATH)/cle/v3d_packet_v42.xml $(LOCAL_PATH)/cle/gen_pack_header.py
$(call header-gen)
$(call pack-header-gen)
$(intermediates)/broadcom/cle/v3d_xml.h: $(addprefix $(MESA_TOP)/src/broadcom/,$(BROADCOM_GENXML_XML_FILES)) $(MESA_TOP)/src/intel/genxml/gen_zipped_file.py
@mkdir -p $(dir $@)

View File

@@ -289,6 +289,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
* token. */
if (parser->first_non_space_token_this_line) {
BEGIN HASH;
yyextra->in_define = false;
}
RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN);
@@ -336,43 +337,55 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
/* For the pre-processor directives, we return these tokens
* even when we are otherwise skipping. */
<HASH>ifdef {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IFDEF);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IFDEF);
}
}
<HASH>ifndef {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IFNDEF);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IFNDEF);
}
}
<HASH>if/[^_a-zA-Z0-9] {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IF);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (IF);
}
}
<HASH>elif/[^_a-zA-Z0-9] {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ELIF);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->lexing_directive = 1;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ELIF);
}
}
<HASH>else {
BEGIN INITIAL;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ELSE);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ELSE);
}
}
<HASH>endif {
BEGIN INITIAL;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ENDIF);
if (!yyextra->in_define) {
BEGIN INITIAL;
yyextra->space_tokens = 0;
RETURN_TOKEN_NEVER_SKIP (ENDIF);
}
}
<HASH>error[^\r\n]* {
@@ -399,7 +412,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
* and not whitespace). This will generate an error.
*/
<HASH>define{HSPACE}* {
if (! parser->skipping) {
yyextra->in_define = true;
if (!parser->skipping) {
BEGIN DEFINE;
yyextra->space_tokens = 0;
RETURN_TOKEN (DEFINE_TOKEN);

View File

@@ -197,6 +197,7 @@ struct glcpp_parser {
int first_non_space_token_this_line;
int newline_as_space;
int in_control_line;
bool in_define;
int paren_count;
int commented_newlines;
skip_node_t *skip_stack;

View File

@@ -667,8 +667,8 @@ public:
* variable has been used. For example, it is an error to redeclare a
* variable as invariant after it has been used.
*
* This is only maintained in the ast_to_hir.cpp path, not in
* Mesa's fixed function or ARB program paths.
* This is maintained in the ast_to_hir.cpp path and during linking,
* but not in Mesa's fixed function or ARB program paths.
*/
unsigned used:1;

View File

@@ -417,9 +417,15 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
* write to any of the pre-defined outputs (e.g. if the vertex shader
* does not write to gl_Position, etc), which is allowed and results in
* undefined behavior.
*
* From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
*
* "Only the input variables that are actually read need to be written
* by the previous stage; it is allowed to have superfluous
* declarations of input variables."
*/
if (producer_def == NULL &&
!is_builtin_gl_in_block(var, consumer->Stage)) {
!is_builtin_gl_in_block(var, consumer->Stage) && var->data.used) {
linker_error(prog, "Input block `%s' is not an output of "
"the previous stage\n", var->get_interface_type()->name);
return;

View File

@@ -427,13 +427,13 @@ optimizations = [
('unpack_64_2x32_split_y', a)), a),
# Byte extraction
(('ushr', a, 24), ('extract_u8', a, 3), '!options->lower_extract_byte'),
(('ushr', 'a@32', 24), ('extract_u8', a, 3), '!options->lower_extract_byte'),
(('iand', 0xff, ('ushr', a, 16)), ('extract_u8', a, 2), '!options->lower_extract_byte'),
(('iand', 0xff, ('ushr', a, 8)), ('extract_u8', a, 1), '!options->lower_extract_byte'),
(('iand', 0xff, a), ('extract_u8', a, 0), '!options->lower_extract_byte'),
# Word extraction
(('ushr', a, 16), ('extract_u16', a, 1), '!options->lower_extract_word'),
(('ushr', 'a@32', 16), ('extract_u16', a, 1), '!options->lower_extract_word'),
(('iand', 0xffff, a), ('extract_u16', a, 0), '!options->lower_extract_word'),
# Subtracts

View File

@@ -2223,13 +2223,13 @@ dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
return EGL_TRUE;
}
/* Returns the total number of file descriptors. Zero indicates an error. */
/* Returns the total number of planes for the format or zero if it isn't a
* valid fourcc format.
*/
static unsigned
dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
dri2_num_fourcc_format_planes(EGLint format)
{
unsigned plane_n;
switch (attrs->DMABufFourCC.Value) {
switch (format) {
case DRM_FORMAT_R8:
case DRM_FORMAT_RG88:
case DRM_FORMAT_GR88:
@@ -2277,14 +2277,14 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
case DRM_FORMAT_YVYU:
case DRM_FORMAT_UYVY:
case DRM_FORMAT_VYUY:
plane_n = 1;
break;
return 1;
case DRM_FORMAT_NV12:
case DRM_FORMAT_NV21:
case DRM_FORMAT_NV16:
case DRM_FORMAT_NV61:
plane_n = 2;
break;
return 2;
case DRM_FORMAT_YUV410:
case DRM_FORMAT_YVU410:
case DRM_FORMAT_YUV411:
@@ -2295,9 +2295,19 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
case DRM_FORMAT_YVU422:
case DRM_FORMAT_YUV444:
case DRM_FORMAT_YVU444:
plane_n = 3;
break;
return 3;
default:
return 0;
}
}
/* Returns the total number of file descriptors. Zero indicates an error. */
static unsigned
dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
{
unsigned plane_n = dri2_num_fourcc_format_planes(attrs->DMABufFourCC.Value);
if (plane_n == 0) {
_eglError(EGL_BAD_ATTRIBUTE, "invalid format");
return 0;
}
@@ -2371,6 +2381,18 @@ dri2_query_dma_buf_formats(_EGLDriver *drv, _EGLDisplay *disp,
formats, count))
return EGL_FALSE;
if (max > 0) {
/* Assert that all of the formats returned are actually fourcc formats.
* Some day, if we want the internal interface function to be able to
* return the fake fourcc formats defined in dri_interface.h, we'll have
* to do something more clever here to pair the list down to just real
* fourcc formats so that we don't leak the fake internal ones.
*/
for (int i = 0; i < *count; i++) {
assert(dri2_num_fourcc_format_planes(formats[i]) > 0);
}
}
return EGL_TRUE;
}
@@ -2381,6 +2403,9 @@ dri2_query_dma_buf_modifiers(_EGLDriver *drv, _EGLDisplay *disp, EGLint format,
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (dri2_num_fourcc_format_planes(format) == 0)
return _eglError(EGL_BAD_PARAMETER, "invalid fourcc format");
if (max < 0)
return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");

View File

@@ -292,6 +292,7 @@ struct dri2_egl_surface
struct {
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_buffer *wl_buffer;
bool wl_release;
__DRIimage *dri_image;
/* for is_different_gpu case. NULL else */
__DRIimage *linear_copy;

View File

@@ -179,9 +179,12 @@ wl_buffer_release(void *data, struct wl_buffer *buffer)
if (dri2_surf->color_buffers[i].wl_buffer == buffer)
break;
if (i == ARRAY_SIZE(dri2_surf->color_buffers)) {
assert (i < ARRAY_SIZE(dri2_surf->color_buffers));
if (dri2_surf->color_buffers[i].wl_release) {
wl_buffer_destroy(buffer);
return;
dri2_surf->color_buffers[i].wl_release = false;
dri2_surf->color_buffers[i].wl_buffer = NULL;
}
dri2_surf->color_buffers[i].locked = false;
@@ -417,9 +420,14 @@ dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)
dri2_egl_display(dri2_surf->base.Resource.Display);
for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
if (dri2_surf->color_buffers[i].wl_buffer &&
!dri2_surf->color_buffers[i].locked)
wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer);
if (dri2_surf->color_buffers[i].wl_buffer) {
if (dri2_surf->color_buffers[i].locked) {
dri2_surf->color_buffers[i].wl_release = true;
} else {
wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer);
dri2_surf->color_buffers[i].wl_buffer = NULL;
}
}
if (dri2_surf->color_buffers[i].dri_image)
dri2_dpy->image->destroyImage(dri2_surf->color_buffers[i].dri_image);
if (dri2_surf->color_buffers[i].linear_copy)
@@ -428,11 +436,9 @@ dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)
munmap(dri2_surf->color_buffers[i].data,
dri2_surf->color_buffers[i].data_size);
dri2_surf->color_buffers[i].wl_buffer = NULL;
dri2_surf->color_buffers[i].dri_image = NULL;
dri2_surf->color_buffers[i].linear_copy = NULL;
dri2_surf->color_buffers[i].data = NULL;
dri2_surf->color_buffers[i].locked = false;
}
if (dri2_dpy->dri2)
@@ -961,6 +967,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
dri2_surf->current->wl_buffer =
create_wl_buffer(dri2_dpy, dri2_surf, image);
dri2_surf->current->wl_release = false;
wl_buffer_add_listener(dri2_surf->current->wl_buffer,
&wl_buffer_listener, dri2_surf);
}

View File

@@ -114,6 +114,7 @@ if with_platform_drm
endif
if with_platform_surfaceless
files_egl += files('drivers/dri2/platform_surfaceless.c')
incs_for_egl += [inc_loader]
endif
if with_platform_wayland
deps_for_egl += [dep_wayland_client, dep_wayland_server]
@@ -131,6 +132,7 @@ endif
if with_platform_android
deps_for_egl += dep_android
files_egl += files('drivers/dri2/platform_android.c')
incs_for_egl += [inc_loader]
endif
if with_platform_haiku
incs_for_egl += inc_haikugl

View File

@@ -3797,7 +3797,7 @@ Program::optimizeSSA(int level)
RUN_PASS(2, AlgebraicOpt, run);
RUN_PASS(2, ModifierFolding, run); // before load propagation -> less checks
RUN_PASS(1, ConstantFolding, foldAll);
RUN_PASS(1, Split64BitOpPreRA, run);
RUN_PASS(0, Split64BitOpPreRA, run);
RUN_PASS(1, LoadPropagation, run);
RUN_PASS(1, IndirectPropagation, run);
RUN_PASS(2, MemoryOpt, run);

View File

@@ -774,8 +774,8 @@ static void r600_texture_get_htile_size(struct r600_common_screen *rscreen,
return;
}
width = align(rtex->resource.b.b.width0, cl_width * 8);
height = align(rtex->resource.b.b.height0, cl_height * 8);
width = align(rtex->surface.u.legacy.level[0].nblk_x, cl_width * 8);
height = align(rtex->surface.u.legacy.level[0].nblk_y, cl_height * 8);
slice_elements = (width * height) / (8 * 8);
slice_bytes = slice_elements * 4;

View File

@@ -134,12 +134,13 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags,
if (ctx->current_saved_cs) {
si_trace_emit(ctx);
si_log_hw_flush(ctx);
/* Save the IB for debug contexts. */
si_save_cs(ws, cs, &ctx->current_saved_cs->gfx, true);
ctx->current_saved_cs->flushed = true;
ctx->current_saved_cs->time_flush = os_time_get_nano();
si_log_hw_flush(ctx);
}
/* Flush the CS. */

View File

@@ -1019,8 +1019,8 @@ static void si_texture_get_htile_size(struct si_screen *sscreen,
return;
}
width = align(rtex->resource.b.b.width0, cl_width * 8);
height = align(rtex->resource.b.b.height0, cl_height * 8);
width = align(rtex->surface.u.legacy.level[0].nblk_x, cl_width * 8);
height = align(rtex->surface.u.legacy.level[0].nblk_y, cl_height * 8);
slice_elements = (width * height) / (8 * 8);
slice_bytes = slice_elements * 4;

View File

@@ -201,6 +201,7 @@ static int tegra_open_render_node(void)
}
if (strcmp(version->name, "nouveau") != 0) {
drmFreeVersion(version);
close(fd);
continue;
}

View File

@@ -283,7 +283,7 @@ int virgl_encode_shader_state(struct virgl_context *ctx,
while (left_bytes) {
uint32_t length, offlen;
int hdr_len = base_hdr_size + (first_pass ? strm_hdr_size : 0);
if (ctx->cbuf->cdw + hdr_len + 1 > VIRGL_MAX_CMDBUF_DWORDS)
if (ctx->cbuf->cdw + hdr_len + 1 >= VIRGL_MAX_CMDBUF_DWORDS)
ctx->base.flush(&ctx->base, NULL, 0);
thispass = (VIRGL_MAX_CMDBUF_DWORDS - ctx->cbuf->cdw - hdr_len - 1) * 4;

View File

@@ -177,6 +177,8 @@ static void *virgl_texture_transfer_map(struct pipe_context *ctx,
/* we want to do a resolve blit into the temporary */
hw_res = trans->resolve_tmp->hw_res;
offset = 0;
trans->base.stride = ((struct virgl_texture*)trans->resolve_tmp)->stride[level];
trans->base.layer_stride = trans->base.stride * nblocksy;
} else {
offset = vrend_get_tex_image_offset(vtex, level, box->z);

View File

@@ -1482,6 +1482,12 @@ dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
for (i = 0, j = 0; (i < ARRAY_SIZE(fourcc_formats)) &&
(j < max || max == 0); i++) {
/* The sRGB format is not a real FourCC as defined by drm_fourcc.h, so we
* must not leak it out to clients.
*/
if (fourcc_formats[i] == __DRI_IMAGE_FOURCC_SARGB8888)
continue;
if (pscreen->is_format_supported(pscreen,
fourcc_to_pipe_format(
fourcc_formats[i]),
@@ -2209,8 +2215,10 @@ dri_kms_init_screen(__DRIscreen * sPriv)
dri2ImageExtension.createImageFromFds = dri2_from_fds;
dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
dri2ImageExtension.createImageFromDmaBufs2 = dri2_from_dma_bufs2;
dri2ImageExtension.queryDmaBufFormats = dri2_query_dma_buf_formats;
dri2ImageExtension.queryDmaBufModifiers = dri2_query_dma_buf_modifiers;
if (pscreen->query_dmabuf_modifiers) {
dri2ImageExtension.queryDmaBufFormats = dri2_query_dma_buf_formats;
dri2ImageExtension.queryDmaBufModifiers = dri2_query_dma_buf_modifiers;
}
}
sPriv->extensions = dri_screen_extensions;

View File

@@ -313,7 +313,7 @@ virgl_drm_winsys_resource_cache_create(struct virgl_winsys *qws,
struct virgl_hw_res *res, *curr_res;
struct list_head *curr, *next;
int64_t now;
int ret;
int ret = 0;
/* only store binds for vertex/index/const buffers */
if (bind != VIRGL_BIND_CONSTANT_BUFFER && bind != VIRGL_BIND_INDEX_BUFFER &&
@@ -617,13 +617,26 @@ static void virgl_drm_add_res(struct virgl_drm_winsys *qdws,
{
unsigned hash = res->res_handle & (sizeof(cbuf->is_handle_added)-1);
if (cbuf->cres > cbuf->nres) {
cbuf->nres += 256;
cbuf->res_bo = realloc(cbuf->res_bo, cbuf->nres * sizeof(struct virgl_hw_buf*));
if (!cbuf->res_bo) {
fprintf(stderr,"failure to add relocation %d, %d\n", cbuf->cres, cbuf->nres);
if (cbuf->cres >= cbuf->nres) {
unsigned new_nres = cbuf->nres + 256;
void *new_ptr = REALLOC(cbuf->res_bo,
cbuf->nres * sizeof(struct virgl_hw_buf*),
new_nres * sizeof(struct virgl_hw_buf*));
if (!new_ptr) {
fprintf(stderr,"failure to add relocation %d, %d\n", cbuf->cres, new_nres);
return;
}
cbuf->res_bo = new_ptr;
new_ptr = REALLOC(cbuf->res_hlist,
cbuf->nres * sizeof(uint32_t),
new_nres * sizeof(uint32_t));
if (!new_ptr) {
fprintf(stderr,"failure to add hlist relocation %d, %d\n", cbuf->cres, cbuf->nres);
return;
}
cbuf->res_hlist = new_ptr;
cbuf->nres = new_nres;
}
cbuf->res_bo[cbuf->cres] = NULL;

View File

@@ -97,6 +97,7 @@ void _apple_glx_vlog(int level, const char *file, const char *function,
fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
_asl_level_string(level), file, line, function, thread);
vfprintf(stderr, fmt, args2);
va_end(args2);
}
msg = asl_new(ASL_TYPE_MSG);

View File

@@ -104,7 +104,7 @@ noinst_LTLIBRARIES += $(VULKAN_PER_GEN_LIBS)
VULKAN_CFLAGS = \
$(AM_CFLAGS) \
-msse2
-msse2 -mstackrealign
VULKAN_CPPFLAGS = \
-I$(top_srcdir)/src/compiler \

View File

@@ -932,8 +932,21 @@ generate_tes_add_indirect_urb_offset(struct brw_codegen *p,
brw_set_default_mask_control(p, BRW_MASK_DISABLE);
brw_MOV(p, dst, header);
/* Uniforms will have a stride <0;4,1>, and we need to convert to <0;1,0>.
* Other values get <4;1,0>.
*/
struct brw_reg restrided_offset;
if (offset.vstride == BRW_VERTICAL_STRIDE_0 &&
offset.width == BRW_WIDTH_4 &&
offset.hstride == BRW_HORIZONTAL_STRIDE_1) {
restrided_offset = stride(offset, 0, 1, 0);
} else {
restrided_offset = stride(offset, 4, 1, 0);
}
/* m0.3-0.4: 128-bit-granular offsets into the URB from the handles */
brw_MOV(p, vec2(get_element_ud(dst, 3)), stride(offset, 4, 1, 0));
brw_MOV(p, vec2(get_element_ud(dst, 3)), restrided_offset);
brw_pop_insn_state(p);
}

View File

@@ -185,9 +185,19 @@ vec4_tes_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
first_component /= 2;
if (indirect_offset.file != BAD_FILE) {
src_reg clamped_indirect_offset = src_reg(this, glsl_type::uvec4_type);
/* Page 190 of "Volume 7: 3D Media GPGPU Engine (Haswell)" says the
* valid range of the offset is [0, 0FFFFFFFh].
*/
emit_minmax(BRW_CONDITIONAL_L,
dst_reg(clamped_indirect_offset),
retype(indirect_offset, BRW_REGISTER_TYPE_UD),
brw_imm_ud(0x0fffffffu));
header = src_reg(this, glsl_type::uvec4_type);
emit(TES_OPCODE_ADD_INDIRECT_URB_OFFSET, dst_reg(header),
input_read_header, indirect_offset);
input_read_header, clamped_indirect_offset);
} else {
/* Arbitrarily only push up to 24 vec4 slots worth of data,
* which is 12 registers (since each holds 2 vec4 slots).

View File

@@ -294,6 +294,29 @@ isl_gen6_filter_tiling(const struct isl_device *dev,
*/
if (ISL_DEV_GEN(dev) < 7 && isl_format_get_layout(info->format)->bpb >= 128)
*flags &= ~ISL_TILING_Y0_BIT;
/* From the BDW and SKL PRMs, Volume 2d,
* RENDER_SURFACE_STATE::Width - Programming Notes:
*
* A known issue exists if a primitive is rendered to the first 2 rows and
* last 2 columns of a 16K width surface. If any geometry is drawn inside
* this square it will be copied to column X=2 and X=3 (arrangement on Y
* position will stay the same). If any geometry exceeds the boundaries of
* this 2x2 region it will be drawn normally. The issue also only occurs
* if the surface has TileMode != Linear.
*
* [Internal documentation notes that this issue isn't present on SKL GT4.]
* To prevent this rendering corruption, only allow linear tiling for
* surfaces with widths greater than 16K-2 pixels.
*
* TODO: Is this an issue for multisampled surfaces as well?
*/
if (info->width > 16382 && info->samples == 1 &&
info->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT &&
(ISL_DEV_GEN(dev) == 8 ||
(dev->info->is_skylake && dev->info->gt != 4))) {
*flags &= ISL_TILING_LINEAR_BIT;
}
}
void

View File

@@ -18,6 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
c_sse2_args = ['-msse2', '-mstackrealign']
inc_intel = include_directories('.')
subdir('blorp')

View File

@@ -533,82 +533,86 @@ void anv_CmdBlitImage(
const VkImageSubresourceLayers *src_res = &pRegions[r].srcSubresource;
const VkImageSubresourceLayers *dst_res = &pRegions[r].dstSubresource;
get_blorp_surf_for_anv_image(cmd_buffer->device,
src_image, src_res->aspectMask,
srcImageLayout, ISL_AUX_USAGE_NONE, &src);
get_blorp_surf_for_anv_image(cmd_buffer->device,
dst_image, dst_res->aspectMask,
dstImageLayout, ISL_AUX_USAGE_NONE, &dst);
assert(anv_image_aspects_compatible(src_res->aspectMask,
dst_res->aspectMask));
struct anv_format_plane src_format =
anv_get_format_plane(&cmd_buffer->device->info, src_image->vk_format,
src_res->aspectMask, src_image->tiling);
struct anv_format_plane dst_format =
anv_get_format_plane(&cmd_buffer->device->info, dst_image->vk_format,
dst_res->aspectMask, dst_image->tiling);
uint32_t aspect_bit;
anv_foreach_image_aspect_bit(aspect_bit, src_image, src_res->aspectMask) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
src_image, 1U << aspect_bit,
srcImageLayout, ISL_AUX_USAGE_NONE, &src);
get_blorp_surf_for_anv_image(cmd_buffer->device,
dst_image, 1U << aspect_bit,
dstImageLayout, ISL_AUX_USAGE_NONE, &dst);
unsigned dst_start, dst_end;
if (dst_image->type == VK_IMAGE_TYPE_3D) {
assert(dst_res->baseArrayLayer == 0);
dst_start = pRegions[r].dstOffsets[0].z;
dst_end = pRegions[r].dstOffsets[1].z;
} else {
dst_start = dst_res->baseArrayLayer;
dst_end = dst_start + anv_get_layerCount(dst_image, dst_res);
struct anv_format_plane src_format =
anv_get_format_plane(&cmd_buffer->device->info, src_image->vk_format,
1U << aspect_bit, src_image->tiling);
struct anv_format_plane dst_format =
anv_get_format_plane(&cmd_buffer->device->info, dst_image->vk_format,
1U << aspect_bit, dst_image->tiling);
unsigned dst_start, dst_end;
if (dst_image->type == VK_IMAGE_TYPE_3D) {
assert(dst_res->baseArrayLayer == 0);
dst_start = pRegions[r].dstOffsets[0].z;
dst_end = pRegions[r].dstOffsets[1].z;
} else {
dst_start = dst_res->baseArrayLayer;
dst_end = dst_start + anv_get_layerCount(dst_image, dst_res);
}
unsigned src_start, src_end;
if (src_image->type == VK_IMAGE_TYPE_3D) {
assert(src_res->baseArrayLayer == 0);
src_start = pRegions[r].srcOffsets[0].z;
src_end = pRegions[r].srcOffsets[1].z;
} else {
src_start = src_res->baseArrayLayer;
src_end = src_start + anv_get_layerCount(src_image, src_res);
}
bool flip_z = flip_coords(&src_start, &src_end, &dst_start, &dst_end);
float src_z_step = (float)(src_end + 1 - src_start) /
(float)(dst_end + 1 - dst_start);
if (flip_z) {
src_start = src_end;
src_z_step *= -1;
}
unsigned src_x0 = pRegions[r].srcOffsets[0].x;
unsigned src_x1 = pRegions[r].srcOffsets[1].x;
unsigned dst_x0 = pRegions[r].dstOffsets[0].x;
unsigned dst_x1 = pRegions[r].dstOffsets[1].x;
bool flip_x = flip_coords(&src_x0, &src_x1, &dst_x0, &dst_x1);
unsigned src_y0 = pRegions[r].srcOffsets[0].y;
unsigned src_y1 = pRegions[r].srcOffsets[1].y;
unsigned dst_y0 = pRegions[r].dstOffsets[0].y;
unsigned dst_y1 = pRegions[r].dstOffsets[1].y;
bool flip_y = flip_coords(&src_y0, &src_y1, &dst_y0, &dst_y1);
const unsigned num_layers = dst_end - dst_start;
anv_cmd_buffer_mark_image_written(cmd_buffer, dst_image,
1U << aspect_bit,
dst.aux_usage,
dst_res->mipLevel,
dst_start, num_layers);
for (unsigned i = 0; i < num_layers; i++) {
unsigned dst_z = dst_start + i;
unsigned src_z = src_start + i * src_z_step;
blorp_blit(&batch, &src, src_res->mipLevel, src_z,
src_format.isl_format, src_format.swizzle,
&dst, dst_res->mipLevel, dst_z,
dst_format.isl_format, dst_format.swizzle,
src_x0, src_y0, src_x1, src_y1,
dst_x0, dst_y0, dst_x1, dst_y1,
gl_filter, flip_x, flip_y);
}
}
unsigned src_start, src_end;
if (src_image->type == VK_IMAGE_TYPE_3D) {
assert(src_res->baseArrayLayer == 0);
src_start = pRegions[r].srcOffsets[0].z;
src_end = pRegions[r].srcOffsets[1].z;
} else {
src_start = src_res->baseArrayLayer;
src_end = src_start + anv_get_layerCount(src_image, src_res);
}
bool flip_z = flip_coords(&src_start, &src_end, &dst_start, &dst_end);
float src_z_step = (float)(src_end + 1 - src_start) /
(float)(dst_end + 1 - dst_start);
if (flip_z) {
src_start = src_end;
src_z_step *= -1;
}
unsigned src_x0 = pRegions[r].srcOffsets[0].x;
unsigned src_x1 = pRegions[r].srcOffsets[1].x;
unsigned dst_x0 = pRegions[r].dstOffsets[0].x;
unsigned dst_x1 = pRegions[r].dstOffsets[1].x;
bool flip_x = flip_coords(&src_x0, &src_x1, &dst_x0, &dst_x1);
unsigned src_y0 = pRegions[r].srcOffsets[0].y;
unsigned src_y1 = pRegions[r].srcOffsets[1].y;
unsigned dst_y0 = pRegions[r].dstOffsets[0].y;
unsigned dst_y1 = pRegions[r].dstOffsets[1].y;
bool flip_y = flip_coords(&src_y0, &src_y1, &dst_y0, &dst_y1);
const unsigned num_layers = dst_end - dst_start;
anv_cmd_buffer_mark_image_written(cmd_buffer, dst_image,
dst_res->aspectMask,
dst.aux_usage,
dst_res->mipLevel,
dst_start, num_layers);
for (unsigned i = 0; i < num_layers; i++) {
unsigned dst_z = dst_start + i;
unsigned src_z = src_start + i * src_z_step;
blorp_blit(&batch, &src, src_res->mipLevel, src_z,
src_format.isl_format, src_format.swizzle,
&dst, dst_res->mipLevel, dst_z,
dst_format.isl_format,
anv_swizzle_for_render(dst_format.swizzle),
src_x0, src_y0, src_x1, src_y1,
dst_x0, dst_y0, dst_x1, dst_y1,
gl_filter, flip_x, flip_y);
}
}
blorp_batch_finish(&batch);
@@ -1583,6 +1587,24 @@ anv_image_hiz_clear(struct anv_cmd_buffer *cmd_buffer,
ISL_AUX_USAGE_NONE, &stencil);
}
/* From the Sky Lake PRM Volume 7, "Depth Buffer Clear":
*
* "The following is required when performing a depth buffer clear with
* using the WM_STATE or 3DSTATE_WM:
*
* * If other rendering operations have preceded this clear, a
* PIPE_CONTROL with depth cache flush enabled, Depth Stall bit
* enabled must be issued before the rectangle primitive used for
* the depth buffer clear operation.
* * [...]"
*
* Even though the PRM only says that this is required if using 3DSTATE_WM
* and a 3DPRIMITIVE, it appears to also sometimes hang when doing a clear
* with WM_HZ_OP.
*/
cmd_buffer->state.pending_pipe_bits |=
ANV_PIPE_DEPTH_CACHE_FLUSH_BIT | ANV_PIPE_DEPTH_STALL_BIT;
blorp_hiz_clear_depth_stencil(&batch, &depth, &stencil,
level, base_layer, layer_count,
area.offset.x, area.offset.y,
@@ -1597,18 +1619,22 @@ anv_image_hiz_clear(struct anv_cmd_buffer *cmd_buffer,
/* From the SKL PRM, Depth Buffer Clear:
*
* Depth Buffer Clear Workaround
* Depth buffer clear pass using any of the methods (WM_STATE, 3DSTATE_WM
* or 3DSTATE_WM_HZ_OP) must be followed by a PIPE_CONTROL command with
* DEPTH_STALL bit and Depth FLUSH bits “set” before starting to render.
* DepthStall and DepthFlush are not needed between consecutive depth clear
* passes nor is it required if the depth-clear pass was done with
* “full_surf_clear” bit set in the 3DSTATE_WM_HZ_OP.
* "Depth Buffer Clear Workaround
*
* Depth buffer clear pass using any of the methods (WM_STATE,
* 3DSTATE_WM or 3DSTATE_WM_HZ_OP) must be followed by a PIPE_CONTROL
* command with DEPTH_STALL bit and Depth FLUSH bits “set” before
* starting to render. DepthStall and DepthFlush are not needed between
* consecutive depth clear passes nor is it required if the depth-clear
* pass was done with “full_surf_clear” bit set in the
* 3DSTATE_WM_HZ_OP."
*
* Even though the PRM provides a bunch of conditions under which this is
* supposedly unnecessary, we choose to perform the flush unconditionally
* just to be safe.
*/
if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
cmd_buffer->state.pending_pipe_bits |=
ANV_PIPE_DEPTH_CACHE_FLUSH_BIT | ANV_PIPE_DEPTH_STALL_BIT;
}
cmd_buffer->state.pending_pipe_bits |=
ANV_PIPE_DEPTH_CACHE_FLUSH_BIT | ANV_PIPE_DEPTH_STALL_BIT;
}
void

View File

@@ -48,6 +48,7 @@ clamp_int64(int64_t x, int64_t min, int64_t max)
void
gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer)
{
struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
uint32_t count = cmd_buffer->state.gfx.dynamic.scissor.count;
const VkRect2D *scissors = cmd_buffer->state.gfx.dynamic.scissor.scissors;
struct anv_state scissor_state =
@@ -73,8 +74,8 @@ gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer)
/* Do this math using int64_t so overflow gets clamped correctly. */
.ScissorRectangleYMin = clamp_int64(s->offset.y, 0, max),
.ScissorRectangleXMin = clamp_int64(s->offset.x, 0, max),
.ScissorRectangleYMax = clamp_int64((uint64_t) s->offset.y + s->extent.height - 1, 0, max),
.ScissorRectangleXMax = clamp_int64((uint64_t) s->offset.x + s->extent.width - 1, 0, max)
.ScissorRectangleYMax = clamp_int64((uint64_t) s->offset.y + s->extent.height - 1, 0, fb->height - 1),
.ScissorRectangleXMax = clamp_int64((uint64_t) s->offset.x + s->extent.width - 1, 0, fb->width - 1)
};
if (s->extent.width <= 0 || s->extent.height <= 0) {

View File

@@ -2475,6 +2475,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
uint32_t *p;
uint32_t vb_emit = cmd_buffer->state.gfx.vb_dirty & pipeline->vb_used;
if (cmd_buffer->state.gfx.dirty & ANV_CMD_DIRTY_PIPELINE)
vb_emit |= pipeline->vb_used;
assert((pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT) == 0);
@@ -2599,7 +2601,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
pipeline->depth_clamp_enable);
}
if (cmd_buffer->state.gfx.dirty & ANV_CMD_DIRTY_DYNAMIC_SCISSOR)
if (cmd_buffer->state.gfx.dirty & (ANV_CMD_DIRTY_DYNAMIC_SCISSOR |
ANV_CMD_DIRTY_RENDER_TARGETS))
gen7_cmd_buffer_emit_scissor(cmd_buffer);
genX(cmd_buffer_flush_dynamic_state)(cmd_buffer);

View File

@@ -91,7 +91,8 @@ emit_vertex_input(struct anv_pipeline *pipeline,
/* Pull inputs_read out of the VS prog data */
const uint64_t inputs_read = vs_prog_data->inputs_read;
const uint64_t double_inputs_read = vs_prog_data->double_inputs_read;
const uint64_t double_inputs_read =
vs_prog_data->double_inputs_read & inputs_read;
assert((inputs_read & ((1 << VERT_ATTRIB_GENERIC0) - 1)) == 0);
const uint32_t elements = inputs_read >> VERT_ATTRIB_GENERIC0;
const uint32_t elements_double = double_inputs_read >> VERT_ATTRIB_GENERIC0;
@@ -115,7 +116,34 @@ emit_vertex_input(struct anv_pipeline *pipeline,
GENX(3DSTATE_VERTEX_ELEMENTS));
if (!p)
return;
memset(p + 1, 0, (num_dwords - 1) * 4);
for (uint32_t i = 0; i < total_elems; i++) {
/* The SKL docs for VERTEX_ELEMENT_STATE say:
*
* "All elements must be valid from Element[0] to the last valid
* element. (I.e. if Element[2] is valid then Element[1] and
* Element[0] must also be valid)."
*
* The SKL docs for 3D_Vertex_Component_Control say:
*
* "Don't store this component. (Not valid for Component 0, but can
* be used for Component 1-3)."
*
* So we can't just leave a vertex element blank and hope for the best.
* We have to tell the VF hardware to put something in it; so we just
* store a bunch of zero.
*
* TODO: Compact vertex elements so we never end up with holes.
*/
struct GENX(VERTEX_ELEMENT_STATE) element = {
.Valid = true,
.Component0Control = VFCOMP_STORE_0,
.Component1Control = VFCOMP_STORE_0,
.Component2Control = VFCOMP_STORE_0,
.Component3Control = VFCOMP_STORE_0,
};
GENX(VERTEX_ELEMENT_STATE_pack)(NULL, &p[1 + i * 2], &element);
}
for (uint32_t i = 0; i < info->vertexAttributeDescriptionCount; i++) {
const VkVertexInputAttributeDescription *desc =
@@ -1145,7 +1173,28 @@ emit_3dstate_vs(struct anv_pipeline *pipeline)
vs.IllegalOpcodeExceptionEnable = false;
vs.SoftwareExceptionEnable = false;
vs.MaximumNumberofThreads = devinfo->max_vs_threads - 1;
vs.VertexCacheDisable = false;
if (GEN_GEN == 9 && devinfo->gt == 4 &&
anv_pipeline_has_stage(pipeline, MESA_SHADER_TESS_EVAL)) {
/* On Sky Lake GT4, we have experienced some hangs related to the VS
* cache and tessellation. It is unknown exactly what is happening
* but the Haswell docs for the "VS Reference Count Full Force Miss
* Enable" field of the "Thread Mode" register refer to a HSW bug in
* which the VUE handle reference count would overflow resulting in
* internal reference counting bugs. My (Jason's) best guess is that
* this bug cropped back up on SKL GT4 when we suddenly had more
* threads in play than any previous gen9 hardware.
*
* What we do know for sure is that setting this bit when
* tessellation shaders are in use fixes a GPU hang in Batman: Arkham
* City when playing with DXVK (https://bugs.freedesktop.org/107280).
* Disabling the vertex cache with tessellation shaders should only
* have a minor performance impact as the tessellation shaders are
* likely generating and processing far more geometry than the vertex
* stage.
*/
vs.VertexCacheDisable = true;
}
vs.VertexURBEntryReadLength = vs_prog_data->base.urb_read_length;
vs.VertexURBEntryReadOffset = 0;

View File

@@ -341,6 +341,11 @@ emit_zero_queries(struct anv_cmd_buffer *cmd_buffer,
sdi.Address.offset = slot_offset + j * sizeof(uint64_t);
sdi.ImmediateData = 0ull;
}
anv_batch_emit(&cmd_buffer->batch, GENX(MI_STORE_DATA_IMM), sdi) {
sdi.Address.bo = &pool->bo;
sdi.Address.offset = slot_offset + j * sizeof(uint64_t) + 4;
sdi.ImmediateData = 0ull;
}
}
emit_query_availability(cmd_buffer, &pool->bo, slot_offset);
}

View File

@@ -111,7 +111,7 @@ foreach g : [['70', ['gen7_cmd_buffer.c']], ['75', ['gen7_cmd_buffer.c']],
inc_vulkan_wsi,
],
c_args : [
c_vis_args, no_override_init_args, '-msse2',
c_vis_args, no_override_init_args, c_sse2_args,
'-DGEN_VERSIONx10=@0@'.format(_gen),
],
dependencies : [dep_libdrm, dep_valgrind, idep_nir_headers],
@@ -155,7 +155,7 @@ anv_deps = [
anv_flags = [
c_vis_args,
no_override_init_args,
'-msse2',
c_sse2_args,
]
if with_platform_x11

View File

@@ -1736,7 +1736,9 @@ dri3_get_buffer(__DRIdrawable *driDrawable,
buffer = new_buffer;
draw->buffers[buf_id] = buffer;
}
dri3_fence_await(draw->conn, draw, buffer);
if (buffer_type == loader_dri3_buffer_back)
dri3_fence_await(draw->conn, draw, buffer);
/*
* Do we need to preserve the content of a previous buffer?

View File

@@ -60,4 +60,36 @@
</category>
<category name="GL_EXT_robustness" number="107">
<function name="GetGraphicsResetStatusEXT"
alias="GetGraphicsResetStatusARB" es2="2.0">
<return type="GLenum"/>
</function>
<function name="ReadnPixelsEXT" alias="ReadnPixelsARB" es2="2.0">
<param name="x" type="GLint"/>
<param name="y" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="type" type="GLenum"/>
<param name="bufSize" type="GLsizei"/>
<param name="data" type="GLvoid *" output="true"/>
</function>
<function name="GetnUniformfvEXT" alias="GetnUniformfvARB" es2="2.0">
<param name="program" type="GLuint"/>
<param name="location" type="GLint"/>
<param name="bufSize" type="GLsizei"/>
<param name="params" type="GLfloat *" output="true"/>
</function>
<function name="GetnUniformivEXT" alias="GetnUniformivARB" es2="2.0">
<param name="program" type="GLuint"/>
<param name="location" type="GLint"/>
<param name="bufSize" type="GLsizei"/>
<param name="params" type="GLint *" output="true"/>
</function>
</category>
</OpenGLAPI>

View File

@@ -49,7 +49,7 @@ ifeq ($(ARCH_X86_HAVE_SSE4_1),true)
LOCAL_WHOLE_STATIC_LIBRARIES := \
libmesa_sse41
LOCAL_CFLAGS := \
-msse4.1 \
-msse4.1 -mstackrealign \
-DUSE_SSE41
endif

View File

@@ -34,7 +34,7 @@ LOCAL_SRC_FILES += \
$(X86_SSE41_FILES)
LOCAL_CFLAGS := \
-msse4.1
-msse4.1 -mstackrealign
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \

View File

@@ -44,7 +44,7 @@ AM_CFLAGS = \
$(WNO_OVERRIDE_INIT) \
$(LIBDRM_CFLAGS) \
$(VALGRIND_CFLAGS) \
-msse2
-msse2 -mstackrealign
AM_CXXFLAGS = $(AM_CFLAGS)

View File

@@ -194,6 +194,9 @@ blorp_surf_for_miptree(struct brw_context *brw,
assert((surf->aux_usage == ISL_AUX_USAGE_NONE) ==
(surf->aux_addr.buffer == NULL));
if (!is_render_target && brw->screen->devinfo.gen == 9)
gen9_apply_single_tex_astc5x5_wa(brw, mt->format, surf->aux_usage);
/* ISL wants real levels, not offset ones. */
*level -= mt->first_level;
}
@@ -305,7 +308,8 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
enum isl_format src_isl_format =
brw_blorp_to_isl_format(brw, src_format, false);
enum isl_aux_usage src_aux_usage =
intel_miptree_texture_aux_usage(brw, src_mt, src_isl_format);
intel_miptree_texture_aux_usage(brw, src_mt, src_isl_format,
0 /* The astc5x5 WA isn't needed */);
/* We do format workarounds for some depth formats so we can't reliably
* sample with HiZ. One of these days, we should fix that.
*/

View File

@@ -168,6 +168,11 @@ enum brw_cache_id {
BRW_MAX_CACHE
};
enum gen9_astc5x5_wa_tex_type {
GEN9_ASTC5X5_WA_TEX_TYPE_ASTC5x5 = 1 << 0,
GEN9_ASTC5X5_WA_TEX_TYPE_AUX = 1 << 1,
};
enum brw_state_id {
/* brw_cache_ids must come first - see brw_program_cache.c */
BRW_STATE_URB_FENCE = BRW_MAX_CACHE,
@@ -1312,6 +1317,8 @@ struct brw_context
*/
enum isl_aux_usage draw_aux_usage[MAX_DRAW_BUFFERS];
enum gen9_astc5x5_wa_tex_type gen9_astc5x5_wa_tex_mask;
__DRIcontext *driContext;
struct intel_screen *screen;
};
@@ -1336,6 +1343,10 @@ void intel_update_renderbuffers(__DRIcontext *context,
__DRIdrawable *drawable);
void intel_prepare_render(struct brw_context *brw);
void gen9_apply_single_tex_astc5x5_wa(struct brw_context *brw,
mesa_format format,
enum isl_aux_usage aux_usage);
void brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering,
bool *draw_aux_buffer_disabled);

View File

@@ -376,6 +376,68 @@ intel_disable_rb_aux_buffer(struct brw_context *brw,
return found;
}
/** Implement the ASTC 5x5 sampler workaround
*
* Gen9 sampling hardware has a bug where an ASTC 5x5 compressed surface
* cannot live in the sampler cache at the same time as an aux compressed
* surface. In order to work around the bug we have to stall rendering with a
* CS and pixel scoreboard stall (implicit in the CS stall) and invalidate the
* texture cache whenever one of ASTC 5x5 or aux compressed may be in the
* sampler cache and we're about to render with something which samples from
* the other.
*
* In the case of a single shader which textures from both ASTC 5x5 and
* a texture which is CCS or HiZ compressed, we have to resolve the aux
* compressed texture prior to rendering. This second part is handled in
* brw_predraw_resolve_inputs() below.
*
* We have observed this issue to affect CCS and HiZ sampling but whether or
* not it also affects MCS is unknown. Because MCS has no concept of a
* resolve (and doing one would be stupid expensive), we choose to simply
* ignore the possibility and hope for the best.
*/
static void
gen9_apply_astc5x5_wa_flush(struct brw_context *brw,
enum gen9_astc5x5_wa_tex_type curr_mask)
{
assert(brw->screen->devinfo.gen == 9);
if (((brw->gen9_astc5x5_wa_tex_mask & GEN9_ASTC5X5_WA_TEX_TYPE_ASTC5x5) &&
(curr_mask & GEN9_ASTC5X5_WA_TEX_TYPE_AUX)) ||
((brw->gen9_astc5x5_wa_tex_mask & GEN9_ASTC5X5_WA_TEX_TYPE_AUX) &&
(curr_mask & GEN9_ASTC5X5_WA_TEX_TYPE_ASTC5x5))) {
brw_emit_pipe_control_flush(brw, PIPE_CONTROL_CS_STALL);
brw_emit_pipe_control_flush(brw, PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE);
}
brw->gen9_astc5x5_wa_tex_mask = curr_mask;
}
static enum gen9_astc5x5_wa_tex_type
gen9_astc5x5_wa_bits(mesa_format format, enum isl_aux_usage aux_usage)
{
if (aux_usage != ISL_AUX_USAGE_NONE &&
aux_usage != ISL_AUX_USAGE_MCS)
return GEN9_ASTC5X5_WA_TEX_TYPE_AUX;
if (format == MESA_FORMAT_RGBA_ASTC_5x5 ||
format == MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5)
return GEN9_ASTC5X5_WA_TEX_TYPE_ASTC5x5;
return 0;
}
/* Helper for the gen9 ASTC 5x5 workaround. This version exists for BLORP's
* use-cases where only a single texture is bound.
*/
void
gen9_apply_single_tex_astc5x5_wa(struct brw_context *brw,
mesa_format format,
enum isl_aux_usage aux_usage)
{
gen9_apply_astc5x5_wa_flush(brw, gen9_astc5x5_wa_bits(format, aux_usage));
}
static void
mark_textures_used_for_txf(BITSET_WORD *used_for_txf,
const struct gl_program *prog)
@@ -415,8 +477,30 @@ brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering,
mark_textures_used_for_txf(used_for_txf, ctx->ComputeProgram._Current);
}
/* Resolve depth buffer and render cache of each enabled texture. */
int maxEnabledUnit = ctx->Texture._MaxEnabledTexImageUnit;
enum gen9_astc5x5_wa_tex_type astc5x5_wa_bits = 0;
if (brw->screen->devinfo.gen == 9) {
/* In order to properly implement the ASTC 5x5 workaround for an
* arbitrary draw or dispatch call, we have to walk the entire list of
* textures looking for ASTC 5x5. If there is any ASTC 5x5 in this draw
* call, all aux compressed textures must be resolved and have aux
* compression disabled while sampling.
*/
for (int i = 0; i <= maxEnabledUnit; i++) {
if (!ctx->Texture.Unit[i]._Current)
continue;
tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
if (!tex_obj || !tex_obj->mt)
continue;
astc5x5_wa_bits |= gen9_astc5x5_wa_bits(tex_obj->_Format,
tex_obj->mt->aux_usage);
}
gen9_apply_astc5x5_wa_flush(brw, astc5x5_wa_bits);
}
/* Resolve depth buffer and render cache of each enabled texture. */
for (int i = 0; i <= maxEnabledUnit; i++) {
if (!ctx->Texture.Unit[i]._Current)
continue;
@@ -450,7 +534,8 @@ brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering,
intel_miptree_prepare_texture(brw, tex_obj->mt, view_format,
min_level, num_levels,
min_layer, num_layers);
min_layer, num_layers,
astc5x5_wa_bits);
/* If any programs are using it with texelFetch, we may need to also do
* a prepare with an sRGB format to ensure texelFetch works "properly".
@@ -461,7 +546,8 @@ brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering,
if (txf_format != view_format) {
intel_miptree_prepare_texture(brw, tex_obj->mt, txf_format,
min_level, num_levels,
min_layer, num_layers);
min_layer, num_layers,
astc5x5_wa_bits);
}
}
@@ -533,7 +619,8 @@ brw_predraw_resolve_framebuffer(struct brw_context *brw,
if (irb) {
intel_miptree_prepare_texture(brw, irb->mt, irb->mt->surf.format,
irb->mt_level, 1,
irb->mt_layer, irb->layer_count);
irb->mt_layer, irb->layer_count,
brw->gen9_astc5x5_wa_tex_mask);
}
}
}

View File

@@ -601,7 +601,8 @@ static void brw_update_texture_surface(struct gl_context *ctx,
view.usage |= ISL_SURF_USAGE_CUBE_BIT;
enum isl_aux_usage aux_usage =
intel_miptree_texture_aux_usage(brw, mt, format);
intel_miptree_texture_aux_usage(brw, mt, format,
brw->gen9_astc5x5_wa_tex_mask);
brw_emit_surface_state(brw, mt, mt->target, view, aux_usage,
surf_offset, surf_index,
@@ -1105,7 +1106,8 @@ update_renderbuffer_read_surfaces(struct brw_context *brw)
};
enum isl_aux_usage aux_usage =
intel_miptree_texture_aux_usage(brw, irb->mt, format);
intel_miptree_texture_aux_usage(brw, irb->mt, format,
brw->gen9_astc5x5_wa_tex_mask);
if (brw->draw_aux_usage[i] == ISL_AUX_USAGE_NONE)
aux_usage = ISL_AUX_USAGE_NONE;

View File

@@ -118,6 +118,33 @@ gen7_emit_push_constant_state(struct brw_context *brw, unsigned vs_size,
const struct gen_device_info *devinfo = &brw->screen->devinfo;
unsigned offset = 0;
/* From the SKL PRM, Workarounds section (#878):
*
* Push constant buffer corruption possible. WA: Insert 2 zero-length
* PushConst_PS before every intended PushConst_PS update, issue a
* NULLPRIM after each of the zero len PC update to make sure CS commits
* them.
*
* This workaround is attempting to solve a pixel shader push constant
* synchronization issue.
*
* There's an unpublished WA that involves re-emitting
* 3DSTATE_PUSH_CONSTANT_ALLOC_PS for every 500-ish 3DSTATE_CONSTANT_PS
* packets. Since our counting methods may not be reliable due to
* context-switching and pre-emption, we instead choose to approximate this
* behavior by re-emitting the packet at the top of the batch.
*/
if (brw->ctx.NewDriverState == BRW_NEW_BATCH) {
/* SKL GT2 and GLK 2x6 have reliably demonstrated this issue thus far.
* We've also seen some intermittent failures from SKL GT4 and BXT in
* the past.
*/
if (!devinfo->is_skylake &&
!devinfo->is_broxton &&
!devinfo->is_geminilake)
return;
}
BEGIN_BATCH(10);
OUT_BATCH(_3DSTATE_PUSH_CONSTANT_ALLOC_VS << 16 | (2 - 2));
OUT_BATCH(vs_size | offset << GEN7_PUSH_CONSTANT_BUFFER_OFFSET_SHIFT);
@@ -154,6 +181,7 @@ const struct brw_tracked_state gen7_push_constant_space = {
.dirty = {
.mesa = 0,
.brw = BRW_NEW_CONTEXT |
BRW_NEW_BATCH | /* Push constant workaround */
BRW_NEW_GEOMETRY_PROGRAM |
BRW_NEW_TESS_PROGRAMS,
},

View File

@@ -2696,7 +2696,7 @@ genX(upload_gs_state)(struct brw_context *brw)
#if GEN_GEN < 7
gs.SOStatisticsEnable = true;
if (gs_prog->info.has_transform_feedback_varyings)
gs.SVBIPayloadEnable = true;
gs.SVBIPayloadEnable = _mesa_is_xfb_active_and_unpaused(ctx);
/* GEN6_GS_SPF_MODE and GEN6_GS_VECTOR_MASK_ENABLE are enabled as it
* was previously done for gen6.

View File

@@ -121,15 +121,6 @@ set_blitter_tiling(struct brw_context *brw,
SET_BLITTER_TILING(brw, false, false); \
ADVANCE_BATCH()
static int
blt_pitch(struct intel_mipmap_tree *mt)
{
int pitch = mt->surf.row_pitch;
if (mt->surf.tiling != ISL_TILING_LINEAR)
pitch /= 4;
return pitch;
}
bool
intel_miptree_blit_compatible_formats(mesa_format src, mesa_format dst)
{
@@ -403,7 +394,8 @@ emit_miptree_blit(struct brw_context *brw,
* for linear surfaces and DWords for tiled surfaces. So the maximum
* pitch is 32k linear and 128k tiled.
*/
if (blt_pitch(src_mt) >= 32768 || blt_pitch(dst_mt) >= 32768) {
if (intel_miptree_blt_pitch(src_mt) >= 32768 ||
intel_miptree_blt_pitch(dst_mt) >= 32768) {
perf_debug("Falling back due to >= 32k/128k pitch\n");
return false;
}

View File

@@ -509,7 +509,7 @@ free_aux_state_map(enum isl_aux_state **state)
}
static bool
need_to_retile_as_linear(struct brw_context *brw, unsigned row_pitch,
need_to_retile_as_linear(struct brw_context *brw, unsigned blt_pitch,
enum isl_tiling tiling, unsigned samples)
{
if (samples > 1)
@@ -518,13 +518,9 @@ need_to_retile_as_linear(struct brw_context *brw, unsigned row_pitch,
if (tiling == ISL_TILING_LINEAR)
return false;
/* If the width is much smaller than a tile, don't bother tiling. */
if (row_pitch < 64)
return true;
if (ALIGN(row_pitch, 512) >= 32768) {
perf_debug("row pitch %u too large to blit, falling back to untiled",
row_pitch);
if (blt_pitch >= 32768) {
perf_debug("blt pitch %u too large to blit, falling back to untiled",
blt_pitch);
return true;
}
@@ -604,7 +600,7 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
bool is_depth_stencil =
mt->surf.usage & (ISL_SURF_USAGE_STENCIL_BIT | ISL_SURF_USAGE_DEPTH_BIT);
if (!is_depth_stencil) {
if (need_to_retile_as_linear(brw, mt->surf.row_pitch,
if (need_to_retile_as_linear(brw, intel_miptree_blt_pitch(mt),
mt->surf.tiling, mt->surf.samples)) {
init_info.tiling_flags = 1u << ISL_TILING_LINEAR;
if (!isl_surf_init_s(&brw->isl_dev, &mt->surf, &init_info))
@@ -2623,8 +2619,19 @@ can_texture_with_ccs(struct brw_context *brw,
enum isl_aux_usage
intel_miptree_texture_aux_usage(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format view_format)
enum isl_format view_format,
enum gen9_astc5x5_wa_tex_type astc5x5_wa_bits)
{
assert(brw->screen->devinfo.gen == 9 || astc5x5_wa_bits == 0);
/* On gen9, ASTC 5x5 textures cannot live in the sampler cache along side
* CCS or HiZ compressed textures. See gen9_apply_astc5x5_wa_flush() for
* details.
*/
if ((astc5x5_wa_bits & GEN9_ASTC5X5_WA_TEX_TYPE_ASTC5x5) &&
mt->aux_usage != ISL_AUX_USAGE_MCS)
return ISL_AUX_USAGE_NONE;
switch (mt->aux_usage) {
case ISL_AUX_USAGE_HIZ:
if (intel_miptree_sample_with_hiz(brw, mt))
@@ -2682,10 +2689,12 @@ intel_miptree_prepare_texture(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format view_format,
uint32_t start_level, uint32_t num_levels,
uint32_t start_layer, uint32_t num_layers)
uint32_t start_layer, uint32_t num_layers,
enum gen9_astc5x5_wa_tex_type astc5x5_wa_bits)
{
enum isl_aux_usage aux_usage =
intel_miptree_texture_aux_usage(brw, mt, view_format);
intel_miptree_texture_aux_usage(brw, mt, view_format, astc5x5_wa_bits);
bool clear_supported = aux_usage != ISL_AUX_USAGE_NONE;
/* Clear color is specified as ints or floats and the conversion is done by
@@ -3578,21 +3587,18 @@ intel_miptree_release_map(struct intel_mipmap_tree *mt,
static bool
can_blit_slice(struct intel_mipmap_tree *mt,
unsigned int level, unsigned int slice)
const struct intel_miptree_map *map)
{
/* See intel_miptree_blit() for details on the 32k pitch limit. */
if (mt->surf.row_pitch >= 32768)
return false;
return true;
const unsigned src_blt_pitch = intel_miptree_blt_pitch(mt);
const unsigned dst_blt_pitch = ALIGN(map->w * mt->cpp, 64);
return src_blt_pitch < 32768 && dst_blt_pitch < 32768;
}
static bool
use_intel_mipree_map_blit(struct brw_context *brw,
struct intel_mipmap_tree *mt,
GLbitfield mode,
unsigned int level,
unsigned int slice)
const struct intel_miptree_map *map)
{
const struct gen_device_info *devinfo = &brw->screen->devinfo;
@@ -3600,19 +3606,19 @@ use_intel_mipree_map_blit(struct brw_context *brw,
/* It's probably not worth swapping to the blit ring because of
* all the overhead involved.
*/
!(mode & GL_MAP_WRITE_BIT) &&
!(map->mode & GL_MAP_WRITE_BIT) &&
!mt->compressed &&
(mt->surf.tiling == ISL_TILING_X ||
/* Prior to Sandybridge, the blitter can't handle Y tiling */
(devinfo->gen >= 6 && mt->surf.tiling == ISL_TILING_Y0) ||
/* Fast copy blit on skl+ supports all tiling formats. */
devinfo->gen >= 9) &&
can_blit_slice(mt, level, slice))
can_blit_slice(mt, map))
return true;
if (mt->surf.tiling != ISL_TILING_LINEAR &&
mt->bo->size >= brw->max_gtt_map_object_size) {
assert(can_blit_slice(mt, level, slice));
assert(can_blit_slice(mt, map));
return true;
}
@@ -3664,7 +3670,7 @@ intel_miptree_map(struct brw_context *brw,
intel_miptree_map_etc(brw, mt, map, level, slice);
} else if (mt->stencil_mt && !(mode & BRW_MAP_DIRECT_BIT)) {
intel_miptree_map_depthstencil(brw, mt, map, level, slice);
} else if (use_intel_mipree_map_blit(brw, mt, mode, level, slice)) {
} else if (use_intel_mipree_map_blit(brw, mt, map)) {
intel_miptree_map_blit(brw, mt, map, level, slice);
#if defined(USE_SSE41)
} else if (!(mode & GL_MAP_WRITE_BIT) &&

View File

@@ -652,13 +652,15 @@ intel_miptree_access_raw(struct brw_context *brw,
enum isl_aux_usage
intel_miptree_texture_aux_usage(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format view_format);
enum isl_format view_format,
enum gen9_astc5x5_wa_tex_type astc5x5_wa_bits);
void
intel_miptree_prepare_texture(struct brw_context *brw,
struct intel_mipmap_tree *mt,
enum isl_format view_format,
uint32_t start_level, uint32_t num_levels,
uint32_t start_layer, uint32_t num_layers);
uint32_t start_layer, uint32_t num_layers,
enum gen9_astc5x5_wa_tex_type astc5x5_wa_bits);
void
intel_miptree_prepare_image(struct brw_context *brw,
struct intel_mipmap_tree *mt);
@@ -741,6 +743,16 @@ intel_miptree_set_depth_clear_value(struct brw_context *brw,
struct intel_mipmap_tree *mt,
float clear_value);
static inline int
intel_miptree_blt_pitch(struct intel_mipmap_tree *mt)
{
int pitch = mt->surf.row_pitch;
if (mt->surf.tiling != ISL_TILING_LINEAR)
pitch /= 4;
return pitch;
}
#ifdef __cplusplus
}
#endif

View File

@@ -142,7 +142,7 @@ foreach v : ['40', '45', '50', '60', '70', '75', '80', '90', '100', '110']
['genX_blorp_exec.c', 'genX_state_upload.c', gen_xml_pack],
include_directories : [inc_common, inc_intel, inc_dri_common],
c_args : [
c_vis_args, no_override_init_args, '-msse2',
c_vis_args, no_override_init_args, c_sse2_args,
'-DGEN_VERSIONx10=@0@'.format(v),
],
dependencies : [dep_libdrm, idep_nir_headers],
@@ -183,8 +183,8 @@ libi965 = static_library(
include_directories : [
inc_common, inc_intel, inc_dri_common, inc_util, inc_drm_uapi,
],
c_args : [c_vis_args, no_override_init_args, '-msse2'],
cpp_args : [cpp_vis_args, '-msse2'],
c_args : [c_vis_args, no_override_init_args, c_sse2_args],
cpp_args : [cpp_vis_args, c_sse2_args],
link_with : [
i965_gen_libs, libintel_common, libintel_dev, libisl, libintel_compiler,
libblorp,

View File

@@ -688,10 +688,10 @@ static void r200ColorMask( struct gl_context *ctx,
if (!rrb)
return;
mask = radeonPackColor( rrb->cpp,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3) );
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3)*0xFF );
if (!(r && g && b && a))

View File

@@ -503,10 +503,10 @@ static void radeonColorMask( struct gl_context *ctx,
return;
mask = radeonPackColor( rrb->cpp,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2),
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3) );
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2)*0xFF,
GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3)*0xFF );
if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
RADEON_STATECHANGE( rmesa, msk );

View File

@@ -163,6 +163,9 @@ st_convert_sampler(const struct st_context *st,
const GLboolean is_integer = texobj->_IsIntegerFormat;
GLenum texBaseFormat = _mesa_base_tex_image(texobj)->_BaseFormat;
if (texobj->StencilSampling)
texBaseFormat = GL_STENCIL_INDEX;
if (st->apply_texture_swizzle_to_border_color) {
const struct st_texture_object *stobj = st_texture_object_const(texobj);
/* XXX: clean that up to not use the sampler view at all */

View File

@@ -566,7 +566,11 @@ make_texture(struct st_context *st,
dest = pipe_transfer_map(pipe, pt, 0, 0,
PIPE_TRANSFER_WRITE, 0, 0,
width, height, &transfer);
if (!dest) {
pipe_resource_reference(&pt, NULL);
_mesa_unmap_pbo_source(ctx, unpack);
return NULL;
}
/* Put image into texture transfer.
* Note that the image is actually going to be upside down in
@@ -1173,6 +1177,13 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
return;
}
/* Put glDrawPixels image into a texture */
pt = make_texture(st, width, height, format, type, unpack, pixels);
if (!pt) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
return;
}
/*
* Get vertex/fragment shaders
*/
@@ -1199,13 +1210,6 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
st_upload_constants(st, &st->fp->Base);
}
/* Put glDrawPixels image into a texture */
pt = make_texture(st, width, height, format, type, unpack, pixels);
if (!pt) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
return;
}
/* create sampler view for the image */
sv[0] = st_create_texture_sampler_view(st->pipe, pt);
if (!sv[0]) {

View File

@@ -519,7 +519,7 @@ replay_init(struct copy_context *copy)
for (offset = 0, i = 0; i < copy->nr_varying; i++) {
const struct gl_vertex_array *src = copy->varying[i].array;
const struct gl_array_attributes *srcattr = src->VertexAttrib;
struct gl_vertex_array *dst = &copy->dstarray[i];
struct gl_vertex_array *dst = &copy->dstarray[copy->varying[i].attr];
struct gl_vertex_buffer_binding *dstbind = &copy->varying[i].dstbinding;
struct gl_array_attributes *dstattr = &copy->varying[i].dstattribs;

View File

@@ -81,6 +81,7 @@ util_vsnprintf(char *str, size_t size, const char *format, va_list ap)
if (ret < 0) {
ret = _vscprintf(format, ap_copy);
}
va_end(ap_copy);
return ret;
}
@@ -119,14 +120,14 @@ util_vasprintf(char **ret, const char *format, va_list ap)
/* Compute length of output string first */
va_copy(ap_copy, ap);
int r = util_vsnprintf(NULL, 0, format, ap);
int r = util_vsnprintf(NULL, 0, format, ap_copy);
va_end(ap_copy);
if (r < 0)
return -1;
*ret = (char *) malloc(r + 1);
if (!ret)
if (!*ret)
return -1;
/* Print to buffer */

View File

@@ -22,7 +22,10 @@ xmlpool_options_h = custom_target(
'xmlpool_options.h',
input : ['gen_xmlpool.py', 't_options.h'],
output : 'options.h',
command : [prog_python2, '@INPUT@', meson.current_source_dir()],
command : [
prog_python2, '@INPUT@', meson.current_source_dir(),
'ca', 'es', 'de', 'nl', 'sv', 'fr',
],
capture : true,
depend_files : files('ca.po', 'es.po', 'de.po', 'nl.po', 'sv.po', 'fr.po'),
)