mesa.git
9 years agonv50/ir: adapt to new method for passing in cull/clip distance masks
Ilia Mirkin [Sat, 24 Oct 2015 03:25:33 +0000 (23:25 -0400)]
nv50/ir: adapt to new method for passing in cull/clip distance masks

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: share shaders between contexts and build immediately
Ilia Mirkin [Tue, 20 Oct 2015 22:50:54 +0000 (18:50 -0400)]
nvc0: share shaders between contexts and build immediately

Avoid deferring building shaders until draw time, should hopefully
reduce any stuttering, as well as enable shader-db style analysis.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: do upload-time fixups for interpolation parameters
Ilia Mirkin [Tue, 20 Oct 2015 22:03:40 +0000 (18:03 -0400)]
nvc0: do upload-time fixups for interpolation parameters

Unfortunately flatshading is an all-or-nothing proposition on nvc0,
while GL 3.0 calls for the ability to selectively specify explicit
interpolation parameters on gl_Color/gl_SecondaryColor which would
override the flatshading setting. This allows us to fix up the
interpolation settings after shader generation based on rasterizer
settings.

While we're at it, we can add support for dynamically forcing all
(non-flat) shader inputs to be interpolated per-sample, which allows
st/mesa to not generate variants for these.

Fixes the remaining failing glsl-1.30/execution/interpolation piglits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonir: Copy "patch" flag from ir_variable to nir_variable.
Kenneth Graunke [Fri, 2 Oct 2015 07:01:23 +0000 (00:01 -0700)]
nir: Copy "patch" flag from ir_variable to nir_variable.

This was introduced in GLSL IR after NIR development had branched.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agonir: Add intrinsics for tessellation shader system values.
Kenneth Graunke [Fri, 9 Oct 2015 06:53:47 +0000 (23:53 -0700)]
nir: Add intrinsics for tessellation shader system values.

nir_intrinsic_load_patch_vertices_in corresponds to gl_PatchVerticesIn,
a special input in both the TCS and TES stages.

nir_intrinsic_load_tess_coord corresponds to gl_TessCoord, a special
tessellation evaluation shader input.

nir_intrinsic_load_tess_level_outer/inner correspond to the
gl_TessLevelOuter[] and gl_TessLevelInner[] evaluation shader inputs,
which we treat as system values because they're stored specially.
(These intrinsics are only for the TES - the TCS uses output variables.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoi965: Fix missing BRW_NEW_*_PROG_DATA flagging caused by cache reuse.
Kenneth Graunke [Wed, 28 Oct 2015 07:53:20 +0000 (00:53 -0700)]
i965: Fix missing BRW_NEW_*_PROG_DATA flagging caused by cache reuse.

Consider the case of two nearly identical GLSL fragment shaders:

   out vec4 color;
   void main() { color = vec4(1); }

and

   layout(early_fragment_tests) in;
   out vec4 color;
   void main() { color = vec4(1); }

These shaders compile to the exact same assembly, but have distinct
values for brw_wm_prog_data::early_fragment_tests.

Since these are two independent GLSL shaders, they have different
program keys - notably, brw_wm_prog_key::program_string_id differs.

When uploading the second, brw_upload_cache will find an existing copy
of the assembly in the cache BO, which means matching_data will be
non-NULL.  Although we create a second cache item (with the new key
and prog_data), we set item->offset to the existing copy and avoid
re-uploading duplicate assembly.

However, brw_search_cache() would only flag BRW_NEW_*_PROG_DATA if
item->offset differed from the supplied offset.  With reuse, both
programs have the same offset, but prog_data changed.  We have to
flag it, but failed to.

To fix this, we simply need to check if the aux (prog_data) pointer
changed.  If either the assembly or the prog_data differs, flag it.

This fixes a regression since 1bba29ed403e735ba0bf04ed8aa2e571884f,
where Topi fixed brw_upload_cache() to actually reuse identical
assembly.  Prior to that, reuse basically never happened due to bugs.
Unfortunately, this code apparently wasn't prepared to handle reuse!

Fixes GPU hangs in Dolphin on Broadwell.

Huge thanks to Pierre Bourdon and Ilia Mirkin for debugging this
and helping track down the real issue.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92623
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Pierre Bourdon <delroth@gmail.com>
9 years agoclover: fix building fix clang-3.8
Laurent Carlier [Wed, 28 Oct 2015 14:47:09 +0000 (15:47 +0100)]
clover: fix building fix clang-3.8

https://bugs.freedesktop.org/show_bug.cgi?id=92705

v2.1: use Linker::Flags::None instead of 0 and emplace_back()

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agonv50: add ARB_copy_image support
Ilia Mirkin [Thu, 29 Oct 2015 00:52:50 +0000 (20:52 -0400)]
nv50: add ARB_copy_image support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: add ARB_copy_image support
Ilia Mirkin [Wed, 28 Oct 2015 20:18:18 +0000 (16:18 -0400)]
nvc0: add ARB_copy_image support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: fix crash when nv50_miptree_from_handle fails
Julien Isorce [Tue, 20 Oct 2015 16:34:23 +0000 (17:34 +0100)]
nvc0: fix crash when nv50_miptree_from_handle fails

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
9 years agovbo: replace assertion with conditional in vbo_compute_max_verts()
Brian Paul [Tue, 27 Oct 2015 19:50:10 +0000 (13:50 -0600)]
vbo: replace assertion with conditional in vbo_compute_max_verts()

With just the right sequence of per-vertex commands and state changes,
it's possible for this assertion to fail (such as with viewperf11's
lightwave-06-1 test).  Instead of asserting, return 0 so that the
caller knows the VBO is full and needs to be flushed.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agomesa: minor formatting fix in get_tex_rgba_compressed()
Brian Paul [Wed, 28 Oct 2015 17:03:21 +0000 (11:03 -0600)]
mesa: minor formatting fix in get_tex_rgba_compressed()

