mesa.git
8 years agoanv: Delete anv_graphics_pipeline_create_info::disable_viewport
Nanley Chery [Mon, 11 Apr 2016 16:57:21 +0000 (09:57 -0700)]
anv: Delete anv_graphics_pipeline_create_info::disable_viewport

There are no users of this field.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agogen{7,8}_pipeline: Always set ViewportXYClipTestEnable
Nanley Chery [Fri, 1 Apr 2016 06:16:12 +0000 (23:16 -0700)]
gen{7,8}_pipeline: Always set ViewportXYClipTestEnable

For the following reasons, there is no behavioural change with this
commit: the ViewportXYClipTest function of the CLIP stage will continue
to be enabled outside of Meta (where disable_viewport is always false),
and the CLIP stage is turned off within Meta, so this function will
continue to be disabled in that case.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agogen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions
Nanley Chery [Thu, 31 Mar 2016 17:04:46 +0000 (10:04 -0700)]
gen{7,8}_pipeline: Apply 3DPRIM_RECTLIST restrictions

According to 3D Primitives Overview in the Bspec, when the RECTLIST
primitive is in use, the CLIP stage should be disabled or set to have
a different Clip Mode, and Viewport Mapping must be disabled:

   Clipping: Must not require clipping or rely on the CLIP unit’s
   ClipTest logic to determine if clipping is required. Either the CLIP
   unit should be DISABLED, or the CLIP unit’s Clip Mode should be set
   to a value other than CLIPMODE_NORMAL.

   Viewport Mapping must be DISABLED (as is typical with the use of
   screen-space coordinates).

We swap out ::disable_viewport for ::use_rectlist, because we currently
always use the RECTLIST primitive when we disable viewport mapping, and
we'll likely continue to use this primitive.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agoanv_cmd_buffer: Don't make the initial state dirty
Nanley Chery [Thu, 7 Apr 2016 09:47:28 +0000 (02:47 -0700)]
anv_cmd_buffer: Don't make the initial state dirty

Avoid excessive state emission. Relevant state for an action command
will get set by the user:

From Chapter 5. Command Buffers,
 When a command buffer begins recording, all state in that command
 buffer is undefined.
 [...]
 Whenever the state of a command buffer is undefined, the application
 must set all relevant state on the command buffer before any state
 dependent commands such as draws and dispatches are recorded, otherwise
 the behavior of executing that command buffer is undefined.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agoanv/meta: Don't set the dynamic state for disabled operations
Nanley Chery [Tue, 29 Mar 2016 20:31:30 +0000 (13:31 -0700)]
anv/meta: Don't set the dynamic state for disabled operations

CmdSet* functions dirty the CommandBuffer's dynamic state. This causes
the new state to be emitted when CmdDraw is called. Since we don't need
the state that would be emitted, don't call the CmdSet* functions.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agoanv/clear: Disable the scissor operation
Nanley Chery [Wed, 6 Apr 2016 22:57:32 +0000 (15:57 -0700)]
anv/clear: Disable the scissor operation

Since the scissor rectangle always matches that of the framebuffer,
this operation isn't needed.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
8 years agoutil: Fix race condition on libgcrypt initialization
Mark Janes [Tue, 12 Apr 2016 18:52:53 +0000 (11:52 -0700)]
util: Fix race condition on libgcrypt initialization

Fixes intermittent Vulkan CTS failures within the test groups:
dEQP-VK.api.object_management.multithreaded_per_thread_device
dEQP-VK.api.object_management.multithreaded_per_thread_resources
dEQP-VK.api.object_management.multithreaded_shared_resources

Signed-off-by: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94904

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agonir/lower_system_values: Simplify the computation of LocalInvocationIndex
Jason Ekstrand [Mon, 11 Apr 2016 06:43:34 +0000 (23:43 -0700)]
nir/lower_system_values: Simplify the computation of LocalInvocationIndex

8 years agoanv/pipeline: Set up flat enables correctly
Jason Ekstrand [Sun, 10 Apr 2016 00:06:59 +0000 (17:06 -0700)]
anv/pipeline: Set up flat enables correctly

8 years agogenxml: Fix the name of a 3DSTATE_SF/SBE field on gen6-7.5
Jason Ekstrand [Sun, 10 Apr 2016 00:02:21 +0000 (17:02 -0700)]
genxml: Fix the name of a 3DSTATE_SF/SBE field on gen6-7.5

