mesa.git
8 years agomesa; add get-extra-pick-list.sh script into bin/
Emil Velikov [Wed, 2 Sep 2015 16:36:22 +0000 (17:36 +0100)]
mesa; add get-extra-pick-list.sh script into bin/

This is a very rudimentary script that checks if any of the applied
cherry-picks have been referenced (fixed?) by another patch. With the
latter either missing the stable tag or hasn't yet been picked.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoautomake: explicitly set distcheck configure flags
Emil Velikov [Thu, 25 Feb 2016 15:48:41 +0000 (15:48 +0000)]
automake: explicitly set distcheck configure flags

Pretty much all of these are enabled by default. Considering the recent
updates (see previous commits) one might as well list most/all of these
here.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: add more missing options for make distcheck
Emil Velikov [Thu, 25 Feb 2016 15:20:04 +0000 (15:20 +0000)]
automake: add more missing options for make distcheck

Namely - opencl, osmesa (only the gallium flavour as it conflicts with
the classic one), surfaceless egl platform and a couple gallium drivers
(virgl and vc4).

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoinstall-gallium-links: port changes from install-lib-links
Emil Velikov [Thu, 25 Feb 2016 16:53:06 +0000 (16:53 +0000)]
install-gallium-links: port changes from install-lib-links

Namely:
b662d5282f7 mesa: Add clean-local rule to remove .lib links.
5c1aac17adf install-lib-links: don't depend on .libs directory
fece147be53 install-lib-links: remove the .install-lib-links file

With these in place, make distcheck now passes and a race condition has
been avoided.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agor600: Make enum alu_op_flags unsigned
Rob Herring [Wed, 24 Feb 2016 18:56:31 +0000 (12:56 -0600)]
r600: Make enum alu_op_flags unsigned

In builds with clang, there are several errors related to the enum
alu_op_flags like this:

src/gallium/drivers/r600/sb/sb_expr.cpp:887:8:
error: case value evaluates to -1610612736, which cannot be narrowed to
type 'unsigned int' [-Wc++11-narrowing]

These are due to the MSB being set in the enum. Fix these errors by
making the enum values unsigned as needed. The flags field that stores
this enum also needs to be unsigned.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Cc: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agogallium/radeon: Add space between string literal and identifier
Rob Herring [Wed, 24 Feb 2016 18:56:30 +0000 (12:56 -0600)]
gallium/radeon: Add space between string literal and identifier

Fix compiles with clang that have this C++11 error:

src/gallium/drivers/radeon/r600_pipe_common.h:662:34:
error: invalid suffix on literal; C++11 requires a space between literal
and identifier [-Wreserved-user-defined-literal]

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Cc: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agofreedreno: drop unnecessary -Wno-packed-bitfield-compat
Rob Herring [Wed, 24 Feb 2016 18:56:29 +0000 (12:56 -0600)]
freedreno: drop unnecessary -Wno-packed-bitfield-compat

Enabling this warning doesn't generate any warnings with gcc, but is an
unknown option for clang, so drop it.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Rob Clark <robdclark@gmail.com> (v1)
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
v2: keep the warning around, commented out
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: clean-up and fix DRI module path handling
Rob Herring [Wed, 24 Feb 2016 18:56:28 +0000 (12:56 -0600)]
Android: clean-up and fix DRI module path handling

MESA_DRI_MODULE_PATH is only getting set for classic DRI drivers and may or
may not be set correctly for gallium_dri.so depending on the makefile
include ordering. For Android 6 and earlier it is fine, but with build
system changes in AOSP master, it is not.

Move the path variables to a single place at the top level and introduce
MESA_DRI_MODULE_REL_PATH for Android 5 and later which require relative
paths. With this, there is a single variable to change.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: remove headers from LOCAL_SRC_FILES
Rob Herring [Wed, 24 Feb 2016 18:56:27 +0000 (12:56 -0600)]
Android: remove headers from LOCAL_SRC_FILES

The Android build system now spits out warnings for header files listed in
LOCAL_SRC_FILES, so strip them out.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: add -Wno-date-time flag for clang
Rob Herring [Wed, 24 Feb 2016 18:56:26 +0000 (12:56 -0600)]
Android: add -Wno-date-time flag for clang

clang complains about date/time macros:

src/mesa/main/context.c:403:25: error: expansion of date or time macro is not reproducible [-Werror,-Wdate-time]

Disable this warning.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: glsl: fix dependence on YACC_HEADER_SUFFIX from build system
Rob Herring [Wed, 24 Feb 2016 18:56:25 +0000 (12:56 -0600)]
Android: glsl: fix dependence on YACC_HEADER_SUFFIX from build system

The makefile was implicitly picking up YACC_HEADER_SUFFIX from the Android
build system, but this variable is now gone. Add it locally to fix the
build with AOSP master.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: remove dependence on .SECONDEXPANSION
Rob Herring [Wed, 24 Feb 2016 18:56:24 +0000 (12:56 -0600)]
Android: remove dependence on .SECONDEXPANSION

