mesa.git
8 years agonir/spirv/alu: Properly implement mod/rem
Jason Ekstrand [Wed, 13 Jan 2016 23:09:45 +0000 (15:09 -0800)]
nir/spirv/alu: Properly implement mod/rem

8 years agoi965: Implement nir_op_irem and nir_op_srem
Jason Ekstrand [Wed, 13 Jan 2016 23:09:00 +0000 (15:09 -0800)]
i965: Implement nir_op_irem and nir_op_srem

8 years agonir: Add more modulus and remainder opcodes
Jason Ekstrand [Wed, 13 Jan 2016 23:05:39 +0000 (15:05 -0800)]
nir: Add more modulus and remainder opcodes

SPIR-V makes a distinction between "modulus" and "remainder" for both
floating-point and signed integer variants.  The difference is primarily
one of which source they take their sign from.  The "remainder" opcode for
integers is equivalent to the C/C++ "%" operation while the "modulus"
opcode is more mathematically correct (at least for an unsigned divisor).
This commit adds corresponding opcodes to NIR.

8 years agonir/spirv: Add support for OpSpecConstantOp
Jason Ekstrand [Wed, 13 Jan 2016 04:02:04 +0000 (20:02 -0800)]
nir/spirv: Add support for OpSpecConstantOp

8 years agonir/spirv/alu: Factor out the opcode table
Jason Ekstrand [Wed, 13 Jan 2016 01:16:48 +0000 (17:16 -0800)]
nir/spirv/alu: Factor out the opcode table

8 years agoanv/pipeline: Pass through specialization constants
Jason Ekstrand [Wed, 13 Jan 2016 00:30:43 +0000 (16:30 -0800)]
anv/pipeline: Pass through specialization constants

8 years agonir/spirv: Add initial support for specialization constants
Jason Ekstrand [Wed, 13 Jan 2016 00:28:28 +0000 (16:28 -0800)]
nir/spirv: Add initial support for specialization constants

8 years agonir/spirv: Add support for OpQuantize
Jason Ekstrand [Tue, 12 Jan 2016 23:36:38 +0000 (15:36 -0800)]
nir/spirv: Add support for OpQuantize

8 years agoi965: Implement nir_op_fquantize2f16
Jason Ekstrand [Tue, 12 Jan 2016 23:35:00 +0000 (15:35 -0800)]
i965: Implement nir_op_fquantize2f16

8 years agonir: Add a fquantize2f16 opcode
Jason Ekstrand [Tue, 12 Jan 2016 23:32:51 +0000 (15:32 -0800)]
nir: Add a fquantize2f16 opcode

This opcode simply takes a 32-bit floating-point value and reduces its
effective precision to 16 bits.

8 years agoanv/device: Bump the max program size again
Jason Ekstrand [Tue, 12 Jan 2016 21:48:32 +0000 (13:48 -0800)]
anv/device: Bump the max program size again

No one will ever need more than 128K, right?

8 years agovk: Implement workaround for occlusion queries
Kristian Høgsberg Kristensen [Tue, 12 Jan 2016 19:46:09 +0000 (11:46 -0800)]
vk: Implement workaround for occlusion queries

We have an issue with occlusion queries (PIPE_CONTROL depth writes)
after using the pipeline with the VS disabled. We work around it by
using a depth cache flush PIPE_CONTROL before doing a depth write.

Fixes dEQP-VK.query_pool.*

8 years agoanv/UpdateDescriptorSets: Respect write.dstArrayElement
Jason Ekstrand [Tue, 12 Jan 2016 19:43:48 +0000 (11:43 -0800)]
anv/UpdateDescriptorSets: Respect write.dstArrayElement

8 years agoMerge ../mesa into vulkan
Kristian Høgsberg Kristensen [Tue, 12 Jan 2016 18:54:26 +0000 (10:54 -0800)]
Merge ../mesa into vulkan

Merge master again to get the brw_device_info with the
correct slice counts for KBL.

8 years agovk: Support SpvBuiltInViewportIndex
Kristian Høgsberg Kristensen [Mon, 11 Jan 2016 20:29:42 +0000 (12:29 -0800)]
vk: Support SpvBuiltInViewportIndex

8 years agovk: Use the correct stride for CC_VIEWPORT structs
Kristian Høgsberg Kristensen [Mon, 11 Jan 2016 20:27:51 +0000 (12:27 -0800)]
vk: Use the correct stride for CC_VIEWPORT structs

