mesa.git
8 years agoisl: Add func isl_surf_get_tile_info()
Chad Versace [Mon, 25 Jan 2016 19:45:12 +0000 (11:45 -0800)]
isl: Add func isl_surf_get_tile_info()

8 years agovtn: Fix atan2 for non-scalars.
Kenneth Graunke [Wed, 27 Jan 2016 23:07:18 +0000 (15:07 -0800)]
vtn: Fix atan2 for non-scalars.

The if/then/else block was bogus, as it can only take a scalar
condition, and we need to select component-wise.  The GLSL IR
implementation of atan2 handles this by looping over components,
but I decided to try and do it vector-wise, and messed up.

For now, just bcsel.  It means that we do the atan1 math even if
all components hit the quick case, but it works, and presumably
at least one component will hit the expensive path anyway.

8 years agovtn: Fix Modf.
Kenneth Graunke [Wed, 27 Jan 2016 22:20:47 +0000 (14:20 -0800)]
vtn: Fix Modf.

We were botching this for negative numbers - floor of a negative rounds
the wrong way.  Additionally, both results are supposed to retain the
sign of the original.

To fix this, just take the abs of both values, then put the sign back.
There's probably a better way to do this, but this works for now.

8 years agoi965: Fix SIN/COS precision problems.
Kenneth Graunke [Wed, 27 Jan 2016 20:21:04 +0000 (12:21 -0800)]
i965: Fix SIN/COS precision problems.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoanv: Put back code to grow shader scratch space
Kristian Høgsberg Kristensen [Wed, 27 Jan 2016 19:36:44 +0000 (11:36 -0800)]
anv: Put back code to grow shader scratch space

This was lost in commit a71e614d33e8d869bbaced8948349a7180783ab7.

8 years agoanv: Update the device limits.
Kenneth Graunke [Wed, 27 Jan 2016 07:09:45 +0000 (23:09 -0800)]
anv: Update the device limits.

Fixes dEQP-VK.api.info.device.properties.  I haven't tested any others.

8 years agogen7/cmd_buffer: SCISSOR_RECT structs are tightly packed
Jason Ekstrand [Wed, 27 Jan 2016 06:10:11 +0000 (22:10 -0800)]
gen7/cmd_buffer: SCISSOR_RECT structs are tightly packed

The pointer has to be 32-byte aligned, but the structs themselves are 2
dwords each, tightly packed.

8 years agoanv/pipeline: Set MaximumVPIndex in 3DSTATE_CLIP
Jason Ekstrand [Wed, 27 Jan 2016 05:52:59 +0000 (21:52 -0800)]
anv/pipeline: Set MaximumVPIndex in 3DSTATE_CLIP

8 years agoanv/pipeline: Only lower input indirects if EmitNoIndirectInput is set
Jason Ekstrand [Wed, 27 Jan 2016 05:45:21 +0000 (21:45 -0800)]
anv/pipeline: Only lower input indirects if EmitNoIndirectInput is set

8 years agoanv/formats: Use is_power_of_two instead of is_rgb to determine renderability
Jason Ekstrand [Wed, 27 Jan 2016 01:28:16 +0000 (17:28 -0800)]
anv/formats: Use is_power_of_two instead of is_rgb to determine renderability

8 years agoHACK/i965/surface_formats: Mark A4B4G4R4 as being supported
Jason Ekstrand [Wed, 27 Jan 2016 01:10:57 +0000 (17:10 -0800)]
HACK/i965/surface_formats: Mark A4B4G4R4 as being supported

The table has this marked as unsupported on all gens, but I don't really
believe that given how early it is in the table.  I've tested and it seems
to work on Broadwell.  The Bspec says that it sould be renderable on SKL+
but alpha blending is questionable.

Side note: We really need to audit the format table again.

8 years agoanv: Support swizzled formats.
Jordan Justen [Tue, 26 Jan 2016 19:10:56 +0000 (11:10 -0800)]
anv: Support swizzled formats.