With the Android build system changes to ninja/kati, the use of
.SECONDEXPANSION is no longer supported. Fix this by avoiding rule specific
variables and using $(transform-generated-source).

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoAndroid: fix build break from nir/glsl move to compiler/
Rob Herring [Wed, 10 Feb 2016 22:02:11 +0000 (16:02 -0600)]
Android: fix build break from nir/glsl move to compiler/

Commits a39a8fbbaa12 ("nir: move to compiler/") and eb63640c1d38
("glsl: move to compiler/") broke Android builds. Fix them.

There is also a missing dependency between generated NIR headers and
several libraries. This isn't a new issue, but seems to have been
exposed by the NIR move.

Built with i915, i965, freedreno, r300g, r600g, vc4, and virgl enabled.

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Cc: Mauro Rossi <issor.oruam@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agogallium/radeon: disable evergreen_do_fast_color_clear for BE
Oded Gabbay [Thu, 25 Feb 2016 20:36:38 +0000 (22:36 +0200)]
gallium/radeon: disable evergreen_do_fast_color_clear for BE

This function is currently broken for BE. I assume it's because of
util_pack_color(). Until I fix this path, I prefer to disable it so users
would be able to see correct colors on their desktop and applications.

Together with the two following patches:
- gallium/r600: Don't let h/w do endian swap for colorformat
- gallium/radeon: remove separate BE path in r600_translate_colorswap

it fixes BZ#72877 and BZ#92039

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/r600: Don't let h/w do endian swap for colorformat
Oded Gabbay [Thu, 25 Feb 2016 21:09:18 +0000 (23:09 +0200)]
gallium/r600: Don't let h/w do endian swap for colorformat

