mesa.git
9 years agoFix a few typos
Zoë Blade [Wed, 22 Apr 2015 10:33:17 +0000 (11:33 +0100)]
Fix a few typos

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoi965/gen8: Factor out texture surface state set-up from gen8_update_texture_surface().
Francisco Jerez [Mon, 13 Apr 2015 18:38:06 +0000 (21:38 +0300)]
i965/gen8: Factor out texture surface state set-up from gen8_update_texture_surface().

This moves most of the surface state set-up logic that can be shared
between textures and shader images to a separate function.

9 years agoi965/gen7: Factor out texture surface state set-up from gen7_update_texture_surface().
Francisco Jerez [Mon, 13 Apr 2015 18:37:02 +0000 (21:37 +0300)]
i965/gen7: Factor out texture surface state set-up from gen7_update_texture_surface().

This moves most of the surface state set-up logic that can be shared
between textures and shader images to a separate function.

9 years agoi965: Add helper functions to calculate the slice pitch of an array or 3D miptree.
Francisco Jerez [Wed, 22 Apr 2015 18:32:49 +0000 (21:32 +0300)]
i965: Add helper functions to calculate the slice pitch of an array or 3D miptree.

9 years agoscons: add target osmesa using gallium state tracker.
Olivier Pena [Wed, 22 Apr 2015 15:36:28 +0000 (15:36 +0000)]
scons: add target osmesa using gallium state tracker.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoradeonsi: set an optimal value for DB_Z_INFO.ZRANGE_PRECISION
Marek Olšák [Thu, 16 Apr 2015 18:40:31 +0000 (20:40 +0200)]
radeonsi: set an optimal value for DB_Z_INFO.ZRANGE_PRECISION

Required because of a VI hw bug.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove deprecated and useless registers
Marek Olšák [Thu, 16 Apr 2015 18:37:45 +0000 (20:37 +0200)]
radeonsi: remove deprecated and useless registers

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove useless includes
Marek Olšák [Thu, 16 Apr 2015 18:16:35 +0000 (20:16 +0200)]
radeonsi: remove useless includes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: print winsys info with R600_DEBUG=info
Marek Olšák [Thu, 16 Apr 2015 18:15:16 +0000 (20:15 +0200)]
gallium/radeon: print winsys info with R600_DEBUG=info

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agowinsys/radeon: make radeon_bo_vtbl static
Marek Olšák [Thu, 16 Apr 2015 17:09:57 +0000 (19:09 +0200)]
winsys/radeon: make radeon_bo_vtbl static

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoglsl: replace while loop with without_array function
Timothy Arceri [Tue, 19 Aug 2014 07:46:44 +0000 (21:46 -1000)]
glsl: replace while loop with without_array function

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoglsl: support packing of arrays of arrays
Timothy Arceri [Fri, 27 Feb 2015 11:43:39 +0000 (22:43 +1100)]
glsl: support packing of arrays of arrays

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoglsl: add arrays of arrays support to without_array function
Timothy Arceri [Tue, 19 Aug 2014 07:40:50 +0000 (21:40 -1000)]
glsl: add arrays of arrays support to without_array function

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs/GL3: started adding support for shader_image_size
Martin Peres [Mon, 27 Apr 2015 07:13:49 +0000 (10:13 +0300)]
docs/GL3: started adding support for shader_image_size

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agogallium/hud: add more options to customize HUD panes
Gediminas Jakutis [Sat, 11 Apr 2015 23:58:33 +0000 (02:58 +0300)]
gallium/hud: add more options to customize HUD panes

Extends the syntax of GALLIUM_HUD environment variable to:
- Add options to set the size and exact location of each pane.
- Add an option to limit the maximum allowed value of the X axis on a
  pane, clamping the graph down to not go above this value.
- Add an option to auto-adjust the value of the Y axis down to the
  highest value still visible on the graph.

v2:
- Make the patch simpler and smaller.
- With dynamic auto-adjusting on, adjust the Y axis once per pane
  update instead of updating once every several seconds.