Some formats require a swizzle in order to map them to actual hardware
formats.  This allows us to turn on two new Vulkan formats.

8 years agoanv/image: Do swizzle remapping in anv_image.c
Jason Ekstrand [Wed, 27 Jan 2016 04:16:43 +0000 (20:16 -0800)]
anv/image: Do swizzle remapping in anv_image.c

TODO: At some point, we really need to make an image_view_init_info that's
a flyweight and stop stuffing everything into image_view.

8 years agoHACK: Expose support for stencil blits
Jason Ekstrand [Tue, 26 Jan 2016 23:59:43 +0000 (15:59 -0800)]
HACK: Expose support for stencil blits

If someone actually tries to use them, they won't work, but at least we
don't fail to return format properties now.

8 years agovtn: Delete references to IMix opcode.
Kenneth Graunke [Wed, 27 Jan 2016 01:02:35 +0000 (17:02 -0800)]
vtn: Delete references to IMix opcode.

This is being removed in SPIR-V.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15452

8 years agoi965/skl: Utilize new 5th bit for gateway messages
Ben Widawsky [Tue, 26 Jan 2016 23:42:08 +0000 (15:42 -0800)]
i965/skl: Utilize new 5th bit for gateway messages

Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
8 years agogenX/pipeline: Don't make vertex bindings with holes
Jason Ekstrand [Tue, 26 Jan 2016 23:44:18 +0000 (15:44 -0800)]
genX/pipeline: Don't make vertex bindings with holes

8 years agoanv/cmd_buffer: Put base_instance in the second component
Jason Ekstrand [Tue, 26 Jan 2016 23:44:02 +0000 (15:44 -0800)]
anv/cmd_buffer: Put base_instance in the second component

8 years agoanv/image: clflush surface state map in anv_fill_buffer_surface_state().
Francisco Jerez [Tue, 26 Jan 2016 22:50:52 +0000 (14:50 -0800)]
anv/image: clflush surface state map in anv_fill_buffer_surface_state().

Some of its users had the required clflush on non-LLC platforms, some
didn't.  Put the clflush in anv_fill_buffer_surface_state() so we
don't forget.

8 years agoanv/image: clflush the right state map in anv_fill_image_surface_state().
Francisco Jerez [Tue, 26 Jan 2016 22:45:46 +0000 (14:45 -0800)]
anv/image: clflush the right state map in anv_fill_image_surface_state().

It was clflushing the nonrt_surface_state structure regardless of
which state structure was actually being initialized.

8 years agoanv/image: Upload raw buffer surface state for untyped storage image and texel buffer...
Francisco Jerez [Tue, 26 Jan 2016 20:23:08 +0000 (12:23 -0800)]
anv/image: Upload raw buffer surface state for untyped storage image and texel buffer access.

8 years agoanv/image: Fix image parameter initialization.
Francisco Jerez [Tue, 26 Jan 2016 20:20:01 +0000 (12:20 -0800)]
anv/image: Fix image parameter initialization.

8 years agoisl/gen9: Fix slice offset calculation for 1D array images.
Francisco Jerez [Tue, 26 Jan 2016 03:20:57 +0000 (19:20 -0800)]
isl/gen9: Fix slice offset calculation for 1D array images.

The X component of the offset is set to the layer index times layer
height which is obviously bogus, return the vertical offset of the
slice as Y component instead.  Fixes a few image load/store tests that
use 1D arrays on SKL when forcing it to fall back to untyped reads and
writes.

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

8 years agoanv/image: Actually fill out brw_image_param structs
Jason Ekstrand [Tue, 5 Jan 2016 21:55:00 +0000 (13:55 -0800)]
anv/image: Actually fill out brw_image_param structs

8 years agoanv/image_view: Add base mip and base layer fields
Jason Ekstrand [Tue, 5 Jan 2016 21:54:02 +0000 (13:54 -0800)]
anv/image_view: Add base mip and base layer fields