Since the rework on gallium pipe formats, there is no more need to do
endian swap of the colorformat in the h/w, because the conversion between
mesa format and gallium (pipe) format takes endianess into account (see
the big #if in p_format.h).

v2: return ENDIAN_NONE only for four 8-bits components
(V_0280A0_COLOR_8_8_8_8)

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/radeon: remove separate BE path in r600_translate_colorswap
Oded Gabbay [Thu, 25 Feb 2016 20:35:00 +0000 (22:35 +0200)]
gallium/radeon: remove separate BE path in r600_translate_colorswap

After further testing, it appears there is no need for
separate BE path in r600_translate_colorswap()

The only fix remaining is the change of the last if statement, in the 4
channels case. Originally, it contained an invalid swizzle configuration
that never got hit, in LE or BE. So the fix is relevant for both systems.

This patch adds an additional 120 available visuals for LE and BE,
as seen in glxinfo

v2:
Tested for regressions by running piglit gpu.py with CAICOS (r600g) on
x86-64 machine. No regressions found.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonv50/ir: emit VOTE instruction
Samuel Pitoiset [Sun, 28 Feb 2016 19:44:47 +0000 (20:44 +0100)]
nv50/ir: emit VOTE instruction

Changes from v2:
 - add missing NOT modifier for GK110/GM107

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agogk110/ir: add ld lock/st unlock emission
Samuel Pitoiset [Sun, 28 Feb 2016 17:22:13 +0000 (18:22 +0100)]
gk110/ir: add ld lock/st unlock emission

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv50,nvc0: bump minimum texture buffer offset alignment
Ilia Mirkin [Sat, 27 Feb 2016 20:30:34 +0000 (15:30 -0500)]
nv50,nvc0: bump minimum texture buffer offset alignment

It appears that it actually needs to be aligned to the datum size, so it
was 1 when testing with R8, but it can be as high as 16 with RGBA32.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
8 years agomesa: add GL_OES_gpu_shader5 and GL_EXT_gpu_shader5 support
Ilia Mirkin [Sat, 20 Feb 2016 00:08:35 +0000 (19:08 -0500)]
mesa: add GL_OES_gpu_shader5 and GL_EXT_gpu_shader5 support

The two extensions are identical, and are largely taking bits of already
existing desktop functionality. We continue to do a poor job of
supporting the 'precise' keyword, just like we do on desktop.

This passes the relevant dEQP tests that I could find.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: expose GL_EXT_texture_sRGB_decode on GLES 3.0+
Ilia Mirkin [Sat, 20 Feb 2016 20:58:19 +0000 (15:58 -0500)]
mesa: expose GL_EXT_texture_sRGB_decode on GLES 3.0+

Could be exposed on earlier GLES versions if we supported EXT_sRGB, but
we don't, for now.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoi965/cfg: Fix comment list punctuation
Ian Romanick [Fri, 26 Feb 2016 19:16:33 +0000 (11:16 -0800)]
i965/cfg: Fix comment list punctuation

Trivial

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/cfg: Split out dead control flow paths to simplify both paths
Ian Romanick [Thu, 25 Feb 2016 03:39:49 +0000 (19:39 -0800)]
i965/cfg: Split out dead control flow paths to simplify both paths

v2: Fix some bad indentation.  Suggested by Curro.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965/cfg: Don't handle fully empty if/else/endif
Ian Romanick [Thu, 25 Feb 2016 03:29:57 +0000 (19:29 -0800)]
i965/cfg: Don't handle fully empty if/else/endif

This will now never occur.  The empty if-else part would have already
been removed leaving an empty if-endif part.

No shader-db changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965/cfg: Eliminate an empty then-branch of an if/else/endif
Ian Romanick [Thu, 25 Feb 2016 03:11:39 +0000 (19:11 -0800)]
i965/cfg: Eliminate an empty then-branch of an if/else/endif

On BDW,

total instructions in shared programs: 8448571 -> 8448367 (-0.00%)
instructions in affected programs: 21000 -> 20796 (-0.97%)
helped: 116
HURT: 0

v2: Remove spurious attempt to combine the if_block with the (removed!)
else_block.  Suggested by Matt and Curro.  Correct the comment
describing what the new pass does.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965/cfg: Track prev_block and prev_inst explicitly in the whole function
Ian Romanick [Thu, 25 Feb 2016 03:26:13 +0000 (19:26 -0800)]
i965/cfg: Track prev_block and prev_inst explicitly in the whole function

This provides a trivial simplification now, and it makes some future
changes more straight forward.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965/cfg: Slightly rearrange dead_control_flow_eliminate
Ian Romanick [Thu, 25 Feb 2016 02:52:05 +0000 (18:52 -0800)]
i965/cfg: Slightly rearrange dead_control_flow_eliminate

'git diff -w' is a bit more illustrative.  A couple declarations were
moved, the continue was removed, and the code was reindented.  This will
simplify future changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965: Simplify brw_nir_lower_vue_inputs() slightly.
Kenneth Graunke [Thu, 25 Feb 2016 07:44:46 +0000 (23:44 -0800)]
i965: Simplify brw_nir_lower_vue_inputs() slightly.

The same code appeared in both branches; pull it above the if statement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Avoid recalculating the normal VUE map for IO lowering.
Kenneth Graunke [Thu, 25 Feb 2016 07:43:17 +0000 (23:43 -0800)]
i965: Avoid recalculating the normal VUE map for IO lowering.

The caller already computes it.  Now that we have stage specific
functions, it's really easy to pass this in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Avoid recalculating the tessellation VUE map for IO lowering.
Kenneth Graunke [Thu, 25 Feb 2016 06:34:51 +0000 (22:34 -0800)]
i965: Avoid recalculating the tessellation VUE map for IO lowering.

The caller already computes it.  Now that we have stage specific
functions, it's really easy to pass this in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Eliminate brw_nir_lower_{inputs,outputs,io} functions.
Kenneth Graunke [Thu, 25 Feb 2016 06:11:35 +0000 (22:11 -0800)]
i965: Eliminate brw_nir_lower_{inputs,outputs,io} functions.

Now that each stage is directly calling brw_nir_lower_io(), and we have
per-stage helper functions, it makes sense to just call the relevant one
directly, rather than going through multiple switch statements.

This also eliminates stupid function parameters, such as the two that
only apply to vertex attributes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Split brw_nir_lower_inputs/outputs into per-stage functions.
Kenneth Graunke [Thu, 25 Feb 2016 06:02:28 +0000 (22:02 -0800)]
i965: Split brw_nir_lower_inputs/outputs into per-stage functions.

These functions are both giant switch statements where most cases don't
overlap at all.  Let's put the bulk of the work in per-stage helpers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Remove catch-all nir_lower_io call with specific cases.
Kenneth Graunke [Thu, 25 Feb 2016 05:50:42 +0000 (21:50 -0800)]
i965: Remove catch-all nir_lower_io call with specific cases.

Most cases already call nir_lower_io explicitly for input and output
lowering.  This catch all isn't very useful anymore - we can just add it
to the remaining cases.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Move optimizations from brw_nir_lower_io to brw_postprocess_nir.
Kenneth Graunke [Thu, 25 Feb 2016 05:40:37 +0000 (21:40 -0800)]
i965: Move optimizations from brw_nir_lower_io to brw_postprocess_nir.

This simplifies things.  Every caller of brw_nir_lower_io() immediately
calls brw_postprocess_nir().  The only real change this will have is
that we get an extra brw_nir_optimize() call when compiling compute
shaders, but that seems fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Always do NIR IO lowering at specialization time.
Kenneth Graunke [Thu, 25 Feb 2016 05:36:15 +0000 (21:36 -0800)]
i965: Always do NIR IO lowering at specialization time.

We've now hit literally every case other than geometry shaders (and
compute shaders, but those are a no-op).  So, let's just move geometry
shaders over too and be done with it.