8 years agogenxml: Break output detail of 3DSTATE_SF on gen7 into a struct
Jason Ekstrand [Sun, 10 Apr 2016 00:00:19 +0000 (17:00 -0700)]
genxml: Break output detail of 3DSTATE_SF on gen7 into a struct

This makes it work like 3DSTATE_SBE[_SWIZ] on gen7+

8 years agogenxml: Fix up MOCS in RENDER_SURFACE_STATE on gen6 to match gen7
Jason Ekstrand [Sat, 9 Apr 2016 23:59:04 +0000 (16:59 -0700)]
genxml: Fix up MOCS in RENDER_SURFACE_STATE on gen6 to match gen7

8 years agoanv/meta: Make clflushes conditional on !devinfo->has_llc
Jason Ekstrand [Sat, 9 Apr 2016 00:07:49 +0000 (17:07 -0700)]
anv/meta: Make clflushes conditional on !devinfo->has_llc

8 years agoanv/formats: Advertise blit support for stencil
Jason Ekstrand [Thu, 31 Mar 2016 00:43:44 +0000 (17:43 -0700)]
anv/formats: Advertise blit support for stencil

Thanks to advances in the blit code, we can do this now.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Add support for W-tiled destinations
Jason Ekstrand [Thu, 31 Mar 2016 03:31:25 +0000 (20:31 -0700)]
anv/blit2d: Add support for W-tiled destinations

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoisl/surface_state: Set the correct pitch for W-tiled surfaces
Jason Ekstrand [Fri, 1 Apr 2016 01:38:21 +0000 (18:38 -0700)]
isl/surface_state: Set the correct pitch for W-tiled surfaces

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Add another passthrough varying to the VS
Jason Ekstrand [Thu, 31 Mar 2016 22:27:30 +0000 (15:27 -0700)]
anv/blit2d: Add another passthrough varying to the VS

We need the VS to provide some setup data for other stages.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/image: Remove the offset parameter from image_view_init
Jason Ekstrand [Thu, 31 Mar 2016 16:32:05 +0000 (09:32 -0700)]
anv/image: Remove the offset parameter from image_view_init

The only place we were using this was in meta_blit2d which always creates a
new image anyway so we can just use the image offset.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Add a bind_dst helper function
Jason Ekstrand [Thu, 31 Mar 2016 16:27:42 +0000 (09:27 -0700)]
anv/blit2d: Add a bind_dst helper function

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Simplify create_iview
Jason Ekstrand [Thu, 31 Mar 2016 16:14:57 +0000 (09:14 -0700)]
anv/blit2d: Simplify create_iview

Now it just creates the image and view.  The caller is responsible for
handling the offset calculations.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agonir/gather_info: Handle discard_if
Jason Ekstrand [Thu, 31 Mar 2016 03:37:18 +0000 (20:37 -0700)]
nir/gather_info: Handle discard_if

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/meta2d: Add support for blitting from W-tiled sources on gen7
Jason Ekstrand [Mon, 28 Mar 2016 23:52:56 +0000 (16:52 -0700)]
anv/meta2d: Add support for blitting from W-tiled sources on gen7

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
8 years agoisl: Remove surf_get_intratile_offset_el
Jason Ekstrand [Wed, 30 Mar 2016 23:23:02 +0000 (16:23 -0700)]
isl: Remove surf_get_intratile_offset_el

The intratile offset may not be a multiple of the element size so this
calculation is invalid.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoisl: Rework the get_intratile_offset function
Jason Ekstrand [Wed, 30 Mar 2016 23:15:54 +0000 (16:15 -0700)]
isl: Rework the get_intratile_offset function