- No longer mishandle pane height when having more than one graph per
  pane.

9 years agoi965: Fill out the rest of brw_debug_recompile_sampler_key().
Kenneth Graunke [Fri, 24 Apr 2015 06:17:10 +0000 (23:17 -0700)]
i965: Fill out the rest of brw_debug_recompile_sampler_key().

This makes INTEL_DEBUG=perf report shader recompiles due to CMS vs.
UMS/IMS differences and Sandybridge textureGather workarounds.

Previously, we just flagged them as "Something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Disassemble sampler message names on Gen5+.
Kenneth Graunke [Fri, 24 Apr 2015 05:56:25 +0000 (22:56 -0700)]
i965: Disassemble sampler message names on Gen5+.

Previously, sampler messages were decoded as

sampler (1, 0, 2, 2) mlen 6 rlen 8              { align1 1H };

I don't know how much time we've collectly wasted trying to read this
format.  I can never recall which number is the surface index, sampler
index, message type, or...whatever that other number is.  Figuring out
the message name from the numerical code is also painful.

Now they decode as:

sampler sample_l SIMD16 Surface = 1 Sampler = 0 mlen 6 rlen 8 { align1 1H };

This is easy to read at a glance, and matches the format I used for
render target formats.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoi965/fs: Disallow constant propagation into POW on Gen 6.
Matt Turner [Sat, 25 Apr 2015 08:50:04 +0000 (01:50 -0700)]
i965/fs: Disallow constant propagation into POW on Gen 6.

Fixes assertion failures in three piglit tests on Gen 6 since commit
0087cf23e.

9 years agomesa: add support for exposing up to GL4.2
Ilia Mirkin [Thu, 23 Apr 2015 14:48:47 +0000 (10:48 -0400)]
mesa: add support for exposing up to GL4.2

Add the 4.0/4.1/4.2 extensions lists to compute_version. A couple of
extensions aren't in mesa yet, so those are marked with 0 until they
become supported.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Add missing pixel_x/y to brw_instruction_name().
Matt Turner [Fri, 24 Apr 2015 23:23:46 +0000 (16:23 -0700)]
i965/fs: Add missing pixel_x/y to brw_instruction_name().

Forgotten in commit 529064f6.

9 years agoi965/fs: Don't constant propagate into integer math instructions.
Matt Turner [Fri, 24 Apr 2015 20:14:56 +0000 (13:14 -0700)]
i965/fs: Don't constant propagate into integer math instructions.

Constant combining won't promote non-floats, so this isn't safe.

Fixes regressions since commit 0087cf23e.

9 years agodocs: add news item and link release notes for mesa 10.5.4
Emil Velikov [Fri, 24 Apr 2015 21:58:23 +0000 (22:58 +0100)]
docs: add news item and link release notes for mesa 10.5.4

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 sums for the 10.5.4 release
Emil Velikov [Fri, 24 Apr 2015 21:51:25 +0000 (22:51 +0100)]
docs: Add sha256 sums for the 10.5.4 release

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

9 years agoAdd release notes for the 10.5.4 release
Emil Velikov [Fri, 24 Apr 2015 21:27:09 +0000 (22:27 +0100)]
Add release notes for the 10.5.4 release

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

9 years agomesa: put more info in glTexImage GL_OUT_OF_MEMORY error message
Brian Paul [Fri, 24 Apr 2015 18:56:04 +0000 (12:56 -0600)]
mesa: put more info in glTexImage GL_OUT_OF_MEMORY error message

Give the user some idea about the size of the texture which caused
the GL_OUT_OF_MEMORY error.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Allow 2-src math instructions to have immediate src1.
Matt Turner [Tue, 17 Mar 2015 00:53:34 +0000 (17:53 -0700)]
i965/fs: Allow 2-src math instructions to have immediate src1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonir: Transform pow(x, 4) into (x*x)*(x*x).
Matt Turner [Fri, 24 Apr 2015 18:37:30 +0000 (11:37 -0700)]
nir: Transform pow(x, 4) into (x*x)*(x*x).

