platform/upstream/mesa.git
9 years agoi965: add handling for imageSamples
Ilia Mirkin [Fri, 28 Aug 2015 03:34:47 +0000 (23:34 -0400)]
i965: add handling for imageSamples

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonir: convert glsl imageSamples into a new intrinsic
Ilia Mirkin [Fri, 28 Aug 2015 03:27:50 +0000 (23:27 -0400)]
nir: convert glsl imageSamples into a new intrinsic

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add support for the imageSamples function
Ilia Mirkin [Fri, 28 Aug 2015 03:22:18 +0000 (23:22 -0400)]
glsl: add support for the imageSamples function

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: add support for textureSamples function
Ilia Mirkin [Wed, 12 Aug 2015 00:37:32 +0000 (20:37 -0400)]
i965: add support for textureSamples function

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
[v2: kayden-supplied code in fs_nir replacing need for logical opcode]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add support for the textureSamples function
Ilia Mirkin [Fri, 28 Aug 2015 03:06:57 +0000 (23:06 -0400)]
glsl: add support for the textureSamples function

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add ARB_shader_texture_image_samples infrastructure
Ilia Mirkin [Fri, 28 Aug 2015 03:06:29 +0000 (23:06 -0400)]
glsl: add ARB_shader_texture_image_samples infrastructure

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonir: add nir_texop_texture_samples and convert from glsl
Ilia Mirkin [Fri, 28 Aug 2015 03:05:03 +0000 (23:05 -0400)]
nir: add nir_texop_texture_samples and convert from glsl

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add ir_texture_samples texture opcode
Ilia Mirkin [Fri, 28 Aug 2015 03:03:46 +0000 (23:03 -0400)]
glsl: add ir_texture_samples texture opcode

Will be used for textureSamples()

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add infra for ARB_shader_texture_image_samples
Ilia Mirkin [Fri, 28 Aug 2015 03:01:29 +0000 (23:01 -0400)]
mesa: add infra for ARB_shader_texture_image_samples

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Fix typos in license
Ian Romanick [Wed, 19 Aug 2015 23:36:35 +0000 (16:36 -0700)]
i965: Fix typos in license

grep -lr 'sub license' | while read f; do \
    sed --in-place -e 's/sub license/sublicense/' $f ;\
    done

grep -lr 'NON-INFRINGEMENT' | while read f; do \
    sed --in-place -e 's/NON-INFRINGEMENT/NONINFRINGEMENT/' $f ;\
    done

As noted by Matt, both of these changes match the MIT license text found
at http://opensource.org/licenses/MIT.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Remove horizontal bars from file header comments
Ian Romanick [Thu, 20 Aug 2015 02:24:45 +0000 (19:24 -0700)]
i965: Remove horizontal bars from file header comments

Why was that ever a thing?

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agosvga: clean up the compile_vs/gs/fs() functions
Brian Paul [Thu, 10 Sep 2015 14:55:01 +0000 (08:55 -0600)]
svga: clean up the compile_vs/gs/fs() functions

Sipmlify structure and remove gotos.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agosvga: fix shader variant memory leak
Brian Paul [Thu, 10 Sep 2015 14:47:16 +0000 (08:47 -0600)]
svga: fix shader variant memory leak

Fixes a small leak in a seldom-hit corner case for VS/FS compilation.
Found with coverity.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agosvga: remove useless MAX2() call
Brian Paul [Tue, 8 Sep 2015 15:40:29 +0000 (09:40 -0600)]
svga: remove useless MAX2() call

The sum of two unsigned ints is always >= 0.  Found with Coverity.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agowinsys/svga: remove useless assertion
Brian Paul [Tue, 8 Sep 2015 15:39:40 +0000 (09:39 -0600)]
winsys/svga: remove useless assertion

An unsigned int is always >= 0.  Found with Coverity.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agodocs: add news item and link release notes for 10.6.7
Emil Velikov [Thu, 10 Sep 2015 18:12:38 +0000 (19:12 +0100)]
docs: add news item and link release notes for 10.6.7

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: add sha256 checksums for 10.6.7
Emil Velikov [Thu, 10 Sep 2015 18:02:21 +0000 (19:02 +0100)]
docs: add sha256 checksums for 10.6.7

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 8789dd627ce3411a8d9271abead240f3265bd4d2)

9 years agodocs: add release notes for 10.6.7
Emil Velikov [Thu, 10 Sep 2015 17:45:17 +0000 (18:45 +0100)]
docs: add release notes for 10.6.7

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 32efdc87cbf89cfe08ad9571cd756e27c803caa8)

9 years agodocs: Update wrt. textureQueryLod on softpipe
Krzesimir Nowak [Thu, 10 Sep 2015 12:16:00 +0000 (14:16 +0200)]
docs: Update wrt. textureQueryLod on softpipe

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Implement and enable textureQueryLod
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:59 +0000 (14:15 +0200)]
softpipe: Implement and enable textureQueryLod

Passes the shader piglit tests and introduces no regressions.

This commit finally makes use of the refactoring in previous
commits.

v2:
  - adapted the code to changes in previous commits (renames,
    need_cube_convert stuff)
  - splitted too long lines

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotgsi: Add code for handling lodq opcode
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:58 +0000 (14:15 +0200)]
tgsi: Add code for handling lodq opcode

This introduces new vfunc in tgsi_sampler just for this opcode. I
decided against extending get_samples vfunc to return the mipmap level
and LOD - the function's prototype is already too scary and doing the
sampling for textureQueryLod would be a waste of time.