The old function tried to work in elements which isn't, strictly speaking,
a valid thing to do.  In the case of a non-power-of-two format, there is no
guarantee that the x offset into the tile is a multiple of the format
block size.  This commit refactors it to work entirely in terms of a tiling
(not a surface) and bytes/rows.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/image: Expose the guts of CreateBufferView for meta
Jason Ekstrand [Wed, 30 Mar 2016 22:20:11 +0000 (15:20 -0700)]
anv/image: Expose the guts of CreateBufferView for meta

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Refactor in preparation for different src/dst types
Jason Ekstrand [Wed, 30 Mar 2016 22:03:34 +0000 (15:03 -0700)]
anv/blit2d: Refactor in preparation for different src/dst types

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Add layouts for using a texel buffer source
Jason Ekstrand [Wed, 30 Mar 2016 20:54:56 +0000 (13:54 -0700)]
anv/blit2d: Add layouts for using a texel buffer source

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Rename the descriptor set and pipeline layouts
Jason Ekstrand [Wed, 30 Mar 2016 20:51:21 +0000 (13:51 -0700)]
anv/blit2d: Rename the descriptor set and pipeline layouts

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Enhance teardown and clean up init error paths
Jason Ekstrand [Wed, 30 Mar 2016 20:47:41 +0000 (13:47 -0700)]
anv/blit2d: Enhance teardown and clean up init error paths

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Factor binding the source image into a helper
Jason Ekstrand [Wed, 30 Mar 2016 20:32:08 +0000 (13:32 -0700)]
anv/blit2d: Factor binding the source image into a helper

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Inline meta_emit_blit2d
Jason Ekstrand [Wed, 30 Mar 2016 18:51:50 +0000 (11:51 -0700)]
anv/blit2d: Inline meta_emit_blit2d

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Pass the source pitch into the shader
Jason Ekstrand [Tue, 29 Mar 2016 21:24:31 +0000 (14:24 -0700)]
anv/blit2d: Pass the source pitch into the shader

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Break the texelfetch portion of shader building into a helper
Jason Ekstrand [Mon, 28 Mar 2016 22:37:47 +0000 (15:37 -0700)]
anv/blit2d: Break the texelfetch portion of shader building into a helper

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Fix whitespace
Jason Ekstrand [Tue, 29 Mar 2016 21:06:32 +0000 (14:06 -0700)]
anv/blit2d: Fix whitespace

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Fix a NIR writemask
Jason Ekstrand [Mon, 28 Mar 2016 22:39:17 +0000 (15:39 -0700)]
anv/blit2d: Fix a NIR writemask

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/meta2d: Don't declare an array sampler in the fragment shader
Jason Ekstrand [Mon, 28 Mar 2016 22:25:47 +0000 (15:25 -0700)]
anv/meta2d: Don't declare an array sampler in the fragment shader

With the new blit framework we aren't using array textures and, from
talking with Nanley, we don't think it's going to be useful in the future
either.  Just get rid of it for now.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoanv/blit2d: Remove the tex_dim parameter from copy_fragment_shader
Jason Ekstrand [Mon, 28 Mar 2016 22:20:26 +0000 (15:20 -0700)]
anv/blit2d: Remove the tex_dim parameter from copy_fragment_shader

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoMerge remote-tracking branch 'public/master' into vulkan
Jason Ekstrand [Thu, 7 Apr 2016 23:56:34 +0000 (16:56 -0700)]
Merge remote-tracking branch 'public/master' into vulkan

8 years agoi965/fs: Use the scale helper in surface_builder
Jason Ekstrand [Tue, 5 Apr 2016 17:37:54 +0000 (10:37 -0700)]
i965/fs: Use the scale helper in surface_builder

As requested by Curro

8 years agoradeonsi: do per-pixel clipping based on viewport states
Marek Olšák [Sun, 3 Apr 2016 01:21:47 +0000 (03:21 +0200)]
radeonsi: do per-pixel clipping based on viewport states

In other words, vport scissors are derived from viewport states.
If the scissor test is enabled, the intersection of both is used.

The guard band will disable clipping, so we have to clip per-pixel.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agonv50/ir: do not try to attach JOIN ops to ATOM
Samuel Pitoiset [Thu, 7 Apr 2016 20:38:47 +0000 (22:38 +0200)]
nv50/ir: do not try to attach JOIN ops to ATOM

This might result in an INVALID_OPCODE dmesg error in case a join is
attached to an atomic operation.

Spotted with arb_shader_image_load_store-host-mem-barrier on GK104.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
8 years agoradeonsi: raise number of samplers per shader to 32
Nicolai Hähnle [Wed, 6 Apr 2016 17:00:08 +0000 (12:00 -0500)]
radeonsi: raise number of samplers per shader to 32

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94835
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: expand the compressed color and depth texture masks to 64 bits
Nicolai Hähnle [Wed, 6 Apr 2016 16:58:42 +0000 (11:58 -0500)]
radeonsi: expand the compressed color and depth texture masks to 64 bits