9 years agoglsl: Transform pow(x, 4) into (x*x)*(x*x).
Matt Turner [Tue, 17 Mar 2015 04:33:31 +0000 (21:33 -0700)]
glsl: Transform pow(x, 4) into (x*x)*(x*x).

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: fix glGetActiveUniformsiv regression
Tapani Pälli [Thu, 23 Apr 2015 11:19:33 +0000 (14:19 +0300)]
mesa: fix glGetActiveUniformsiv regression

Commit 7519ddb caused regression to glGetActiveUniformsiv.
Patch adds back validation loop of all given uniforms before
writing any values, not touching params in case of errors
is tested by the conformance suite.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90149
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomesa: refactor active attrib queries for glGetProgramiv
Tapani Pälli [Thu, 23 Apr 2015 08:13:17 +0000 (11:13 +0300)]
mesa: refactor active attrib queries for glGetProgramiv

Main motivation here is to get rid of iterating IR and
encapsulate queries within program resources.
No functional changes.

Piglit tests calling the modified functionality:

   - gl-get-active-attrib-returns-all-inputs
   - glsl-1.50-get-active-attrib-array
   - getactiveattrib

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
9 years agoi965: Add an INTEL_DEBUG=spill option to test spilling
Jason Ekstrand [Thu, 23 Apr 2015 18:49:27 +0000 (11:49 -0700)]
i965: Add an INTEL_DEBUG=spill option to test spilling

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/debug: Use the ull specifier for DEBUG enum defines
Jason Ekstrand [Thu, 23 Apr 2015 20:59:32 +0000 (13:59 -0700)]
i965/debug: Use the ull specifier for DEBUG enum defines

The INTEL_DEBUG variable is a uint64_t and if we want a enum value higer
than 32 bits, you need to use ull.  We might as well use it for all of them.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Disallow linear blits that are not cacheline aligned.
Kenneth Graunke [Tue, 21 Apr 2015 19:32:38 +0000 (12:32 -0700)]
i965: Disallow linear blits that are not cacheline aligned.

The BLT engine on Gen8+ requires linear surfaces to be cacheline
aligned.  This restriction was added as part of converting the BLT to
use 48-bit addressing.

The main user, intel_emit_linear_blit, now handles this properly.
But we might also have linear miptrees; just refuse to blit those.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88521
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agoi965: Make intel_emit_linear_blit handle Gen8+ alignment restrictions.
Kenneth Graunke [Wed, 15 Apr 2015 10:04:33 +0000 (03:04 -0700)]
i965: Make intel_emit_linear_blit handle Gen8+ alignment restrictions.

The BLT engine on Gen8+ requires linear surfaces to be cacheline
aligned.  This restriction was added as part of converting the BLT to
use 48-bit addressing.

intel_emit_linear_blit needs to handle blits that are not cacheline
aligned, as we use it for arbitrary glBufferSubData calls and subrange
mappings.

Since intel_emit_linear_blit uses 1 byte per pixel, we can use the src/dst
pixel X offset field to represent the unaligned portion, and subtract
that from the address so it's cacheline aligned.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88521
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agomapi: Adding missing string.h include.
Pali Rohár [Thu, 23 Apr 2015 21:02:07 +0000 (22:02 +0100)]
mapi: Adding missing string.h include.

File glapi_entrypoint.c calls memcpy() function, but does not include
string.h header. So compilation can fail at error: implicit declaration
of function 'memcpy'.

Signed-off-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoos/os_memory_aligned.h: Handle integer overflow.
Jose Fonseca [Wed, 22 Apr 2015 19:23:59 +0000 (20:23 +0100)]
os/os_memory_aligned.h: Handle integer overflow.

This code is only used when our memory debugging wrappers are enabled,
as we use the C runtime functions directly elsewhere.

Tested llvmpipe on Windows w/ memory debugging enabled.

VMware PR894263.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agodraw: fix prim ids when there's no gs
Roland Scheidegger [Thu, 23 Apr 2015 16:13:32 +0000 (18:13 +0200)]
draw: fix prim ids when there's no gs

