mesa.git
6 years agomesa: rename some vars in client_state()
Brian Paul [Fri, 26 Jan 2018 18:03:29 +0000 (11:03 -0700)]
mesa: rename some vars in client_state()

Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
6 years agomesa: Care for differences in fog mode only if fog is consumed.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Care for differences in fog mode only if fog is consumed.

In creating fixed function vertex shader hash keys do only
care for producing the varying output if fog is enabled and the
varing is consumed in the fragment stage.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Reduce ffvertex_prog state_key to 36 bytes.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Reduce ffvertex_prog state_key to 36 bytes.

Using lower alignment restrictions for the state key fields finally
yields to a smaller hashing state key.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Remove unused ffvertex_prog texunit_really_enabled.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Remove unused ffvertex_prog texunit_really_enabled.

Remove set but not read field from the state key used for hashing
fixed function vertex shaders.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Remove unused bit in ffvertex_prog state_key.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Remove unused bit in ffvertex_prog state_key.

Remove set but not read field from the state key used for hashing
fixed function vertex shaders.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: texgen_enabled is only 1 bit.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: texgen_enabled is only 1 bit.

For the state key for hashing fixed function vertex shaders, the
texgen_enabled field requires only a single bit.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Encode fog modes in a 2 bit field.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Encode fog modes in a 2 bit field.

For the state key for hashing fixed function
vertex shaders, encode the different fog modes, including
if fog is generally enabled or not, into a 2 bit field.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Move seperate_specular into the lighting section.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Move seperate_specular into the lighting section.

For the state key for hashing fixed function
vertex shaders, the information is only evaluated
if lighting is generally switched on.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Get the point size array state from varying_vp_inputs.
Mathias Fröhlich [Sat, 27 Jan 2018 19:09:00 +0000 (12:09 -0700)]
mesa: Get the point size array state from varying_vp_inputs.

For the state key for hashing fixed function
vertex shaders, The varying_vp_inputs bitmask already
contains the point size array enabled information.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: Remove unused gl_fog_attrib::_Scale.
Mathias Fröhlich [Tue, 30 Jan 2018 15:37:21 +0000 (08:37 -0700)]
mesa: Remove unused gl_fog_attrib::_Scale.

The patch removes a variable that is only written to.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agoanv/pipeline: lower constant initializers on output variables earlier
Iago Toral Quiroga [Tue, 16 Jan 2018 08:37:11 +0000 (09:37 +0100)]
anv/pipeline: lower constant initializers on output variables earlier

If a shader only writes to an output via a constant initializer we
need to lower it before we call nir_remove_dead_variables so that
this pass sees the stores from the initializer and doesn't kill the
output.

Fixes test failures in new work-in-progress CTS tests:
dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_vert
dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_frag

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965: move disk cache from brw_context to intel_screen
Tapani Pälli [Fri, 26 Jan 2018 06:20:07 +0000 (08:20 +0200)]
i965: move disk cache from brw_context to intel_screen

Now every context refers to same disk_cache instance in screen.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agomesa: Correctly print glTexImage dimensions
Elie Tournier [Thu, 25 Jan 2018 15:18:10 +0000 (15:18 +0000)]
mesa: Correctly print glTexImage dimensions

texture_format_error_check_gles() displays error like "glTexImage%dD".
This patch just replace the %d by the correct dimension.

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agomesa: shrink size of gl_array_attributes (v2)
Brian Paul [Mon, 29 Jan 2018 21:09:54 +0000 (14:09 -0700)]
mesa: shrink size of gl_array_attributes (v2)

Inspired by Marek's earlier patch, but even smaller.  Sort fields from
largest to smallest.  Use bitfields for more fields (sometimes with an
extra bit for MSVC).  Reduce Stride field to GLshort.

Note that some fields cannot be bitfields because they're accessed via
pointers (such as for glEnableClientState(GL_VERTEX_ARRAY) to set the
Enabled field).

Reduces size from 48 to 24 bytes.
Also reduces size of gl_vertex_array_object from 3632 to 2864 bytes.

And add some assertions in init_array().

v2: use s/GLuint/unsigned/, improve commit comments.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: shrink gl_vertex_array
Brian Paul [Fri, 26 Jan 2018 21:49:41 +0000 (14:49 -0700)]
mesa: shrink gl_vertex_array

Inspired by Marek's earlier patch, but goes a little further.
Sort fields from largest to smallest.  Use bitfields.

Reduced from 48 bytes to 32.  Also reduces size of gl_vertex_array_object
from 4144 to 3632

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomesa: replace GLenum with GLenum16 in common structures (v4)
Marek Olšák [Fri, 26 Jan 2018 21:25:53 +0000 (14:25 -0700)]
mesa: replace GLenum with GLenum16 in common structures (v4)