These will be needed by image_load_store

8 years agogen7: Add support for base vertex/instance
Jason Ekstrand [Tue, 26 Jan 2016 20:09:33 +0000 (12:09 -0800)]
gen7: Add support for base vertex/instance

8 years agogen8: Add support for base vertex/instance
Jason Ekstrand [Tue, 26 Jan 2016 20:08:31 +0000 (12:08 -0800)]
gen8: Add support for base vertex/instance

8 years agonir/spirv: Add proper support for InstanceIndex
Jason Ekstrand [Tue, 26 Jan 2016 19:48:23 +0000 (11:48 -0800)]
nir/spirv: Add proper support for InstanceIndex

8 years agonir/lower_io: Lower INSTNACE_INDEX
Jason Ekstrand [Tue, 26 Jan 2016 19:48:07 +0000 (11:48 -0800)]
nir/lower_io: Lower INSTNACE_INDEX

8 years agoglsl/enums: Add an enum for Vulkan instance index
Jason Ekstrand [Tue, 26 Jan 2016 19:47:23 +0000 (11:47 -0800)]
glsl/enums: Add an enum for Vulkan instance index

8 years agogenX/pipeline: Break emit_vertex_input out into common code
Jason Ekstrand [Tue, 26 Jan 2016 18:52:56 +0000 (10:52 -0800)]
genX/pipeline: Break emit_vertex_input out into common code

It's mostly the same and contains some non-trivial logic, so it really
should be shared.  Also, we're about to make some modifications here that
we would really like to share.

8 years agoanv: Remove long unused anv_aub.h
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:53:00 +0000 (14:53 -0800)]
anv: Remove long unused anv_aub.h

8 years agoanv: Dirty fragment shader descriptors in meta restore
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:43:07 +0000 (14:43 -0800)]
anv: Dirty fragment shader descriptors in meta restore

We need to reemit render targets, so dirtying VK_SHADER_STAGE_VERTEX_BIT
doesn't help us much.

8 years agoanv: Reemit STATE_BASE_ADDRESS after second level cmd buffers
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:41:06 +0000 (14:41 -0800)]
anv: Reemit STATE_BASE_ADDRESS after second level cmd buffers

Otherwise the primary batch will continue using the state base addresses
set by the secondary.  Fixes remaining renderpass tests.

8 years agoanv/meta: Fix sample mask in clear pipelines
Chad Versace [Tue, 26 Jan 2016 19:01:24 +0000 (11:01 -0800)]
anv/meta: Fix sample mask in clear pipelines

Once we begin emitting the correct sample mask,
genX_3DSTATE_SAMPLE_MASK_pack will hit an assertion if the mask contains
too many bits.

8 years agoglsl: move to compiler/
Emil Velikov [Mon, 18 Jan 2016 10:16:48 +0000 (12:16 +0200)]
glsl: move to compiler/

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agonir: move to compiler/
Emil Velikov [Mon, 18 Jan 2016 10:54:03 +0000 (12:54 +0200)]
nir: move to compiler/

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agocompiler: move the glsl_types C wrapper alongside their C++ brethren
Emil Velikov [Wed, 25 Nov 2015 16:03:26 +0000 (16:03 +0000)]
compiler: move the glsl_types C wrapper alongside their C++ brethren

At a later stage we might want to split out the NIR specific [XXX:
which one was it], as to make things move obvious and rename the files
appropriately. This patch aims to split it out of nir.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agonir: move glsl_types.{cpp,h} to compiler
Emil Velikov [Mon, 18 Jan 2016 09:35:29 +0000 (11:35 +0200)]
nir: move glsl_types.{cpp,h} to compiler

Allows us to remove the SCons workaround :-)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agonir: move shader_enums.[ch] to compiler
Emil Velikov [Mon, 18 Jan 2016 08:47:13 +0000 (10:47 +0200)]
nir: move shader_enums.[ch] to compiler