8 years agost/omx: Avoid segfault in deconstructor if constructor fails
Tom St Denis [Tue, 3 Nov 2015 17:41:54 +0000 (12:41 -0500)]
st/omx: Avoid segfault in deconstructor if constructor fails

If the constructor fails before the LIST_INIT calls the pointers
will be null and the deconstructor will segfault.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agovl: use preferred format for deinterlacing
Christian König [Wed, 16 Dec 2015 13:19:41 +0000 (14:19 +0100)]
vl: use preferred format for deinterlacing

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agovl: improve motion adaptive deinterlacer
Christian König [Tue, 15 Dec 2015 20:21:50 +0000 (21:21 +0100)]
vl: improve motion adaptive deinterlacer

Handle other formats than YV12 as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/va: add BOB deinterlacing v2
Christian König [Tue, 8 Dec 2015 12:18:43 +0000 (13:18 +0100)]
st/va: add BOB deinterlacing v2

Tested with MPV.

v2: correctly handle compositor deinterlacing as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/va: add NV12 -> NV12 post processing v2
Christian König [Mon, 7 Dec 2015 15:40:29 +0000 (16:40 +0100)]
st/va: add NV12 -> NV12 post processing v2

Usefull for mpv and GStreamer.

v2: use common functionality for size adjustment.

Signed-off-by: Indrajit-kumar Das <Indrajit-kumar.Das@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/va: use vl_video_buffer_adjust_size
Christian König [Wed, 16 Dec 2015 20:11:17 +0000 (21:11 +0100)]
st/va: use vl_video_buffer_adjust_size

Use the new helper function instead of open coding it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/vdpau: use vl_video_buffer_adjust_size
Christian König [Tue, 15 Dec 2015 10:53:48 +0000 (11:53 +0100)]
st/vdpau: use vl_video_buffer_adjust_size

Use the new helper function instead of open coding it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agovl/buffers: extract vl_video_buffer_adjust_size helper
Christian König [Tue, 15 Dec 2015 10:51:44 +0000 (11:51 +0100)]
vl/buffers: extract vl_video_buffer_adjust_size helper

Useful for the state trackers as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agost/va: make the implementation thread safe v2
Christian König [Wed, 16 Dec 2015 19:58:49 +0000 (20:58 +0100)]
st/va: make the implementation thread safe v2

Otherwise we might crash with MPV.

v2: minor cleanups suggested on the list.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Julien Isorce <j.isorce@samsung.com>
Tested-by: Julien Isorce <j.isorce@samsung.com>
8 years agonir/spirv: Allow non-block variables with interface types in lists
Jason Ekstrand [Tue, 12 Jan 2016 09:31:10 +0000 (01:31 -0800)]
nir/spirv: Allow non-block variables with interface types in lists

The original objective was to disallow UBO and SSBO variables from the
variable lists.  This was accidentally broken in b208620fd when fixing some
other interface issues.

8 years agonir/spirv: Handle matrix decorations on arrays of matrices
Jason Ekstrand [Tue, 12 Jan 2016 09:04:41 +0000 (01:04 -0800)]
nir/spirv: Handle matrix decorations on arrays of matrices

Connor's original shallow-copy plan works great except that a couple of the
decorations apply to a matrix which may be some levels down in an array.
We weren't properly unpacking that.  This fixes most of the remaining SSBO
and UBO layout tests.

8 years agomesa: use gl_shader_variable in program resource list
Tapani Pälli [Tue, 12 Jan 2016 06:52:12 +0000 (08:52 +0200)]
mesa: use gl_shader_variable in program resource list

Patch changes linker to allocate gl_shader_variable instead of using
ir_variable. This makes it possible to get rid of ir_variables and ir
in memory after linking.

v2: check that we do not create duplicate entries with
    packed varyings

v3: document 'patch' bit (Ilia Mirkin)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglsl: track total amount of uniform locations used
Tapani Pälli [Fri, 8 Jan 2016 06:20:25 +0000 (08:20 +0200)]
glsl: track total amount of uniform locations used

Linker missed a check for situation where we exceed max amount of
uniform locations with explicit + implicit locations. Patch adds this
check to already existing iteration over uniforms in linker.

Fixes following CTS test:
   ES31-CTS.explicit_uniform_location.uniform-loc-negative-link-max-num-of-locations