v2: - fix glGet*
    - also use GLenum16 for DrawBuffers
v3: - rebase to top of tree (BrianP) and incorporate Ian's suggestions
v4: - fix a GLenum16 bug in VBO/save code, add some STATIC_ASSERT()s

gl_context = 152432 -> 136840 bytes
vbo_context = 22096 -> 20608 bytes

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agomesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT()
Brian Paul [Mon, 29 Jan 2018 21:19:44 +0000 (14:19 -0700)]
mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT()

get_value_size() returns -1 for an error.  The similar check in
_mesa_GetUnsignedBytei_vEXT() is correct.

Found by chance.  There are apparently no Piglit tests which exercise
glGetUnsignedBytei_vEXT() or glGetUnsignedBytevEXT().

Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agosvga: Check rasterization state object before checking poly_stipple_enable
Neha Bhende [Mon, 22 Jan 2018 23:01:20 +0000 (15:01 -0800)]
svga: Check rasterization state object before checking poly_stipple_enable

Sometimes rasterization state object could be empty. This is causing
segfault on hw8,9,10 for some traces.

This patch fixes enemy_territory_quake_wars_high,
enemy_territory_quake_wars_low, etqw-demo, lightsmark2008, quake1
glretrace crashes on hw 8,9,10.

Tested with mtt-glretrace and mtt-piglit.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agosvga: Adjust alpha for S3TC_DXT1_EXT RGB formats
Neha Bhende [Mon, 29 Jan 2018 16:32:19 +0000 (09:32 -0700)]
svga: Adjust alpha for S3TC_DXT1_EXT RGB formats

According to spec, S3TC_DXT1_EXT RGB formats are supposed to be
opaque. Correspoding svga formats are not handling it so explicitly
setting it to 1.0.
This fixes piglit test spec@ext_texture_compression_s3tc@s3tc-targeted
Note: This test is testcase for freedesktop bug 100925

Tested with mtt-piglit and mtt-glretrace on 8,9,10,11 and 15

Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa/st/glsl_to_tgsi: Mark first write as unconditional when appropriate
Gert Wollny [Mon, 29 Jan 2018 12:24:00 +0000 (05:24 -0700)]
mesa/st/glsl_to_tgsi: Mark first write as unconditional when appropriate

In the register lifetime estimation if the first write is unconditional or
conditional but not within a loop then this is an unconditional dominant
write in the sense of register life time estimation.
Add a test case and record the write accordingly.