We were resetting the prim id count for each run of the prim assembler,
hence this only worked when the draw calls were very small (the exact limit
depending on the vertex size), since larger draw calls get split up.
So, do the same as we do already if there's a gs, reset it to zero explicitly
for every new instance (this possibly could use the same variable but that
isn't doable without some heavy refactoring and I'm not sure it makes sense).

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
CC: <mesa-stable@lists.freedesktop.org>
9 years agogallium/radeon: don't crash when getting out-of-bounds TEMP references
Marek Olšák [Thu, 19 Mar 2015 11:14:08 +0000 (12:14 +0100)]
gallium/radeon: don't crash when getting out-of-bounds TEMP references

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agonir/lower_source_mods: Don't propagate register sources
Jason Ekstrand [Mon, 13 Apr 2015 21:13:16 +0000 (14:13 -0700)]
nir/lower_source_mods: Don't propagate register sources

The nir_lower_source_mods pass does a weak form of copy propagation to
clean up all of the mov-with-negate's that get generated.  However, we
weren't properly checking that the sources were SSA and so we could end up
moving a register read which is not, in general, valid.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Rewrite instr_rewrite_src
Jason Ekstrand [Mon, 13 Apr 2015 21:02:21 +0000 (14:02 -0700)]
nir: Rewrite instr_rewrite_src

The old code wasn't correctly handling the case where the new value of the
source contains an indirect.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/locals_to_regs: Hanadle indirect accesses of length-1 arrays
Jason Ekstrand [Sat, 11 Apr 2015 00:38:17 +0000 (17:38 -0700)]
nir/locals_to_regs: Hanadle indirect accesses of length-1 arrays

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/locals_to_regs: Initialize registers with constant initializers
Jason Ekstrand [Fri, 10 Apr 2015 22:39:34 +0000 (15:39 -0700)]
nir/locals_to_regs: Initialize registers with constant initializers

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/locals_to_regs: Pass around the nir_shader rather than a void * mem_ctx
Jason Ekstrand [Fri, 10 Apr 2015 21:50:06 +0000 (14:50 -0700)]
nir/locals_to_regs: Pass around the nir_shader rather than a void * mem_ctx

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a simple growing array data structure
Jason Ekstrand [Sat, 11 Apr 2015 00:06:05 +0000 (17:06 -0700)]
nir: Add a simple growing array data structure

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/types: Make glsl_get_length smarter
Jason Ekstrand [Fri, 10 Apr 2015 23:16:02 +0000 (16:16 -0700)]
nir/types: Make glsl_get_length smarter

Previously, this function returned the number of elements for structures
and arrays and 0 for everything else.  In NIR, this is almost never what
you want because we also treat matricies as arrays so you have to
special-case constantly.  This commit  glsl_get_length treat matrices
as an array of columns by returning the number of columns instead of 0

This also fixes a bug in locals_to_regs caused by not checking for the
matrix case in one place.

v2: Only special-case for matrices and return a length of 0 for vectors as
    we did before.  This was needed to not break the TGSI-based drivers and
    doesn't really affect NIR at the moment.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