The only advantage to doing this at link time was to save the expense
of running the pass on recompiles.  But we're already running a lot of
passes, and the extra code complexity isn't worth it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Make an is_scalar boolean in brw_compile_gs().
Kenneth Graunke [Wed, 13 Jan 2016 23:23:48 +0000 (15:23 -0800)]
i965: Make an is_scalar boolean in brw_compile_gs().

Shorter than compiler->scalar_stage[MESA_SHADER_GEOMETRY], which can
help with line-wrapping.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965/nir: Do lower_io late for fragment shaders
Jason Ekstrand [Wed, 17 Feb 2016 21:23:45 +0000 (13:23 -0800)]
i965/nir: Do lower_io late for fragment shaders

The Vulkan driver wants to be able to delete fragment outputs that are
beyond key.nr_color_regions; this is a lot easier if we lower outputs at
specialization time rather than link time.

(Rationale added to commit message by Ken)

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoi965: Set dest type to UW for several send messages
Jordan Justen [Mon, 1 Feb 2016 02:28:42 +0000 (18:28 -0800)]
i965: Set dest type to UW for several send messages

Without this, on SIMD 16 the send instruction destination will appear
to write more than one destination register, causing the simulator to
report an error.

Of course, the send instruction can actually write more than one
destination register regardless of the type set for the destination,
so this is a bit strange.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agonvc0: rework nvc0_compute_validate_program()
Samuel Pitoiset [Wed, 24 Feb 2016 17:44:56 +0000 (18:44 +0100)]
nvc0: rework nvc0_compute_validate_program()

Reduce the amount of duplicated code by re-using
nvc0_program_validate(). While we are at it, change the prototype
to return void and remove nvc0_compute.h which is now useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre Moreau <pierre.morrow@free.fr>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: make sure to validate compute global buffers on Fermi
Samuel Pitoiset [Wed, 24 Feb 2016 17:44:55 +0000 (18:44 +0100)]
nvc0: make sure to validate compute global buffers on Fermi

No reason to not validate those global buffers and this might avoid
fails if someone try to use the global memory from compute programs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre Moreau <pierre.morrow@free.fr>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: move nvc0_validate_global_residents() to nvc0_compute.c
Samuel Pitoiset [Wed, 24 Feb 2016 17:44:54 +0000 (18:44 +0100)]
nvc0: move nvc0_validate_global_residents() to nvc0_compute.c

While we are at it, rename it to nvc0_compute_validate_globals() and
update its prototype.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre Moreau <pierre.morrow@free.fr>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoegl/wayland: Try to use wl_surface.damage_buffer for SwapBuffersWithDamage
Derek Foreman [Tue, 16 Feb 2016 16:34:39 +0000 (10:34 -0600)]
egl/wayland: Try to use wl_surface.damage_buffer for SwapBuffersWithDamage

Since commit d1314de293e9e4a63c35f094c3893aaaed8580b4 we ignore
damage passed to SwapBuffersWithDamage.

Wayland 1.10 now has functionality that allows us to properly
process those damage rectangles, and a way to query if it's
available.

Now we can use wl_surface.damage_buffer and interpret the incoming
damage as being in buffer co-ordinates.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
8 years agovirgl: add missing CAP turned off.
Dave Airlie [Fri, 26 Feb 2016 04:02:56 +0000 (04:02 +0000)]
virgl: add missing CAP turned off.

8 years agoprogram: Remove extra reference_program()
Miklós Máté [Tue, 15 Dec 2015 23:05:44 +0000 (00:05 +0100)]
program: Remove extra reference_program()

It was already done in get_mesa_program()

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agoautomake: add nine to make distcheck
Emil Velikov [Thu, 25 Feb 2016 15:12:49 +0000 (15:12 +0000)]
automake: add nine to make distcheck

Will allow us to catch/prevent issues, like the one in mesa 11.2.0-rc1.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agost/nine: don't forget to bundle the nine_limits.h file
Emil Velikov [Thu, 25 Feb 2016 16:07:45 +0000 (16:07 +0000)]
st/nine: don't forget to bundle the nine_limits.h file