Fixes: 807e2539e512ca6c96f059da855473eb7be99ba1 ("mesa/st/glsl_to_tgsi: Add
tracking of ifelse writes in register merging")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104803
Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agomesa: skip validation of legality of size/type queries for format queries
Roland Scheidegger [Sat, 27 Jan 2018 00:39:35 +0000 (01:39 +0100)]
mesa: skip validation of legality of size/type queries for format queries

The size/type query is always legal (if we made it that far).
Removing this causes a difference for GL_TEXTURE_BUFFER - the reason is that
these parameters are valid only with GetTexLevelParameter() if gl 3.1 is
supported, but not if only ARB_texture_buffer_object is supported.
However, while the spec says that these queries return "the same information
as querying GetTexLevelParameter" I believe we're not expected to return just
zeros here. By definition, these pnames are always valid (unlike for the
GetTexLevelParameter() function which would return an error without GL 3.1).
The spec is a bit inconsistent there and open to interpretation - while
mentioning the "same information as querying GetTexLevelParameter" is
returned, it also mentions that 0 is returned for size/type if the
target/format is not supported - implying correct results to be returned
if it is supported, regardless that GetTexLevelParameter would return
an error. (Also, the bit about this returning the same as
GetTexLevelParameter also includes querying stencil type, which isn't
even possible with GetTexLevelParameter.)

This breaks some piglit arb_internalformat_query2 tests (which I believe to
be wrong).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>§
6 years agomesa: restrict formats being supported by target type for formatquery
Roland Scheidegger [Sat, 27 Jan 2018 00:25:26 +0000 (01:25 +0100)]
mesa: restrict formats being supported by target type for formatquery

The code just considered all formats as being supported if they were either
a valid fbo or texture format.
This was quite awkward since then the query would return "supported" for
e.g. GL_RGB9E5 or compressed formats and target RENDERBUFFER (albeit the driver
could still refuse it in theory). However, when then querying for instance the
internalformat sizes, it would just return 0 (due to the checks being more
strict there).
It was also a problem for texture buffer targets, which have a more restricted
list of formats which are allowed (and again, it would return supported but
then querying sizes would return 0).
So only take validation of formats into account which make sense for a given
target.
Can also toss out some special checks for rgb9e5 later, since we'd never get
there if it wasn't supported in the first place.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
6 years agomesa: (trivial) add TODO comment for default results for internal queries
Roland Scheidegger [Tue, 30 Jan 2018 00:03:49 +0000 (01:03 +0100)]
mesa: (trivial) add TODO comment for default results for internal queries

6 years agomesa: remove misleading gles checks for formatquery
Roland Scheidegger [Sat, 27 Jan 2018 00:12:52 +0000 (01:12 +0100)]
mesa: remove misleading gles checks for formatquery

Testing for gles there is just confusing - this is about target being
supported, if it was valid at all was already determined earlier
(in _legal_parameters). It didn't make sense at all in any case, since
it would only have said false there for gles for 2d but not 2d arrays etc.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
6 years agoi965: Emit PIPE_CONTROL with ISP bit on older platforms.
Rafael Antognolli [Fri, 26 Jan 2018 01:14:47 +0000 (17:14 -0800)]
i965: Emit PIPE_CONTROL with ISP bit on older platforms.

Emit it on all platforms since gen7.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/cmd_buffer: Emit PIPE_CONTROL with ISP bit on older platforms.
Rafael Antognolli [Fri, 26 Jan 2018 01:13:26 +0000 (17:13 -0800)]
anv/cmd_buffer: Emit PIPE_CONTROL with ISP bit on older platforms.

Emit it on all platforms since gen7.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agost/glsl_to_nir: remove dead io after conversion to nir
Timothy Arceri [Mon, 29 Jan 2018 06:33:57 +0000 (17:33 +1100)]
st/glsl_to_nir: remove dead io after conversion to nir

This fixes an assert in nir_lower_var_copies() for some bioshock
shaders where an unused clipdistance array has no size.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi/nir: add support vs double inputs
Timothy Arceri [Fri, 15 Dec 2017 03:22:16 +0000 (14:22 +1100)]
radeonsi/nir: add support vs double inputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi: pass input_idx to declare_nir_input_vs()
Timothy Arceri [Fri, 15 Dec 2017 03:16:01 +0000 (14:16 +1100)]
radeonsi: pass input_idx to declare_nir_input_vs()

This make it consistent with declare_nir_input_fs() and will allow
us to support doubles.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi: add bitcast_inputs() helper
Timothy Arceri [Fri, 15 Dec 2017 03:13:11 +0000 (14:13 +1100)]
radeonsi: add bitcast_inputs() helper

Will be used in a following patch to help support doubles.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi/nir: fix num_inputs for doubles in vs
Timothy Arceri [Fri, 15 Dec 2017 00:22:56 +0000 (11:22 +1100)]
radeonsi/nir: fix num_inputs for doubles in vs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agonir: partially revert c2acf97fcc9b32e
Timothy Arceri [Thu, 14 Dec 2017 06:22:23 +0000 (17:22 +1100)]
nir: partially revert c2acf97fcc9b32e

c2acf97fcc9b32e changed the use of double_inputs_read to be
inconsitent with its previous meaning. Here we re-enable the
gather info code that was removed as the modified code from
c2acf97fcc9b32e now uses the double_inputs member rather than
double_inputs_read.

This change allows us to use double_inputs_read with gallium
drivers without impacting double_inputs which is used by i965.

We also make use of the compiler option vs_inputs_dual_locations
to allow for the difference in behaviour between drivers that handle
vs inputs as taking up two locations for doubles, versus those that
treat them as taking a single location.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
6 years agonir: add vs_inputs_dual_locations compiler option
Timothy Arceri [Sun, 7 Jan 2018 23:37:27 +0000 (10:37 +1100)]
nir: add vs_inputs_dual_locations compiler option

Allows nir drivers to either use a single or dual locations for
vs double inputs.

i965 uses dual locations for both OpenGL and Vulkan drivers, for
now gallium OpenGL drivers only use a single location.

The following patch will also make use of this option when
calling nir_shader_gather_info().

Reviewed-by: Karol Herbst <kherbst@redhat.com>
6 years agocompiler: tidy up double_inputs_read uses
Timothy Arceri [Sat, 16 Dec 2017 03:06:23 +0000 (14:06 +1100)]
compiler: tidy up double_inputs_read uses

First we move double_inputs_read into a vs struct in the union,
double_inputs_read is only used for vs inputs so this will
save space and also allows us to add a new double_inputs field.

We add the new field because c2acf97fcc9b changed the behaviour
of double_inputs_read, and while it's no longer used to track
actual reads in i965 we do still want to track this for gallium
drivers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradv/gfx9: fix block compression texture views. (v2)
Dave Airlie [Mon, 29 Jan 2018 04:15:09 +0000 (04:15 +0000)]
radv/gfx9: fix block compression texture views. (v2)

This ports a fix from amdvlk, to fix the sizing for mip levels
when block compressed images are viewed using uncompressed views.

My original fix didn't power the clamping, but it looks like
the clamping is required to stop the sizing going too large.

Fixes:
dEQP-VK.image.texel_view_compatible.graphic.extended*bc*
Doesn't crash DOW3 anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: e38685cc62e 'Revert "radv: disable support for VEGA for now."'
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: Signal fence correctly after sparse binding.
Bas Nieuwenhuizen [Sat, 27 Jan 2018 13:51:12 +0000 (14:51 +0100)]
radv: Signal fence correctly after sparse binding.

It did not signal syncobjs in the fence, and also signalled too early
if there was work on the queue already, as we have to wait till that
work is done.

Fixes: d27aaae4d2 "radv: Add external fence support."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agomesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()
Brian Paul [Wed, 24 Jan 2018 16:14:35 +0000 (09:14 -0700)]
mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()

The arrays specified by ctx->Array._DrawArrays are used for all
vertex drawing via vbo_context::draw_prims().  Different arrays are
used for immediate mode, vertex arrays, display lists, etc.  Changing
from one to another requires updating derived/driver array state.

Before, we indirectly specifid the arrays with the gl_draw_method values.
Now we just directly specify the arrays instead.  This is simpler and
will allow a subsequent display list optimization.

In the future, it might make sense to get rid of ctx->Array._DrawArrays
entirely and just pass the arrays as another parameter to
vbo_context::draw_prims().

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: s/[0]/[VERT_ATTRIB_POS]/ in recalculate_input_bindings()
Brian Paul [Wed, 24 Jan 2018 20:31:11 +0000 (13:31 -0700)]
vbo: s/[0]/[VERT_ATTRIB_POS]/ in recalculate_input_bindings()

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: add new VBO_ATTRIBS_ masks to vbo_attrib.h
Brian Paul [Thu, 18 Jan 2018 19:28:11 +0000 (12:28 -0700)]
vbo: add new VBO_ATTRIBS_ masks to vbo_attrib.h

These will be used in a later patch.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/
Brian Paul [Sat, 20 Jan 2018 04:44:20 +0000 (21:44 -0700)]
vbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/

To match the VERT_ATTRIB_COLOR_INDEX name.
Give a name to the previously anonymous enum of VBO_ATTRIB_x values.
Update the comment on the enum.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: minor clean-ups in vbo_exec.h
Brian Paul [Sat, 20 Jan 2018 04:16:19 +0000 (21:16 -0700)]
vbo: minor clean-ups in vbo_exec.h

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: s/_API_NOOP_H/VBO_NOOP_H/ in vbo_noop.h
Brian Paul [Sat, 20 Jan 2018 04:14:49 +0000 (21:14 -0700)]
vbo: s/_API_NOOP_H/VBO_NOOP_H/ in vbo_noop.h

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: whitespace/formatting fixes in vbo_exec.h
Brian Paul [Sat, 20 Jan 2018 04:13:52 +0000 (21:13 -0700)]
vbo: whitespace/formatting fixes in vbo_exec.h

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: move, rename vp_mode enums, get_program_mode() function
Brian Paul [Sat, 20 Jan 2018 04:03:07 +0000 (21:03 -0700)]
vbo: move, rename vp_mode enums, get_program_mode() function

Instead of NONE/ARB use FF/SHADER.  Move the enum declaration to
vbo_private.h where it's used.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agovbo: s/cl/array/ in vbo_context.c
Brian Paul [Fri, 19 Jan 2018 17:52:57 +0000 (10:52 -0700)]
vbo: s/cl/array/ in vbo_context.c

I think 'cl' used to mean client array.

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
6 years agonir: mark unused space in packed_tex_data
Tapani Pälli [Fri, 26 Jan 2018 09:26:18 +0000 (11:26 +0200)]
nir: mark unused space in packed_tex_data

This change cleans following scary warnings in valgrind output
when disk cache is being written:

   ==6532== Uninitialised byte(s) found during client check request
   ==6532==    at 0x14423FAD: blob_write_bytes (blob.c:152)
   ==6532==    by 0x144240FB: blob_write_uint32 (blob.c:194)
   ==6532==    by 0x144001A5: write_tex (nir_serialize.c:613)

and later (loads of):

   ==6532== Use of uninitialised value of size 8
   ==6532==    at 0x62FCD9E: crc32_z (in /usr/lib64/libz.so.1.2.11)
   ==6532==    by 0x13F65014: util_hash_crc32 (crc32.c:127)
   ==6532==    by 0x13F5DABA: cache_put (disk_cache.c:947)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoi965: fix disk_cache leak when destroying context
Tapani Pälli [Fri, 26 Jan 2018 08:47:31 +0000 (10:47 +0200)]
i965: fix disk_cache leak when destroying context

   ==2780== 1,024 bytes in 1 blocks are possibly lost in loss record 180 of 205
   ==2780==    at 0x4C31A1E: calloc (vg_replace_malloc.c:711)
   ==2780==    by 0x13F6467E: util_queue_init (u_queue.c:309)
   ==2780==    by 0x13F5C9F6: disk_cache_create (disk_cache.c:369)
   ==2780==    by 0x13F05406: brw_disk_cache_init (brw_disk_cache.c:428)
   ==2780==    by 0x13F01E78: brwCreateContext (brw_context.c:1068)

Fixes: 1a61a8b9a7c ("i965: Initialize disk shader cache if MESA_GLSL_CACHE_DISABLE is false")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoi965: fix prog_data leak in brw_disk_cache
Tapani Pälli [Fri, 26 Jan 2018 08:25:16 +0000 (10:25 +0200)]
i965: fix prog_data leak in brw_disk_cache

   ==25481== 576 bytes in 1 blocks are definitely lost in loss record 179 of 208
   ==25481==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
   ==25481==    by 0x1404E2CC: ralloc_size (ralloc.c:121)
   ==25481==    by 0x14119F82: read_and_upload (brw_disk_cache.c:176)
   ==25481==    by 0x1411A5C9: brw_disk_cache_upload_program (brw_disk_cache.c:271)
   ==25481==    by 0x1412FCA4: brw_upload_wm_prog (brw_wm.c:597)

Fixes: 516d50db319 ("i965: add initial implementation of on disk shader cache")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoac: fix indentation
Timothy Arceri [Mon, 29 Jan 2018 00:07:28 +0000 (11:07 +1100)]
ac: fix indentation

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoac: remove unused nir2llvmtype()
Timothy Arceri [Mon, 22 Jan 2018 07:26:12 +0000 (18:26 +1100)]
ac: remove unused nir2llvmtype()

The last use of this was removed in the previous patch.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoac: fix gs load inputs type
Timothy Arceri [Mon, 22 Jan 2018 07:23:27 +0000 (18:23 +1100)]
ac: fix gs load inputs type

This fixes the scenario where the input is a struct. With this
the Unreal engines Elemental demo now works on radeonsi.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoac/nir: call glsl_get_sampler_dim() only once where possible
Kai Wasserbäch [Tue, 23 Jan 2018 20:14:54 +0000 (21:14 +0100)]
ac/nir: call glsl_get_sampler_dim() only once where possible

Changes since v1:
  * Rebased on top of e68150de263156a3f3d1b609b6506c5649967f61 and
    82adf53308c137ce0dc5f2d5da4e7cc40c5b808c.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agodocs/features: add r600 ARB_query_buffer_object support
Dave Airlie [Thu, 25 Jan 2018 00:21:03 +0000 (10:21 +1000)]
docs/features: add r600 ARB_query_buffer_object support

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agor600: add ARB_query_buffer_object support
Dave Airlie [Sun, 3 Dec 2017 19:31:46 +0000 (05:31 +1000)]
r600: add ARB_query_buffer_object support

This uses a different shader than radeonsi, as we can't address non-256
aligned ssbos, which the radeonsi code does. This passes some extra
offsets into the shader.

It also contains a set of u64 instruction implementation that may
or may not be complete (at least the u64div is definitely not something
that works outside this use-case). If r600 grows 64-bit integers,
it will use the GLSL lowering for divmod.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agor600/shader: refactor mul hi/lo instruction emission
Dave Airlie [Sun, 21 Jan 2018 22:39:46 +0000 (08:39 +1000)]
r600/shader: refactor mul hi/lo instruction emission

This just makes it a bit simpler for cayman vs eg

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agor600/eg: construct proper rat mask for image/buffers.
Dave Airlie [Fri, 19 Jan 2018 03:20:36 +0000 (13:20 +1000)]
r600/eg: construct proper rat mask for image/buffers.

If the images/buffer bindings had a gap, this produced the wrong values,
this should fix that to generate the correct rat mask for mixes of
images/buffers/cbs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agomeson: libdrm shouldn't appear in Requires.private: if it wasn't found
Jon Turney [Thu, 25 Jan 2018 18:53:08 +0000 (18:53 +0000)]
meson: libdrm shouldn't appear in Requires.private: if it wasn't found

Otherwise, using pkg-config to retrieve flags will fail, e.g.

$ pkg-config gl --cflags
Package libdrm was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdrm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libdrm', required by 'gl', not found

Fixes: 3218056e0eb3 ("meson: Build i965 and dri stack")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
6 years agobroadcom/vc5: Don't forget to get the BO offset when opening a dmabuf.
Eric Anholt [Wed, 24 Jan 2018 03:23:01 +0000 (14:23 +1100)]
broadcom/vc5: Don't forget to get the BO offset when opening a dmabuf.

Fixes black display in DRI due to storing to 0x00000000.

6 years agobroadcom/vc5: Enable the driver on V3D 4.2.
Eric Anholt [Sat, 27 Jan 2018 07:12:29 +0000 (18:12 +1100)]
broadcom/vc5: Enable the driver on V3D 4.2.

The changes in 4.2 haven't impacted any of our CL or state struct entries
that I can see, so I haven't enabled custom compile for doing 4.2 instead
of 4.1.

6 years agobroadcom/vc5: Enable CLIF dumping of V3D 4.2.
Eric Anholt [Sat, 27 Jan 2018 07:45:35 +0000 (18:45 +1100)]
broadcom/vc5: Enable CLIF dumping of V3D 4.2.

6 years agobroadcom/vc5: Update the compiler for V3D 4.2.
Eric Anholt [Sat, 27 Jan 2018 07:34:35 +0000 (18:34 +1100)]
broadcom/vc5: Update the compiler for V3D 4.2.

6 years agobroadcom/vc5: Update QPU instruction pack/unpack for v4.2.
Eric Anholt [Sat, 27 Jan 2018 07:29:37 +0000 (18:29 +1100)]
broadcom/vc5: Update QPU instruction pack/unpack for v4.2.

After the 4.1 spec, 4.2 retroactively renamed patchid to barrierid because
it's used for other barriers in compute.

6 years agobroadcom/vc5: Add XML for V3D 4.2.
Eric Anholt [Sat, 27 Jan 2018 07:05:58 +0000 (18:05 +1100)]
broadcom/vc5: Add XML for V3D 4.2.

6 years agobroadcom/vc5: Fix a race between XML codegen build and CLIF build.
Eric Anholt [Sat, 27 Jan 2018 07:50:10 +0000 (18:50 +1100)]
broadcom/vc5: Fix a race between XML codegen build and CLIF build.

6 years agoAndroid: Attempt to fix broadcom build after vc5 changes.
Eric Anholt [Wed, 17 Jan 2018 20:46:35 +0000 (12:46 -0800)]
Android: Attempt to fix broadcom build after vc5 changes.

6 years agoac: rename and move si_const_array into common code
Marek Olšák [Sun, 31 Dec 2017 22:35:59 +0000 (23:35 +0100)]
ac: rename and move si_const_array into common code

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: move address space definitions to common code
Marek Olšák [Mon, 1 Jan 2018 20:03:29 +0000 (21:03 +0100)]
ac: move address space definitions to common code

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: don't use byval LLVM qualifier in shaders
Marek Olšák [Sun, 31 Dec 2017 23:30:51 +0000 (00:30 +0100)]
ac: don't use byval LLVM qualifier in shaders

shader-db doesn't show any regression and 32-bit pointers with byval
are declared as VGPRs for some reason.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agogallium/radeon: set number of pb_cache buckets = number of heaps
Marek Olšák [Mon, 1 Jan 2018 21:58:43 +0000 (22:58 +0100)]
gallium/radeon: set number of pb_cache buckets = number of heaps

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agopb_cache: let drivers choose the number of buckets
Marek Olšák [Mon, 1 Jan 2018 21:47:36 +0000 (22:47 +0100)]
pb_cache: let drivers choose the number of buckets

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agopb_cache: call os_time_get outside of the loop
Marek Olšák [Mon, 1 Jan 2018 21:38:14 +0000 (22:38 +0100)]
pb_cache: call os_time_get outside of the loop

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agogallium/radeon: simplify radeon_flags_from_heap
Marek Olšák [Sun, 31 Dec 2017 19:42:27 +0000 (20:42 +0100)]
gallium/radeon: simplify radeon_flags_from_heap

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agost/shader_cache: restore num_tgsi_tokens when loading from cache
Timothy Arceri [Fri, 26 Jan 2018 00:56:50 +0000 (11:56 +1100)]
st/shader_cache: restore num_tgsi_tokens when loading from cache

Without this we will fail to correctly serialise programs when
using glGetProgramBinary() if the program was retrieved from
the disk cache rather than freshly compiled.

Fixes: c69b0dd6817b "st/glsl_to_tgsi: store num_tgsi_tokens in st_*_program"
Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104762

6 years agowinsys/amdgpu: fix assertion failure with UVD and VCE rings
Marek Olšák [Fri, 26 Jan 2018 02:48:37 +0000 (03:48 +0100)]
winsys/amdgpu: fix assertion failure with UVD and VCE rings

Cc: 18.0 <mesa-stable@lists.freedesktop.org>
6 years agomesa: remove MESA_FUNCTION
Brian Paul [Thu, 25 Jan 2018 20:44:19 +0000 (13:44 -0700)]
mesa: remove MESA_FUNCTION

Just use __func__ in the two macros where it was used.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: change gl_link_status enums to uppercase
Brian Paul [Thu, 25 Jan 2018 19:50:12 +0000 (12:50 -0700)]
mesa: change gl_link_status enums to uppercase

follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: change gl_compile_status enums to uppercase
Brian Paul [Thu, 25 Jan 2018 19:43:48 +0000 (12:43 -0700)]
mesa: change gl_compile_status enums to uppercase

To follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: minor comment reformatting, whitespace fixes in mtypes.h
Brian Paul [Thu, 25 Jan 2018 19:37:14 +0000 (12:37 -0700)]
mesa: minor comment reformatting, whitespace fixes in mtypes.h

Trivial.

6 years agoi965/gen10: Use CS Stall instead of WriteImmediate.
Rafael Antognolli [Fri, 26 Jan 2018 19:19:31 +0000 (11:19 -0800)]
i965/gen10: Use CS Stall instead of WriteImmediate.

Fixes: ca19ee33d7d39cb89d948b1c983763065975ce5b
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/gen10: Emit CS stall and mark push constants dirty.
Rafael Antognolli [Fri, 26 Jan 2018 19:15:47 +0000 (11:15 -0800)]
anv/gen10: Emit CS stall and mark push constants dirty.

I got reviews and fixed the patches locally, but ended up merging the
ones that I sent originally to the list. This patch fixes those
mistakes.

Fixes: 78c125af3904c539ea69bec2dd9fdf7a5162854f
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/gen10: Re-enable push constants.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:58 +0000 (16:33 -0800)]
i965/gen10: Re-enable push constants.