9 years agonir: Move get_const_initializer_load from vars_to_ssa to NIR core
Jason Ekstrand [Fri, 10 Apr 2015 21:46:22 +0000 (14:46 -0700)]
nir: Move get_const_initializer_load from vars_to_ssa to NIR core

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/lower_vars_to_ssa: Pass around the nir_shader instead of a void mem_ctx
Jason Ekstrand [Fri, 10 Apr 2015 21:43:28 +0000 (14:43 -0700)]
nir/lower_vars_to_ssa: Pass around the nir_shader instead of a void mem_ctx

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/nir: Use the correct offsets when handling register indirects
Jason Ekstrand [Fri, 10 Apr 2015 18:52:08 +0000 (11:52 -0700)]
i965/nir: Use the correct offsets when handling register indirects

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/print: Print the closing paren on load_const instructions
Jason Ekstrand [Fri, 10 Apr 2015 04:09:48 +0000 (21:09 -0700)]
nir/print: Print the closing paren on load_const instructions

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/tex: Use the correct return size for query_levels and lod
Jason Ekstrand [Fri, 10 Apr 2015 04:04:21 +0000 (21:04 -0700)]
nir/tex: Use the correct return size for query_levels and lod

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Refactor tex_instr_dest_size to use a switch statement
Jason Ekstrand [Fri, 10 Apr 2015 04:03:02 +0000 (21:03 -0700)]
nir: Refactor tex_instr_dest_size to use a switch statement

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/lower_vars_to_ssa: Actually look for indirects when determining aliasing
Jason Ekstrand [Fri, 10 Apr 2015 03:45:45 +0000 (20:45 -0700)]
nir/lower_vars_to_ssa: Actually look for indirects when determining aliasing

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agodocs: mark off texture_stencil8 (v2.1)
Dave Airlie [Sun, 5 Apr 2015 04:46:11 +0000 (14:46 +1000)]
docs: mark off texture_stencil8 (v2.1)

copy drivers from the stencil_texturing list,
softpipe is definitely broken for stencil texturing
since it uses float, but I'll look at that later.

v2.1: update relnotes

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: add ARB_texture_stencil8 support (v4)
Dave Airlie [Sun, 5 Apr 2015 04:45:25 +0000 (14:45 +1000)]
st/mesa: add ARB_texture_stencil8 support (v4)

if we support stencil texturing, enable texture_stencil8
there is no requirement to support native S8 for this,
the texture can be converted to x24s8 fine.

v2: fold fixes from Marek in:
   a) put S8 last in the list
   b) fix renderable to always test for d/s renderable
    fixup the texture case to use a stencil only format
    for picking the format for the texture view.
v3: hit fallback for getteximage
v4: put s8 back in front, it shouldn't get picked now (Ilia)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: finish implementing ARB_texture_stencil8 (v5)
Dave Airlie [Sun, 5 Apr 2015 03:19:18 +0000 (13:19 +1000)]
mesa: finish implementing ARB_texture_stencil8 (v5)

Parts of this were implemented previously, so finish it off.

v2: fix getteximage falling into the integer check
    add fixes for the FBO paths, (fbo-stencil8 test).

v3: fix getteximage path harder.
v4: remove swapbytes from getteximage path (Ilia)
v5: brown paper bag the swapbytes removal. (Ilia)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: remove the gl_sl_pragmas structure
Jason Ekstrand [Wed, 22 Apr 2015 16:30:30 +0000 (09:30 -0700)]
mesa: remove the gl_sl_pragmas structure

This code was added by Brian Paul in 2009 but, as far as Matt and I can
tell, it's been dead ever since the new GLSL compiler was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoi965: Add a brw_compiler structure and store the register sets in it
Jason Ekstrand [Thu, 16 Apr 2015 19:01:09 +0000 (12:01 -0700)]
i965: Add a brw_compiler structure and store the register sets in it

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Rename brw_compile to brw_codegen
Jason Ekstrand [Thu, 16 Apr 2015 18:06:57 +0000 (11:06 -0700)]
i965: Rename brw_compile to brw_codegen

This name better matches what it's actually used for.  The patch was
generated with the following command:

for file in *; do
sed -i -e s/brw_compile/brw_codegen/g $file
done

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Use device_info instead of the context for computing vue maps
Jason Ekstrand [Fri, 17 Apr 2015 19:52:00 +0000 (12:52 -0700)]
i965: Use device_info instead of the context for computing vue maps

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Use device_info instead of the context in instruction scheduling
Jason Ekstrand [Fri, 17 Apr 2015 19:15:58 +0000 (12:15 -0700)]
i965: Use device_info instead of the context in instruction scheduling

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Add a devinfo field to backend_visitor and use it for gen checks
Jason Ekstrand [Thu, 16 Apr 2015 01:00:05 +0000 (18:00 -0700)]
i965: Add a devinfo field to backend_visitor and use it for gen checks

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Remove remaining uses of ctx->Const.UniformBooleanTrue in visitors
Jason Ekstrand [Thu, 16 Apr 2015 00:39:25 +0000 (17:39 -0700)]
i965: Remove remaining uses of ctx->Const.UniformBooleanTrue in visitors