9 years agost/mesa: implement ARB_copy_image
Marek Olšák [Mon, 24 Aug 2015 00:55:20 +0000 (02:55 +0200)]
st/mesa: implement ARB_copy_image

I wonder if the craziness was worth it.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium: add PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS
Marek Olšák [Sun, 23 Aug 2015 23:19:35 +0000 (01:19 +0200)]
gallium: add PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS

For ARB_copy_image.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoradeonsi: allow copying between compatible compressed and uncompressed formats
Marek Olšák [Sun, 23 Aug 2015 23:08:48 +0000 (01:08 +0200)]
radeonsi: allow copying between compatible compressed and uncompressed formats

which is where a block in src maps to a pixel in dst and vice versa.
e.g. DXT1 <-> R32G32_UINT
     DXT5 <-> R32G32B32A32_UINT

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agomesa: set TargetIndex in VDPAURegister*SurfaceNV (v2)
Marek Olšák [Tue, 27 Oct 2015 10:11:19 +0000 (11:11 +0100)]
mesa: set TargetIndex in VDPAURegister*SurfaceNV (v2)

We initialized Target, but not TargetIndex.
This is required since 7d7dd1871174905dfdd3ca874a09d9.

v2: do it in the right place. Noticed by Brian Paul.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92645

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoi965: remove unneeded src_reg copy in emit_shader_time_write
Emil Velikov [Wed, 7 Oct 2015 11:38:12 +0000 (12:38 +0100)]
i965: remove unneeded src_reg copy in emit_shader_time_write

The variable is already of type src_reg. creating a new instance only to
destroy it seems unnecessary.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: remove cache_aux_free_func array
Emil Velikov [Wed, 7 Oct 2015 11:38:11 +0000 (12:38 +0100)]
i965: remove cache_aux_free_func array

There is only one function that can be called, which is well known at
compilation time.

The abstraction used here seems unnecessary, so let's use a direct call
to brw_stage_prog_data_free() when appropriate, cut down the size of
struct brw_cache.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomain: fix GL_MAX_NUM_ACTIVE_VARIABLES value for shader storage blocks
Samuel Iglesias Gonsalvez [Tue, 27 Oct 2015 08:33:01 +0000 (09:33 +0100)]
main: fix GL_MAX_NUM_ACTIVE_VARIABLES value for shader storage blocks

The maximum number of active variables for shader storage blocks should
take into account the specific rules for shader storage blocks, i.e. for
an active shader storage block member declared as an array, an entry
will be generated only for the first array element, regardless of its type.

Fixes 3 dEQP-GLES31.functional.* tests:

dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.named_block
dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.unnamed_block
dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.block_array

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agost/vdpau: disable RefPicList for Vdpau HEVC
Boyuan Zhang [Fri, 23 Oct 2015 17:44:23 +0000 (13:44 -0400)]
st/vdpau: disable RefPicList for Vdpau HEVC

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
9 years agost/va: add VAAPI HEVC decode support
Boyuan Zhang [Fri, 23 Oct 2015 17:37:48 +0000 (13:37 -0400)]
st/va: add VAAPI HEVC decode support

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
9 years agoradeon/uvd: implement and add flag for VAAPI HEVC decode
Boyuan Zhang [Fri, 23 Oct 2015 16:30:33 +0000 (12:30 -0400)]
radeon/uvd: implement and add flag for VAAPI HEVC decode

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
9 years agovl: add RefPicList defines for VAAPI HEVC decode
Boyuan Zhang [Fri, 23 Oct 2015 16:12:19 +0000 (12:12 -0400)]
vl: add RefPicList defines for VAAPI HEVC decode

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
9 years agomesa: Draw indirect is not allowed if the default VAO is bound.
Marta Lofstedt [Mon, 26 Oct 2015 09:58:37 +0000 (10:58 +0100)]
mesa: Draw indirect is not allowed if the default VAO is bound.