v2: use var->type->uniform_locations() (Timothy)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agonir/spirv: Allow creating local/global variables from interface types
Jason Ekstrand [Tue, 12 Jan 2016 01:45:52 +0000 (17:45 -0800)]
nir/spirv: Allow creating local/global variables from interface types

Not sure if this is actually allowed, but it's not that hard to just strip
the interface information from the type.

8 years agonir/spirv: Allow base derefs in get_vulkan_resource_index
Jason Ekstrand [Tue, 12 Jan 2016 01:45:24 +0000 (17:45 -0800)]
nir/spirv: Allow base derefs in get_vulkan_resource_index

8 years agonir/spirv: Allow OpBranchConditional without a merge
Jason Ekstrand [Tue, 12 Jan 2016 01:03:50 +0000 (17:03 -0800)]
nir/spirv: Allow OpBranchConditional without a merge

This can happen if you have a predicated break/continue.

8 years agonir/spirv/cfg: Allow breaking from the continue block
Jason Ekstrand [Tue, 12 Jan 2016 01:03:16 +0000 (17:03 -0800)]
nir/spirv/cfg: Allow breaking from the continue block

8 years agonir/spirv: Stop wrapping carry/borrow in b2i
Jason Ekstrand [Tue, 12 Jan 2016 01:02:27 +0000 (17:02 -0800)]
nir/spirv: Stop wrapping carry/borrow in b2i

The upstream versions now return an integer like GLSL/SPIR-V want.

8 years agonir/spirv: Better handle OpCopyMemory
Jason Ekstrand [Tue, 12 Jan 2016 00:29:38 +0000 (16:29 -0800)]
nir/spirv: Better handle OpCopyMemory

8 years agonir/spirv: Add no-op support for OpSourceContinued
Jason Ekstrand [Tue, 12 Jan 2016 00:06:06 +0000 (16:06 -0800)]
nir/spirv: Add no-op support for OpSourceContinued

8 years agomain: get rid of needless conditional
Erik Faye-Lund [Wed, 16 Dec 2015 16:09:50 +0000 (17:09 +0100)]
main: get rid of needless conditional

We already check if the driver changed the completeness, we don't
need to duplicate that check. Let's just early out there instead.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agogallium/util: removed unused header-file
Erik Faye-Lund [Wed, 16 Dec 2015 16:09:49 +0000 (17:09 +0100)]
gallium/util: removed unused header-file

This hasn't been in use since c476305 ("gallium/util: pregenerate
half float tables"), where the last bit of run-time init using this
was killed. So let's just get rid of the pointless header.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agonvc0: do not force re-binding of compute constbufs on Fermi
Samuel Pitoiset [Mon, 11 Jan 2016 23:31:11 +0000 (00:31 +0100)]
nvc0: do not force re-binding of compute constbufs on Fermi

Re-binding compute constant buffers after launching a grid have no effects
because they are not currently validated and because dirty_cp is not updated
accordingly. This might also prevent weird future behaviours when UBOs will
be bound for compute.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agometa: Unconditionally set GL_SKIP_DECODE_EXT
Ian Romanick [Tue, 10 Nov 2015 23:18:54 +0000 (15:18 -0800)]
meta: Unconditionally set GL_SKIP_DECODE_EXT

The path that depends on this will be avoided (by fallback_required) if
the extension is not supported.  _mesa_set_sampler_srgb_decode does not
generate GL errors (by design), so there are no problems there.

I kept this change separate and last because it is one of the few in the
series that is not a candidate for the stable branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa: Only bind the sampler in one place
Ian Romanick [Tue, 10 Nov 2015 23:16:33 +0000 (15:16 -0800)]
meta: Only bind the sampler in one place

All of the calls after the first _mesa_bind_sampler call are DSA style
calls that don't depend on the current binding.

I kept this change separate and last because it is one of the few in the
series that is not a candidate for the stable branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/decompress: Don't pollute the sampler object namespace
Ian Romanick [Wed, 11 Nov 2015 00:33:02 +0000 (16:33 -0800)]
meta/decompress: Don't pollute the sampler object namespace

tl;dr: For many types of GL object, we can *NEVER* use the Gen function.

In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions.  The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.