Since commit 2881b123, we have used 0/~0 for representing booleans on all
gens.  However, we still had a bunch of places in the visitor code where we
were still referring to ctx->Const.UniformBooleanTrue.  Since this is
always ~0, we can just remove them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/vec4: Add a devinfo field to the generator and use it for gen checks
Jason Ekstrand [Thu, 16 Apr 2015 17:30:05 +0000 (10:30 -0700)]
i965/vec4: Add a devinfo field to the generator and use it for gen checks

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Add a devinfo field to the generator and use it for gen checks
Jason Ekstrand [Wed, 15 Apr 2015 00:45:40 +0000 (17:45 -0700)]
i965/fs: Add a devinfo field to the generator and use it for gen checks

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/device_info: Add a supports_simd16_3src flag
Jason Ekstrand [Fri, 17 Apr 2015 00:52:03 +0000 (17:52 -0700)]
i965/device_info: Add a supports_simd16_3src flag

This also involves moving revision checking to screen creation time and
passing that into brw_get_device_info so that we can get the right
device_info for early versions of SKL.  Since the only place we used
revision was to check for SIMD16 3-src instruction support, it's safe to
remove the revision field from brw_context.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/device_info: Add a HSW_FEATURES macro
Jason Ekstrand [Fri, 17 Apr 2015 00:50:43 +0000 (17:50 -0700)]
i965/device_info: Add a HSW_FEATURES macro

It's basically just a copy of GEN7_FEATURES only with is_haswell set

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Make the annotation code take a device_info instead of a context
Jason Ekstrand [Wed, 15 Apr 2015 22:01:25 +0000 (15:01 -0700)]
i965: Make the annotation code take a device_info instead of a context

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Remove the GL context from the generator
Jason Ekstrand [Wed, 15 Apr 2015 21:51:18 +0000 (14:51 -0700)]
i965/fs: Remove the GL context from the generator

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Remove the context field from brw_compiler
Jason Ekstrand [Wed, 15 Apr 2015 21:13:58 +0000 (14:13 -0700)]
i965: Remove the context field from brw_compiler

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Make the disassembler take a device_info instead of a context
Jason Ekstrand [Wed, 15 Apr 2015 20:46:21 +0000 (13:46 -0700)]
i965: Make the disassembler take a device_info instead of a context

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Make instruction compaction take a device_info instead of a context
Jason Ekstrand [Wed, 15 Apr 2015 20:19:21 +0000 (13:19 -0700)]
i965: Make instruction compaction take a device_info instead of a context

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Make the brw_inst helpers take a device_info instead of a context
Jason Ekstrand [Wed, 15 Apr 2015 01:00:06 +0000 (18:00 -0700)]
i965: Make the brw_inst helpers take a device_info instead of a context

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/eu: Add a devinfo parameter to brw_compile
Jason Ekstrand [Tue, 14 Apr 2015 23:57:24 +0000 (16:57 -0700)]
i965/eu: Add a devinfo parameter to brw_compile

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Do better fake context setup in unit tests
Jason Ekstrand [Fri, 17 Apr 2015 22:23:18 +0000 (15:23 -0700)]
i965: Do better fake context setup in unit tests

In future tests, we will start relying on devinfo and not just brw in the
compiler.  Changing this now keeps these tests from failing in the future.

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: Remove the context parameter from brw_texture_offset
Jason Ekstrand [Tue, 14 Apr 2015 21:23:40 +0000 (14:23 -0700)]
i965: Remove the context parameter from brw_texture_offset

It wasn't really being used anyway.  We used it to assert that gpu_shader5
is supported in the back-end but that should be caught by the front-end.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agosoftpipe: fix stencil write to use an integer value
Dave Airlie [Wed, 22 Apr 2015 07:13:06 +0000 (17:13 +1000)]
softpipe: fix stencil write to use an integer value