From OpenGL ES 3.1 specification, section 10.5:
"DrawArraysIndirect requires that all data sourced for the
command, including the DrawArraysIndirectCommand
structure,  be in buffer objects,  and may not be called when
the default vertex array object is bound."

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agowinsys/amdgpu: remove the dcc_enable surface flag
Marek Olšák [Mon, 26 Oct 2015 10:11:44 +0000 (11:11 +0100)]
winsys/amdgpu: remove the dcc_enable surface flag

dcc_size is sufficient and doesn't need a further comment in my opinion.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
9 years agoradeonsi: add debug flags that disable DCC and DCC fast clear
Marek Olšák [Thu, 22 Oct 2015 20:55:19 +0000 (22:55 +0200)]
radeonsi: add debug flags that disable DCC and DCC fast clear

For debugging, bug reports, etc.
This is not in the radeonsi directory, but it is about radeonsi.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
9 years agoradeonsi: properly check if DCC is enabled and allocated
Marek Olšák [Thu, 22 Oct 2015 20:48:32 +0000 (22:48 +0200)]
radeonsi: properly check if DCC is enabled and allocated

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
9 years agoradeonsi: simplify DCC handling in si_initialize_color_surface
Marek Olšák [Thu, 22 Oct 2015 09:10:14 +0000 (11:10 +0200)]
radeonsi: simplify DCC handling in si_initialize_color_surface

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
9 years agomesa: Draw indirect is not allowed when xfb is active and unpaused
Marta Lofstedt [Mon, 26 Oct 2015 10:50:24 +0000 (11:50 +0100)]
mesa: Draw indirect is not allowed when xfb is active and unpaused

OpenGL ES 3.1 specification, section 10.5:
"An INVALID_OPERATION error is generated if
transform feedback is active and not paused."

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa: Draw Indirect return wrong error code on unalinged
Marta Lofstedt [Mon, 26 Oct 2015 10:22:27 +0000 (11:22 +0100)]
mesa: Draw Indirect return wrong error code on unalinged

From OpenGL 4.4 specification, section 10.4 and
Open GL Es 3.1 section 10.5:
"An INVALID_VALUE error is generated if indirect is not a multiple
of the size, in basic machine units, of uint."

However, the current code follow the ARB_draw_indirect:
https://www.opengl.org/registry/specs/ARB/draw_indirect.txt
"INVALID_OPERATION is generated by DrawArraysIndirect and
DrawElementsIndirect if commands source data beyond the end
of a buffer object or if <indirect> is not word aligned."

V2: After discussions on the list, it was suggested to
only keep the INVALID_VALUE error.

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agomain: Remove interface block array index for doing the name comparison
Samuel Iglesias Gonsalvez [Wed, 21 Oct 2015 12:34:29 +0000 (14:34 +0200)]
main: Remove interface block array index for doing the name comparison

From ARB_program_query_interface spec:

"uint GetProgramResourceIndex(uint program, enum programInterface,
                                   const char *name);
 [...]
 If <name> exactly matches the name string of one of the active resources
 for <programInterface>, the index of the matched resource is returned.
 Additionally, if <name> would exactly match the name string of an active
 resource if "[0]" were appended to <name>, the index of the matched
 resource is returned. [...]"

"A string provided to GetProgramResourceLocation or
 GetProgramResourceLocationIndex is considered to match an active variable
 if:
[...]
   * if the string identifies the base name of an active array, where the
     string would exactly match the name of the variable if the suffix
     "[0]" were appended to the string;
[...]
"

Fixes the following two dEQP-GLES31 tests:

dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array
dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array_single_element

v2:
- Add AoA support (Timothy)
- Apply it too for GetUniformLocation(), GetUniformName() and others
  because ARB_program_interface_query says that they are equivalent
  to GetProgramResourceLocation() and GetProgramResourceName() (Tapani)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agovc4: Add support for copy propagation with unpack flags present.
Eric Anholt [Thu, 6 Aug 2015 03:05:56 +0000 (20:05 -0700)]
vc4: Add support for copy propagation with unpack flags present.

total instructions in shared programs: 89251 -> 87862 (-1.56%)
instructions in affected programs:     52971 -> 51582 (-2.62%)

9 years agovc4: Rewrite the pack instructions as a MOV with a dst pack flag
Eric Anholt [Mon, 26 Oct 2015 20:45:06 +0000 (13:45 -0700)]
vc4: Rewrite the pack instructions as a MOV with a dst pack flag

Another step in reducing the special-casing of instructions.

9 years agovc4: Move dst pack setup out to a helper function with more asserts.
Eric Anholt [Mon, 26 Oct 2015 21:16:19 +0000 (14:16 -0700)]
vc4: Move dst pack setup out to a helper function with more asserts.