Here's the problem scenario:

 - Application calls a meta function that generates a name.  The first
   Gen will probably return 1.

 - Application decides to use the same name for an object of the same
   type without calling Gen.  Many demo programs use names 1, 2, 3,
   etc. without calling Gen.

 - Application calls the meta function again, and the meta function
   replaces the data.  The application's data is lost, and the app
   fails.  Have fun debugging that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/decompress: Save and restore the sampler using gl_sampler_object instead of...
Ian Romanick [Wed, 11 Nov 2015 19:01:46 +0000 (11:01 -0800)]
meta/decompress: Save and restore the sampler using gl_sampler_object instead of GL API object handle

Some meta operations can be called recursively.  Future changes (the
"Don't pollute the ... namespace" changes) will cause objects with
invalid names to be used.  If a nested meta operation tries to restore
an object named 0xDEADBEEF, it will fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/decompress: Track sampler using gl_sampler_object instead of GL API object handle
Ian Romanick [Wed, 11 Nov 2015 00:26:38 +0000 (16:26 -0800)]
meta/decompress: Track sampler using gl_sampler_object instead of GL API object handle

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/decompress: Use internal functions for sampler object access
Ian Romanick [Tue, 10 Nov 2015 23:33:20 +0000 (15:33 -0800)]
meta/decompress: Use internal functions for sampler object access

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/generate_mipmap: Don't pollute the sampler object namespace
Ian Romanick [Tue, 10 Nov 2015 23:12:13 +0000 (15:12 -0800)]
meta/generate_mipmap: Don't pollute the sampler object namespace

tl;dr: For many types of GL object, we can *NEVER* use the Gen function.

In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions.  The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.

Here's the problem scenario:

 - Application calls a meta function that generates a name.  The first
   Gen will probably return 1.

 - Application decides to use the same name for an object of the same
   type without calling Gen.  Many demo programs use names 1, 2, 3,
   etc. without calling Gen.

 - Application calls the meta function again, and the meta function
   replaces the data.  The application's data is lost, and the app
   fails.  Have fun debugging that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/generate_mipmap: Save and restore the sampler using gl_sampler_object instead...
Ian Romanick [Wed, 11 Nov 2015 05:33:52 +0000 (21:33 -0800)]
meta/generate_mipmap: Save and restore the sampler using gl_sampler_object instead of GL API object handle

Some meta operations can be called recursively.  Future changes (the
"Don't pollute the ... namespace" changes) will cause objects with
invalid names to be used.  If a nested meta operation tries to restore
an object named 0xDEADBEEF, it will fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/generate_mipmap: Track sampler using gl_sampler_object instead of GL API object...
Ian Romanick [Tue, 10 Nov 2015 23:06:04 +0000 (15:06 -0800)]
meta/generate_mipmap: Track sampler using gl_sampler_object instead of GL API object handle

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/generate_mipmap: Use internal functions for sampler object access
Ian Romanick [Tue, 10 Nov 2015 03:22:25 +0000 (19:22 -0800)]
meta/generate_mipmap: Use internal functions for sampler object access

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/blit: Don't pollute the sampler object namespace in _mesa_meta_setup_sampler
Ian Romanick [Tue, 10 Nov 2015 03:10:48 +0000 (19:10 -0800)]
meta/blit: Don't pollute the sampler object namespace in _mesa_meta_setup_sampler

tl;dr: For many types of GL object, we can *NEVER* use the Gen function.

In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions.  The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.

Here's the problem scenario:

 - Application calls a meta function that generates a name.  The first
   Gen will probably return 1.

 - Application decides to use the same name for an object of the same
   type without calling Gen.  Many demo programs use names 1, 2, 3,
   etc. without calling Gen.

 - Application calls the meta function again, and the meta function
   replaces the data.  The application's data is lost, and the app
   fails.  Have fun debugging that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/blit: Save and restore the sampler using gl_sampler_object instead of GL API...
Ian Romanick [Wed, 11 Nov 2015 02:46:12 +0000 (18:46 -0800)]
meta/blit: Save and restore the sampler using gl_sampler_object instead of GL API object handle

Some meta operations can be called recursively.  Future changes (the
"Don't pollute the ... namespace" changes) will cause objects with
invalid names to be used.  If a nested meta operation tries to restore
an object named 0xDEADBEEF, it will fail.