This fixes a number of regressions since
61393bdcdc3b63624bf6e9730444f5e9deeedfc8
u_tile: fix stencil texturing tests under softpipe

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89960
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Fix typo in a comment
Anuj Phogat [Wed, 22 Apr 2015 18:23:49 +0000 (11:23 -0700)]
mesa: Fix typo in a comment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agofreedreno: misc minor cleanups
Rob Clark [Wed, 22 Apr 2015 17:11:33 +0000 (13:11 -0400)]
freedreno: misc minor cleanups

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: (partial) gl_FragCoord.zw
Rob Clark [Wed, 22 Apr 2015 17:09:28 +0000 (13:09 -0400)]
freedreno/a4xx: (partial) gl_FragCoord.zw

The bit to enable .z is still commented out, as it is triggering gpu
hangs in 0ad.  But at least gl_FragCoord.w works now, and we know what
bits we are *supposed* to set for .z (with that uncommented all piglit
fragcoord tests are passing).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: primitive-restart
Rob Clark [Wed, 22 Apr 2015 17:08:44 +0000 (13:08 -0400)]
freedreno/a4xx: primitive-restart

This was the missing bit to get dolphin-emu working on a4xx.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/nir: sysval fixes
Rob Clark [Wed, 22 Apr 2015 17:07:33 +0000 (13:07 -0400)]
freedreno/nir: sysval fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: wire up integer texture sampling
Rob Clark [Wed, 22 Apr 2015 17:05:53 +0000 (13:05 -0400)]
freedreno/a4xx: wire up integer texture sampling

Similar to a3xx, the compiler needs to know the return type of the sam,
etc, instructions.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: formats updates/fixes
Rob Clark [Wed, 22 Apr 2015 17:00:03 +0000 (13:00 -0400)]
freedreno/a4xx: formats updates/fixes