This is in preparation of raising the number of exposed sampler views to 32
bits, which will raise the total number of sampler views to 33 for the
polygon stipple texture. That texture should never be compressed (and it's
certainly not a depth texture), but this approach seems cleaner to me than
special-casing the last slot in all affected code paths.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: replace magic 16 by SI_NUM_USER_SAMPLERS
Nicolai Hähnle [Wed, 6 Apr 2016 16:45:37 +0000 (11:45 -0500)]
radeonsi: replace magic 16 by SI_NUM_USER_SAMPLERS

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: raise PIPE_MAX_SAMPLERS to 32
Nicolai Hähnle [Wed, 6 Apr 2016 16:51:47 +0000 (11:51 -0500)]
gallium: raise PIPE_MAX_SAMPLERS to 32

The previous value of 18 was motivated by having drivers that want to expose
16 samplers but also use some additional samplers for internal use. Raising
the value even higher isn't going to hurt that case.

On the other hand, some drivers actually use PIPE_MAX_SAMPLERS as the number
of samplers they expose externally, so raising this number above 32 is fragile
(because several places in the code use bitfields, and tracking down and
widening all of them is prone to miss some case).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agost/glsl_to_tgsi: make samplers_used an uint32_t (v2)
Nicolai Hähnle [Wed, 6 Apr 2016 21:21:28 +0000 (16:21 -0500)]
st/glsl_to_tgsi: make samplers_used an uint32_t (v2)

It is used as a bitfield, so it seems cleaner to keep it unsigned.

The literal 1 is a (signed) int, and shifting into the sign bit is undefined
in C, so change occurences of 1 to 1u.

v2: add an assert for bitfield size and use 1u << idx

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
8 years agotgsi/scan: add an assert for the size of the samplers_declared bitfield
Nicolai Hähnle [Thu, 7 Apr 2016 17:19:56 +0000 (12:19 -0500)]
tgsi/scan: add an assert for the size of the samplers_declared bitfield

The literal 1 is a (signed) int, and shifting into the sign bit is undefined
in C, so change occurences of 1 to 1u.

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agodraw/aaline: stronger guard against no free samplers (v2)
Nicolai Hähnle [Wed, 6 Apr 2016 21:27:21 +0000 (16:27 -0500)]
draw/aaline: stronger guard against no free samplers (v2)

Line anti-aliasing will fail when there is no free sampler available. Make
the corresponding guard more robust in preparation of raising
PIPE_MAX_SAMPLERS to 32.

The literal 1 is a (signed) int, and shifting into the sign bit is undefined
in C, so change occurences of 1 to 1u.

v2: add an assert for bitfield size and use 1u << idx

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
8 years agoutil/pstipple: stronger guard against no free samplers (v2)
Nicolai Hähnle [Wed, 6 Apr 2016 17:57:51 +0000 (12:57 -0500)]
util/pstipple: stronger guard against no free samplers (v2)

When hasFixedUnit is false, polygon stippling will fail when there is no free
sampler available. Make the corresponding guard more robust in preparation
of raising PIPE_MAX_SAMPLERS to 32.

The literal 1 is a (signed) int, and shifting into the sign bit is undefined
in C, so change occurences of 1 to 1u.

v2: add an assert for bitfield size and use 1u << idx

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
8 years agosvga: new SVGA_MSAA env var to disable/enable MSAA pixel formats
Brian Paul [Tue, 5 Apr 2016 01:39:58 +0000 (19:39 -0600)]
svga: new SVGA_MSAA env var to disable/enable MSAA pixel formats

On by default.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agosvga: add some trivial null pointer checks
Brian Paul [Tue, 5 Apr 2016 15:56:49 +0000 (09:56 -0600)]
svga: add some trivial null pointer checks

These small mallocs will probably never fail, but static analysis tools
may complain about the missing checks.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agotrace: add missing set_shader_images()
Samuel Pitoiset [Tue, 5 Apr 2016 17:37:16 +0000 (19:37 +0200)]
trace: add missing set_shader_images()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: disable perfect ZPASS counts for PIPE_QUERY_OCCLUSION_PREDICATE
Marek Olšák [Thu, 7 Apr 2016 00:27:01 +0000 (02:27 +0200)]
radeonsi: disable perfect ZPASS counts for PIPE_QUERY_OCCLUSION_PREDICATE

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: don't use the real barrier instruction in tess ctrl shaders
Marek Olšák [Wed, 6 Apr 2016 22:49:32 +0000 (00:49 +0200)]
radeonsi: don't use the real barrier instruction in tess ctrl shaders

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoRevert "clover: Fix build against clang SVN >= r265359"
Michel Dänzer [Thu, 7 Apr 2016 06:05:33 +0000 (15:05 +0900)]
Revert "clover: Fix build against clang SVN >= r265359"

This reverts commit 0daab9878d2b96356cf667591a2c877d912be52d.