9 years agovc4: Switch the unpack ops to being unpack flags on a mov.
Eric Anholt [Sun, 25 Oct 2015 00:35:03 +0000 (17:35 -0700)]
vc4: Switch the unpack ops to being unpack flags on a mov.

This paves the way for copy propagating our unpacks.  We end up with a
small change on shader-db:

total instructions in shared programs: 89390 -> 89251 (-0.16%)
instructions in affected programs:     19041 -> 18902 (-0.73%)

which appears to be because we no longer convert MOVs for an FMAX dst,
r4.unpack, r4.unpack (instead of the previous MOV dst, r4.unpack), and
this ends up with a slightly better schedule.

9 years agovc4: Drop some confused code about pack/unpack handling.
Eric Anholt [Mon, 26 Oct 2015 20:22:18 +0000 (13:22 -0700)]
vc4: Drop some confused code about pack/unpack handling.

At one point I thought packs and unpacks were in the same field of the
instruction.  They aren't.  These instructions therefore never cause a
pack.

total instructions in shared programs: 89472 -> 89390 (-0.09%)
instructions in affected programs:     15261 -> 15179 (-0.54%)

9 years agovc4: Reduce MOV special-casing in QIR-to-QPU.
Eric Anholt [Mon, 26 Oct 2015 21:07:44 +0000 (14:07 -0700)]
vc4: Reduce MOV special-casing in QIR-to-QPU.

I'm going to introduce some more types of MOV, which also want the elision
of raw MOVs.

9 years agovc4: Fix up the test for whether the unpack can be from r4.
Eric Anholt [Mon, 26 Oct 2015 20:17:33 +0000 (13:17 -0700)]
vc4: Fix up the test for whether the unpack can be from r4.

We can do 16a/16b from float as well.  No difference on shader-db.

9 years agovc4: Don't try to follow MOVs across a pack.
Eric Anholt [Mon, 26 Oct 2015 20:57:57 +0000 (13:57 -0700)]
vc4: Don't try to follow MOVs across a pack.

9 years agovc4: Only copy propagate raw MOVs.
Eric Anholt [Sun, 25 Oct 2015 00:49:03 +0000 (17:49 -0700)]
vc4: Only copy propagate raw MOVs.

No problems being fixed, but needed for the new unpack changes.

9 years agovc4: If a QIR source has an unpack set, print it.
Eric Anholt [Sun, 25 Oct 2015 00:33:30 +0000 (17:33 -0700)]
vc4: If a QIR source has an unpack set, print it.

Not used yet, but will be.

9 years agoglsl: Convert TES gl_PatchVerticesIn into a constant when using a TCS.
Kenneth Graunke [Wed, 29 Jul 2015 01:16:37 +0000 (18:16 -0700)]
glsl: Convert TES gl_PatchVerticesIn into a constant when using a TCS.

When a TCS is present, the TES input gl_PatchVerticesIn is actually a
constant - it's simply the # of output vertices specified by the TCS
layout qualifiers.  So, we can replace the system value with a constant,
which may allow further optimization, and will likely be more efficient.

If the TCS is absent, we can't do this optimization.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoi965: Add missing close-parenthesis in error messages
Ian Romanick [Fri, 16 Oct 2015 16:18:24 +0000 (09:18 -0700)]
i965: Add missing close-parenthesis in error messages

Trivial.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965: Fix is-renderable check in intel_image_target_renderbuffer_storage
Ian Romanick [Thu, 15 Oct 2015 19:50:12 +0000 (12:50 -0700)]
i965: Fix is-renderable check in intel_image_target_renderbuffer_storage

Previously we could create a renderbuffer with format
MESA_FORMAT_R8G8B8A8_UNORM, convert that renderbuffer to an EGLImage,
then FAIL to convert the EGLImage back to a renderbuffer because
reasons.  Just use the same check in
intel_image_target_renderbuffer_storage that brw_render_target_supported
uses.

There are more checks in brw_render_target_supported, but I don't think
they are necessary here.  A different approach would be to refactor
brw_render_target_supported to take rb->Format and rb->NumSamples as
parameters (instead of a gl_renderbuffer) and use the new function here.

Fixes:

    ES2-CTS.gtf.GL2ExtensionTests.egl_image.egl_image

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92476
Cc: "10.3 10.4 10.5 10.6 11.0" <mesa-stable@lists.freedesktop.org>
9 years agoglsl: keep track of intra-stage indices for atomics
Timothy Arceri [Mon, 26 Oct 2015 19:58:15 +0000 (06:58 +1100)]
glsl: keep track of intra-stage indices for atomics

This is more optimal as it means we no longer have to upload the same set
of ABO surfaces to all stages in the program.

This also fixes a bug where since commit c0cd5b var->data.binding was
being used as a replacement for atomic buffer index, but they don't have
to be the same value they just happened to end up the same when binding is 0.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Alejandro Piñeiro <apinheiro@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90175