This way one can reuse it in glsl, nir or other infrastructure without
pulling nir as dependency.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agocompiler: introduce a libcompiler static library
Emil Velikov [Mon, 23 Nov 2015 17:03:04 +0000 (17:03 +0000)]
compiler: introduce a libcompiler static library

Currently it's an empty library, although it'll be used to store common
code between GLSL and NIR that is compiler specific (rather than generic
as the one in src/util).

XXX: strictly speaking we could add a python/mako parser to generate the
relevant files instead including builtin_type_macros.h in such a manner.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
8 years agogallium/ddebug: add 'verbose' option
Nicolai Hähnle [Thu, 21 Jan 2016 21:53:02 +0000 (16:53 -0500)]
gallium/ddebug: add 'verbose' option

This currently just writes out the name of dump files, which can be useful
to easily correlate those files with other log outputs (driver debug output,
apitrace calls, etc.)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/ddebug: make 'noflush' also affect 'always' mode
Nicolai Hähnle [Thu, 21 Jan 2016 21:46:59 +0000 (16:46 -0500)]
gallium/ddebug: make 'noflush' also affect 'always' mode

This changes the default behavior of 'always' mode to be consistent with
hang detection mode.

I have used this to more easily compare dumped command streams using diff.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: use llvm.amdgcn.s.barrier instead of llvm.AMDGPU.barrier.local
Nicolai Hähnle [Mon, 25 Jan 2016 19:11:07 +0000 (14:11 -0500)]
radeonsi: use llvm.amdgcn.s.barrier instead of llvm.AMDGPU.barrier.local

The new name for the intrinsic was introduced in LLVM r258558.

v2: use ternary operator instead of preprocessor

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965/compiler: Set nir_options.vertex_id_zero_based
Jason Ekstrand [Tue, 26 Jan 2016 00:10:12 +0000 (16:10 -0800)]
i965/compiler: Set nir_options.vertex_id_zero_based

8 years agoHACK/i965: Default to scalar GS on BDW+
Jason Ekstrand [Mon, 25 Jan 2016 23:52:53 +0000 (15:52 -0800)]
HACK/i965: Default to scalar GS on BDW+

8 years agoi965/bxt: Fix conservative wm thread counts.
Ben Widawsky [Mon, 25 Jan 2016 19:49:10 +0000 (11:49 -0800)]
i965/bxt: Fix conservative wm thread counts.

When setting the conservative thread counts, I halved everything. That isn't
correct for the wm, which has nothing to do with actual thread counts. I suck.

BXT only has 1 slice, and there is some ambiguity about subslices, so just
reserve the max possible for now. It looks like this might fix:
piglit.spec.glsl-1_50.execution.variable-indexing.gs-output-array-vec4-index-wr.bxtm64.
I kind of question why that is, but it is what Jenkins says.

Mark is current running some of the other blacklisted tests on this patch. (it
effects anything requiring scratch space).

Cc: mesa-stable <mesa-stable@lists.freedesktop.org>
Cc: Neil Roberts <neil@linux.intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Mark Janes <mark.a.janes@intel.com>
8 years agoMerge remote-tracking branch 'mattst88/nir-lower-pack-unpack' into vulkan
Jason Ekstrand [Mon, 25 Jan 2016 23:50:31 +0000 (15:50 -0800)]
Merge remote-tracking branch 'mattst88/nir-lower-pack-unpack' into vulkan

8 years agogen7/state: Apply min/mag filters individually for samplers
Jason Ekstrand [Mon, 25 Jan 2016 23:33:08 +0000 (15:33 -0800)]
gen7/state: Apply min/mag filters individually for samplers

This fixes tests which apply different min and mag filters, and depend on
the min filter to be correct.

8 years agogen8/state: Apply min/mag filters individually for samplers
Ben Widawsky [Mon, 25 Jan 2016 23:26:25 +0000 (15:26 -0800)]
gen8/state: Apply min/mag filters individually for samplers

