mesa.git
8 years agonir: Add an info bit for uses_sample_qualifier
Jason Ekstrand [Tue, 10 May 2016 00:15:21 +0000 (17:15 -0700)]
nir: Add an info bit for uses_sample_qualifier

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Fix undefined df bits in brw_reg comparisons.
Kenneth Graunke [Fri, 13 May 2016 23:41:13 +0000 (16:41 -0700)]
i965: Fix undefined df bits in brw_reg comparisons.

Commit 5310bca024f77da40ea6f4c275455f9cb0528f9e added a new "double df"
field to the brw_reg struct, adding an extra 4 bytes of data that isn't
usually initialized (or may contain irrelevant garbage if the struct is
mutated).  This means that it's no longer safe to memcmp().

Instead, add a brw_regs_equal() function which ignores the extra df bits
unless they matter.  To keep the implementation cheap, we wrap the first
set of fields in a union/struct so that we can use a single DWord
comparison.

v2: Drop unnecessary casts (caught by Francisco Jerez).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoi965: disable cull distance temporarily.
Dave Airlie [Sat, 14 May 2016 01:38:38 +0000 (11:38 +1000)]
i965: disable cull distance temporarily.

I'll fix this up on Monday, so leave the docs changes in place.

Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoRevert "glsl: Extend lowering pass for gl_ClipDistance to support other arrays (v4)"
Dave Airlie [Sat, 14 May 2016 01:37:48 +0000 (11:37 +1000)]
Revert "glsl: Extend lowering pass for gl_ClipDistance to support other arrays (v4)"

This reverts commit ad355652c20b245f5f2faa8622e71461e3121a7f.

This broke a bunch of clip tests.

8 years agodocs: Mark GL_OES_shader_io_blocks as started
Ian Romanick [Wed, 11 May 2016 20:06:00 +0000 (13:06 -0700)]
docs: Mark GL_OES_shader_io_blocks as started

Watch the oes_shader_io_blocks of my fd.o Mesa GIT repo for progress.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agodocs: update ARB_cull_distance status.
Kristian Høgsberg Kristensen [Fri, 13 May 2016 23:32:14 +0000 (16:32 -0700)]
docs: update ARB_cull_distance status.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agoi965: Add support for GL_ARB_cull_distance
Kristian Høgsberg Kristensen [Fri, 13 May 2016 00:38:56 +0000 (17:38 -0700)]
i965: Add support for GL_ARB_cull_distance

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agost/mesa: flip y coordinate of interpolateAtOffset for winsys
Ilia Mirkin [Fri, 13 May 2016 02:14:17 +0000 (22:14 -0400)]
st/mesa: flip y coordinate of interpolateAtOffset for winsys

This fixes a few dEQP tests like

dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.no_qualifiers.default_framebuffer

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: make sure that textureProj(bias) variants are only exposed in fs
Ilia Mirkin [Fri, 13 May 2016 05:09:53 +0000 (01:09 -0400)]
glsl: make sure that textureProj(bias) variants are only exposed in fs

Many were already marked as fs_only, but not all. This fixes the
remaining ir_txb entries.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl: be more strict when validating shader inputs
Ilia Mirkin [Fri, 13 May 2016 04:26:44 +0000 (00:26 -0400)]
glsl: be more strict when validating shader inputs

interpolateAt* can only take input variables or an element of an input
variable array. No structs.

Further, GLSL 4.40 relaxes the requirement to allow swizzles, so enable
that as well.

This fixes the following dEQP tests:

dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.negative.interpolate_struct_member
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid.negative.interpolate_struct_member
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.negative.interpolate_struct_member

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoglsl: make sure that interpolateAt arguments are variables
Ilia Mirkin [Fri, 13 May 2016 03:54:36 +0000 (23:54 -0400)]
glsl: make sure that interpolateAt arguments are variables

In the case of a constant, it might have been propagated through and
variable_referenced() returns NULL. Error out in that case.

Fixes 3 dEQP tests:

dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.negative.interpolate_constant
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid.negative.interpolate_constant
dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_offset.negative.interpolate_constant

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
8 years agomesa/st: Add support for GL_ARB_cull_distance (v2)
Tobias Klausmann [Sun, 8 May 2016 20:44:08 +0000 (22:44 +0200)]
mesa/st: Add support for GL_ARB_cull_distance (v2)

v2: don't bother with cull dist varyings except to assert.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogallium: Add a pipe cap for arb_cull_distance
Tobias Klausmann [Sun, 8 May 2016 20:44:07 +0000 (22:44 +0200)]
gallium: Add a pipe cap for arb_cull_distance

This lets us safely enable or disable the extension as needed

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: Add arb_cull_distance support (v3)
Tobias Klausmann [Sun, 8 May 2016 20:44:06 +0000 (22:44 +0200)]
glsl: Add arb_cull_distance support (v3)

v2: make too large array a compile error
v3: squash mesa/prog patch to avoid static compiler errors in bisect

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
8 years agoglsl: Extend lowering pass for gl_ClipDistance to support other arrays (v4)
Tobias Klausmann [Sun, 8 May 2016 20:44:05 +0000 (22:44 +0200)]
glsl: Extend lowering pass for gl_ClipDistance to support other arrays (v4)

This will come in handy when we want to lower gl_CullDistance into
gl_CullDistanceMESA.