v2: Add a comment explaining why samp_obj_save is set to NULL in
_mesa_meta_fb_tex_blit_begin.  This came out of review feedback from
Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/blit: Use internal functions for sampler object access
Ian Romanick [Mon, 9 Nov 2015 20:41:47 +0000 (12:41 -0800)]
meta/blit: Use internal functions for sampler object access

This requires tracking the sampler object using the gl_sampler_object*
instead of the object name.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/blit: Group the SamplerParameteri calls with the other sampler operations
Ian Romanick [Mon, 9 Nov 2015 19:39:15 +0000 (11:39 -0800)]
meta/blit: Group the SamplerParameteri calls with the other sampler operations

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agomesa: Refator _mesa_BindSampler to make _mesa_bind_sampler
Ian Romanick [Tue, 10 Nov 2015 03:02:21 +0000 (19:02 -0800)]
mesa: Refator _mesa_BindSampler to make _mesa_bind_sampler

Pulls the parts of _mesa_BindSampler that aren't just parameter
validation out into a function that can be called from other parts of
Mesa (e.g., meta).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agomesa: Add _mesa_set_sampler_srgb_decode method
Ian Romanick [Mon, 9 Nov 2015 20:16:58 +0000 (12:16 -0800)]
mesa: Add _mesa_set_sampler_srgb_decode method

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agomesa: Add _mesa_set_sampler_filters method
Ian Romanick [Mon, 9 Nov 2015 19:59:19 +0000 (11:59 -0800)]
mesa: Add _mesa_set_sampler_filters method

v2: Add filter enum assertions.  Suggested by Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agomesa: Add _mesa_set_sampler_wrap method
Ian Romanick [Mon, 9 Nov 2015 19:55:59 +0000 (11:55 -0800)]
mesa: Add _mesa_set_sampler_wrap method

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agonir/spirv/cfg: Handle unreachable instructions
Jason Ekstrand [Mon, 11 Jan 2016 23:35:15 +0000 (15:35 -0800)]
nir/spirv/cfg: Handle unreachable instructions

8 years agonir/vars_to_ssa: Add phi sources for unreachable predecessors
Jason Ekstrand [Mon, 11 Jan 2016 23:33:41 +0000 (15:33 -0800)]
nir/vars_to_ssa: Add phi sources for unreachable predecessors

It is possible to end up with unreachable blocks if, for instance, you have
an "if (...) { break; } else { continue; } unreachable()".  In this case,
the unreachable block does not show up in the dominance tree so it never
gets visited.  Instead, we go and visit all of those in follow-on pass.

8 years agonvc0: remove useless goto in nvc0_launch_grid()
Samuel Pitoiset [Mon, 11 Jan 2016 23:11:06 +0000 (00:11 +0100)]
nvc0: remove useless goto in nvc0_launch_grid()

Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa: Mark Identity as const
Ian Romanick [Thu, 7 Jan 2016 23:10:16 +0000 (15:10 -0800)]
mesa: Mark Identity as const

I was going to send this as review for dce1e1a8, but I missed that
window.  This saves 64 bytes of unshared data and prelaces it with 96
bytes shared text.  My guess is that some of the calls to memcpy get
optimized to something else.

   text    data     bss     dec     hex filename
7847613  220208   27432 8095253  7b8615 i965_dri.so before
7847709  220144   27432 8095285  7b8635 i965_dri.so after

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Brian Paul <brianp@vmware.com>
8 years agonir/spirv: Properly handle OpConstantNull
Jason Ekstrand [Mon, 11 Jan 2016 20:39:32 +0000 (12:39 -0800)]
nir/spirv: Properly handle OpConstantNull

8 years agonir/spirv: Assert that matrix types are valid
Jason Ekstrand [Mon, 11 Jan 2016 20:39:16 +0000 (12:39 -0800)]
nir/spirv: Assert that matrix types are valid

8 years agonir/types: Add an is_error helper
Jason Ekstrand [Mon, 11 Jan 2016 20:39:03 +0000 (12:39 -0800)]
nir/types: Add an is_error helper

8 years agonir/spirv: Handle OpNoLine
Jason Ekstrand [Mon, 11 Jan 2016 20:14:45 +0000 (12:14 -0800)]
nir/spirv: Handle OpNoLine

8 years agoanv/gen7: Remove unheeded helper begin_render_pass()
Chad Versace [Mon, 11 Jan 2016 22:07:35 +0000 (14:07 -0800)]
anv/gen7: Remove unheeded helper begin_render_pass()