This fixes tests which apply different min and mag filters, and depend on the
min filter to be correct.

8 years agoi965/fs: Feel free to spill partial reads/writes
Jason Ekstrand [Mon, 25 Jan 2016 23:00:38 +0000 (15:00 -0800)]
i965/fs: Feel free to spill partial reads/writes

Now that we properly handle write-masking, this should be safe.

8 years agoi965/fs: Properly write-mask spills
Jason Ekstrand [Mon, 25 Jan 2016 20:42:01 +0000 (12:42 -0800)]
i965/fs: Properly write-mask spills

For unspills (scratch reads), we can just set WE_all all the time because
we always unspill into a new GRF.  For spills, we have two options: If the
instruction has a 32-bit-per-channel destination and "normal" regioning,
then we just do a regular write and it will interleave channels from
different control-flow paths properly.  If, on the other hand, the the
regioning is non-normal, then we have to unspill, run the instruction, and
spill afterwards.  In this second case, we need to do the spill with
we_ALL.

8 years agoanv: Remove a few finished finishme
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:14:47 +0000 (15:14 -0800)]
anv: Remove a few finished finishme

8 years agoanv: Remove stale assert
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:12:43 +0000 (15:12 -0800)]
anv: Remove stale assert

This goes back to when we didn't have the subpass number in the command
buffer begin info.

8 years agoi965/gen7+: Use NIR for lowering of pack/unpack opcodes.
Matt Turner [Mon, 25 Jan 2016 19:07:28 +0000 (11:07 -0800)]
i965/gen7+: Use NIR for lowering of pack/unpack opcodes.

8 years agoi965/vec4: Implement nir_op_pack_uvec2_to_uint.
Matt Turner [Mon, 25 Jan 2016 18:49:15 +0000 (10:49 -0800)]
i965/vec4: Implement nir_op_pack_uvec2_to_uint.

And mark nir_op_pack_uvec4_to_uint unreachable, since it's only produced
by lowering pack[SU]norm4x8 which the vec4 backend does not need.

8 years agonir: Add lowering support for unpacking opcodes.
Matt Turner [Mon, 25 Jan 2016 19:07:02 +0000 (11:07 -0800)]
nir: Add lowering support for unpacking opcodes.

8 years agonir: Add lowering support for packing opcodes.
Matt Turner [Mon, 25 Jan 2016 19:05:52 +0000 (11:05 -0800)]
nir: Add lowering support for packing opcodes.

8 years agoi965/fs: Implement support for extract_word.
Matt Turner [Thu, 21 Jan 2016 02:56:37 +0000 (18:56 -0800)]
i965/fs: Implement support for extract_word.

The vec4 backend will lower it.

8 years agonir: Add opcodes to extract bytes or words.
Matt Turner [Thu, 21 Jan 2016 17:09:29 +0000 (09:09 -0800)]
nir: Add opcodes to extract bytes or words.

The uint versions zero extend while the int versions sign extend.

8 years agoanv/meta: Fix CopyBuffer when size matches HW limit
Nanley Chery [Thu, 31 Dec 2015 00:00:47 +0000 (16:00 -0800)]
anv/meta: Fix CopyBuffer when size matches HW limit

Perform a copy when the copy_size matches the HW limit (max_copy_size).
Otherwise the current behavior is that we fail the following assertion:

      assert(height < max_surface_dim);

because the values are equal.

8 years agoanv: Don't use uninitialized barycentric_interp_modes
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:34:32 +0000 (11:34 -0800)]
anv: Don't use uninitialized barycentric_interp_modes

If we don't have a fragment shader, wm_prog_data in undefined.

8 years agoanv: Disable fs dispatch for depth/stencil only pipelines
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:24:19 +0000 (11:24 -0800)]
anv: Disable fs dispatch for depth/stencil only pipelines

Fixes most renderpass bugs.