[airlied: drop separate APIs for clip/cull - just use single API
to call both passes.]

v3: reexamine my sanity, this was pretty broken, the new code
creates one copy of gl_ClipDistanceMESA, as the clip distance
varying and lowers everything into that in two passes, one for clips
one for culls.
v4: rework using the passes in clip/cull sizes, instead of the
array sizes.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
8 years agoglsl: rename lower_clip_distance to lower_distance.
Dave Airlie [Sun, 8 May 2016 20:44:04 +0000 (22:44 +0200)]
glsl: rename lower_clip_distance to lower_distance.

This just renames the file in anticipation of adding cull lowering,
and renames the internals.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
8 years agomesa/main: Add support for GL_ARB_cull_distance (v2)
Tobias Klausmann [Sun, 8 May 2016 20:44:02 +0000 (22:44 +0200)]
mesa/main: Add support for GL_ARB_cull_distance (v2)

airlied:
v2: rename LowerClipDistance to LowerCombinedClipCullDistnace.
I don't think we want any other behaviour with any current hw.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglapi: Add GL_ARB_cull_distance
Tobias Klausmann [Sun, 8 May 2016 20:44:01 +0000 (22:44 +0200)]
glapi: Add GL_ARB_cull_distance

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoanv/copy: Fix copying Images from Buffers with larger dimensions
Nanley Chery [Mon, 9 May 2016 18:45:07 +0000 (11:45 -0700)]
anv/copy: Fix copying Images from Buffers with larger dimensions

This function previously assumed that the Buffer and Image had matching
dimensions. However, it is possible to copy from a Buffer with larger
dimensions than the Image. Modify the copy function to enable this.

v2: Use ternary instead of MAX for setting bufferExtent (Jason Ekstrand)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95292
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Tested-by: Matthew Waters <matthew@centricular.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years ago.mailmap: Fix my email addresses.
Maarten Lankhorst [Fri, 13 May 2016 10:27:45 +0000 (12:27 +0200)]
.mailmap: Fix my email addresses.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
8 years agoradeonsi/sid_tables: rename reg_table to sid_reg_table
Nicolai Hähnle [Mon, 9 May 2016 00:20:57 +0000 (19:20 -0500)]
radeonsi/sid_tables: rename reg_table to sid_reg_table

This is purely cosmetic, making it easier to assign blame for space used
in the binary in case somebody else makes a similar cleanup effort in the
future.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi/sid_tables: store offset into global fields table instead of pointer
Nicolai Hähnle [Sun, 8 May 2016 23:48:16 +0000 (18:48 -0500)]
radeonsi/sid_tables: store offset into global fields table instead of pointer

This avoids relocations in the final binary.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi/sid_tables: store strings by offset instead of by pointer
Nicolai Hähnle [Sun, 8 May 2016 23:37:12 +0000 (18:37 -0500)]
radeonsi/sid_tables: store strings by offset instead of by pointer

This saves some space and avoids the need for relocations.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agor600: remove TABLE_SIZE macro
Nicolai Hähnle [Sun, 8 May 2016 20:09:02 +0000 (15:09 -0500)]
r600: remove TABLE_SIZE macro

Use ARRAY_SIZE instead.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agor600: move alu_op_table to .c file
Nicolai Hähnle [Sun, 8 May 2016 20:08:00 +0000 (15:08 -0500)]
r600: move alu_op_table to .c file

So that it gets compiled and emitted only once, saving space is the final
binary.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agor600: move cf_op_table to .c file
Nicolai Hähnle [Sun, 8 May 2016 19:48:26 +0000 (14:48 -0500)]
r600: move cf_op_table to .c file

So that it gets compiled and emitted only once, saving space is the final
binary.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agor600: move fetch_op_table to .c file
Nicolai Hähnle [Sun, 8 May 2016 19:46:59 +0000 (14:46 -0500)]
r600: move fetch_op_table to .c file

So that it gets compiled and emitted only once, saving space is the final
binary.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agor600: protect r600_isa.h with extern "C"
Nicolai Hähnle [Sun, 8 May 2016 19:53:53 +0000 (14:53 -0500)]
r600: protect r600_isa.h with extern "C"

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agogallium/ddebug: Implement launch_grid.
Bas Nieuwenhuizen [Thu, 21 Apr 2016 15:37:40 +0000 (17:37 +0200)]
gallium/ddebug: Implement launch_grid.

Does not implement dumping info.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/ddebug: Support compute states.
Bas Nieuwenhuizen [Thu, 21 Apr 2016 15:07:01 +0000 (17:07 +0200)]
gallium/ddebug: Support compute states.

v2: Reuse the macro for bind & delete.

Note that may not be able to share the delete long-term as
pipe_compute_state contains members not in pipe_shader_state,
and we need to distinguish the pointer location if we add that
struct to the union.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/ddebug: Add passthrough for get_compute_param.
Bas Nieuwenhuizen [Thu, 21 Apr 2016 15:05:19 +0000 (17:05 +0200)]
gallium/ddebug: Add passthrough for get_compute_param.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonir: Remove empty visit_call_src and visit_load_const_src functions
Ian Romanick [Mon, 14 Dec 2015 23:19:25 +0000 (15:19 -0800)]
nir: Remove empty visit_call_src and visit_load_const_src functions

The guts were removed in dfb3abba.  It has been almost exactly a year,
so I dont think we're going to "decide we want [predication] back."