The helper didn't help much. It looks like a leftover from past
code-reuse.  Now it's called from exactly one location,
gen7_CmdBeginRenderPass(). So fold it into its caller.

8 years agoconfigure.ac: always define __STDC_CONSTANT_MACROS
Oded Gabbay [Mon, 11 Jan 2016 19:55:15 +0000 (21:55 +0200)]
configure.ac: always define __STDC_CONSTANT_MACROS

The ISO C99 standard (7.18.4) specifies that C++
implementations should define UINT64_C only when
__STDC_CONSTANT_MACROS is defined.

Because we now use UINT64_C in our cpp files (since commit
208bfc493debe0344d0b9cb93975981f14412628), we need to add this define.

This also solves compilation errors with GCC 4.8.x on ppc64le machines.

v2: add this define to SCons build system

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agoi965: Upload 3DSTATE_BINDING_TABLE_POINTERS_HS when !TCS on Gen9+.
Kenneth Graunke [Sun, 10 Jan 2016 23:01:03 +0000 (15:01 -0800)]
i965: Upload 3DSTATE_BINDING_TABLE_POINTERS_HS when !TCS on Gen9+.

Gen9+ requires us to emit 3DSTATE_BINDING_TABLE_POINTERS_HS for the
hull shader push constants to take effect.  The passthrough TCS uses
push constants for the default tessellation levels.  So, when those
change, we need to re-upload the binding table as well.

Fixes five Piglit tests on Skylake:
- spec/arb_tessellation_shader/vs-tes-vertex
- spec/arb_tessellation_shader/vs-tes-tessinner-tessouter-inputs-quads
- spec/arb_tessellation_shader/vs-tes-tessinner-tessouter-inputs-tris
- spec/arb_tessellation_shader/tes-read-texture
- spec/arb_tessellation_shader/tess_with_geometry

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoAdd missing platform information for KBL
Mark Janes [Sat, 9 Jan 2016 00:30:20 +0000 (16:30 -0800)]
Add missing platform information for KBL

In testing KBL, I found:

 - urb size was not set for slices gt1.5, gt2, and gt3.  The value I
   used for these slices (384) was taken from an earlier patch authored
   by Ben Widawsky.

 - slice count was missing.  This field was added by
   a403ad4f5a034e52a3cd845e91c4aa3e6927b731

With this commit, KBL passes piglit at parity with SKL.

Note: As requested by Kristian, Sarah modified this patch to drop
setting urb size for gt1.5, gt2, and gt3, since the correct default is
set in the GEN9 macro by commit c1e38ad37042b0ec261eb0ba5631b7ff0ee7a9da
"i965/skl: Use larger URB size where available."

Signed-off-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Cc: "11.1" <mesa-stable@lists.freedesktop.org>
8 years agoanv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
Jason Ekstrand [Mon, 11 Jan 2016 18:55:57 +0000 (10:55 -0800)]
anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir

While we're at it, we delete any unused variables.  This allows us to prune
variables that are not used in the current stage from the shader.

8 years agoanv/pipeline: Only delete functions for SPIR-V shaders
Jason Ekstrand [Mon, 11 Jan 2016 18:54:26 +0000 (10:54 -0800)]
anv/pipeline: Only delete functions for SPIR-V shaders

We can assume that direct NIR shaders only have one entrypoint

8 years agonir/spirv: Get rid of a bunch of stage asserts
Jason Ekstrand [Mon, 11 Jan 2016 18:33:12 +0000 (10:33 -0800)]
nir/spirv: Get rid of a bunch of stage asserts

Since we may have multiple entrypoints from different stages, we don't know
what stage we are actually in so these asserts are invalid.

8 years agonir/spirv: Take an entrypoint stage as well as a name
Jason Ekstrand [Mon, 11 Jan 2016 18:31:25 +0000 (10:31 -0800)]
nir/spirv: Take an entrypoint stage as well as a name

8 years agonir/dead_variables: Add a a mode parameter
Jason Ekstrand [Mon, 11 Jan 2016 18:27:47 +0000 (10:27 -0800)]
nir/dead_variables: Add a a mode parameter

This allows dead_variables to be used on any type of variable.

8 years agonv50/ir: the whole point of data array is to hand out regular registers
Ilia Mirkin [Mon, 11 Jan 2016 17:58:19 +0000 (12:58 -0500)]
nv50/ir: the whole point of data array is to hand out regular registers