8 years agoglsl: Remove 2x16 half-precision pack/unpack opcodes.
Matt Turner [Thu, 21 Jan 2016 19:46:22 +0000 (11:46 -0800)]
glsl: Remove 2x16 half-precision pack/unpack opcodes.

i965/fs was the only consumer, and we're now doing the lowering in NIR.

8 years agoi965/fs: Switch from GLSL IR to NIR for un/packHalf2x16 lowering.
Matt Turner [Thu, 21 Jan 2016 23:30:57 +0000 (15:30 -0800)]
i965/fs: Switch from GLSL IR to NIR for un/packHalf2x16 lowering.

8 years agonir: Add lowering of nir_op_unpack_half_2x16.
Matt Turner [Thu, 21 Jan 2016 23:46:47 +0000 (15:46 -0800)]
nir: Add lowering of nir_op_unpack_half_2x16.

8 years agoi965: Make separate nir_options for scalar/vector stages.
Matt Turner [Thu, 21 Jan 2016 17:30:05 +0000 (09:30 -0800)]
i965: Make separate nir_options for scalar/vector stages.

We'll want to have different lowering options set for scalar/vector
stages.

8 years agoi965: Move brw_compiler_create() to new brw_compiler.c.
Matt Turner [Thu, 21 Jan 2016 17:19:53 +0000 (09:19 -0800)]
i965: Move brw_compiler_create() to new brw_compiler.c.

A future patch will want to use designated initalizers, which aren't
available in C++, but this is C.

8 years agonir: Make argument order of unop_convert match binop_convert.
Matt Turner [Thu, 21 Jan 2016 17:54:19 +0000 (09:54 -0800)]
nir: Make argument order of unop_convert match binop_convert.

Strangely the return and parameter types were reversed.

8 years agometa: Use internal functions to set texture parameters
Ian Romanick [Wed, 13 Jan 2016 00:37:27 +0000 (16:37 -0800)]
meta: Use internal functions to set texture parameters

_mesa_texture_parameteriv is used because (the more obvious)
_mesa_texture_parameteri just stuffs the parameter in an array and calls
_mesa_texture_parameteriv.  This just cuts out the middleman.

As a side bonus we no longer need check that ARB_stencil_texturing is
supported.  The test doesn't allow non-supporting implementations to
avoid any work, and it's redundant with the value-changed test.

Fix bug #93717 because the state restore commands at the bottom of
_mesa_meta_GenerateMipmap no longer depend on the bound state.

Fixes  piglit   arb_direct_state_access-generatetexturemipmap  with  the
changes  recently sent  to the  piglit mailing  list.  See  the bugzilla
entry for more info.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93717
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/blit: Restore GL_DEPTH_STENCIL_TEXTURE_MODE state for GL_TEXTURE_RECTANGLE
Ian Romanick [Wed, 13 Jan 2016 00:08:47 +0000 (16:08 -0800)]
meta/blit: Restore GL_DEPTH_STENCIL_TEXTURE_MODE state for GL_TEXTURE_RECTANGLE

Commit c246828c added the code to save and restore the stencil
texturing mode.  The restore, however, was erroneously inside the
'target != GL_TEXTURE_RECTANGLE' block.

Fixes piglit test 'arb_stencil_texturing-blit_corrupts_state
GL_TEXTURE_RECTANGLE'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agometa/copy_image: Fix typo in comment
Ian Romanick [Thu, 14 Jan 2016 23:15:16 +0000 (15:15 -0800)]
meta/copy_image: Fix typo in comment

Trivial.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agomesa: Don't include meta.h
Ian Romanick [Wed, 20 Jan 2016 20:24:38 +0000 (12:24 -0800)]
mesa: Don't include meta.h

Commit 055093e removed the call to _mesa_meta_in_progress, and meta.h
has not been necessary in src/mesa/main/enable.c since.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
8 years agoradeonsi: add DCC buffer for sampler views on new CS
Nicolai Hähnle [Sun, 24 Jan 2016 16:16:34 +0000 (11:16 -0500)]
radeonsi: add DCC buffer for sampler views on new CS