Without this mesa 11.2.0-rc1 ended up busted :-(

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Repored-by: Ondřej Súkup <mimi.vx@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoi965/fs: Allow saturate propagation to propagate negations into MADs.
Matt Turner [Wed, 11 Feb 2015 01:45:28 +0000 (17:45 -0800)]
i965/fs: Allow saturate propagation to propagate negations into MADs.

Allows us to transform

   mad      res  src0   src1   src2
   mov.sat  dst  -res

into

   mad.sat  dst  -src0 -src1   src2

instructions in affected programs: 3712 -> 3688 (-0.65%)
helped: 24

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/fs: Allow saturate propagation to propagate negations into ADDs.
Matt Turner [Thu, 29 Jan 2015 22:17:20 +0000 (14:17 -0800)]
i965/fs: Allow saturate propagation to propagate negations into ADDs.

Allows us to transform

   add      res  src0   src1
   mov.sat  dst  -res

into

   add.sat  dst  -src0 -src1

No shader-db changes.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/fs: Allow saturate propagation to propagate negations into MULs.
Matt Turner [Wed, 28 Jan 2015 06:46:22 +0000 (22:46 -0800)]
i965/fs: Allow saturate propagation to propagate negations into MULs.

Allows us to transform

   mul      res  src0   src1
   mov.sat  dst  -res

into

   mul.sat  dst  src0  -src1

instructions in affected programs: 45246 -> 45054 (-0.42%)
helped: 162

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoi965/fs: Don't CSE negated multiplies with saturation.
Matt Turner [Mon, 22 Feb 2016 18:25:38 +0000 (10:25 -0800)]
i965/fs: Don't CSE negated multiplies with saturation.

It's not correct to CSE these multiplies

   mul.sat dst1, -a, b
   mul.sat dst2,  a, b

by emitting a negated MOV from dst1 to dst2:

   mul.sat dst1, -a, b
   mov     dst2, -dst1

Take 2.0*2.0 for example. The first multiply would produce 0.0 and the
second would produce 1.0.

Fixes bad generated code in 18 to 22 shaders:

instructions in affected programs: 432 -> 464 (7.41%)
helped: 4
HURT: 18

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoglsl: Consider ubo_load to be a horizontal operation.
Matt Turner [Mon, 22 Feb 2016 17:36:48 +0000 (09:36 -0800)]
glsl: Consider ubo_load to be a horizontal operation.

Unclear to me whether it actually is a horizontal operation that cannot
be vectorized, but the fact that i965 generates the same code in either
case makes me less interested in finding out.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94199
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl/ast: Implicit conversion from double to float is not allowed
Andres Gomez [Thu, 25 Feb 2016 10:49:24 +0000 (12:49 +0200)]
glsl/ast: Implicit conversion from double to float is not allowed

Also, renamed get_conversion_operation to avoid
future misunderstandings.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agogallium/radeon: return correct values for BE in r600_translate_colorswap
Oded Gabbay [Wed, 24 Feb 2016 12:43:28 +0000 (14:43 +0200)]
gallium/radeon: return correct values for BE in r600_translate_colorswap

Because I changed the swizzle check, I also need to adapt the return
values for each check.

It's basically almost the same as before, we just cross between STD and
STD_REV, and cross between ALT and ALT_REV

This fixes the rgba test in gl-1.0-readpixsanity (piglit) and also
fixes tri-flat (mesa demos).

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: remove duplicate define from enum pipe_format
Oded Gabbay [Wed, 24 Feb 2016 09:49:53 +0000 (11:49 +0200)]
gallium: remove duplicate define from enum pipe_format

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agoglsl: Detect do-while-false loops and unroll them
Ian Romanick [Fri, 19 Feb 2016 02:08:58 +0000 (18:08 -0800)]
glsl: Detect do-while-false loops and unroll them

Previously loops like

   do {
      // ...
   } while (false);

that did not have any other loop-branch instructions would not be
unrolled.  This is commonly used to wrap multiline preprocessor macros.

This produces IR like

    (loop (
       ...
       break
    ))

Since limiting_terminator was NULL, the loop unroller would
throw up its hands and say, "I don't know how many iterations.  How
can I unroll this?"

We can detect this another way.  If there is no limiting_terminator
and the only loop-branch is a break as the last IR, there's only one
iteration.

On my very old checkout of shader-db, this removes a loop from Orbital
Explorer, but it does not otherwise affect the shader.  The loop removed
is the one the compiler inserts surrounding the switch statement.

This change does prevent some seriously bad code generation in some
patches to meta shaders that I recently sent out for review.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoi965: Enable tiled mem_copy with sRGB-formatted resources
Nanley Chery [Thu, 11 Feb 2016 00:53:57 +0000 (16:53 -0800)]
i965: Enable tiled mem_copy with sRGB-formatted resources

RGBA8 and BGRA8 unorm formats are compatible with the various
mem_copy functions. Their sRGB counterparts are also compatible
because they're also color-renderable (of importance when the
specified resource is a readbuffer) and they share the same
physical layout.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agomesa: replace for loop with bitshifting in supported_buffer_bitmask()
Brian Paul [Tue, 23 Feb 2016 20:46:28 +0000 (13:46 -0700)]
mesa: replace for loop with bitshifting in supported_buffer_bitmask()

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: updates some comments in buffers.c
Brian Paul [Tue, 23 Feb 2016 20:41:27 +0000 (13:41 -0700)]
mesa: updates some comments in buffers.c

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: make _mesa_draw_buffers() static
Brian Paul [Tue, 23 Feb 2016 20:35:32 +0000 (13:35 -0700)]
mesa: make _mesa_draw_buffers() static

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: make _mesa_draw_buffer() static
Brian Paul [Tue, 23 Feb 2016 20:34:46 +0000 (13:34 -0700)]
mesa: make _mesa_draw_buffer() static

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: make _mesa_read_buffer() static
Brian Paul [Tue, 23 Feb 2016 20:32:21 +0000 (13:32 -0700)]
mesa: make _mesa_read_buffer() static