The GPU hang caused by push constants is apparently fixed, so let's
enable them again.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/gen10: Ignore push constant packets during context restore.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:57 +0000 (16:33 -0800)]
anv/gen10: Ignore push constant packets during context restore.

Similar to the GL driver, ignore 3DSTATE_CONSTANT_* packets when doing a
context restore.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/gen10: Ignore push constant packets during context restore.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:56 +0000 (16:33 -0800)]
i965/gen10: Ignore push constant packets during context restore.

These packets were causing GPU hangs when the context was restored,
possibly because they were pointing to BO's that were already
unreferenced. So we tell the hardware to ignore such packets after the
batch buffer ends, since we know those BO's are not around anymore.

This change fixes GPU hangs on CNL. The (partial) solution to this
problem so far was to entirely disable push constants on this platform.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agomesa: silence MinGW 'may be unused uninitialized' warning in get.c
Brian Paul [Thu, 25 Jan 2018 21:37:34 +0000 (14:37 -0700)]
mesa: silence MinGW 'may be unused uninitialized' warning in get.c

The warning happens on line 2114 for the memcpy(data, p, size) call.
I'm not sure why that generates the warning but not the earlier use
of p in the code.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: Fix function pointers initialization in status tracker
Eleni Maria Stea [Thu, 25 Jan 2018 20:09:00 +0000 (13:09 -0700)]
mesa: Fix function pointers initialization in status tracker