The corresponding clang change was reverted.

Trivial.

8 years agonir/types: Add a wrapper for count_attribute_slots
Jason Ekstrand [Fri, 25 Mar 2016 23:12:19 +0000 (16:12 -0700)]
nir/types: Add a wrapper for count_attribute_slots

Reviewed-by: Rob Clark <robdclark@gmail.com>
8 years agogenxml: Add GEN6 genxml
Kristian Høgsberg Kristensen [Thu, 7 Apr 2016 00:07:08 +0000 (17:07 -0700)]
genxml: Add GEN6 genxml

Not used yet, but let's put it here for now.

8 years agor600: use radeon_emit in a few more places in evergreen_compute
Dave Airlie [Wed, 6 Apr 2016 21:38:21 +0000 (22:38 +0100)]
r600: use radeon_emit in a few more places in evergreen_compute

This is just a cleanup of the code.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: make compute global buffer functions static.
Dave Airlie [Wed, 6 Apr 2016 21:35:53 +0000 (22:35 +0100)]
r600: make compute global buffer functions static.

This moves things around so that the global buffer handling
functions in evergreen_compute.c are static.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: make two compute functions static.
Dave Airlie [Wed, 6 Apr 2016 21:35:12 +0000 (22:35 +0100)]
r600: make two compute functions static.

These aren't used outside evergreen_compute.c

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: using pipe_grid_info more in evergreen_compute.
Dave Airlie [Wed, 6 Apr 2016 21:28:23 +0000 (22:28 +0100)]
r600: using pipe_grid_info more in evergreen_compute.

No reason to pull the pieces apart here, also make
one of the functions static as it's unused outside this.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: in evergreen_compute use ctx consistently instead of ctx_
Dave Airlie [Wed, 6 Apr 2016 21:24:35 +0000 (22:24 +0100)]
r600: in evergreen_compute use ctx consistently instead of ctx_

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: use rctx consistently in evergreen_compute.c
Dave Airlie [Wed, 6 Apr 2016 21:23:32 +0000 (22:23 +0100)]
r600: use rctx consistently in evergreen_compute.c

Another step towards cleaning this up.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agor600: cleanup whitespace in evergreen_compute.c
Dave Airlie [Wed, 6 Apr 2016 21:20:17 +0000 (22:20 +0100)]
r600: cleanup whitespace in evergreen_compute.c

This aligns the code with the style of the rest of the driver.

Makes editing it a lot less painful.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoGL3.txt: Mark ARB_framebuffer_no_attachments as done
Edward O'Callaghan [Mon, 1 Feb 2016 00:18:15 +0000 (11:18 +1100)]
GL3.txt: Mark ARB_framebuffer_no_attachments as done

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agor600g: Enable ARB_framebuffer_no_attachments
Edward O'Callaghan [Mon, 1 Feb 2016 01:12:12 +0000 (12:12 +1100)]
r600g: Enable ARB_framebuffer_no_attachments

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: Enable ARB_framebuffer_no_attachments
Edward O'Callaghan [Fri, 1 Jan 2016 18:53:57 +0000 (05:53 +1100)]
radeonsi: Enable ARB_framebuffer_no_attachments

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: Improve assert info out of si_set_framebuffer_state()
Edward O'Callaghan [Sun, 20 Mar 2016 07:01:06 +0000 (18:01 +1100)]
radeonsi: Improve assert info out of si_set_framebuffer_state()

Lets give the developer a little hand if we are going to assert
on a zero literal at the end of a branch.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: Allow 16 samples MSAA mode for PIPE_FORMAT_NONE
Edward O'Callaghan [Sun, 20 Mar 2016 03:50:04 +0000 (14:50 +1100)]
radeonsi: Allow 16 samples MSAA mode for PIPE_FORMAT_NONE

For ARB_framebuffer_no_attachment; A is_format_supported() query
with 'PIPE_FORMAT_NONE' passed implies a query of the number of
samples supported from the framebuffer with no attachment.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agosoftpipe: Set samples and layers in set_framebuffer_state() cb
Edward O'Callaghan [Fri, 12 Feb 2016 10:11:57 +0000 (21:11 +1100)]
softpipe: Set samples and layers in set_framebuffer_state() cb

Carries across the number of samples and layers state in the
'softpipe_set_framebuffer_state()' callback. This state is
part of 'ARB_framebuffer_no_attachments' support.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agomesa/st: Update framebuffer state with no.of samples,layers
Edward O'Callaghan [Sun, 3 Jan 2016 10:08:33 +0000 (21:08 +1100)]
mesa/st: Update framebuffer state with no.of samples,layers