9 years agogallivm: disable f16c when not using AVX
Roland Scheidegger [Mon, 26 Oct 2015 15:44:47 +0000 (16:44 +0100)]
gallivm: disable f16c when not using AVX

f16c intrinsic can only be emitted when AVX is used. So when we disable AVX
due to forcing 128bit vectors we must not use this intrinsic (depending on
llvm version, this worked previously because llvm used AVX even when we didn't
tell it to, however I've seen this fail with llvm 3.3 since
718249843b915decf8fccec92e466ac1a6219934 which seems to have the side effect
of disabling avx in llvm albeit it only touches sse flags really, but
with ea421e919ae6e72e1319fb205c42a6fb53ca2f82 it's now really disabled).
Albeit being able to use AVX with 128bit vectors also would have its uses, the
code as is really was meant to emulate jit code creation for less capable cpus.
v2: add some (ifdefed out) missing de-featuring options for simulating
less capable cpus.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agost/va: pass picture desc to begin and decode
Julien Isorce [Fri, 23 Oct 2015 12:25:47 +0000 (13:25 +0100)]
st/va: pass picture desc to begin and decode

At least vl_mpeg12_decoder uses the picture
desc in begin_frame and decode_bitstream.

https://bugs.freedesktop.org/show_bug.cgi?id=92634

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agomesa: add additional checks for uniform location query
Tapani Pälli [Mon, 26 Oct 2015 09:13:14 +0000 (11:13 +0200)]
mesa: add additional checks for uniform location query

Patch adds additional check to make sure we don't return locations for
structures or arrays of structures.

From page 79 of the OpenGL 4.2 spec:
    "A valid name cannot be a structure, an array of structures, or any
    portion of a single vector or a matrix."

v2: use without-array() to simplify code (Timothy)

No Piglit or CTS regressions observed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
9 years agodocs: add news item and link release notes for 11.0.4
Emil Velikov [Sun, 25 Oct 2015 10:17:08 +0000 (10:17 +0000)]
docs: add news item and link release notes for 11.0.4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
9 years agodocs: add sha256 checksums for 11.0.4
Emil Velikov [Sun, 25 Oct 2015 10:04:09 +0000 (10:04 +0000)]
docs: add sha256 checksums for 11.0.4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit ec14e6f8fd05999b482e0785d8cd286042c9c254)

9 years agodocs: add release notes for 11.0.4
Emil Velikov [Sat, 24 Oct 2015 18:34:01 +0000 (19:34 +0100)]
docs: add release notes for 11.0.4

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 31bf24703193cc23961923e01548b1acb2760a93)

9 years agoi965: Make brw_varying_to_offset take a const pointer to the VUE map.
Kenneth Graunke [Sun, 26 Jul 2015 04:29:28 +0000 (21:29 -0700)]
i965: Make brw_varying_to_offset take a const pointer to the VUE map.

It doesn't modify it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Fix names of the 16-bit unpacks
Eric Anholt [Wed, 5 Aug 2015 04:23:53 +0000 (21:23 -0700)]
vc4: Fix names of the 16-bit unpacks

They're only f16-to-f32 on a float operation, otherwise they're
i16-to-i32.

9 years agovc4: Don't try to register coalesce into the VPM across non-raw MOVs.
Eric Anholt [Sun, 25 Oct 2015 00:38:26 +0000 (17:38 -0700)]
vc4: Don't try to register coalesce into the VPM across non-raw MOVs.

No known bugs, just something I noticed while updating optimization code
for other changes.

9 years agovc4: Take advantage of the 8888 pack function in pack_unorm_4x8.
Eric Anholt [Sun, 25 Oct 2015 00:04:49 +0000 (17:04 -0700)]
vc4: Take advantage of the 8888 pack function in pack_unorm_4x8.

One instruction instead of four, and it turns out you do this a lot for
the Over operator.

total uniforms in shared programs: 32168 -> 32087 (-0.25%)
uniforms in affected programs:     318 -> 237 (-25.47%)
total instructions in shared programs: 89830 -> 89472 (-0.40%)
instructions in affected programs:     6434 -> 6076 (-5.56%)

9 years agovc4: Fix the test for skipping raw MOVs.
Eric Anholt [Sat, 24 Oct 2015 23:30:30 +0000 (16:30 -0700)]
vc4: Fix the test for skipping raw MOVs.

I don't know what previous test was trying to do, but it dates back to the
first add of vc4_qpu_emit.c.  No change to shader-db.

9 years agoi965: Remove unused devinfo revision
Ben Widawsky [Fri, 23 Oct 2015 21:38:39 +0000 (14:38 -0700)]
i965: Remove unused devinfo revision

I left the function to obtain the revision because it is, and will continue to
be useful in the future. I'd rather not have to dig it up every time we need it.
Comments left at the implementation to say as much.