We assigned the function that gets the device uuid to the GetDriverUuid
function pointer and the function that gets the driver uuid to the
GetDeviceUuid function pointer inside the state tracker. Exchanged the
pointers.

cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agoanv/pipeline: remove the pipeline layout field from anv_pipeline
Iago Toral Quiroga [Thu, 25 Jan 2018 11:07:34 +0000 (12:07 +0100)]
anv/pipeline: remove the pipeline layout field from anv_pipeline

It no longer has any users.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/cmd_buffer: add the pipeline layout to the pipeline state
Iago Toral Quiroga [Thu, 25 Jan 2018 10:54:35 +0000 (11:54 +0100)]
anv/cmd_buffer: add the pipeline layout to the pipeline state

We need to access the pipeline layout to compute correct dynamic
offsets for dyamic UBO/SSBO descriptors when we emit draw commands.
Instead of taking it from the pipeline object, store the layout
in the command buffer pipeline state.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/pipeline: don't take the layout from the pipeline to compile shaders
Iago Toral Quiroga [Thu, 25 Jan 2018 09:25:00 +0000 (10:25 +0100)]
anv/pipeline: don't take the layout from the pipeline to compile shaders

The Vulkan spec states that VkPipelineLayout objects must not be
destroyed while any command buffer that uses them is in the recording
state, but it permits them to be destroyed otherwise. This means that
applications are allowed to free pipeline layouts after command recording
is finished even if there are pipeline objects that still exist and were
created with these layouts.