This fixes a VM fault and possible lockup in high memory pressure situations.

Cc: "11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
8 years agoradeonsi: emit rw_buffers for tes_shader only if tes_shader present
Nicolai Hähnle [Fri, 22 Jan 2016 22:50:06 +0000 (17:50 -0500)]
radeonsi: emit rw_buffers for tes_shader only if tes_shader present

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: do not set the shader->key for gs copy shaders
Nicolai Hähnle [Fri, 22 Jan 2016 22:37:10 +0000 (17:37 -0500)]
radeonsi: do not set the shader->key for gs copy shaders

The key for a geometry shader would be interpreted as the key for a vertex
shader further down the line, which really doesn't make sense.

This does not affect the contents of shader->key because geometry shaders
don't have any key entries anyway.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: si_llvm_emit_vs_epilogue is never used with gs copy shaders
Nicolai Hähnle [Fri, 22 Jan 2016 22:26:44 +0000 (17:26 -0500)]
radeonsi: si_llvm_emit_vs_epilogue is never used with gs copy shaders

Hence remove the misleading branch on is_gs_copy_shader.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: move is_gs_copy_shader to si_shader_context
Nicolai Hähnle [Fri, 22 Jan 2016 22:20:15 +0000 (17:20 -0500)]
radeonsi: move is_gs_copy_shader to si_shader_context

It is only used during shader creation now, so no need to keep it around
afterwards.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: replace use of is_gs_copy_shader in si_shader_vs
Nicolai Hähnle [Fri, 22 Jan 2016 22:09:58 +0000 (17:09 -0500)]
radeonsi: replace use of is_gs_copy_shader in si_shader_vs

We now have an explicit parameter that contains the same information, and
this will allow us to get rid of is_gs_copy_shader in the si_shader struct.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: ensure that VGT_GS_MODE is sent when necessary
Nicolai Hähnle [Fri, 22 Jan 2016 22:04:48 +0000 (17:04 -0500)]
radeonsi: ensure that VGT_GS_MODE is sent when necessary

Specifically, when the API switches from using a GS to not using a GS and then
back to using the same GS again, we do not have to re-send all the GS state,
but we do have to send VGT_GS_MODE. So make VGT_GS_MODE consistently be a part
of the VS state.

This fixes a rendering bug in Dolphin, but surely other applications are
affected as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93648
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoradeonsi: extract the VGT_GS_MODE calculation into its own function
Nicolai Hähnle [Fri, 22 Jan 2016 21:58:15 +0000 (16:58 -0500)]
radeonsi: extract the VGT_GS_MODE calculation into its own function

Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agotrace: fix a segfault when tracing indirect draw calls
Samuel Pitoiset [Sun, 24 Jan 2016 16:50:46 +0000 (17:50 +0100)]
trace: fix a segfault when tracing indirect draw calls

Like other resources, the indirect draw buffer must be unwrapped.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoRevert "mesa: enable enums for OES_geometry_shader"
Marek Olšák [Sun, 24 Jan 2016 14:32:06 +0000 (15:32 +0100)]
Revert "mesa: enable enums for OES_geometry_shader"

This reverts commit 67e30987031d189d606125d4b712a575f619ab44.

It breaks a bunch of geometry shader tests, such as "spec@!opengl 3.2@minmax"
and others depending on the glGet queries.

8 years agowinsys/amdgpu: optionally use buffer lists with all allocated buffers
Marek Olšák [Thu, 14 Jan 2016 18:31:18 +0000 (19:31 +0100)]
winsys/amdgpu: optionally use buffer lists with all allocated buffers

Set RADEON_ALL_BOS=1 to use it.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoanv/cmd_buffer: Zero out binding tables and samplers in state_reset
Jason Ekstrand [Sat, 23 Jan 2016 06:57:02 +0000 (22:57 -0800)]
anv/cmd_buffer: Zero out binding tables and samplers in state_reset