Handle the case of ARB_framebuffer_no_attachment.
Also, kill off a dead debug printf() call while we are here.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/trace: Dump no.of samples and layers in fb state
Edward O'Callaghan [Mon, 1 Feb 2016 00:16:06 +0000 (11:16 +1100)]
gallium/trace: Dump no.of samples and layers in fb state

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium: Put no.of {samples,layers} into pipe_framebuffer_state
Edward O'Callaghan [Sat, 2 Jan 2016 14:44:55 +0000 (01:44 +1100)]
gallium: Put no.of {samples,layers} into pipe_framebuffer_state

Here we store the number of samples and layers directly in the
pipe_framebuffer_state so that in the case of
ARB_framebuffer_no_attachment we may make use of them directly.

Further, we adjust various gallium/auxiliary helper functions
accordingly.

V2:
  Convert branches in util_framebuffer_get_num_layers() and
  util_framebuffer_get_num_samples() to their canonical form.

V3:
  'git stash pop' the typo fix of 'cbufs' which should be
  'nr_cbufs' that was missing in V2, woops! Thanks Marek for
  pointing this out yet again.

V4:
  Squash in the following patch:

  'gallium/util: Ensure util_framebuffer_get_num_samples() is valid'

   Upon context creation, internal driver structures are malloc()'ed
   and memset() to zero them. This results in a invalid number of
   samples 'by default'. Handle this in the simplest way to avoid
   elaborate and probably equally sub-optimial solutions.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agomesa/st: Set _NumSamples in update_framebuffer_state()
Edward O'Callaghan [Tue, 16 Feb 2016 23:27:41 +0000 (10:27 +1100)]
mesa/st: Set _NumSamples in update_framebuffer_state()

Using PIPE_FORMAT_NONE to indicate what MSAA modes are supported
with a framebuffer using no attachment.

V.2:
 Rewrite MSAA mode loop to be more general.
V.3:
 Move comment to right place after loop was rewritten.
V.4: [airlied]
 remove unneeded variable, and assert, and unneeded pipe assignment

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agogallium: Obtain ARB_framebuffer_no_attachment constants
Edward O'Callaghan [Wed, 17 Feb 2016 10:01:57 +0000 (21:01 +1100)]
gallium: Obtain ARB_framebuffer_no_attachment constants

Set default values for the constants required in
ARB_framebuffer_no_attachments and obtained the number
of layers from ``PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS``.

We also obtain the MaxFramebufferSamples value using
a query back to the driver for PIPE_FORMAT_NONE.

V.1:
 Merge if branch predicates into one branch.
 Move const init into st_init_limits()

[airlied: whitespace fixup]
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogallium: Add PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT
Edward O'Callaghan [Wed, 17 Feb 2016 09:59:52 +0000 (20:59 +1100)]
gallium: Add PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT

Add PIPE_CAP to determine if the GL extension
'GL_ARB_framebuffer_no_attachments' shall be
supported.

The driver is required to support 'PIPE_FORMAT_NONE'
via its 'is_format_supported()' callback in order
to determine the MSAA modes the hardware supports so
that values requested from the application using
'GL_ARB_framebuffer_no_attachments' may be quantized
to what the hardware expects.

V.2:
 Fix doc for a more detailed description of the PIPE_CAP
 and the corresponding GL constant.

V.3:
 Renamed and repurposed once again.

V.4:
 Remove CAP from cap_mapping array.

[airlied: fix damaged whitespace]

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agomesa/st: Use _mesa_geometric_ functions appropriately
Edward O'Callaghan [Fri, 1 Jan 2016 18:55:49 +0000 (05:55 +1100)]
mesa/st: Use _mesa_geometric_ functions appropriately

Change references to gl_framebuffer::Width, Height, MaxNumLayers
and Visual::samples to use the _mesa_geometric_ convenience functions
for those places where the geometry of the gl_framebuffer is needed.
This is in contrast to the geometry of the intersection of the
attachments of the gl_framebuffer.

This patch paves the way to enable GL_ARB_framebuffer_no_attachements
for all gallium drivers.

V.2:
 Remove itermeditate variable state.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agomesa: Add comment to framebuffer_parameteri()
Edward O'Callaghan [Wed, 17 Feb 2016 08:15:49 +0000 (19:15 +1100)]
mesa: Add comment to framebuffer_parameteri()