v2:
  - splitted too long lines

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Add functions for computing relative mipmap level
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:57 +0000 (14:15 +0200)]
softpipe: Add functions for computing relative mipmap level

These functions will be used by textureQueryLod.

v2:

  - renamed mip_level_* funcs to mip_rel_level_* to indicate that
    these functions return mip level relative to base level and
    documented them
  - renamed a level member in sp_filter_funcs struct to relative_level
  - changed mip_rel_level_none and mip_rel_level_nearest to return mip
    level relative to base level, mip_rel_level_linear already did
    that
  - documented clamp_lod function

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Split 3D to 2D coords conversion into separate function
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:56 +0000 (14:15 +0200)]
softpipe: Split 3D to 2D coords conversion into separate function

This is to avoid tying the conversion to the sampling -
textureQueryLod will need to do the conversion too, but it does not do
any sampling.

So instead of a "get_samples" vfunc, there is just a bool saying
whether the conversion is needed or not. This solution keeps a nice
property of not adding any overhead for the common case (2D textures).

v2:
  - replaced the "convert_coords" vfunc with a "need_cube_convert"
    boolean to avoid overhead of copying arrays in common case
  - removed an unused typedef
  - splitted too long lines in convert_cube
  - const fixes in convert_cube

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Split code getting a filter into separate function
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:55 +0000 (14:15 +0200)]
softpipe: Split code getting a filter into separate function

This function will be later used by textureQueryLod. The
img_filter_func are optional, because textureQueryLod will not need
them.

v2:
  - adapted to changes in previous commit (renames)
  - simplified conditions a bit
  - updated docs
  - splitted too long lines

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Put mip_filter_func inside a struct
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:54 +0000 (14:15 +0200)]
softpipe: Put mip_filter_func inside a struct

Putting this function pointer into a struct enables grouping of
several related functions in a single place. For now it is just a
single function, but the struct will be later extended with a
mip_level_func for returning relative mip level.

v2:
  - renamed sp_mip struct to sp_filter_funcs
  - renamed sp_filter_funcs instances from mip_foo to funcs_foo
  - splitted too long lines
  - sp_sampler now holds a pointer to sp_filter_funcs instead of an
    instance of it
  - some const fixes

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Split compute_lambda_lod into two functions
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:53 +0000 (14:15 +0200)]
softpipe: Split compute_lambda_lod into two functions

textureQueryLod returns a vec2 with a mipmap information and a
LOD. The latter needs to be not clamped.

v2:
  - changed the "not_clamped" part to "unclamped"
  - corrected "clamp into" to "clamp to"
  - splitted too long lines

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosoftpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:52 +0000 (14:15 +0200)]
softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value

The level-of-detail bias wasn't simply added in the explicit LOD case.
This case seems to be tested only in piglit's
fs-texturequerylod-nearest-biased test, which is currently skipped, as
softpipe does not support textureQueryLod at the moment.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotgsi: Remove trailing backslash in comment
Krzesimir Nowak [Thu, 10 Sep 2015 12:15:51 +0000 (14:15 +0200)]
tgsi: Remove trailing backslash in comment

It clearly is here by accident.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/radeon: handle PIPE_TRANSFER_FLUSH_EXPLICIT
Marek Olšák [Sun, 6 Sep 2015 13:41:35 +0000 (15:41 +0200)]
gallium/radeon: handle PIPE_TRANSFER_FLUSH_EXPLICIT

Basically, do the same thing as for buffer_unmap, but use the explicit range
instead. It's for apps which want to map a whole buffer and mark touched
ranges explicitly.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: don't update polygon offset state if it has no effect
Marek Olšák [Thu, 3 Sep 2015 17:34:58 +0000 (19:34 +0200)]
radeonsi: don't update polygon offset state if it has no effect

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: decrease the size of si_pm4_state
Marek Olšák [Sun, 6 Sep 2015 13:59:33 +0000 (15:59 +0200)]
radeonsi: decrease the size of si_pm4_state

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi/compute: add buffers to the CS directly
Marek Olšák [Sun, 6 Sep 2015 13:49:55 +0000 (15:49 +0200)]
radeonsi/compute: add buffers to the CS directly

Packets are emitted immediately anyway.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: only use new versions of LLVM image and sample intrinsics
Marek Olšák [Thu, 3 Jul 2014 18:17:36 +0000 (20:17 +0200)]
radeonsi: only use new versions of LLVM image and sample intrinsics

Just a cleanup I had made a long time ago and forgot about.

v2: use tgsi_is_shadow_target

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agogallium/radeon: drop support for LLVM 3.4
Marek Olšák [Sun, 6 Sep 2015 14:26:21 +0000 (16:26 +0200)]
gallium/radeon: drop support for LLVM 3.4

This allows using the new tex instrinsics unconditionally.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agor600/llvm: remove dead code for LLVM 3.3
Marek Olšák [Sun, 6 Sep 2015 14:19:33 +0000 (16:19 +0200)]
r600/llvm: remove dead code for LLVM 3.3

LLVM 3.3 has been unsupported for quite a while.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agor600g: use pipe_resource::width0 instead pb_buffer::size
Marek Olšák [Sun, 6 Sep 2015 14:40:21 +0000 (16:40 +0200)]
r600g: use pipe_resource::width0 instead pb_buffer::size