There are two solutions to this, one is to use reference counting on
pipeline layout objects. The other is to avoid holding references to
pipeline layouts where they are not really needed.

This patch takes a step towards the second option by making the
pipeline shader compile code take pipeline layout from the
VkGraphicsPipelineCreateInfo provided rather than the pipeline
object.

A follow-up patch will remove any remaining uses of the layout field
so we can remove it from the pipeline object and avoid the need
for reference counting.

v2: Use ANV_FROM_HANDLE, remove unnecessary braces (Jason)

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/descriptor_set: add reference counting for descriptor set layouts
Iago Toral Quiroga [Thu, 25 Jan 2018 08:43:22 +0000 (09:43 +0100)]
anv/descriptor_set: add reference counting for descriptor set layouts

The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

v2: allocate off the device allocator with DEVICE scope (Jason)

Fixes the following work-in-progress CTS tests:
dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.graphics
dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.compute

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoac/nir: set amdgpu.uniform and invariant.load for SSBOs
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:21 +0000 (23:26 +0100)]
ac/nir: set amdgpu.uniform and invariant.load for SSBOs

For descriptors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: set amdgpu.uniform and invariant.load for UBOs
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:20 +0000 (23:26 +0100)]
ac/nir: set amdgpu.uniform and invariant.load for UBOs