Not called from any other file.  Remove _mesa_ prefix and update comments.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: move declaration of buffer var in handle_first_current()
Brian Paul [Tue, 23 Feb 2016 20:25:43 +0000 (13:25 -0700)]
mesa: move declaration of buffer var in handle_first_current()

Declare the var in the scopes where it's used.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agomesa: use gl_buffer_index in a few places
Brian Paul [Tue, 23 Feb 2016 20:24:11 +0000 (13:24 -0700)]
mesa: use gl_buffer_index in a few places

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agost/mesa: remove useless break statement
Brian Paul [Tue, 23 Feb 2016 20:19:29 +0000 (13:19 -0700)]
st/mesa: remove useless break statement

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agost/mesa: rename st_readpixels to st_ReadPixels
Brian Paul [Tue, 23 Feb 2016 20:12:56 +0000 (13:12 -0700)]
st/mesa: rename st_readpixels to st_ReadPixels

To match the convention of other device driver functions.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agost/mesa: fix frontbuffer glReadPixels regressions
Brian Paul [Tue, 23 Feb 2016 23:15:34 +0000 (16:15 -0700)]
st/mesa: fix frontbuffer glReadPixels regressions

The change "mesa/readpix: Don't clip in _mesa_readpixels()" caused a
few piglit regressions.  The failing tests use glReadPixels to read
from the front color buffer.  The problem is we were trying to read
from a non-existant front color buffer.  The front color buffer is
created on demand in st/mesa.  Since the missing buffer bounds were
effectively 0 x 0 the glReadPixels was totally clipped and returned
early.

The fix involves creating the real front color buffer when we're about
to try reading from it.

Tested with llvmpipe and VMware driver on Linux, Windows.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94253
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94254
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94257
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agogallium/radeon: Correctly translate colorswaps for big endian
Oded Gabbay [Tue, 23 Feb 2016 14:33:45 +0000 (16:33 +0200)]
gallium/radeon: Correctly translate colorswaps for big endian

The current code in r600_translate_colorswap uses the swizzle information
to determine which colorswap to use.

This works for BE & LE when the nr_channels is <4, but when nr_channels==4
(e.g. PIPE_FORMAT_A8R8G8B8_UNORM), this method can not be used for both BE
and LE, because the swizzle info is the same for both of them.

As a result, r600g doesn't support 24bit color formats, only 16bit, which
forces the user to choose 16bit color in X server.

This patch fixes this bug by separating the checks for LE and BE and
adapting the swizzle conditions in the BE part of the checks.

Tested on an Evergreen GPU (Cedar GL FirePro 2270) running inside POWER7
Big-Endian Machine.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
CC: "11.2" "11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agomesa: use sizeof on the correct type
Thomas Hindoe Paaboel Andersen [Mon, 22 Feb 2016 22:58:00 +0000 (15:58 -0700)]
mesa: use sizeof on the correct type

Before the luminance stride was based on the size of GL_FLOAT
which is just the type constant (0x1406). Change it to use the
size of GLfloat.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agotgsi/scan: handle holes between VS inputs, assert-fail in other cases
Marek Olšák [Mon, 22 Feb 2016 23:37:39 +0000 (00:37 +0100)]
tgsi/scan: handle holes between VS inputs, assert-fail in other cases

"st/mesa: overhaul vertex setup for clearing, glDrawPixels, glBitmap"
added a vertex shader declaring IN[0] and IN[2], but not IN[1].

Drivers relying on tgsi_shader_info can't handle holes in declarations,
because tgsi_shader_info doesn't track that.

This is just a quick workaround meant for stable that will work for vertex
shaders.

This fixes radeonsi DrawPixels and CopyPixels crashes.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agodocs: Mark off GL_OES_shader_image_atomic as done.
Francisco Jerez [Mon, 22 Feb 2016 23:48:17 +0000 (15:48 -0800)]
docs: Mark off GL_OES_shader_image_atomic as done.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965/fs: Return result of image atomic in a register of the expected type.
Francisco Jerez [Sun, 16 Aug 2015 22:52:19 +0000 (01:52 +0300)]
i965/fs: Return result of image atomic in a register of the expected type.