Silences several "unused parameter" warnings:

nir/nir.c: In function ‘visit_call_src’:
nir/nir.c:1052:32: warning: unused parameter ‘instr’ [-Wunused-parameter]
 visit_call_src(nir_call_instr *instr, nir_foreach_src_cb cb, void *state)
                                ^
nir/nir.c:1052:58: warning: unused parameter ‘cb’ [-Wunused-parameter]
 visit_call_src(nir_call_instr *instr, nir_foreach_src_cb cb, void *state)
                                                          ^
nir/nir.c:1052:68: warning: unused parameter ‘state’ [-Wunused-parameter]
 visit_call_src(nir_call_instr *instr, nir_foreach_src_cb cb, void *state)
                                                                    ^
nir/nir.c: In function ‘visit_load_const_src’:
nir/nir.c:1058:44: warning: unused parameter ‘instr’ [-Wunused-parameter]
 visit_load_const_src(nir_load_const_instr *instr, nir_foreach_src_cb cb,
                                            ^
nir/nir.c:1058:70: warning: unused parameter ‘cb’ [-Wunused-parameter]
 visit_load_const_src(nir_load_const_instr *instr, nir_foreach_src_cb cb,
                                                                      ^
nir/nir.c:1059:28: warning: unused parameter ‘state’ [-Wunused-parameter]
                      void *state)
                            ^

v2: Add some comments in nir_foreach_src suggested by Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Connor Abbott <cwabbott0@gmail.com>
8 years agonir: Silence unused parameter warnings
Ian Romanick [Tue, 25 Aug 2015 17:19:12 +0000 (18:19 +0100)]
nir: Silence unused parameter warnings

These cases had the parameter removed:

nir/nir_lower_vec_to_movs.c: In function ‘try_coalesce’:
nir/nir_lower_vec_to_movs.c:124:66: warning: unused parameter ‘shader’ [-Wunused-parameter]
 try_coalesce(nir_alu_instr *vec, unsigned start_idx, nir_shader *shader)
                                                                  ^
nir/nir_lower_io.c: In function ‘load_op’:
nir/nir_lower_io.c:147:32: warning: unused parameter ‘state’ [-Wunused-parameter]
 load_op(struct lower_io_state *state,
                                ^

These cases had the parameter (void) silenced because the parameter was
necessary for an interface:

nir/glsl_to_nir.cpp:1900:32: warning: unused parameter 'ir' [-Wunused-parameter]
 nir_visitor::visit(ir_barrier *ir)
                                ^
nir/nir.c: In function ‘remove_use_cb’:
nir/nir.c:802:35: warning: unused parameter ‘state’ [-Wunused-parameter]
 remove_use_cb(nir_src *src, void *state)
                                   ^
nir/nir.c: In function ‘remove_def_cb’:
nir/nir.c:811:37: warning: unused parameter ‘state’ [-Wunused-parameter]
 remove_def_cb(nir_dest *dest, void *state)
                                     ^

Number of total warnings in my build reduced from 2543 to 2538
(reduction of 5).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agovl/dri: fix close fd error out
Leo Liu [Thu, 12 May 2016 14:05:57 +0000 (10:05 -0400)]
vl/dri: fix close fd error out

fd should be set to -1 only if it got closed by pipe_loader_release.

Signed-off-by: Leo Liu <leo.liu@amd.com>
8 years agonvc0: fix indentation in nvc0_invalidate_resource_storage()
Samuel Pitoiset [Thu, 12 May 2016 18:57:41 +0000 (20:57 +0200)]
nvc0: fix indentation in nvc0_invalidate_resource_storage()

Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: save some CPU cycles in nvc0_context_unreference_resources()
Samuel Pitoiset [Thu, 12 May 2016 19:06:05 +0000 (21:06 +0200)]
nvc0: save some CPU cycles in nvc0_context_unreference_resources()

This reduces the number of loop iterations for invalidating buffers
and images.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: invalidate texture buffers for compute
Samuel Pitoiset [Thu, 12 May 2016 18:54:41 +0000 (20:54 +0200)]
nvc0: invalidate texture buffers for compute

This is a pretty rare situation but this can happen though.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoswr: properly expose compressed format support
Tim Rowley [Thu, 12 May 2016 16:27:57 +0000 (11:27 -0500)]
swr: properly expose compressed format support

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoanv: Don't advertise shaderImageGatherExtended
Jason Ekstrand [Thu, 12 May 2016 17:56:58 +0000 (10:56 -0700)]
anv: Don't advertise shaderImageGatherExtended

We don't actually support all of the extended gather functionality so we
shouldn't be advertising it.

8 years agonir: glsl_get_bit_size() should take glsl_type
Rob Clark [Wed, 11 May 2016 19:05:09 +0000 (15:05 -0400)]
nir: glsl_get_bit_size() should take glsl_type

It's what all the call-sites once, so gets rid of a bunch of inlined
glsl_get_base_type() at the call-sites.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965/gen9: Enable lossless compression
Topi Pohjolainen [Sat, 2 Jan 2016 14:25:57 +0000 (16:25 +0200)]
i965/gen9: Enable lossless compression

I tried first creating the auxiliary buffer the same time with the
color buffer. That, however, led me into a situation where we would
later create the rest of the mip-levels and the compression would
need to be disabled (it is only supported for single level buffers).

Here we try to create it on demand just before the hardware starts
to render. This is similar what we do with fast clear buffers,
their creation is deferred until the first clear.
This setup also gives the opportunity to detect if the miptree
represents the temporaty texture used internally in the mesa core.
This texture is mostly written by cpu and therefore enabling
compression for it doesn't make much sense.

Note that a heuristic is included. Floating point formats are not
enabled yet as they are only seen to hurt performance.

Some highlights with window system driver kept fixed to default
and only the application driver changing:

Manhattan: 8.32152% +/- 0.355881%
Offscreen: 9.09713% +/- 0.340763%

Glb trex: 8.46231% +/- 0.460624%
Offscreen: 9.31872% +/- 0.463743%

v2 (Ben): Re-use msaa layout type for single sampled case.
v3: Moved the deferred allocation of mcs to brw_try_draw_prims() and
    brw_blorp_blit_miptrees() instead.
v4: (Ken): Drop MIPTREE_LAYOUT_ACCELERATED_UPLOAD when allocating mcs.
    Do not enable for scanout buffers

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Set render state for lossless compressed
Topi Pohjolainen [Tue, 23 Feb 2016 09:02:35 +0000 (11:02 +0200)]
i965: Set render state for lossless compressed

v2: Add support for blorp and removed the support for meta
v3 (Ben): Add assertion on compressed non-fast clear - must
          be partial clear.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/wm: Don't sample lossless compressed as multisampled
Topi Pohjolainen [Mon, 18 Apr 2016 18:47:23 +0000 (21:47 +0300)]
i965/wm: Don't sample lossless compressed as multisampled

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/gen9: Setup MCS for compressed texture surfaces
Topi Pohjolainen [Mon, 8 Feb 2016 16:00:31 +0000 (18:00 +0200)]
i965/gen9: Setup MCS for compressed texture surfaces

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/blorp: Do not resolve lossless compressed blit sources
Topi Pohjolainen [Tue, 19 Apr 2016 06:45:09 +0000 (09:45 +0300)]
i965/blorp: Do not resolve lossless compressed blit sources

Blorp blits use sampling engine which is capable of resolving
on the fly. Buffers are still resolved for blitter engine. Current
understanding is that blitter doesn't understand lossless compression.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/blorp: Prepare blits for lossless compression
Topi Pohjolainen [Mon, 18 Apr 2016 05:51:10 +0000 (08:51 +0300)]
i965/blorp: Prepare blits for lossless compression

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Deferred allocation of mcs for lossless compressed
Topi Pohjolainen [Tue, 19 Apr 2016 06:01:10 +0000 (09:01 +0300)]
i965: Deferred allocation of mcs for lossless compressed

Until now mcs was associated to single sampled buffers only for
fast clear purposes and it was therefore the responsibility of the
clear logic to allocate the aux buffer when needed. Now that normal
3D render or blorp blit may render with mcs enabled also, they need
to prepare the mcs just as well.

v2: Do not enable for scanout buffers
v3 (Ben):
   - Fix typo in commit message.
   - Check for gen < 9 and return early in brw_predraw_set_aux_buffers()
   - Check for gen < 9 and return early in intel_miptree_prepare_mcs()
v4: Check for msaa_layput and number of samples to determine if
    lossless compression is to used. Otherwise one cannot distuingish
    between fast clear with and without compression.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Add flag telling if miptree is for client consumption
Topi Pohjolainen [Sun, 24 Apr 2016 07:45:48 +0000 (10:45 +0300)]
i965: Add flag telling if miptree is for client consumption

Consider later on adding specific disable flags such as

MIPTREE_LAYOUT_DISABLE_AUX_MCS   = 1 << 3, /* CCS_D */
MIPTREE_LAYOUT_DISABLE_AUX_CCS_E = 1 << 4,
MIPTREE_LAYOUT_DISABLE_AUX       = MIPTREE_LAYOUT_DISABLE_AUX_MCS |
                                   MIPTREE_LAYOUT_DISABLE_AUX_CCS_E,

and equivalent boolean/enums into miptree.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Add helper for lossless compression support
Topi Pohjolainen [Mon, 8 Feb 2016 16:13:17 +0000 (18:13 +0200)]
i965: Add helper for lossless compression support

v2: Check explicitly against base type of GL_FLOAT instead of
    using _mesa_is_format_integer_color(). Otherwise we miss
    GL_UNSIGNED_NORMALIZED.
v3 (Ben): Also call intel_miptree_supports_non_msrt_fast_clear()
          in order to really check everything.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/gen9: Prepare surface state setup for lossless compression
Topi Pohjolainen [Wed, 9 Dec 2015 12:44:21 +0000 (14:44 +0200)]
i965/gen9: Prepare surface state setup for lossless compression

v2 (Ben): Use combination of msaa_layout and number of samples
          instead of introducing explicit type for lossless
          compression (intel_miptree_is_lossless_compressed()).
v3 (Ben): Do not set fast claer state in surface state setup.
          Moved into brw_postdraw_set_buffers_need_resolve()
          using a separate patch.
v4: Support for blorp
v5 (Ben): Re-use gen8_get_aux_mode()

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/gen8: Expose auxiliary mode resolver
Topi Pohjolainen [Fri, 6 May 2016 07:35:17 +0000 (10:35 +0300)]
i965/gen8: Expose auxiliary mode resolver

Also use the opportunity to drop the unused surface type argument.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Relax assertion of halign == 16 for lossless compressed aux
Topi Pohjolainen [Mon, 18 Apr 2016 15:43:40 +0000 (18:43 +0300)]
i965: Relax assertion of halign == 16 for lossless compressed aux

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/blorp: Set full resolve for lossless compressed
Topi Pohjolainen [Sun, 17 Apr 2016 15:33:55 +0000 (18:33 +0300)]
i965/blorp: Set full resolve for lossless compressed

v2 (Ben): Introduce union for fast clear and resolve ops

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/blorp: Do not skip fast color clear with new color
Topi Pohjolainen [Thu, 12 May 2016 04:47:59 +0000 (07:47 +0300)]
i965/blorp: Do not skip fast color clear with new color

This hasn't been visible before. It showed up with lossless
compression with:

dEQP-GLES3.functional.fbo.color.repeated_clear.sample.tex2d.rgb8

Current fast clear logic kicks color resolves even for gpu sampling.
In the test case this results into trashing of the fast color clear
state between two subsequent clears, and therefore each clear is
performed correctly.
With lossless compression the resolves are unnecessary and therefore
the clear state indicates that the buffer is already cleared. Without
considering if the previous color value was the same as the new,
clears that need to be performed are skipped and the buffer ends up
holding old pixel values.

v2 (Ken): Fix the comparison for gen < 9

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Enable scalar GS by default.
Kenneth Graunke [Tue, 10 May 2016 00:09:35 +0000 (17:09 -0700)]
i965: Enable scalar GS by default.

I'd originally left this off because Orbital Explorer was hanging the
GPU, but it seems to be working these days.  There have been a bunch
of changes since then, so we probably fixed something.

On my Broadwell laptop, both Synmark/GSCloth and Orbital Explorer seem
to run at approximately the same framerate in either mode.  This is
despite large reductions in instruction count for Synmark, and large
increases for Orbital Explorer.  It apparently just doesn't matter.

Switching to scalar mode will gain us fp64 support in the next release,
as vec4-mode support isn't yet ready.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Reduce the SIMD8 GS push constant threshold from 32 to 24.
Kenneth Graunke [Tue, 10 May 2016 01:11:00 +0000 (18:11 -0700)]
i965: Reduce the SIMD8 GS push constant threshold from 32 to 24.

Three Shadow of Mordor geometry shaders increase by a single
instruction, but the number of spills/fills in Orbital Explorer
is reduced from 194:1279 -> 82:454.  No other programs are affected.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Delete bogus assertion in emit_gs_input_load().
Kenneth Graunke [Mon, 9 May 2016 04:23:18 +0000 (21:23 -0700)]
i965: Delete bogus assertion in emit_gs_input_load().

This looks like leftover cruft from an earlier attempt at writing
point size hacks.  Each vertex has its own copy of gl_PointSize,
so accessing any vertex other than 0 would cause this to fail.

The tests seem to work fine without it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Support instanced GS inputs in the scalar backend.
Kenneth Graunke [Sun, 8 May 2016 09:54:28 +0000 (02:54 -0700)]
i965: Support instanced GS inputs in the scalar backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Use an early return for the push case in emit_gs_input_load().
Kenneth Graunke [Sun, 8 May 2016 12:22:13 +0000 (05:22 -0700)]
i965: Use an early return for the push case in emit_gs_input_load().

Just trying to keep things from getting too ugly in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Drop BRW_NEW_BLORP from stipple and line parameter packets.
Kenneth Graunke [Wed, 11 May 2016 07:07:26 +0000 (00:07 -0700)]
i965: Drop BRW_NEW_BLORP from stipple and line parameter packets.

BLORP never touches these, and they're all non-pipelined.  Some
are fairly large packets as well.

I haven't tried to benchmark this; the effect is likely to be small.
However, we may as well stop the pointless papercuts; maybe they'll
add up someday.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoglsl: fixed uninitialized pointer
Jakob Sinclair [Wed, 11 May 2016 12:10:19 +0000 (14:10 +0200)]
glsl: fixed uninitialized pointer

Class "ir_constant" had a bunch of constructors where the pointer member
"array_elements" had not been initialized. This could have lead to unsafe
code if something had tried to write anything to it. This patch fixes
this issue by initializing the pointer to NULL in all the constructors.
This issue was discovered by Coverity.

CID: 401603, 401604, 401605, 401610

Signed-off-by: Jakob Sinclair <sinclair.jakob@openmailbox.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
8 years agonvc0: fix gl_SampleMaskIn computation
Ilia Mirkin [Sat, 9 Apr 2016 16:00:54 +0000 (12:00 -0400)]
nvc0: fix gl_SampleMaskIn computation

The SAMPLEMASK semantic should only return the bits set covered by the
current invocation. However we were always retrieving the covmask, which
returns the covered samples of the whole pixel.

When not doing per-sample invocation, this is precisely what we want.
However when doing per-sample invocation, we have to select the
sampleid'th bit and only return that. Furthermore, this means that we
have to have a 1:1 correlation for invocations and samples.

This fixes most

dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.*

tests. A few failures remain due to disagreements about nr_samples==1
logic as well as what happens with MSAA x2 RTs when the shading fraction
is 0.5.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv50/ir: generalize interp fixups to be able to fixup anything
Ilia Mirkin [Sat, 7 May 2016 20:14:01 +0000 (16:14 -0400)]
nv50/ir: generalize interp fixups to be able to fixup anything

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years ago.mailmap: Update the e-mail addresses for Kristian Høgsberg
Jason Ekstrand [Wed, 11 May 2016 19:32:14 +0000 (12:32 -0700)]
.mailmap: Update the e-mail addresses for Kristian Høgsberg

This changes it to use his personal e-mail and adds his @intel.com address

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
8 years ago.mailmap: Use Connor Abbott's personal e-mail
Jason Ekstrand [Wed, 11 May 2016 19:27:15 +0000 (12:27 -0700)]
.mailmap: Use Connor Abbott's personal e-mail

8 years agoAdd .mailmap
Giuseppe Bilotta [Mon, 28 Dec 2015 09:50:42 +0000 (10:50 +0100)]
Add .mailmap

This adds a first tentative .mailmap file, to canonicize contributor
name/emails in shortlogs and other statistical endeavours.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoi965: Stop splitting fma() prior to optimization
Jason Ekstrand [Thu, 5 May 2016 23:38:25 +0000 (16:38 -0700)]
i965: Stop splitting fma() prior to optimization

According to the GLSL spec, if the user uses the fma() intrinsic to
generate a precise-consumed value, and you have it in your hardware, you
shouldn't split it.  For a while now, we've been splitting all ffma's
up-front and then planned to fuse them later which isn't valid.  Correctly
handling the GLSL behaviour fixes rendering corruptions in Tomb Raider.
The only reason why doing this possibly helped before was for ARB programs
which is handled by the previous commit.

Shader-db results on Haswell:

   total instructions in shared programs: 7560300 -> 7561510 (0.02%)
   instructions in affected programs: 56265 -> 57475 (2.15%)
   helped: 86
   HURT: 291

The only shaders in the database that are affected are from "Shadow of
Mordor" which is the first app in our database to use fma().  We could, at
some point in the future, split inexact ffma opcodes which would fix the
shader-db regressions since Shadow of Mordor doesn't ues precise.  However,
this fixes a bug now and and the shader-db impact is fairly small.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoptn: Emit mul+add for MAD
Jason Ekstrand [Fri, 6 May 2016 00:14:39 +0000 (17:14 -0700)]
ptn: Emit mul+add for MAD

Unlike fma() in GLSL, MAD in ARB programs is 100% splittable.  Just emit
the split version and let the optimizer fuse them later.

Shader-db results on Haswell:

   total instructions in shared programs: 7560379 -> 7560300 (-0.00%)
   instructions in affected programs: 143928 -> 143849 (-0.05%)
   helped: 443
   HURT: 250

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir/algebraic: Separate ffma lowering from fusing
Jason Ekstrand [Thu, 5 May 2016 23:58:44 +0000 (16:58 -0700)]
nir/algebraic: Separate ffma lowering from fusing

The i965 driver has its own pass for fusing mul+add combinations that's
much smarter than what nir_opt_algebraic can do so we don't want to get the
nir_opt_algebraic one just because we didn't set lower_ffma.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoanv: fix build break
Rob Clark [Wed, 11 May 2016 18:03:24 +0000 (14:03 -0400)]
anv: fix build break

Previous rename of lower-output-to-temps pass predated merging of anv,
and apparently vulkan wasn't enabled in my local builds so overlooked
this when rebasing.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agomesa/st: split the type_size calculation into it's own file
Rob Clark [Thu, 24 Mar 2016 18:14:36 +0000 (14:14 -0400)]
mesa/st: split the type_size calculation into it's own file

We'll want to re-use this for NIR.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglsl: export accessor for builtin-uniform descriptors
Rob Clark [Fri, 29 Jan 2016 16:18:11 +0000 (11:18 -0500)]
glsl: export accessor for builtin-uniform descriptors

We'll need this for a nir pass to lower builtin-uniform access.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir/lower-io: add support for lowering inputs
Rob Clark [Fri, 25 Mar 2016 19:10:50 +0000 (15:10 -0400)]
nir/lower-io: add support for lowering inputs

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir/lower-io: split out some helper fxns
Rob Clark [Fri, 25 Mar 2016 19:03:40 +0000 (15:03 -0400)]
nir/lower-io: split out some helper fxns

Prep work to reduce the noise in the next patch.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: rename lower_outputs_to_temporaries -> lower_io_to_temporaries
Rob Clark [Fri, 25 Mar 2016 17:52:26 +0000 (13:52 -0400)]
nir: rename lower_outputs_to_temporaries -> lower_io_to_temporaries

Since it will gain support to lower inputs, give it a more generic name.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agonir: move callsite of lower_outputs_to_temporaries
Rob Clark [Fri, 25 Mar 2016 17:47:15 +0000 (13:47 -0400)]
nir: move callsite of lower_outputs_to_temporaries

Going to convert this pass to parameterized lower_io_to_temporaries, and
we want the user to be able to specify whether to lower outputs or
inputs or both.  The restriction of running this pass before validate
to avoid output reads no longer applies.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: lower-io-types pass
Rob Clark [Fri, 25 Mar 2016 19:15:44 +0000 (15:15 -0400)]
nir: lower-io-types pass

A pass to lower complex (struct/array/mat) inputs/outputs to primitive
types.  This allows, for example, linking that removes unused components
of a larger type which is not indirectly accessed.

In the near term, it is needed for gallium (mesa/st) support for NIR,
since only used components of a type are assigned VBO slots, and we
otherwise have no way to represent that to the driver backend.  But it
should be useful for doing shader linking in NIR.

v2: use glsl_count_attribute_slots() rather than passing a type_size
    fxn pointer

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir: passthrough-edgeflags support
Rob Clark [Mon, 1 Feb 2016 22:34:12 +0000 (17:34 -0500)]
nir: passthrough-edgeflags support

Handled by tgsi_emulate for glsl->tgsi case.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agonir: add lowering pass for glBitmap
Rob Clark [Tue, 22 Dec 2015 02:54:00 +0000 (21:54 -0500)]
nir: add lowering pass for glBitmap

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agonir: add lowering pass for glDrawPixels
Rob Clark [Tue, 22 Dec 2015 02:27:25 +0000 (21:27 -0500)]
nir: add lowering pass for glDrawPixels

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agonir: add lowering pass for y-transform
Rob Clark [Sat, 7 Nov 2015 15:59:09 +0000 (10:59 -0500)]
nir: add lowering pass for y-transform

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agogallium: add NIR as a possible IR
Rob Clark [Sat, 30 Jan 2016 18:11:47 +0000 (13:11 -0500)]
gallium: add NIR as a possible IR

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: refactor pipe_shader_state to support multiple IR's
Rob Clark [Sat, 17 Oct 2015 17:34:24 +0000 (13:34 -0400)]
gallium: refactor pipe_shader_state to support multiple IR's

The goal is to allow the pipe driver to request something other than
TGSI, but detect whether what is getting is TGSI vs what it requested.
The pipe drivers will always have to support TGSI (and convert that into
whatever it is that they prefer), but in some cases we should be able to
skip the TGSI intermediate step (such as glsl->nir vs glsl->tgsi->nir).

I think pipe_compute_state should get similar treatment.  Currently,
afaict, it has one user and one consumer, which has allowed it to be
sloppy wrt. supporting alternative IR's.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agofreedreno: fix multi-layer transfer_map's
Rob Clark [Wed, 11 May 2016 15:28:13 +0000 (11:28 -0400)]
freedreno: fix multi-layer transfer_map's

The use of transfer_inline_write() in TexSubImage path (see fb9fe352ea4)
exposed a bug for "layer_first" resources (ie. a4xx) not setting correct
layer_stride.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoglsl: use var with initializer on global var validation
Juan A. Suarez Romero [Wed, 11 May 2016 11:48:18 +0000 (13:48 +0200)]
glsl: use var with initializer on global var validation

Currently, when cross validating global variables, all global variables
seen in the shaders that are part of a program are saved in a table.

When checking a variable this already exist in the table, we check both
are initialized to the same value. If the already saved variable does
not have an initializer, we copy it from the new variable.

Unfortunately this is wrong, as we are modifying something it is
constant. Also, if this modified variable is used in
another program, it will keep the initializer, when it should have none.

Instead of copying the initializer, this commit replaces the old
variable with the new one. So if we see again the same variable with an
initializer, we can compare if both are the same or not.

v2: convert tabs in whitespaces (Kenenth Graunke)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoutil/ralloc: Remove double zero'ing of rzalloc buffers
Jordan Justen [Tue, 10 May 2016 21:22:13 +0000 (14:22 -0700)]
util/ralloc: Remove double zero'ing of rzalloc buffers

Juha-Pekka found this back in May 2015:
<1430915727-28677-1-git-send-email-juhapekka.heikkila@gmail.com>

From the discussion, obviously it would be preferable to make
ralloc_size no longer return zeroed memory, but Juha-Pekka found that
it would break Mesa.

In <56AF1C57.2030904@gmail.com>, Juha-Pekka mentioned that patches
exist to fix i965 when ralloc_size is fixed to not zero memory, but
the patches have not made their way to mesa-dev yet.

For now, let's stop doing the double zeroing of rzalloc buffers.

v2:
 * Move ralloc_size code to rzalloc_size, and add a comment as
   suggested by Ken.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agogenxml: avoid using a GNU make pattern rule
Jonathan Gray [Tue, 3 May 2016 00:25:09 +0000 (10:25 +1000)]
genxml: avoid using a GNU make pattern rule

% pattern rules are a GNU extension.  Convert the use of one to a
inference rule to allow this to build on OpenBSD.

v2: inference rules can't have additional prerequisites so add a target
rule to still depend on gen_pack_header.py

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agogallivm: improve dumping of bitcode
Roland Scheidegger [Wed, 11 May 2016 02:42:51 +0000 (04:42 +0200)]
gallivm: improve dumping of bitcode

Use GALLIVM_DEBUG=dumpbc for dumping of modules as bitcode.
Instead of a fixed llvmpipe.bc name, use ir_<modulename>.bc so multiple
modules can be dumped (albeit it might still overwrite previous modules,
particularly the modules from draw tend to always have the same name).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agoswr: [rasterizer] Include cmath for std::isnan and std::isinf.
Vinson Lee [Mon, 9 May 2016 23:02:12 +0000 (16:02 -0700)]
swr: [rasterizer] Include cmath for std::isnan and std::isinf.

This patch fixes this build error.

  CXX      rasterizer/memory/libswrAVX_la-ClearTile.lo
In file included from rasterizer/memory/ClearTile.cpp:34:0:
./rasterizer/memory/Convert.h: In function ‘uint16_t Convert32To16Float(float)’:
./rasterizer/memory/Convert.h:170:9: error: ‘__builtin_isnan’ is not a member of ‘std’
     if (std::isnan(val))
         ^
./rasterizer/memory/Convert.h:170:9: note: suggested alternative:
<built-in>: note:   ‘__builtin_isnan’
./rasterizer/memory/Convert.h:176:14: error: ‘__builtin_isinf_sign’ is not a member of ‘std’
     else if (std::isinf(val))
              ^
./rasterizer/memory/Convert.h:176:14: note: suggested alternative:
<built-in>: note:   ‘__builtin_isinf_sign’

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95180
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoi965/blorp: Don't blend integer values during MSAA resolves
Jason Ekstrand [Wed, 4 May 2016 22:53:04 +0000 (15:53 -0700)]
i965/blorp: Don't blend integer values during MSAA resolves

Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agometa/blit: Don't blend integer values during MSAA resolves
Jason Ekstrand [Wed, 4 May 2016 22:52:50 +0000 (15:52 -0700)]
meta/blit: Don't blend integer values during MSAA resolves

Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965/fs: Default all constants to a location of -1
Jason Ekstrand [Tue, 10 May 2016 20:54:58 +0000 (13:54 -0700)]
i965/fs: Default all constants to a location of -1

Otherwise constants which aren't live get an undefined constant location.
When we go to set up param and pull_param we end up assigning all unused
uniforms to slot 0.  This cases the Vulkan driver to segfault because it
doesn't have pull_param.

This fixes bugs in the Vulkan driver introduced in c3fab3d000.

Reviewed-by: Mark Janes <mark.a.janes@intel.com>
8 years agost/glsl_to_tgsi: attach image to correct instruction for samples
Dave Airlie [Tue, 10 May 2016 05:53:48 +0000 (15:53 +1000)]
st/glsl_to_tgsi: attach image to correct instruction for samples

This fixes a crash (but not the test):
GL45-CTS.shader_texture_image_samples_tests.functional_test

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agomesa: move MESA_MAP_NOWAIT_BIT up away from GL_MAP_PERSISTENT_BIT
Dave Airlie [Tue, 10 May 2016 04:56:02 +0000 (14:56 +1000)]
mesa: move MESA_MAP_NOWAIT_BIT up away from GL_MAP_PERSISTENT_BIT

This was colliding badly and making
GL45-CTS.buffer_storage.map_persistent_texture
fail on radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agomesa/meta: check for signed/unsigned int conversion for pbo getteximage
Dave Airlie [Tue, 10 May 2016 05:41:46 +0000 (15:41 +1000)]
mesa/meta: check for signed/unsigned int conversion for pbo getteximage

When doing GetTexSubImage using a PBO, we should check if it involves
a signed/unsigned conversion and bail if it does, just like in the
other cases.

This fixes:
GL33-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo
on Haswell at least.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95324
Reviewed-by: Matt Turer <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoi965: Handle BRW_OPCODE_DO on Gen6+ in brw_instruction_name().
Matt Turner [Mon, 9 May 2016 22:58:20 +0000 (15:58 -0700)]
i965: Handle BRW_OPCODE_DO on Gen6+ in brw_instruction_name().

This became a problem after the recent disassembler changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoradeonsi: Set declared tessellation LDS size to hardware size.
Bas Nieuwenhuizen [Fri, 6 May 2016 19:06:14 +0000 (21:06 +0200)]
radeonsi: Set declared tessellation LDS size to hardware size.

The calculated limit gave problems on SI as it was > 32 KiB
and the hardware LDS size on SI is only 32 KiB. It isn't
correct anyway when processing multiple patches in a threadgroup.

As we potentially have any number of patches such that the
used LDS is at most the hardware LDS size, and exact size
per patch is not known at compile time, this seems like
the only valid bound.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agofreedreno/ir3: size input/output arrays properly
Rob Clark [Tue, 10 May 2016 15:46:11 +0000 (11:46 -0400)]
freedreno/ir3: size input/output arrays properly

We index into these based on var->data.driver_location, which might have
gaps (ie. two inputs, one w/ drvloc 0 and other 2).  This shows up in
(for example) 'bin/copyteximage 1D', but was only noticed recently due
to additional asserts.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoir_to_mesa: Emit smarter ir_binop_logic_or for vertex programs
Ian Romanick [Wed, 13 Apr 2016 18:43:23 +0000 (11:43 -0700)]
ir_to_mesa: Emit smarter ir_binop_logic_or for vertex programs

Continue using ADD in the other case because a fragment shader backend
could fuse the ADD with a MUL to generate a MAD for ((x && y) || z).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoprog: Delete all remains of OPCODE_SNE, OPCODE_SEQ, OPCODE_SGT, and OPCODE_SLE
Ian Romanick [Wed, 13 Apr 2016 00:38:23 +0000 (17:38 -0700)]
prog: Delete all remains of OPCODE_SNE, OPCODE_SEQ, OPCODE_SGT, and OPCODE_SLE

There is nothing left that can generate them.  These used to be
generated by ir_to_mesa or by the assembler for various NV extensions
that have been removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>