UBOs are constants buffers.

Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Fixes: 41c36c45 ("amd/common: use ac_build_buffer_load() for emitting UBO loads")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: set the noalias attribute on input pointers
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:18 +0000 (23:26 +0100)]
ac/nir: set the noalias attribute on input pointers

This attribute is similar to the definition of restrict in
C99 and it might help LLVM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac: only load used channels when sampling buffer views
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:11 +0000 (20:12 +0100)]
ac: only load used channels when sampling buffer views

This allows to reduce the number of dwords that are loaded
with buffer_load_format_xyzw. For example, when the only used
channel is 1, the driver will emit buffer_load_format_x instead.

Shader stats for DOW3 (with some local hacky scripts for SPIRV):

143 shaders in 143 tests
Totals:
SGPRS: 5344 -> 5352 (0.15 %)
VGPRS: 3476 -> 3452 (-0.69 %)
Spilled SGPRs: 30 -> 29 (-3.33 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 269860 -> 269808 (-0.02 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 1267 -> 1272 (0.39 %)
Wait states: 0 -> 0 (0.00 %)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoac: pass the number of channels to ac_build_buffer_load_format()
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:10 +0000 (20:12 +0100)]
ac: pass the number of channels to ac_build_buffer_load_format()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoac: add ac_build_buffer_load_common() helper
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:09 +0000 (20:12 +0100)]
ac: add ac_build_buffer_load_common() helper