So the result is of float type if we're implementing the float
overload of imageAtomicExchange.  This is the only back-end change
required to support OES_shader_image_atomic AFAICT.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoglsl: Implement the required built-in functions when OES_shader_image_atomic is enabled.
Francisco Jerez [Fri, 21 Aug 2015 11:12:22 +0000 (14:12 +0300)]
glsl: Implement the required built-in functions when OES_shader_image_atomic is enabled.

This is basically just the same atomic functions exposed by
ARB_shader_image_load_store, with one exception:

    "highp float imageAtomicExchange(
         coherent IMAGE_PARAMS,
         float data);"

There's no float atomic exchange overload in the original
ARB_shader_image_load_store or GL 4.2, so this seems like new
functionality that requires specific back-end support and a separate
availability condition in the built-in function generator.

v2: Move image availability predicate logic into a separate static
    function for clarity.  Had to pull out the image_function_flags
    enum from the builtin_builder class for that to be possible.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoglsl: Add usual extension boilerplate for OES_shader_image_atomic.
Francisco Jerez [Mon, 22 Feb 2016 23:06:45 +0000 (15:06 -0800)]
glsl: Add usual extension boilerplate for OES_shader_image_atomic.

v2: No need for extension enable bits (Ilia).

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa: Add extension table entry for OES_shader_image_atomic.
Francisco Jerez [Mon, 22 Feb 2016 23:04:37 +0000 (15:04 -0800)]
mesa: Add extension table entry for OES_shader_image_atomic.

v2: No need for extension enable bits (Ilia).

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: rename 3d binding points to NVC0_BIND_3D_XXX
Samuel Pitoiset [Sun, 21 Feb 2016 10:58:35 +0000 (11:58 +0100)]
nvc0: rename 3d binding points to NVC0_BIND_3D_XXX

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX
Samuel Pitoiset [Sun, 21 Feb 2016 10:49:25 +0000 (11:49 +0100)]
nvc0: rename 3d dirty flags to NVC0_NEW_3D_XXX

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: prefix compute macros with _CP_ instead of _COMPUTE_
Samuel Pitoiset [Sun, 21 Feb 2016 10:15:43 +0000 (11:15 +0100)]
nvc0: prefix compute macros with _CP_ instead of _COMPUTE_

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: rename NVXX_COMPUTE to NVXX_CP
Samuel Pitoiset [Sun, 21 Feb 2016 10:13:01 +0000 (11:13 +0100)]
nvc0: rename NVXX_COMPUTE to NVXX_CP

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d
Samuel Pitoiset [Sun, 21 Feb 2016 10:06:27 +0000 (11:06 +0100)]
nvc0: rename nvc0_context::dirty to nvc0_context::dirty_3d

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonvc0/ir: add missing emission of locked load predicate
Samuel Pitoiset [Mon, 22 Feb 2016 20:11:33 +0000 (21:11 +0100)]
nvc0/ir: add missing emission of locked load predicate

Like unlocked store on shared memory, locked store can fail and the
second dest which is a predicate must be emitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
8 years agonvc0/ir: add ld lock/st unlock emission on GK104
Samuel Pitoiset [Sun, 21 Feb 2016 14:28:16 +0000 (15:28 +0100)]
nvc0/ir: add ld lock/st unlock emission on GK104

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv50/ir: restore OP_SELP to be a regular instruction
Samuel Pitoiset [Sun, 21 Feb 2016 18:40:01 +0000 (19:40 +0100)]
nv50/ir: restore OP_SELP to be a regular instruction

Actually OP_SELP doesn't need to be a compare instruction. Instead we
just need to set the NOT modifier when building the instruction.
While we are at it, fix the dst register type and use a GPR.

Suggested by Ilia Mirkin.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agosvga: unbind index buffer when drawing non-indexed primitives
Brian Paul [Mon, 22 Feb 2016 15:53:47 +0000 (08:53 -0700)]
svga: unbind index buffer when drawing non-indexed primitives

Silences a warning reported by the svga3d device.

v2: also null-out the index buffer pointer

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agomesa: add GL_EXT_texture_border_clamp support
Ilia Mirkin [Wed, 17 Feb 2016 12:36:58 +0000 (07:36 -0500)]
mesa: add GL_EXT_texture_border_clamp support

This extension is identical to GL_OES_texture_border_clamp. But dEQP has
tests that want the EXT variant.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: add GL_OES_texture_border_clamp support
Ilia Mirkin [Tue, 16 Feb 2016 00:09:15 +0000 (19:09 -0500)]
mesa: add GL_OES_texture_border_clamp support

Only minor differences to the existing ARB_texture_border_clamp support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: bump version
Ilia Mirkin [Mon, 22 Feb 2016 14:06:59 +0000 (09:06 -0500)]
mesa: bump version

11.2 has been branched, we're on 11.3 now.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agonouveau: update the Makefile.sources list
Emil Velikov [Mon, 22 Feb 2016 10:22:21 +0000 (10:22 +0000)]
nouveau: update the Makefile.sources list