This was accidentally left here when I moved the early platform support:
commit 28ed1e08e8ba98ebd4ff0b56326372f0df9c73ad
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Aug 7 13:58:37 2015 -0700

    i965/skl: Remove early platform support

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agodocs/index.html: fix typo
Fabio Pedretti [Thu, 15 Oct 2015 08:00:23 +0000 (10:00 +0200)]
docs/index.html: fix typo

Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agofreedreno: remove unnecessary null checks
Rob Clark [Fri, 23 Oct 2015 17:37:26 +0000 (13:37 -0400)]
freedreno: remove unnecessary null checks

According to piglit/xonotic/neverball/stc, blend/rasterize/zsa state
will always be bound (never null).  And the null checks were in-
consistent anyways, so remove them.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agoradeonsi: Implement DCC fast clear.
Bas Nieuwenhuizen [Fri, 23 Oct 2015 23:47:45 +0000 (01:47 +0200)]
radeonsi: Implement DCC fast clear.

Uses the DCC buffer instead of the CMASK buffer. The ELIMINATE_FAST_CLEAR
still works. Furthermore, with DCC compression we can directly clear
to a limited set of colors such that we do not need a postprocessing step.

v2 Marek: check dcc_buffer && dirty_level_mask in set_sampler_view

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agogallivm: fix tex offsets with mirror repeat linear
Roland Scheidegger [Thu, 22 Oct 2015 21:58:50 +0000 (23:58 +0200)]
gallivm: fix tex offsets with mirror repeat linear

Can't see why anyone would ever want to use this, but it was clearly broken.
This fixes the piglit texwrap offset test using this combination.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: fix sampling with texture offsets in SoA path
Roland Scheidegger [Thu, 22 Oct 2015 21:49:41 +0000 (23:49 +0200)]
gallivm: fix sampling with texture offsets in SoA path

When using nearest filtering and clamp / clamp to edge wrapping results could
be wrong for negative offsets. Fix this by adding the offset before doing
the conversion to int coords (could also use floor instead of trunc int
conversion but probably more complex on "typical" cpu).

This fixes the piglit texwrap offset failures with this filter/wrap combo
(which only leaves the linear/mirror repeat combination broken).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agosoftpipe: fix using non-zero layer in non-array view from array resource
Roland Scheidegger [Thu, 22 Oct 2015 20:28:28 +0000 (22:28 +0200)]
softpipe: fix using non-zero layer in non-array view from array resource

For vertex/geometry shader sampling, this is the same as for llvmpipe - just
use the original resource target.
For fragment shader sampling though (which does not use first-layer based mip
offsets) adjust the sampling code to use first_layer in the non-array cases.
While here also fix up some code which looked wrong wrt buffer texel fetch
(no piglit change).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agollvmpipe: fix using non-zero layer in non-array view from array resource
Roland Scheidegger [Thu, 22 Oct 2015 20:26:52 +0000 (22:26 +0200)]
llvmpipe: fix using non-zero layer in non-array view from array resource

Just need to use resource target not view target when calculating
first-layer based mip offsets. (This is a gl specific problem since
d3d10 does not distinguish between non-array and array resources neither
at the resource nor view level, only at the shader level.)
Fixes new piglit arb_texture_view sampling-2d-array-as-2d-layer test.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoradeonsi: add Stoney to si_init_gs_info()
Alex Deucher [Fri, 23 Oct 2015 22:31:57 +0000 (18:31 -0400)]
radeonsi: add Stoney to si_init_gs_info()

This patch was originally written before stoney support
was merged.  Add stoney.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoradeonsi: Enable DCC.
Bas Nieuwenhuizen [Tue, 20 Oct 2015 22:10:39 +0000 (00:10 +0200)]
radeonsi: Enable DCC.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeonsi: Add FLUSH_AND_INV_CB_DATA_TS for DCC.
Bas Nieuwenhuizen [Tue, 20 Oct 2015 22:10:38 +0000 (00:10 +0200)]
radeonsi: Add FLUSH_AND_INV_CB_DATA_TS for DCC.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeonsi: Disable operations that do not work with DCC.
Bas Nieuwenhuizen [Tue, 20 Oct 2015 22:10:37 +0000 (00:10 +0200)]
radeonsi: Disable operations that do not work with DCC.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeonsi: Allocate buffers for DCC.
Bas Nieuwenhuizen [Tue, 20 Oct 2015 22:10:36 +0000 (00:10 +0200)]
radeonsi: Allocate buffers for DCC.

As the alignment requirements can be 32 KiB or more, also adding
an aligned buffer creation function.

DCC is disabled for textures that can be shared as sharing the
DCC buffers has not been implemented yet.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeonsi: only apply the SNORM blit workaround to *8_SNORM
Marek Olšák [Thu, 22 Oct 2015 21:36:11 +0000 (23:36 +0200)]
radeonsi: only apply the SNORM blit workaround to *8_SNORM