Fixes: 0d3051f75a (nv50/ir: Fix scratch allocation size and file)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa/uniform_query: add IROUNDD and use for doubles->ints (v2)
Dave Airlie [Thu, 15 Oct 2015 04:07:40 +0000 (05:07 +0100)]
mesa/uniform_query: add IROUNDD and use for doubles->ints (v2)

For the case where we convert a double to an int, we should
round the same as we do for floats.

This fixes GL41-CTS.gpu_shader_fp64.state_query

v2: add IROUNDD (Ilia)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: replace unreachable code path with assert
Timothy Arceri [Fri, 8 Jan 2016 04:25:37 +0000 (15:25 +1100)]
glsl: replace unreachable code path with assert

The lower_named_interface_blocks() pass is called before we try
assign locations to varyings so this shouldn't be reachable.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
8 years agoRevert "glsl: replace unreachable code path with assert"
Timothy Arceri [Sun, 10 Jan 2016 22:20:39 +0000 (09:20 +1100)]
Revert "glsl: replace unreachable code path with assert"

This reverts commit 98270fd20d4d58db8ae5af3b6f10ed6a81c058a6.

Something went terribly wrong the commit is not what the commit
message says.

8 years agoglsl: replace unreachable code path with assert
Timothy Arceri [Fri, 8 Jan 2016 04:25:37 +0000 (15:25 +1100)]
glsl: replace unreachable code path with assert

The lower_named_interface_blocks() pass is called before we try
assign locations to varyings so this shouldn't be reachable.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
8 years agoglsl: combine if blocks
Timothy Arceri [Fri, 8 Jan 2016 04:25:36 +0000 (15:25 +1100)]
glsl: combine if blocks

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
8 years agomesa: Update todo regarding StencilOp and StencilOpSeparate.
Rhys Kidd [Thu, 20 Aug 2015 13:03:29 +0000 (23:03 +1000)]
mesa: Update todo regarding StencilOp and StencilOpSeparate.

OpenGL 2.0 function StencilOp() is in part internally implemented via
StencilOpSeparate(). This change happened some time ago, however the
accompanying doxygen todo comment was not accordingly updated.

Replace the outdated portion of this doxygen todo comment, leaving the
remainder unchanged.

Also better respect the 80 character suggested line length in this file.

v2: Fully remove comment, following code review by t_arceri@yahoo.com.au

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoglsl: Make bitfield_insert/extract and bfi/bfm non-vectorizable.
Kenneth Graunke [Thu, 7 Jan 2016 23:45:21 +0000 (15:45 -0800)]
glsl: Make bitfield_insert/extract and bfi/bfm non-vectorizable.

Currently, opt_vectorize() tries to combine:

    result.x = bitfieldInsert(src0.x, src1.x, src2.x, src3.x);
    result.y = bitfieldInsert(src0.y, src1.y, src2.y, src3.y);
    result.z = bitfieldInsert(src0.z, src1.z, src2.z, src3.z);
    result.w = bitfieldInsert(src0.w, src1.w, src2.w, src3.w);

into a single ir_quadop_bitfield_insert opcode, which operates on
ivec4s.  However, GLSL IR's opcodes currently require the bits and
offset parameters to be scalar integers.  So, this breaks.

We want to be able to vectorize this eventually, but for now, just
chicken out and make opt_vectorize() bail by marking all the bitfield
insert/extract related opcodes as horizontal.  This is a relatively
uncommon case today, so we'll do the simple fix for stable branches,
and fix it properly on master.

Fixes assertion failures when compiling Shadow of Mordor vertex shaders
on i965 in vec4 mode (where OptimizeForAOS enables opt_vectorize()).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
8 years agonv50/ir: Fix scratch allocation size and file
Pierre Moreau [Fri, 1 Jan 2016 12:09:42 +0000 (13:09 +0100)]
nv50/ir: Fix scratch allocation size and file

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agovk: Handle uninitialized FS inputs and gl_PrimitiveID
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 09:03:20 +0000 (01:03 -0800)]
vk: Handle uninitialized FS inputs and gl_PrimitiveID

These show up as varying_to_slot[attr] == -1. Instead of storing -1 - 2
in swiz.Attribute[input_index].SourceAttribute, handle it correctly.