pb_buffer::size was aligned by 29aaab2b5f55cc6d9a84f58ce2bb8607e76a9dde,
which broke the CMASK code I think.

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

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: enable VGPR spilling on VI
Marek Olšák [Wed, 2 Sep 2015 17:05:09 +0000 (19:05 +0200)]
radeonsi: enable VGPR spilling on VI

This fixes corruption in Unigine Heaven on VI

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agowinsys/amdgpu: calculate the maximum number of compute units
Marek Olšák [Wed, 2 Sep 2015 17:04:25 +0000 (19:04 +0200)]
winsys/amdgpu: calculate the maximum number of compute units

Required for register spilling.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoUse IMP_LIB_EXT when checking for LLVM shared libraries
Jon TURNEY [Fri, 4 Sep 2015 13:00:19 +0000 (14:00 +0100)]
Use IMP_LIB_EXT when checking for LLVM shared libraries

When checking for LLVM shared libraries, use IMP_LIB_EXT for the extension for
shared libraries appropriate to the target, rather than hardcoding '.so'

Also add some comments to explain why we have this circus of pain.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoi965: Resolve GCC sign-compare warning.
Rhys Kidd [Tue, 8 Sep 2015 15:52:50 +0000 (23:52 +0800)]
i965: Resolve GCC sign-compare warning.

mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_control_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:805:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_control_index_table); i++) {
                      ^
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c: In function 'set_3src_source_index':
mesa/src/mesa/drivers/dri/i965/brw_eu_compact.c:839:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < ARRAY_SIZE(gen8_3src_source_index_table); i++) {
                      ^
mesa/src/mesa/drivers/dri/i965/brw_state_dump.c: In function 'dump_sampler_state':
mesa/src/mesa/drivers/dri/i965/brw_state_dump.c:382:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < size / 16; i++) {
                  ^
mesa/src/mesa/drivers/dri/i965/brw_state_upload.c: In function 'brw_pipeline_state_finished':
mesa/src/mesa/drivers/dri/i965/brw_state_upload.c:801:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (i != pipeline) {
             ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_gen7_hiz_buf_create':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1544:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                               ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_gen8_hiz_buf_create':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1638:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                            ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c: In function 'intel_miptree_alloc_hiz':
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1771:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int level = mt->first_level; level <= mt->last_level; ++level) {
                                            ^
mesa/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1775:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int layer = 0; layer < mt->level[level].depth; ++layer) {
                                 ^

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Resolve GCC sign-compare warning.
Rhys Kidd [Tue, 8 Sep 2015 15:52:49 +0000 (23:52 +0800)]
mesa: Resolve GCC sign-compare warning.

mesa/src/mesa/program/prog_to_nir.c: In function 'setup_registers_and_variables':
/mesa/src/mesa/program/prog_to_nir.c:1059:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < c->prog->NumTemporaries; i++) {
                      ^

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglsl: Resolve GCC sign-compare warning.
Rhys Kidd [Tue, 8 Sep 2015 15:52:48 +0000 (23:52 +0800)]
glsl: Resolve GCC sign-compare warning.

mesa/src/glsl/nir/nir_lower_tex_projector.c: In function 'nir_lower_tex_projector_block':
mesa/src/glsl/nir/nir_lower_tex_projector.c:63:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i = 0; i < tex->num_srcs; i++) {
                         ^
mesa/src/glsl/nir/nir_lower_tex_projector.c: In function 'nir_lower_tex_projector_block':
mesa/src/glsl/nir/nir_lower_tex_projector.c:114:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i = proj_index + 1; i < tex->num_srcs; i++) {
                                      ^
mesa/src/glsl/nir/nir_lower_tex_projector.c: In function 'nir_lower_tex_projector_block':
mesa/src/glsl/nir/nir_lower_tex_projector.c:53:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (proj_index = 0; proj_index < tex->num_srcs; proj_index++) {
                                       ^
mesa/src/glsl/nir/nir_lower_tex_projector.c:57:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (proj_index == tex->num_srcs)
                      ^
mesa/src/glsl/nir/nir_search.c: In function 'match_value':
mesa/src/glsl/nir/nir_search.c:84:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 0; i < num_components; ++i)
                      ^
mesa/src/glsl/nir/nir_search.c: In function 'match_value':
mesa/src/glsl/nir/nir_search.c:110:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for (int i = 0; i < num_components; ++i) {
                            ^
mesa/src/glsl/nir/nir_search.c: In function 'match_value':
mesa/src/glsl/nir/nir_search.c:139:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             if (i < num_components)
                   ^
mesa/src/glsl/nir/nir_opt_peephole_ffma.c: In function 'get_mul_for_src':
mesa/src/glsl/nir/nir_opt_peephole_ffma.c:130:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (unsigned i = 0; i < num_components; i++)
                           ^

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Resolve GCC missing field initializer warning.
Rhys Kidd [Tue, 8 Sep 2015 15:15:27 +0000 (23:15 +0800)]
mesa: Resolve GCC missing field initializer warning.

Resolve a series of missing field initializer warnings within get_hash_params.py

Of the form:
In file included from mesa/src/mesa/main/get.c:495:0:
mesa/src/mesa/main/get_hash.h:180:5: warning: missing initializer for field
'extra' of 'const struct value_desc' [-Wmissing-field-initializers]
     { GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES, LOC_CUSTOM, TYPE_INT, 0 },
     ^
mesa/src/mesa/main/get.c:165:15: note: 'extra' declared here
    const int *extra;
               ^

This patch addresses some likely code rot around the *extra field, where the
initialization is via C code generated indirectly from a Python script.
It resolves a number of warnings reported by GCC when configured to be pedantic.

$ gcc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2

No piglit regressions on Ironlake.

v2:
- Squash series into a single patch.

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoclover: Avoid using typename to allow compilation of clover by clang
Albert Freeman [Tue, 8 Sep 2015 13:06:40 +0000 (13:06 +0000)]
clover: Avoid using typename to allow compilation of clover by clang

When parsing an variable declaration qualified with the typename
keyword, clang attempted to declare a variable with the type of non
type member "enum type type" of module::argument (within the header
file clover/core/module.hpp) instead of the typed member of
module::argument "enum type".

Replaced "typename" with "enum" to force clang to declare the variable
marg_type with type "enum type" of module::argument.

CC: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Albert Freeman <albertwdfreeman@gmail.com>
9 years agoi965: Advertise 65536 for GL_MAX_UNIFORM_BLOCK_SIZE.
Kenneth Graunke [Tue, 8 Sep 2015 22:41:11 +0000 (15:41 -0700)]
i965: Advertise 65536 for GL_MAX_UNIFORM_BLOCK_SIZE.

Our old value of 16384 is the minimum value.  DirectX apparently
requires 65536 at a minimum; that's also what nVidia and the Intel
Windows driver advertise.  AMD advertises MAX_INT.

Ilia Mirkin noticed that "Shadow Warrior" uses UBOs larger than 16k
on Nouveau, which advertises 65536 bytes for this limit.  Traces
captured on Nouveau don't work on i965 because our lower limit causes
the GLSL linker to reject the captured shaders.  While this isn't
important in and of itself, it does suggest that raising the limit
would be beneficial.

We can read linear buffers up to 2^27 bytes in size, so raising this
should be safe; we could probably even go larger.  For now, matching
nVidia and Intel/Windows seems like a good plan.

We have to reinitialize MaxCombinedUniformComponents as core Mesa will
have set it based on a stale value for MaxUniformBlockSize.

According to Tapani, there's an unreleased game that asserts on this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agonv50/ir: don't fold immediate into mad if registers are too high
Ilia Mirkin [Thu, 10 Sep 2015 09:02:26 +0000 (05:02 -0400)]
nv50/ir: don't fold immediate into mad if registers are too high

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agonv50/ir: fix emission of 8-byte wide interp instruction
Ilia Mirkin [Thu, 10 Sep 2015 07:55:06 +0000 (03:55 -0400)]
nv50/ir: fix emission of 8-byte wide interp instruction

This can come up if the target register number is > 63, which is fairly
rare.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91551
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agonv50/ir: r63 is only 0 if we are using less than 63 registers
Ilia Mirkin [Thu, 10 Sep 2015 07:49:36 +0000 (03:49 -0400)]
nv50/ir: r63 is only 0 if we are using less than 63 registers

It is advantageous to use r63 instead of r127 since r63 can fit into the
shorter encoding. However if we've RA'd over 63 registers, we must use
r127 as the replacement instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agonv50/ir: make edge splitting fix up phi node sources
Ilia Mirkin [Thu, 10 Sep 2015 05:54:30 +0000 (01:54 -0400)]
nv50/ir: make edge splitting fix up phi node sources

Unfortunately nv50_ir phi nodes aren't directly connected to the CFG, so
the mapping between source and the actual BB is by inbound edge order.
So when manipulating edges one has to be extremely careful. We were
insufficiently careful when splitting critical edges which resulted in
the phi nodes being confused as to where their sources were coming from.

This primarily manifests itself with the TXL-lowering logic on nv50,
when it is inside of a conditional. I've been unable to trigger the
issue anywhere else so far. This resolves rendering failures
in a number of games like Two Worlds 2, Trine: Enchanted Edition, Trine 2,
XCOM:Enemy Unknown, Stacking. It also improves the situation in
Hearthstone, Sonic Generations, and The Raven: Legacy of a Master Thief.
However more work needs to be done there (splitting a lot more edges
solves it, so it's some other sort of RA-related issue).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90887
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agoglsl: Remove ADD_VARYING macro
Ian Romanick [Wed, 26 Aug 2015 12:45:52 +0000 (13:45 +0100)]
glsl: Remove ADD_VARYING macro

The purpose of the macro was to create the name_as_gs_input from name.
The previous commit removed the name_as_gs_input from add_varying, so
the macro is unnecessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoglsl: Silence unused parameter warnings
Ian Romanick [Wed, 26 Aug 2015 12:38:49 +0000 (13:38 +0100)]
glsl: Silence unused parameter warnings

builtin_variables.cpp:1062:53: warning: unused parameter 'name_as_gs_input' [-Wunused-parameter]
                                         const char *name_as_gs_input)
                                                     ^
builtin_functions.cpp:4774:47: warning: unused parameter 'intrinsic_name' [-Wunused-parameter]
                                   const char *intrinsic_name,
                                               ^
builtin_functions.cpp:4907:66: warning: unused parameter 'state' [-Wunused-parameter]
 _mesa_glsl_find_builtin_function_by_name(_mesa_glsl_parse_state *state,
                                                                  ^
builtin_functions.cpp:4915:49: warning: unused parameter 'num_arguments' [-Wunused-parameter]
                                        unsigned num_arguments,
                                                 ^
builtin_functions.cpp:4916:49: warning: unused parameter 'flags' [-Wunused-parameter]
                                        unsigned flags)
                                                 ^
ir_print_visitor.cpp:589:37: warning: unused parameter 'ir' [-Wunused-parameter]
 ir_print_visitor::visit(ir_barrier *ir)
                                     ^
linker.cpp:3212:48: warning: unused parameter 'ctx' [-Wunused-parameter]
 build_program_resource_list(struct gl_context *ctx,
                                                ^
standalone_scaffolding.cpp:65:57: warning: unused parameter ‘id’ [-Wunused-parameter]
 _mesa_shader_debug(struct gl_context *, GLenum, GLuint *id,
                                                         ^

v2: Rebase on top of GL_ARB_shader_image_size work (especially
58a86897).  Silence more warnings added by that work.

v3: Remove mention of the removed parameter from comments.  Suggested by
Iago.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1]
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Cc: "Martin Peres <martin.peres@linux.intel.com>"
9 years agonvc0: remove BGRA4 format support
Ilia Mirkin [Thu, 10 Sep 2015 01:50:03 +0000 (21:50 -0400)]
nvc0: remove BGRA4 format support

Something is wrong with the support somewhere. I couldn't get the blob
driver to use it either, although it happily used RGB5_A1.
teximage-colors works, but WoW seems to fail in the menus for drawing
text.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91526
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
9 years agogallium/ttn: fix cursor handling vs builder
Rob Clark [Wed, 9 Sep 2015 21:27:17 +0000 (17:27 -0400)]
gallium/ttn: fix cursor handling vs builder

After inserting instructions the cursor.option becomes _after_instr
(even if it started life as an _after_block).  So we cannot simply stash
the current cursor on the if/loop_stack.  Otherwise we end up inserting
instructions after the endif/endloop in the block preceeding the if/
loop.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonvc0: keep track of cb bindings per buffer, use for upload settings
Ilia Mirkin [Wed, 9 Sep 2015 07:17:38 +0000 (03:17 -0400)]
nvc0: keep track of cb bindings per buffer, use for upload settings

CB updates to bound buffers need to go through the CB_DATA endpoints,
otherwise the shader may not notice that the updates happened.
Furthermore, these updates have to go in to the same address as the
bound buffer, otherwise, again, the shader may not notice updates.

So we keep track of all the places where a constbuf is bound, and
iterate over all of them when updating data. If a binding is found that
encompasses the region to be updated, then we use the settings of that
binding for the upload. Otherwise we upload as a regular data update.

This fixes piglit 'arb_uniform_buffer_object-rendering offset' as well
as blurriness in Witcher2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91890
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agonir/glsl: Use lower_outputs_to_temporaries instead of relying on GLSL IR
Jason Ekstrand [Tue, 8 Sep 2015 21:31:11 +0000 (14:31 -0700)]
nir/glsl: Use lower_outputs_to_temporaries instead of relying on GLSL IR

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agonir: Add a pass to lower outputs to temporary variables
Jason Ekstrand [Sat, 29 Aug 2015 00:09:02 +0000 (17:09 -0700)]
nir: Add a pass to lower outputs to temporary variables

This pass can be used as a helper for NIR producers so they don't have to
worry about creating the temporaries themselves.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agonir/cursor: Add a constructor for the end of a block but before the jump
Jason Ekstrand [Sat, 29 Aug 2015 00:17:39 +0000 (17:17 -0700)]
nir/cursor: Add a constructor for the end of a block but before the jump

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agonv30: Disable msaa unless requested from the env by NV30_MAX_MSAA
Hans de Goede [Wed, 9 Sep 2015 13:52:09 +0000 (15:52 +0200)]
nv30: Disable msaa unless requested from the env by NV30_MAX_MSAA

Some modern apps try to use msaa without keeping in mind the
restrictions on videomem of older cards. Resulting in dmesg saying:

 [ 1197.850642] nouveau E[soffice.bin[3785]] fail ttm_validate
 [ 1197.850648] nouveau E[soffice.bin[3785]] validating bo list
 [ 1197.850654] nouveau E[soffice.bin[3785]] validate: -12

Because we are running out of video memory, after which the program
using the msaa visual freezes, and eventually the entire system freezes.

To work around this we do not allow msaa visauls by default and allow
the user to override this via NV30_MAX_MSAA.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[imirkin: move env var lookup to screen so that it's only done once]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
9 years agonv30: Fix color resolving for nv3x cards
Hans de Goede [Wed, 9 Sep 2015 13:52:08 +0000 (15:52 +0200)]
nv30: Fix color resolving for nv3x cards

We do not have a generic blitter on nv3x cards, so we must use the
sifm object for color resolving.

This commit divides the sources and dest surfaces in to tiles which
match the constraints of the sifm object, so that color resolving
will work properly on nv3x cards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agogallium/docs: clairify dmabuf fd ownership
Rob Clark [Thu, 3 Sep 2015 18:53:03 +0000 (14:53 -0400)]
gallium/docs: clairify dmabuf fd ownership

Since debugging issues w/ fd's close()d at the wrong time can be quite
fun, this should probably be made more explicit in the docs.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agoandroid: radeonsi: add support for sid_tables.h generated sources
Mauro Rossi [Sun, 6 Sep 2015 12:15:38 +0000 (14:15 +0200)]
android: radeonsi: add support for sid_tables.h generated sources

This patch is necessary to avoid building error on android,
due to missing sid_tables.h generated sources

v2:[Emil Velikov] Correctly split the lists.

Fixes: fbbebeae10f(radeonsi: inline si_cmd_context_control)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: Always define __STDC_LIMIT_MACROS.
Mauro Rossi [Fri, 21 Aug 2015 21:46:29 +0000 (23:46 +0200)]
android: Always define __STDC_LIMIT_MACROS.

Analogous to commit 02a4fe22b13 (configure.ac: Always define
__STDC_LIMIT_MACROS.)

v2: [Emil Velikov] keep the LLVM specific __STDC_FORMAT_MACROS

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: rename LLVM_VERSION_PATCH to MESA_LLVM_VERSION_PATCH
Mauro Rossi [Fri, 21 Aug 2015 21:46:28 +0000 (23:46 +0200)]
android: rename LLVM_VERSION_PATCH to MESA_LLVM_VERSION_PATCH

Fixes: 797f4eacea8(configure.ac: rename LLVM_VERSION_PATCH to avoid
conflict with llvm-config.h)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agonouveau: android: add space before PRIx64 macro
Mauro Rossi [Fri, 21 Aug 2015 21:46:27 +0000 (23:46 +0200)]
nouveau: android: add space before PRIx64 macro

Otherwise the android build fails with

   error : unable to find string literal operator ‘operator"" PRIx64’

There are several resources referring to the problem, which is related
to c++11, in our case used when building mesa for lollipop.

http://comments.gmane.org/gmane.comp.graphics.opensg.user/5883

I've not investigated all the semantics, some people even suggested a
bug in the gcc compiler,
I just saw the building error was solved with one little space for
lollipop and no side effect when c+11 not used.

v2: [Emil Velikov] add an alternative commit message from Mauro.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agosvga: pick all the files into the tarball
Emil Velikov [Wed, 9 Sep 2015 12:22:23 +0000 (13:22 +0100)]
svga: pick all the files into the tarball

Signed-off-by: Emil Velikov <emil.velikov@collabora.co.uk>
9 years agoauxiliary: rework the python generated sources rules
Emil Velikov [Fri, 17 Jul 2015 09:52:35 +0000 (10:52 +0100)]
auxiliary: rework the python generated sources rules

There are a few bits this commit aims to resolve:

One can generalise the mkdir rule to a simple MKDIR_P $(@D) which will
expand appropriately for even if we change the subdir name, and/or add
new rules. We can also drop the explicit $(srcdir) prefix for the
dependency rules, they they are not strictly required, nor used
elsewhere in mesa.

Finally replace $< with explicit filename to be consistent through the
file, and honour PYTHON_FLAGS.

v2: Add comprehensive commit summary/message (Ian, Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglsl: build: remove bogus dependency
Emil Velikov [Wed, 9 Sep 2015 11:40:03 +0000 (12:40 +0100)]
glsl: build: remove bogus dependency

v2: rebase on top of the previous commit - don't touch the LOCAL_PATH
prefix for nir_constant_expressions.h

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoglsl: build: use makefile.sources variables when possible
Emil Velikov [Fri, 17 Jul 2015 12:30:51 +0000 (13:30 +0100)]
glsl: build: use makefile.sources variables when possible

Rather than folding one variable within the other only to unwrap them,
just use the ones we need.

v2: bring back LOCAL_PATH prefix for nir_constant_expressions,h

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
9 years agoglsl: automake: reuse $(NIR_GENERATED_FILES) where possible
Emil Velikov [Fri, 17 Jul 2015 12:28:00 +0000 (13:28 +0100)]
glsl: automake: reuse $(NIR_GENERATED_FILES) where possible

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoglsl: automake: rework the sources generation rules
Emil Velikov [Wed, 9 Sep 2015 11:28:37 +0000 (12:28 +0100)]
glsl: automake: rework the sources generation rules

The glsl equivalent of "mesa: automake: rework the source generation
rules". Plus let's make things consistent and always explicitly provide
the header name.

v2: Rebase on top of reverted "remove custom AM_V_LEX/YACC" (Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: automake: rework the source generation rules
Emil Velikov [Fri, 17 Jul 2015 09:44:30 +0000 (10:44 +0100)]
mesa: automake: rework the source generation rules

Same logic as previous commit applies.

Additionally remove the odd (set -e/mv/INDENT) from the rules.
The last one is the only one we remotely care about, if reading the
generated sources.

Upcoming work from DylanB which will replace the existing python
scripts with ones that produce more readable output anyway.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agomapi: automake: rework the source generation rules
Emil Velikov [Fri, 17 Jul 2015 09:27:29 +0000 (10:27 +0100)]
mapi: automake: rework the source generation rules

Same logic as previous commit applies. Also fix bogus MESA_MAPI_DIR -
the sources are located in the source dir (duh).

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agomapi: automake: rework the *api/glapi_mapi_tmp.h rules
Emil Velikov [Wed, 9 Sep 2015 11:14:00 +0000 (12:14 +0100)]
mapi: automake: rework the *api/glapi_mapi_tmp.h rules

Same logic as previous commit applies.

v2: Merge with "inline glapi_gen_mapi define" (Matt)

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoutil: automake: rework the format_srgb.c rule
Emil Velikov [Fri, 17 Jul 2015 09:21:06 +0000 (10:21 +0100)]
util: automake: rework the format_srgb.c rule

A handful of changes/cleanups paving the way to bmake support:
 - Remove optional $(srcdir)/ prefix for files in the prereq list.
 - Drop the space after the AM_V_GEN variable.
 - Using $< in a non-suffix rule is a GNU make idiom.
 - Use $(@D) over $(dir $@). The latter is a POSIX standard.

v2: Cosmetic tweaks in the commit summary.

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
9 years agoxmlpool: 'promote' LOCALEDIR variable
Emil Velikov [Wed, 15 Jul 2015 09:28:05 +0000 (10:28 +0100)]
xmlpool: 'promote' LOCALEDIR variable

This is the only place in mesa that uses this constuct which seems
to be GNUmake-ism. Attempting to build with POSIX make implementations
(bmake) would fail as below.

--- options.h ---
LOCALEDIR := .
sh: line 2: LOCALEDIR: command not found
*** [options.h] Error code 127

So let's keep things consistent and compatible by making the variable
non target specific.

v2:
 - Bring back LOCALEDIR.
 - Reword the commit message
 - Change mesa-stable tag 10.6 > 11.0

Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl_dri2: Add support for EGL_KHR_create_contest when using swrast
Boyan Ding [Tue, 21 Jul 2015 15:43:58 +0000 (23:43 +0800)]
egl_dri2: Add support for EGL_KHR_create_contest when using swrast

This requires swrast version >= 3. Also EGL_EXT_create_context_robostness
is supported if __DRI2_ROBUSTNESS extension is found.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=80821
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
9 years agoegl_dri2: Use createContextAttribs if swrast version >= 3
Boyan Ding [Tue, 21 Jul 2015 15:43:57 +0000 (23:43 +0800)]
egl_dri2: Use createContextAttribs if swrast version >= 3

v2: Change return type of the new function from int to bool

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
9 years agoegl_dri2: Move filling context_attrib array in a separate function
Boyan Ding [Tue, 21 Jul 2015 15:43:56 +0000 (23:43 +0800)]
egl_dri2: Move filling context_attrib array in a separate function

v2: Change return type of the new function from int to bool

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
9 years agomesa: Allow query of GL_VERTEX_BINDING_BUFFER
Marta Lofstedt [Mon, 31 Aug 2015 13:04:18 +0000 (15:04 +0200)]
mesa: Allow query of GL_VERTEX_BINDING_BUFFER

According to OpenGL ES 3.1 specification table : 20.2 and
OpenGL specification 4.4 table 23.4. The glGetIntegeri_v
functions should report the name  of the buffer bound
when called with GL_VERTEX_BINDING_BUFFER.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Enable GL_MAX_VERTEX_ATTRIB enums for GLES 3.1
Marta Lofstedt [Mon, 10 Aug 2015 11:24:00 +0000 (13:24 +0200)]
mesa/es3.1: Enable GL_MAX_VERTEX_ATTRIB enums for GLES 3.1

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agoi965/nir: Use nir_system_value_from_intrinsic to reduce duplication.
Kenneth Graunke [Mon, 3 Aug 2015 23:10:21 +0000 (16:10 -0700)]
i965/nir: Use nir_system_value_from_intrinsic to reduce duplication.

This code is all pretty much identical.  We just needed the translation
from one enum value to the other.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agonir: Add a nir_system_value_from_intrinsic() function.
Kenneth Graunke [Mon, 3 Aug 2015 23:02:16 +0000 (16:02 -0700)]
nir: Add a nir_system_value_from_intrinsic() function.

This converts NIR intrinsics that load system values into Mesa's
SYSTEM_VALUE_* enumerations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoi965: Mark topologies with adjacency information as G45+.
Kenneth Graunke [Sat, 25 Jul 2015 04:03:31 +0000 (21:03 -0700)]
i965: Mark topologies with adjacency information as G45+.

These didn't exist on the original 965.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoi965: Fix value of _3DPRIM_TRIFAN_NOSTIPPLE.
Kenneth Graunke [Sat, 25 Jul 2015 04:01:43 +0000 (21:01 -0700)]
i965: Fix value of _3DPRIM_TRIFAN_NOSTIPPLE.

TRIFAN_NOSTIPPLE has always been 0x16 - 0x15 is marked "Reserved" on all
platforms.  See the 965 PRM, Volume 2, Table 3-1, "3D Primitive Topology
Type Encoding" for a list.

We don't currently use this, and I don't expect we will, but we may as
well not leave the bogus value around.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoi965: Add 64-bit dirty flag handling to brw_upload_pull_constants
Chris Forbes [Sun, 7 Dec 2014 02:32:11 +0000 (15:32 +1300)]
i965: Add 64-bit dirty flag handling to brw_upload_pull_constants

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Add defines for all new Gen7/8 URB opcodes
Chris Forbes [Thu, 6 Nov 2014 11:04:01 +0000 (00:04 +1300)]
i965: Add defines for all new Gen7/8 URB opcodes

Tessellation needs to emit URB reads and atomics;

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/gen8+: Skip depth stalls on state change
Ben Widawsky [Wed, 26 Aug 2015 17:52:58 +0000 (10:52 -0700)]
i965/gen8+: Skip depth stalls on state change

Docs suggest this is no longer required starting with Gen8.

Perf (no regressions in n=20)
OglMultithread       0.67%
OglTerrainPanInst    0.12%
trex                 0.45%
warsow               0.64%

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
9 years agor600: don't use shader key without verifying shader type (v2)
Dave Airlie [Mon, 7 Sep 2015 22:36:32 +0000 (08:36 +1000)]
r600: don't use shader key without verifying shader type (v2)

Since 7a32652231f96eac14c4bfce02afe77b4132fb77
r600: Turn 'r600_shader_key' struct into union

we were accessing key fields that might be aliased in the union
with other fields, so we should check what shader type we are
compiling for before using key values from it.

v1.1: make it compile
v2: have caffeine, make it work - we don't set type
until later, so don't reference it until we've set it.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoi965/skl: Use more compact hiz dimensions
Ben Widawsky [Tue, 8 Sep 2015 17:19:22 +0000 (10:19 -0700)]
i965/skl: Use more compact hiz dimensions

I meant to do this here, but it was in the wrong place:

commit c1151b18f2dce7c6f238f057e9c4fa8d912ce6b5
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Wed Jun 24 20:07:54 2015 -0700

   i965/skl: Use more compact hiz dimensions

NOTE: Jordan did go back and look at the original mailing list post. I mailed
the right thing, and pushed the wrong one.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
9 years agost/mesa: increase viewport bounds limits for GL4 hw
Ilia Mirkin [Tue, 8 Sep 2015 20:58:43 +0000 (16:58 -0400)]
st/mesa: increase viewport bounds limits for GL4 hw

According to the ARB_viewport_array spec, GL4 limit is higher than the
GL3 limit. Also take this opportunity to fix the GL3 limit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agonvc0: always emit a full shader colormask
Ilia Mirkin [Sun, 6 Sep 2015 08:51:29 +0000 (04:51 -0400)]
nvc0: always emit a full shader colormask

Indications are that if the colormask indicates a single bit set on
fermi, that value will always be read from $r0 instead of a potentially
higher register (if e.g. green is set). Not to upset the counting logic,
always set the header up with a full color mask for each RT. Such a
situation can basically only ever happen with generated blit shaders.

Fixes the following piglit on Fermi (Kepler is unaffected):
  fbo-stencil blit GL_DEPTH32F_STENCIL8

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
9 years agodocs: fix date formatting in index.html
Brian Paul [Tue, 8 Sep 2015 14:47:01 +0000 (08:47 -0600)]
docs: fix date formatting in index.html

9 years agonir: UBO loads no longer use const_index[1]
Iago Toral Quiroga [Tue, 1 Sep 2015 09:32:29 +0000 (11:32 +0200)]
nir: UBO loads no longer use const_index[1]

Commit 2126c68e5cba killed the array elements parameter on load/store
intrinsics that was stored in const_index[1]. It looks like that
patch missed to remove this assignment in the UBO path.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agonv30: Fix max width / height checks in nv30 sifm code
Hans de Goede [Mon, 7 Sep 2015 19:50:48 +0000 (21:50 +0200)]
nv30: Fix max width / height checks in nv30 sifm code

The sifm object has a limit of 1024x1024 for its input size and 2048x2048
for its output. The code checking this was trying to be clever resulting
in it seeing a surface of e.g 1024x256 being outside of the input size
limit.

This commit fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
9 years agoi965: Disallow fast blit paths for CopyTexImage with PixelTransfer ops
Chris Wilson [Sat, 5 Sep 2015 18:19:33 +0000 (19:19 +0100)]
i965: Disallow fast blit paths for CopyTexImage with PixelTransfer ops

glCopyTexImage behaves similarly to glReadPixels with respect to the
pixel transfer operations. Therefore if any are set we cannot use the
simple blit-only fast paths.

(Though if would be possible to relax the blorp path to handle
pixel zoom, or we can just enhance meta.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviwewed-by: Iago Toral <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
9 years agomesa/tests: Remove unneeded X11_CFLAGS
Jon TURNEY [Fri, 4 Sep 2015 11:43:06 +0000 (12:43 +0100)]
mesa/tests: Remove unneeded X11_CFLAGS

X11_CFLAGS is never defined.  Path to X11 headers is not needed here, so
just remove.

Future work: Using AM_CFLAGS here looks wrong, as this Makefile only builds
C++ files

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglxl/tests: Use X11_INCLUDES instead of X11_CFLAGS
Jon TURNEY [Fri, 4 Sep 2015 11:43:05 +0000 (12:43 +0100)]
glxl/tests: Use X11_INCLUDES instead of X11_CFLAGS

X11_CFLAGS is undefined, so these tests will fail to build if x11proto is
installed in a non-standard location.

(See also commits 35189d76bc93c379854b028bad901d7e08, etc.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agosvga: Fix surface view error handling
Thomas Hellstrom [Fri, 4 Sep 2015 10:26:05 +0000 (03:26 -0700)]
svga: Fix surface view error handling

Make sure errors are correcly propagated.
Also don't flush during state emission if emission fails.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoxa: add xa_surface_from_handle2 v2
Rob Clark [Thu, 3 Sep 2015 06:13:33 +0000 (23:13 -0700)]
xa: add xa_surface_from_handle2 v2

Like xa_surface_from_handle(), but takes a handle type, rather than
hard-coding 'shared' handle.  This is needed to fix bugs seen with
xf86-video-freedreno with xrandr rotation, for example.  The root issue
is that doing a GEM_OPEN ioctl on a bo that already has a GEM handle
associated with the drm_file will result in two unique handles for the
same bo.  Which causes all sorts of follow-on fail.

v2:
- Add support for for fd handles.
- Avoid duplicating code.
- Bump xa version minor.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
9 years agoi965/nir/vec4: removed unneeded tex src swizzle set
Alejandro Piñeiro [Sat, 5 Sep 2015 13:26:59 +0000 (15:26 +0200)]
i965/nir/vec4: removed unneeded tex src swizzle set

At that point the swizzle should be correct.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>