Like the comment says. This fixes DCC, which doesn't like blitting RG16
as RGBA8.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoutil/format: add helper util_format_is_snorm8
Marek Olšák [Thu, 22 Oct 2015 21:32:16 +0000 (23:32 +0200)]
util/format: add helper util_format_is_snorm8

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add another requirement for PARTIAL_ES_WAVE
Marek Olšák [Mon, 19 Oct 2015 00:45:56 +0000 (02:45 +0200)]
radeonsi: add another requirement for PARTIAL_ES_WAVE

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: merge two ifs setting WD_SWITCH_ON_EOP
Marek Olšák [Sun, 18 Oct 2015 20:22:22 +0000 (22:22 +0200)]
radeonsi: merge two ifs setting WD_SWITCH_ON_EOP

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: make PARTIAL_ES_WAVE globally dependent on SWITCH_ON_EOI
Marek Olšák [Sun, 18 Oct 2015 20:17:04 +0000 (22:17 +0200)]
radeonsi: make PARTIAL_ES_WAVE globally dependent on SWITCH_ON_EOI

This catches the other cases that enable SWITCH_ON_EOI.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add one more SWITCH_ON_EOI requirement for Hawaii and VI
Marek Olšák [Sun, 18 Oct 2015 20:07:01 +0000 (22:07 +0200)]
radeonsi: add one more SWITCH_ON_EOI requirement for Hawaii and VI

The VI condition depends on geometry shaders and MAX_PRIMGRP_IN_WAVE.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: only apply the instancing bug workaround to Bonaire
Marek Olšák [Sun, 18 Oct 2015 19:51:41 +0000 (21:51 +0200)]
radeonsi: only apply the instancing bug workaround to Bonaire

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add SWITCH_ON_EOI requirement for 4 SE parts
Marek Olšák [Sun, 18 Oct 2015 19:43:30 +0000 (21:43 +0200)]
radeonsi: add SWITCH_ON_EOI requirement for 4 SE parts

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove unnecessary PARTIAL_VS_WAVE setting for streamout
Marek Olšák [Sun, 18 Oct 2015 19:28:54 +0000 (21:28 +0200)]
radeonsi: remove unnecessary PARTIAL_VS_WAVE setting for streamout

hardware does this automatically

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: allow unbinding vertex shaders
Marek Olšák [Thu, 22 Oct 2015 19:32:23 +0000 (21:32 +0200)]
radeonsi: allow unbinding vertex shaders

Draw calls without a vertex shader are skipped.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: allow unbinding pixel shaders and remove the dummy shader
Marek Olšák [Thu, 22 Oct 2015 20:19:34 +0000 (22:19 +0200)]
radeonsi: allow unbinding pixel shaders and remove the dummy shader

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add draw_vbo check for a NULL pixel shader
Marek Olšák [Thu, 22 Oct 2015 20:18:49 +0000 (22:18 +0200)]
radeonsi: add draw_vbo check for a NULL pixel shader

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add checks for a NULL pixel shader
Marek Olšák [Thu, 22 Oct 2015 20:17:28 +0000 (22:17 +0200)]
radeonsi: add checks for a NULL pixel shader

This will allow removing the dummy PS.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/util: add a test for NULL fragment shaders
Marek Olšák [Thu, 22 Oct 2015 20:14:53 +0000 (22:14 +0200)]
gallium/util: add a test for NULL fragment shaders

Just to validate that radeonsi doesn't crash.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agost/mesa: don't load state parameters if there are none
Marek Olšák [Thu, 22 Oct 2015 17:46:07 +0000 (19:46 +0200)]
st/mesa: don't load state parameters if there are none

Out of 7063 shaders from my shader-db:
- 6564 (93%) shaders don't have any state parameters.
- 347 (5%) shaders have 1 state parameter for WPOS lowering.
- The remaining 2% have more state parameters, usually matrices.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoradeonsi: add Stoney pci ids
Samuel Li [Thu, 22 Oct 2015 16:06:43 +0000 (12:06 -0400)]
radeonsi: add Stoney pci ids

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Samuel Li <samuel.li@amd.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agoradeonsi: add support for Stoney asics (v3)
Samuel Li [Fri, 21 Aug 2015 19:35:46 +0000 (15:35 -0400)]
radeonsi: add support for Stoney asics (v3)

v2 (agd): rebase on mesa master, split pci ids to
separate commit
v3 (agd): use carrizo for llvm processor name for
llvm 3.7 and older

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Samuel Li <samuel.li@amd.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agonvc0: respect edgeflag attribute width
Ilia Mirkin [Fri, 23 Oct 2015 06:14:31 +0000 (02:14 -0400)]
nvc0: respect edgeflag attribute width

The edgeflag comes in as ubyte with glEdgeFlagPointer but as float with
plain immediate glEdgeFlag. Avoid reading bytes that weren't meant for
the edgeflag in the pointer case.