8 years agovk: Support reseting timestamp query pools
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 08:51:50 +0000 (00:51 -0800)]
vk: Support reseting timestamp query pools

8 years agovk: Advertise number of timestamp bits
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 08:51:14 +0000 (00:51 -0800)]
vk: Advertise number of timestamp bits

We have 36 bits.

8 years agovk: Expose correct timestampPeriod for SKL
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 08:50:04 +0000 (00:50 -0800)]
vk: Expose correct timestampPeriod for SKL

Skylake uses 83.333ms per tick.

8 years agovk: Mark VkEvent and VkSemaphore as done
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 08:48:41 +0000 (00:48 -0800)]
vk: Mark VkEvent and VkSemaphore as done

8 years agovk: Assert on use of uninitialized surface state
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 07:43:20 +0000 (23:43 -0800)]
vk: Assert on use of uninitialized surface state

This exposes a case where we want to anv_CmdCopyBufferToImage() on an
image that wasn't created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT and
end up using uninitialized color_rt_surface_state from the meta image
view.

8 years agovk: Only begin subpass if we're continuing a render pass
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 06:50:18 +0000 (22:50 -0800)]
vk: Only begin subpass if we're continuing a render pass

If VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not set in
pBeginInfo->flags, we don't have a render pass or framebuffer. Change
the condition that guard looking up render pass and framebuffer to test
for VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT instead of
VK_COMMAND_BUFFER_LEVEL_SECONDARY.

Fixes all remaining crashes in dEQP-VK.api.command_buffers.*.

8 years agovk: Remove unsupported warnings for Skylake and Broxton
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 06:24:58 +0000 (22:24 -0800)]
vk: Remove unsupported warnings for Skylake and Broxton

These are working as well as Broadwell and Cherryiew. The recent merge
from mesa master brings in Kabylake device info and that should be all
we need to enable that.

8 years agoMerge ../mesa into vulkan
Kristian Høgsberg Kristensen [Sat, 9 Jan 2016 06:16:43 +0000 (22:16 -0800)]
Merge ../mesa into vulkan

8 years agoanv/reloc_list: Make valgrind explicitly check relocation data
Jason Ekstrand [Sat, 9 Jan 2016 00:44:54 +0000 (16:44 -0800)]
anv/reloc_list: Make valgrind explicitly check relocation data

8 years agomesa: merge bind_atomic_buffers_{base|range}
Nicolai Hähnle [Wed, 6 Jan 2016 22:30:18 +0000 (17:30 -0500)]
mesa: merge bind_atomic_buffers_{base|range}

Reduced code duplication should make the code more maintainable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: merge bind_shader_storage_buffers_{base|range}
Nicolai Hähnle [Wed, 6 Jan 2016 22:26:14 +0000 (17:26 -0500)]
mesa: merge bind_shader_storage_buffers_{base|range}

Reduced code duplication should make the code more maintainable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: merge bind_uniform_buffers_{base|range}
Nicolai Hähnle [Wed, 6 Jan 2016 22:20:57 +0000 (17:20 -0500)]
mesa: merge bind_uniform_buffers_{base|range}

Reduced code duplication should make the code more maintainable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: merge bind_xfb_buffers_{base|range}
Nicolai Hähnle [Wed, 6 Jan 2016 20:47:01 +0000 (15:47 -0500)]
mesa: merge bind_xfb_buffers_{base|range}

Reduced code duplication should make the code more maintainable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoglsl: Don't add nir files to libglsl_la_SOURCES
Kristian Høgsberg Kristensen [Fri, 8 Jan 2016 23:23:56 +0000 (15:23 -0800)]
glsl: Don't add nir files to libglsl_la_SOURCES

SCons doesn't understand nir yet and doesn't want to compile the glsl to
nir pass. Move the files to their own variable so we can add it only for
automake.

Tested-by: Brian Paul <brianp@vmware.com>
8 years agonir/spirv: Add matrix determinants and inverses
Jason Ekstrand [Sat, 9 Jan 2016 00:02:06 +0000 (16:02 -0800)]
nir/spirv: Add matrix determinants and inverses

8 years agonv50,nvc0: use a face sysval to avoid the useless back-and-forth conversion
Ilia Mirkin [Fri, 8 Jan 2016 22:32:56 +0000 (17:32 -0500)]
nv50,nvc0: use a face sysval to avoid the useless back-and-forth conversion

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>