Reflect the nv50->g80 change and the new gm107_texture header.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoradeonsi: implement binary shaders & shader cache in memory (v2)
Marek Olšák [Thu, 11 Feb 2016 14:49:34 +0000 (15:49 +0100)]
radeonsi: implement binary shaders & shader cache in memory (v2)

v2: handle _mesa_hash_table_insert failure
    other cosmetic changes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: remove unused radeon_shader_binary_free_* functions
Marek Olšák [Thu, 11 Feb 2016 22:33:54 +0000 (23:33 +0100)]
gallium/radeon: remove unused radeon_shader_binary_free_* functions

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: make radeon_shader_reloc name string fixed-sized
Marek Olšák [Thu, 11 Feb 2016 22:20:38 +0000 (23:20 +0100)]
radeonsi: make radeon_shader_reloc name string fixed-sized

This will simplify implementations of binary shaders.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: move some struct si_shader members to new struct si_shader_info
Marek Olšák [Thu, 11 Feb 2016 20:09:38 +0000 (21:09 +0100)]
radeonsi: move some struct si_shader members to new struct si_shader_info

This will be part of shader binaries.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: use smaller types for some si_shader members
Marek Olšák [Thu, 11 Feb 2016 20:06:33 +0000 (21:06 +0100)]
radeonsi: use smaller types for some si_shader members

in order to decrease the shader size for a shader cache.

v2: add & use SI_MAX_VS_OUTPUTS

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: enable compiling one variant per shader
Marek Olšák [Thu, 28 Jan 2016 00:29:59 +0000 (01:29 +0100)]
radeonsi: enable compiling one variant per shader

Shader stats from VERDE:

Default scheduler:

Totals:
SGPRS: 491272 -> 488672 (-0.53 %)
VGPRS: 289980 -> 311093 (7.28 %)
Code Size: 11091656 -> 11219948 (1.16 %) bytes
LDS: 97 -> 97 (0.00 %) blocks
Scratch: 1732608 -> 2246656 (29.67 %) bytes per wave
Max Waves: 78063 -> 77352 (-0.91 %)
Wait states: 0 -> 0 (0.00 %)

Looking at some of the worst regressions, I get:
- The VGPR increase seems to be caused by the fact that if PS has used less
  than 16 VGPRs, now it will always use 16 VGPRs and sometimes even 20.
  However, the wave count remains at 10 if VGPRs <= 24, so no harm there.
- The scratch increase seems to be caused by SGPR spilling.
  The unnecessary SGPR spilling has been an ongoing issue with the compiler
  and it's completely fixable by rematerializing s_loads or reordering
  instructions.

SI scheduler:

Totals:
SGPRS: 374848 -> 374576 (-0.07 %)
VGPRS: 284456 -> 307515 (8.11 %)
Code Size: 11433068 -> 11535452 (0.90 %) bytes
LDS: 97 -> 97 (0.00 %) blocks
Scratch: 509952 -> 522240 (2.41 %) bytes per wave
Max Waves: 79456 -> 78217 (-1.56 %)
Wait states: 0 -> 0 (0.00 %)

VGPRs - same story as before. The SI scheduler doesn't spill SGPRs so much
and generally spills way less than the default scheduler.
(522240 spills vs 2246656 spills)

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: print full shader name before disassembly
Marek Olšák [Fri, 5 Feb 2016 22:30:01 +0000 (23:30 +0100)]
radeonsi: print full shader name before disassembly

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: compile non-GS middle parts of shaders immediately if enabled
Marek Olšák [Thu, 28 Jan 2016 01:53:13 +0000 (02:53 +0100)]
radeonsi: compile non-GS middle parts of shaders immediately if enabled

Still disabled.

Only prologs & epilogs are compiled in draw calls, but each variant of those
is compiled only once per process.

VS is always compiled as hw VS.
TES is always compiled as hw VS.

LS and ES stages are always compiled on demand.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: rework polygon stippling for PS prolog
Marek Olšák [Wed, 27 Jan 2016 01:59:23 +0000 (02:59 +0100)]
radeonsi: rework polygon stippling for PS prolog

Don't use the pstipple module.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: add PS prolog
Marek Olšák [Mon, 15 Feb 2016 22:57:54 +0000 (23:57 +0100)]
radeonsi: add PS prolog

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: add PS epilog
Marek Olšák [Tue, 26 Jan 2016 23:50:29 +0000 (00:50 +0100)]
radeonsi: add PS epilog

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: add TCS epilog
Marek Olšák [Tue, 26 Jan 2016 23:38:03 +0000 (00:38 +0100)]
radeonsi: add TCS epilog

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: add VS epilog
Marek Olšák [Tue, 26 Jan 2016 23:33:07 +0000 (00:33 +0100)]
radeonsi: add VS epilog

It only exports the primitive ID.
Also used by TES when it's compiled as VS.

The VS input location of the primitive ID input is v2.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>