Fixes intermittent failures with gl-2.0-edgeflag piglit (and valgrind
complaints about reading uninitialized memory).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
9 years agogallivm: Explicitly disable unsupported CPU features.
Jose Fonseca [Fri, 23 Oct 2015 10:40:25 +0000 (11:40 +0100)]
gallivm: Explicitly disable unsupported CPU features.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92214
CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agovc4: Convert blending to being done in 4x8 unorm normally.
Eric Anholt [Wed, 19 Aug 2015 16:38:14 +0000 (09:38 -0700)]
vc4: Convert blending to being done in 4x8 unorm normally.

We can't do this all the time, because you want blending to be done in
linear space, and sRGB would lose too much precision being done in 4x8.
The win on instructions is pretty huge when you can, though.

total uniforms in shared programs: 32065 -> 32168 (0.32%)
uniforms in affected programs:     327 -> 430 (31.50%)
total instructions in shared programs: 92644 -> 89830 (-3.04%)
instructions in affected programs:     15580 -> 12766 (-18.06%)

Improves openarena performance at 1920x1080 from 10.7fps to 11.2fps.

9 years agovc4: Add QIR/QPU support for the 8-bit vector instructions.
Eric Anholt [Fri, 9 Jan 2015 02:07:15 +0000 (18:07 -0800)]
vc4: Add QIR/QPU support for the 8-bit vector instructions.

9 years agovc4: Don't try to CSE non-SSA instructions.
Eric Anholt [Fri, 23 Oct 2015 15:34:01 +0000 (16:34 +0100)]
vc4: Don't try to CSE non-SSA instructions.

This can happen when we're doing destination packing -- we don't know
what's in the rest of the register.

Signed-off-by: Eric Anholt <eric@anholt.net>
9 years agonir: Add opcodes for saturated vector math.
Eric Anholt [Wed, 19 Aug 2015 05:38:34 +0000 (22:38 -0700)]
nir: Add opcodes for saturated vector math.

This corresponds to instructions used on vc4 for its blending inside of
shaders.  I've seen these opcodes on other architectures before, but I
think it's the first time these are needed in Mesa.

v2: Rename to 'u' instead of 'i', since they're all 'u'norm (from review
    by jekstrand)

9 years agovc4: Add dumping of VC4_PACKET_GL_INDEXED_PRIMITIVE.
Eric Anholt [Fri, 23 Oct 2015 14:26:12 +0000 (15:26 +0100)]
vc4: Add dumping of VC4_PACKET_GL_INDEXED_PRIMITIVE.

9 years agovc4: Add a workaround for HW-2116 (state counter wrap fails).
Eric Anholt [Fri, 23 Oct 2015 13:43:41 +0000 (14:43 +0100)]
vc4: Add a workaround for HW-2116 (state counter wrap fails).

I haven't proven that this happens (I've got other GPU hangs in the
way), but the closed driver also does this and it's documented as an
errata.

9 years agovc4: Fix missing \n in a perf_debug().
Eric Anholt [Fri, 23 Oct 2015 13:41:47 +0000 (14:41 +0100)]
vc4: Fix missing \n in a perf_debug().

9 years agoi965/fs: Allow copy propagating into new surface access opcodes
Kristian Høgsberg Kristensen [Wed, 21 Oct 2015 06:22:27 +0000 (23:22 -0700)]
i965/fs: Allow copy propagating into new surface access opcodes

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/fs: Optimize ssbo stores
Kristian Høgsberg Kristensen [Thu, 22 Oct 2015 06:43:34 +0000 (23:43 -0700)]
i965/fs: Optimize ssbo stores

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Write groups of enabled components together.

Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/fs: Drop offset_reg temporary in ssbo load
Kristian Høgsberg Kristensen [Thu, 22 Oct 2015 05:49:14 +0000 (22:49 -0700)]
i965/fs: Drop offset_reg temporary in ssbo load

Now that we don't read each component one-by-one, we don't need the
temoprary vgrf for the offset. More importantly, this register was type
UD while the nir source was type D. This broke copy propagation and left
a redundant MOV in the generated code.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/fs: Avoid scalar destinations in emit_uniformize()
Kristian Høgsberg Kristensen [Wed, 21 Oct 2015 06:31:49 +0000 (23:31 -0700)]
i965/fs: Avoid scalar destinations in emit_uniformize()

The scalar destination registers break copy propagation. Instead compute
the results to a regular register and then reference a component when we
later use the result as a source.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/fs: Don't uniformize surface index twice
Kristian Høgsberg Kristensen [Wed, 21 Oct 2015 06:16:51 +0000 (23:16 -0700)]
i965/fs: Don't uniformize surface index twice

The emit_untyped_read and emit_untyped_write helpers already uniformize
the surface index argument. No need to do it before calling them.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>