V.2:
 Change 'N.B.,' to 'NOTE:'.

Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoi965/sf_state: Pull flat_enables out of prog_data
Jason Ekstrand [Wed, 6 Apr 2016 01:23:36 +0000 (18:23 -0700)]
i965/sf_state: Pull flat_enables out of prog_data

Previously, we were walking over the shader source to figure out which
inputs should be marked flat.  Now, we can just pull it out of prog_data.
This is needed for properly setting up 3DSTATE_SF/SBE for Vulkan and it
also means that it will get properly cached.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/fs: Add a flat_inputs field to prog_data
Jason Ekstrand [Wed, 6 Apr 2016 01:19:34 +0000 (18:19 -0700)]
i965/fs: Add a flat_inputs field to prog_data

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agobrw/device_info: Add a helper for getting a device name
Jason Ekstrand [Mon, 4 Apr 2016 21:50:03 +0000 (14:50 -0700)]
brw/device_info: Add a helper for getting a device name

This is needed by the Vulkan driver

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/fs_surface_builder: Mask signed integers after conversion
Jason Ekstrand [Tue, 19 Jan 2016 01:30:59 +0000 (17:30 -0800)]
i965/fs_surface_builder: Mask signed integers after conversion

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965/fs: Make the repclear shader support either a uniform or a flat input
Jason Ekstrand [Mon, 4 Apr 2016 21:38:42 +0000 (14:38 -0700)]
i965/fs: Make the repclear shader support either a uniform or a flat input

In the Vulkan driver we use a single flat input instead of a uniform
because setting up push constants is more disruptive to the pipeline than
setting up another vertex input.  This uses the number of uniforms as a key
to keep it working for the GL driver.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Move get_hw_prim_for_gl_prim to brw_util.c
Jason Ekstrand [Thu, 22 Oct 2015 03:40:28 +0000 (20:40 -0700)]
i965: Move get_hw_prim_for_gl_prim to brw_util.c

It's used by brw_compile_gs in brw_vec4_gs_visitor.cpp so it needs to be in
a file that's linked into libi965_compiler.la.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoradeonsi: set shader calling conventions
Bas Nieuwenhuizen [Thu, 31 Mar 2016 09:58:26 +0000 (11:58 +0200)]
radeonsi: set shader calling conventions

Note that old mesa + new LLVM or new mesa + old LLVM breaks
with this change and the corresponding LLVM change (D18559).

For LLVM version <= 3.8 we use the old method, but we can't detect
people using a post 3.8 svn version that is still too old.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agodrirc: add a workaround for blackness in Warsow
Marek Olšák [Thu, 31 Mar 2016 21:32:53 +0000 (23:32 +0200)]
drirc: add a workaround for blackness in Warsow

Cc: 11.1 11.2 <mesa-stable@lists.freedesktop.org>
8 years agoglsl: use has_shader_storage_buffer_objects helper
Ilia Mirkin [Mon, 4 Apr 2016 15:54:22 +0000 (11:54 -0400)]
glsl: use has_shader_storage_buffer_objects helper

Replaces open-coded logic with existing helper.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agoglsl: remove remaining tabs in link_uniform_blocks.cpp
Timothy Arceri [Sun, 3 Apr 2016 08:33:40 +0000 (18:33 +1000)]
glsl: remove remaining tabs in link_uniform_blocks.cpp

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agomesa: remove unused IsShaderStorage field
Timothy Arceri [Sun, 3 Apr 2016 05:14:14 +0000 (15:14 +1000)]
mesa: remove unused IsShaderStorage field

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoglsl: fully split apart buffer block arrays
Timothy Arceri [Sun, 3 Apr 2016 02:44:33 +0000 (12:44 +1000)]
glsl: fully split apart buffer block arrays

With this change we create the UBO and SSBO arrays separately from the
beginning rather than putting them into a combined array and splitting
it apart later.

A bug is with UBO and SSBO stage reference querying is also fixed as
we now use the block index to lookup the references in the separate arrays
not the combined buffer block array.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agofreedreno/ir3: insert extra move into phi
Rob Clark [Tue, 5 Apr 2016 17:45:34 +0000 (13:45 -0400)]
freedreno/ir3: insert extra move into phi

We had an implicit assumption that the phi src was assigned in it's
source (pred) block leading into the phi.  But this is not true with
NIR, so we can't just ignore the source block specified in the
nir_phi_src.  Insert an extra mov in the source block.  If it is not
required the CP pass will take it back out again.