For both versions of llvm.amdgcn.buffer.load.{format}.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradv: fix RADV_DEBUG=syncshaders on GFX9
Samuel Pitoiset [Thu, 25 Jan 2018 14:46:51 +0000 (15:46 +0100)]
radv: fix RADV_DEBUG=syncshaders on GFX9

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix a GPU hang with RADV_DEBUG=syncshaders
Samuel Pitoiset [Thu, 25 Jan 2018 14:46:50 +0000 (15:46 +0100)]
radv: fix a GPU hang with RADV_DEBUG=syncshaders

The GPU hangs when the driver forces a PS_PARTIAL_FLUSH after
a dispatch call (and vice versa for graphics). Something has
changed in the kernel driver because it used to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/shader: scan if fragment shaders write memory
Samuel Pitoiset [Wed, 24 Jan 2018 16:44:35 +0000 (17:44 +0100)]
ac/shader: scan if fragment shaders write memory

It's better to do that in ac_shader_info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9
Samuel Pitoiset [Wed, 24 Jan 2018 11:31:40 +0000 (12:31 +0100)]
ac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9

According to LLVM, only pre-GFX9 targets do not flush denorms
for fmin/fmax.

All dEQP-VK.glsl.builtin.precision.* still pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoanv/pipeline: Don't look at blend state unless we have an attachment
Jason Ekstrand [Thu, 18 Jan 2018 01:10:34 +0000 (17:10 -0800)]
anv/pipeline: Don't look at blend state unless we have an attachment

Without this, we may end up dereferencing blend before we check for
binding->index != UINT32_MAX.  However, Vulkan allows the blend state to
be NULL so long as you don't have any color attachments.  This fixes a
segfault when running The Talos Principal.

Fixes: 12f4e00b69e724a23504b7bd3958fb75dc462950
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>