This fixes a use of an undefined value if the client uses push constants in
a stage without ever setting any descriptors on GEN8-9.

8 years agonir/opcodes: Properly flush denormals in fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 06:04:09 +0000 (22:04 -0800)]
nir/opcodes: Properly flush denormals in fquantize2f16

8 years agoi965/nir: Properly flush denormals in nir_op_fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 05:24:53 +0000 (21:24 -0800)]
i965/nir: Properly flush denormals in nir_op_fquantize2f16

8 years agoglsl: Conditionalize atan2 math.
Kenneth Graunke [Tue, 19 Jan 2016 23:07:52 +0000 (15:07 -0800)]
glsl: Conditionalize atan2 math.

In the old hand-writen implementation of atan2, the calculation of
atan(y/x) was performed conditionally in the "then" block of the
outermost if statement.  I believe I accidentally lifted this out
into unconditional code when converting to IR builder.

For reference, the original hand-written IR is visible in commit
722eff674b832e2321f791c68358ef52d2a1ff25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: Erik Faye-Lund <kusmabite@gmail.com>
8 years agoanv/format: Add a helpful comment about format names
Jason Ekstrand [Sat, 23 Jan 2016 03:14:41 +0000 (19:14 -0800)]
anv/format: Add a helpful comment about format names

8 years agoanv/formats: Add support for 3 more formats
Jason Ekstrand [Sat, 23 Jan 2016 03:03:27 +0000 (19:03 -0800)]
anv/formats: Add support for 3 more formats

8 years agoanv/pipeline: Add a default L3$ setup
Jason Ekstrand [Sat, 23 Jan 2016 03:02:55 +0000 (19:02 -0800)]
anv/pipeline: Add a default L3$ setup

8 years agovirgl: enable building on Android
Rob Herring [Thu, 17 Dec 2015 15:45:50 +0000 (09:45 -0600)]
virgl: enable building on Android

This is just a copy-n-paste and rename of vc4 Android makefiles.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agovirtio_gpu: Add PCI ID to driver map
Rob Herring [Thu, 17 Dec 2015 15:45:49 +0000 (09:45 -0600)]
virtio_gpu: Add PCI ID to driver map

Add the virtio-gpu PCI ID so the driver probing works.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoanv/formats: Rename ambiguous func parameter
Chad Versace [Sat, 23 Jan 2016 01:51:24 +0000 (17:51 -0800)]
anv/formats: Rename ambiguous func parameter

vkGetPhysicalDeviceImageFormatProperties has multiple 'flags'
parameters.

8 years agoanv/formats: Advertise multisample formats
Chad Versace [Sat, 23 Jan 2016 01:47:59 +0000 (17:47 -0800)]
anv/formats: Advertise multisample formats

Teach vkGetPhysicalDeviceImageFormatProperties() to advertise
multisampled formats.

8 years agoanv/image: Drop assertion that samples == 1
Chad Versace [Sat, 23 Jan 2016 01:16:20 +0000 (17:16 -0800)]
anv/image: Drop assertion that samples == 1

8 years agoisl: Fix gen8_choose_msaa_layout()
Chad Versace [Sat, 23 Jan 2016 01:06:55 +0000 (17:06 -0800)]
isl: Fix gen8_choose_msaa_layout()

Gen8 requires any Y tiling, not any *standard* Y tiling.

8 years agoisl: Add func isl_tiling_is_any_y()
Chad Versace [Sat, 23 Jan 2016 01:06:44 +0000 (17:06 -0800)]
isl: Add func isl_tiling_is_any_y()

8 years agoanv/meta: Assert correct sample counts for blit funcs
Chad Versace [Thu, 21 Jan 2016 01:03:29 +0000 (17:03 -0800)]
anv/meta: Assert correct sample counts for blit funcs

Add assertions to:
    anv_CmdBlitImage
    anv_CmdCopyImage
    anv_CmdCopyImageToBuffer
    anv_CmdCopyBufferToImage