Fixes:

  ./tests/spec/glsl-1.10/execution/vs-call-in-nested-loop.shader_test
  ./tests/spec/glsl-1.10/execution/vs-inner-loop-modifies-outer-loop-var.shader_test

and probably others.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: eliminate unnecessary absneg's
Rob Clark [Tue, 5 Apr 2016 16:39:47 +0000 (12:39 -0400)]
freedreno/ir3: eliminate unnecessary absneg's

The frontend inserts (abs) and (neg)'s to convert between NIR boolean
(~0/0) and native boolean (1/0).  So we'd end up with things like:

   cmps.s.ge r1.x, ...
   absneg.s r1.x, (neg)r1.x
   absneg.s r1.x, (abs)r1.x
   sel.b32 r2.x, r0.x, r1.x, r0.y

The (neg) already gets collapsed due to the following (abs).  Now by
realizing that r1.x comes from a cmps.s instruction, we can drop the
(abs) as well.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoclover: Fix build against clang SVN >= r265359
Michel Dänzer [Tue, 5 Apr 2016 06:43:35 +0000 (15:43 +0900)]
clover: Fix build against clang SVN >= r265359

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
8 years agoradeonsi: use bounded indexing for samplers
Bas Nieuwenhuizen [Sun, 3 Apr 2016 09:45:02 +0000 (11:45 +0200)]
radeonsi: use bounded indexing for samplers

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: use bounded indexing for constant buffers
Bas Nieuwenhuizen [Sun, 3 Apr 2016 09:39:52 +0000 (11:39 +0200)]
radeonsi: use bounded indexing for constant buffers

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: allow multiple exports of the same texture with different usage
Marek Olšák [Mon, 28 Mar 2016 23:36:40 +0000 (01:36 +0200)]
gallium/radeon: allow multiple exports of the same texture with different usage

Instead of failing an assertion, disable DCC and CMASK on the first export
that needs it, and merge the external usage flags.

v2: clear the EXPLICIT_FLUSH flag if it's not set; whitespace fixes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
8 years agodocs/relnotes: document EGL_KHR_reusable_sync
Marek Olšák [Tue, 5 Apr 2016 13:32:16 +0000 (15:32 +0200)]
docs/relnotes: document EGL_KHR_reusable_sync

8 years agoegl: add EGL_KHR_reusable_sync to egl_dri
Dongwon Kim [Tue, 5 Apr 2016 00:14:10 +0000 (17:14 -0700)]
egl: add EGL_KHR_reusable_sync to egl_dri

This patch enables an EGL extension, EGL_KHR_reusable_sync.
This new extension basically provides a way for multiple APIs or
threads to be excuted synchronously via a "reusable sync"
primitive shared by those threads/API calls.

This was implemented based on the specification at

https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_reusable_sync.txt

v2
- use thread functions defined in C11/threads.h instead of
  using direct pthread calls
- make the timeout set with reference to CLOCK_MONOTONIC
- cleaned up the way expiration time is calculated
- (bug fix) in dri2_client_wait_sync, case EGL_SYNC_CL_EVENT_KHR
  has been added.
- (bug fix) in dri2_destroy_sync, return from cond_broadcast
  call is now stored in 'err' intead of 'ret' to prevent 'ret'
  from being reset to 'EGL_FALSE' even in successful case
- corrected minor syntax problems

v3
- dri2_egl_unref_sync now became 'void' type. No more error check
  is needed for this function call as a result.
- (bug fix) resolved issue with duplicated unlocking of display in
  eglClientWaitSync when type of sync is "EGL_KHR_REUSABLE_SYNC"

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
8 years agofreedreno/ir3: deal with duplicate phi sources
Rob Clark [Mon, 4 Apr 2016 21:38:01 +0000 (17:38 -0400)]
freedreno/ir3: deal with duplicate phi sources

Otherwise we end up with funny things like:

  mov.f32f32 r0.x, r1.y
  mov.f32f32 r0.x, r1.y

(It doesn't happen as much after fixing the problem w/ CP into phi src,
but it can still happen since we aren't too clever about generating phi
sources in the first place.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fix silly brain-fart in RA
Rob Clark [Mon, 4 Apr 2016 21:36:41 +0000 (17:36 -0400)]
freedreno/ir3: fix silly brain-fart in RA

We want to consider all the vars, not 1/32nd of them, when extending
live-ranges.

Signed-off-by: Rob Clark <robclark@freedesktop.org>