Update formats table with new formats that Ilia has figured out, and fix
sampling from srgb texture and integer vbo's.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: update generated headers
Rob Clark [Sat, 18 Apr 2015 16:08:53 +0000 (12:08 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agogallium/targets/d3dadapter9: drop the libdrm prefix for drm.h
Emil Velikov [Fri, 20 Mar 2015 21:20:10 +0000 (21:20 +0000)]
gallium/targets/d3dadapter9: drop the libdrm prefix for drm.h

The path is provided by libdrm.pc and already used appropriately by
the build system.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agocso: minor comment fix
Brian Paul [Tue, 21 Apr 2015 14:10:22 +0000 (08:10 -0600)]
cso: minor comment fix

9 years agoglsl: rewrite glsl_type::record_key_hash() to avoid buffer overflow
Brian Paul [Thu, 16 Apr 2015 21:29:18 +0000 (15:29 -0600)]
glsl: rewrite glsl_type::record_key_hash() to avoid buffer overflow

This should be more efficient than the previous snprintf() solution.
But more importantly, it avoids a buffer overflow bug that could result
in crashes or unpredictable results when processing very large interface
blocks.

For the app in question, key->length = 103 for some interfaces.  The check
if size >= sizeof(hash_key) was insufficient to prevent overflows of the
hash_key[128] array because it didn't account for the terminating zero.
In this case, this caused the call to hash_table_string_hash() to return
different results for identical inputs, and then shader linking failed.

This new solution also takes all structure fields into account instead
of just the first 15 when sizeof(pointer)==8.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV()
Brian Paul [Thu, 16 Apr 2015 21:27:41 +0000 (15:27 -0600)]
mesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV()

If an app called glTextureBarrierNV() without checking if the
extension was available, we'd crash with some gallium drivers
in st_TextureBarrier() because the pipe_context::texture_barrier()
pointer was NULL.

Generate GL_INVALID_OPERATION instead.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agomain: silence missing return value warning in array_index_of_resource()
Brian Paul [Thu, 16 Apr 2015 21:27:20 +0000 (15:27 -0600)]
main: silence missing return value warning in array_index_of_resource()

v2: return -1 instead of 0, per Emil Velikov.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoandroid: re-build all mesa binaries properly
Chih-Wei Huang [Fri, 3 Apr 2015 21:01:26 +0000 (05:01 +0800)]
android: re-build all mesa binaries properly

The clean steps ensure both 32-bit and 64-bit objects are cleaned.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: xmlpool: cleanup the generation rules
Emil Velikov [Wed, 22 Apr 2015 14:38:57 +0000 (15:38 +0100)]
android: xmlpool: cleanup the generation rules

 - Do not attempt to create the save folder twice - both dir $@ and
PRIVATE_LOCALEDIR point to the same place.
 - Use @ and $(hide), for mkdir and python, to avoid spamming the
output.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: xmlpool: Get rid of the last use of intermediates-dir-for
Chih-Wei Huang [Fri, 3 Apr 2015 21:01:24 +0000 (05:01 +0800)]
android: xmlpool: Get rid of the last use of intermediates-dir-for

v2 [Emil Velikov]
 - Keep the PRIVATE_LOCALEDIR variable.
 - Do not use $(@D) but the more widespead $(dir $@)

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: export the path of the generated headers
Chih-Wei Huang [Fri, 3 Apr 2015 21:01:23 +0000 (05:01 +0800)]
android: export the path of the generated headers

The modules need the headers can get the path automatically.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: fix the building rules for Android 5.0
Chih-Wei Huang [Fri, 3 Apr 2015 21:01:22 +0000 (05:01 +0800)]
android: fix the building rules for Android 5.0

Android 5.0 allows modules to generate source into $OUT/gen, which will
then be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as necessary.
Modules will need to change calls to local-intermediates-dir into
local-generated-sources-dir.

The patch changes local-intermediates-dir into local-generated-sources-dir.
If the Android version is less than 5.0, fallback to local-intermediates-dir.

The patch also fixes the 64-bit building issue of Android 5.0.

v2 [Emil Velikov]
 - Keep the LOCAL_UNSTRIPPED_PATH variable.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
9 years agoandroid: fix building issues of host binaries
Chih-Wei Huang [Fri, 3 Apr 2015 21:01:21 +0000 (05:01 +0800)]
android: fix building issues of host binaries

Define _GNU_SOURCE to enable features (__USE_XOPEN2K and __USE_UNIX98)
required to build the host binaries.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: fix a building error of libmesa_program
Chih-Wei Huang [Thu, 2 Apr 2015 06:16:33 +0000 (14:16 +0800)]
android: fix a building error of libmesa_program

Add libmesa_glsl to LOCAL_STATIC_LIBRARIES to get
its exported include path (for nir_opcodes.h).

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
9 years agoandroid: mesa: fold the ARCH_X86_HAVE_SSE4_1 conditionals
Emil Velikov [Wed, 22 Apr 2015 14:53:11 +0000 (15:53 +0100)]
android: mesa: fold the ARCH_X86_HAVE_SSE4_1 conditionals

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: mesa: fix the path of the SSE4_1 optimisations
Emil Velikov [Sat, 28 Mar 2015 18:23:01 +0000 (18:23 +0000)]
android: mesa: fix the path of the SSE4_1 optimisations

Commit dd6f641303c(mesa: Build with subdir-objects.) removed the SRCDIR
variable, but forgot to update all references of it.

v2: Fix path - must be relative to LOCAL_PATH. (Chih-Wei)

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
9 years agoandroid: build the Mesa IR -> NIR translator
Emil Velikov [Sat, 28 Mar 2015 18:12:23 +0000 (18:12 +0000)]
android: build the Mesa IR -> NIR translator

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoandroid: nir: add build rules for nir_builder_opcodes.h
Emil Velikov [Wed, 22 Apr 2015 13:51:31 +0000 (14:51 +0100)]
android: nir: add build rules for nir_builder_opcodes.h

Missed out with commit 2a135c470e3(nir: Add an ALU op builder kind of
like ir_builder.h)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>