mesa.git
10 years agovc4: Add support for texture border color.
Eric Anholt [Mon, 29 Sep 2014 19:26:21 +0000 (12:26 -0700)]
vc4: Add support for texture border color.

One spot in the docs says that it's stored at a miplevel just beyond the
last miplevel, which was scary.  But really, you just load it as the R
coordinate (which conflicts with cubemaps, but you don't do border
clamping on cubes).

10 years agovc4: Add the necessary stubs for occlusion queries.
Eric Anholt [Mon, 29 Sep 2014 18:33:13 +0000 (11:33 -0700)]
vc4: Add the necessary stubs for occlusion queries.

We have to expose them for GL 2.0, but we just always return a value of 0.
We should be advertising 0 query bits instead of 64, but gallium doesn't
have plumbing for that yet.  At least this stops the segfaults.

10 years agovc4: Optimize out silly SUBs of 0.
Eric Anholt [Thu, 25 Sep 2014 04:57:06 +0000 (21:57 -0700)]
vc4: Optimize out silly SUBs of 0.

Drops instructions on vs-temp-array-mat4-index-col-row-wr.shader_test,
which I was looking at because it's failing to register allocate.

10 years agovc4: Dump constant uniform values in VC4_DEBUG=qir.
Eric Anholt [Thu, 25 Sep 2014 05:03:06 +0000 (22:03 -0700)]
vc4: Dump constant uniform values in VC4_DEBUG=qir.

Definitely helps when trying to understand and optimize a program.

10 years agovc4: Turn a SEL_X_Y(x, 0) into SEL_X_0(x).
Eric Anholt [Thu, 25 Sep 2014 04:37:12 +0000 (21:37 -0700)]
vc4: Turn a SEL_X_Y(x, 0) into SEL_X_0(x).

This may reduce register pressure and uniform counts.  Drops a bunch of 0
uniform loads on vs-temp-array-mat4-index-col-row-wr.shader_test, which is
failing to register allocate.

10 years agovc4: Add support for texture cube maps.
Eric Anholt [Sun, 28 Sep 2014 01:57:20 +0000 (18:57 -0700)]
vc4: Add support for texture cube maps.

It's not passing some of the piglit tests, because it looks like at small
miplevels some contents from surrounding faces are getting filtered in at
the corners.  It does get 7 new tests passing.

10 years agovc4: Rename the slice's size0.
Eric Anholt [Sun, 28 Sep 2014 02:10:34 +0000 (19:10 -0700)]
vc4: Rename the slice's size0.

In the other related fields, "0" refers to the size of the first miplevel,
while this is a field in a slice.  The other implicit slices we have
(cubemap layers) don't vary in size compared to the first one.

10 years agovc4: Stop trying to reuse temporaries that store uniform values.
Eric Anholt [Mon, 29 Sep 2014 16:39:46 +0000 (09:39 -0700)]
vc4: Stop trying to reuse temporaries that store uniform values.

Almost always, the MOV will get copy propagated out.  Even if it doesn't,
it's probably better to just reload the uniform at next use (to reduce
register pressure) rather than try to save instruction count.

I was looking at this because in the presence of texturing (which calls
add_uniform() directly to get the uniform load forced into the
instruction) the c->uniform_contents indices don't match 1:1 with the
temporary qregs.

10 years agoegl: setup screen iterator before using it
Tapani Pälli [Mon, 29 Sep 2014 12:02:57 +0000 (15:02 +0300)]
egl: setup screen iterator before using it

commit 4ed23fd broke creation of pbuffer surfaces, patch fixes
the failure, noticed when running chrome with '--use-gl=egl'.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
10 years agoilo: fix a missing 'else'
Chia-I Wu [Mon, 29 Sep 2014 08:58:14 +0000 (16:58 +0800)]
ilo: fix a missing 'else'

An 'else' is missing in the disassembler.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoglsl: Allow texture2DProjLod and textureCubeLod in GL ES
Kalyan Kondapally [Sat, 27 Sep 2014 02:44:06 +0000 (19:44 -0700)]
glsl: Allow texture2DProjLod and textureCubeLod in GL ES

According to GLES (i.e. 1.0 and above) spec textureCubeLod and
texture2DProjLod are built in functions. We seem to disable support
for these functions with GLES. This patch enables the support.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84355

10 years agoconfigure.ac: bump libdrm_freedreno requirement
Rob Clark [Sun, 28 Sep 2014 16:45:23 +0000 (12:45 -0400)]
configure.ac: bump libdrm_freedreno requirement

We need 2.4.57 for fd_bo_dmabuf() / fd_bo_from_dmabuf().

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoglsl: Recognize open-coded pow(x, y).
Matt Turner [Sun, 7 Sep 2014 07:41:41 +0000 (00:41 -0700)]
glsl: Recognize open-coded pow(x, y).

pow(x, y) is equivalent to exp(log(x) * y).

instructions in affected programs:     578 -> 458 (-20.76%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Don't invalidate live intervals in saturate propagation.
Matt Turner [Mon, 8 Sep 2014 19:09:44 +0000 (12:09 -0700)]
i965/fs: Don't invalidate live intervals in saturate propagation.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/fs: Ignore mov.sat instructions in interference check in sat prop.
Matt Turner [Mon, 8 Sep 2014 19:06:49 +0000 (12:06 -0700)]
i965/fs: Ignore mov.sat instructions in interference check in sat prop.

When an instruction's result was consumed by multiple mov.sat
instructions, we would decide that we couldn't move the saturate
modifier because something else was using the result, even though it was
just another mov.sat!

total instructions in shared programs: 4275598 -> 4274842 (-0.02%)
instructions in affected programs:     75634 -> 74878 (-1.00%)

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/fs: Walk instructions in reverse in saturate propagation.
Matt Turner [Mon, 8 Sep 2014 19:05:25 +0000 (12:05 -0700)]
i965/fs: Walk instructions in reverse in saturate propagation.

When we find a mov.sat, we search backwards. We might as well search
everything else backwards as well and potentially look at fewer
instructions.

This change enables the next patch.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agofreedreno/a3xx: add flat interpolation mode
Rob Clark [Fri, 26 Sep 2014 14:33:11 +0000 (10:33 -0400)]
freedreno/a3xx: add flat interpolation mode

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/a3xx: add LOD_BIAS
Rob Clark [Sat, 27 Sep 2014 15:45:26 +0000 (11:45 -0400)]
freedreno/a3xx: add LOD_BIAS

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: turn missing caps into compile warnings
Rob Clark [Fri, 26 Sep 2014 21:56:08 +0000 (17:56 -0400)]
freedreno: turn missing caps into compile warnings

Get rid of the 'default' case (as suggestied by imirkin) so compiler
warns us about missing caps.  Also add some caps that were missing until
now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: we have more than 0 viewports!
Rob Clark [Fri, 26 Sep 2014 19:40:35 +0000 (15:40 -0400)]
freedreno: we have more than 0 viewports!

4155d1c7 'st/mesa: drop dependence on API profile in st_init_extensions'
broke freedreno because somehow 'PIPE_CAP_MAX_VIEWPORTS' fell through
the cracks.  Resulting that we reported zero viewports.  So the state
tracker never bothered to give us any valid viewport!

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: update generated headers
Rob Clark [Thu, 25 Sep 2014 21:14:05 +0000 (17:14 -0400)]
freedreno: update generated headers

Among other things, fixes a bug for fixed point registers/bitfields.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: don't advertise mirror-clamp support
Rob Clark [Fri, 26 Sep 2014 14:35:52 +0000 (10:35 -0400)]
freedreno: don't advertise mirror-clamp support

At least on a3xx, we cannot do it without some emulation in shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: fix compiler warning
Rob Clark [Fri, 26 Sep 2014 14:35:33 +0000 (10:35 -0400)]
freedreno: fix compiler warning

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoconfigure.ac: Compute LLVM_VERSION_PATCH using llvm-config
Tom Stellard [Thu, 25 Sep 2014 19:55:40 +0000 (12:55 -0700)]
configure.ac: Compute LLVM_VERSION_PATCH using llvm-config

This is the only guaranteed way get the patch level for llvm,
since the define cannot always be found in config.h depending
on the version of llvm or the build system used.

CC: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
10 years agoRemove Bluegene/L wrappers
Emil Velikov [Thu, 25 Sep 2014 14:26:13 +0000 (15:26 +0100)]
Remove Bluegene/L wrappers

Added back in 2009, with osmesa/GLU in mind. Unlikely to be working
any more since the removal of the static makefiles.

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: remove last DJGPP remains
Emil Velikov [Thu, 25 Sep 2014 13:16:16 +0000 (14:16 +0100)]
mesa: remove last DJGPP remains

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoconfigure: use explicit enabled/disabled in config switch description
Emil Velikov [Mon, 22 Sep 2014 17:58:19 +0000 (18:58 +0100)]
configure: use explicit enabled/disabled in config switch description

Rather than having double negatives -> disable-opencl, default=no
simply use enabled/disabled. It makes things a bit easier for the
reader and consistent throughout the file.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoconfigure: ask vdpau.pc for the default location of the vdpau drivers
Emil Velikov [Mon, 22 Sep 2014 17:41:58 +0000 (18:41 +0100)]
configure: ask vdpau.pc for the default location of the vdpau drivers

Rather than using hardcoded values honor the value set at libvdpau
build time - i.e. the moduledir variable from vdpau.pc

Update the omx description to match reality while we're here.

Cc: Christian König <deathsimple@vodafone.de>
Cc: Alexandre Demers <alexandre.f.demers@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoconfigure: drop --with-egl-driver-dir switch
Emil Velikov [Mon, 22 Sep 2014 17:32:03 +0000 (18:32 +0100)]
configure: drop --with-egl-driver-dir switch

The location of the egl driver(s) is matter that we should have
never exposed to the user. Currently the dri2 driver is built
into the libEGL loader, with the gallium based one soon to follow.

v2: Fold EGL_DRIVER_INSTALL_DIR within the makefiles. Suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoconfigure: remove non-functional --with-opencl-libdir
Emil Velikov [Mon, 22 Sep 2014 17:12:00 +0000 (18:12 +0100)]
configure: remove non-functional --with-opencl-libdir

The parameter used to control where the gallium pipe-drivers
were installed, but was broken since

commit 45270fb0fd1abd7619933c2845f9dc74cdfbe6fd
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 13 10:45:01 2012 -0700

    targets/pipe-loader: Convert to automake

Considering that nowadays the pipe-drivers can be used by
more than just the opencl target, even fixing this up will
not be the best idea.

Cc: Matt Turner <mattst88@gmail.com>
Cc: Francisco Jerez <currojerez@riseup.net>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61415
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Strip arrayness from ir_type_dereference_variable too
Ian Romanick [Wed, 10 Sep 2014 22:19:43 +0000 (15:19 -0700)]
glsl: Strip arrayness from ir_type_dereference_variable too

If the thing being dereferenced is a record or an array of records, it
should be treated as row-major.  The ir_type_derference_record path
already does this, and I think I intended to do the same for this path
in b17a4d5d.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83741
Cc: mesa-stable@lists.freedesktop.org
10 years agoglsl: Round struct size up to at least 16 bytes
Ian Romanick [Wed, 10 Sep 2014 17:54:55 +0000 (10:54 -0700)]
glsl: Round struct size up to at least 16 bytes

Per rule #9, the size of the structure is vec4 aligned.  The MAX2 in the
loop ensures that sizes >= 16 bytes are vec4 aligned.  The new MAX2
after the loop ensures that sizes < 16 bytes are vec4 aligned.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Cc: mesa-stable@lists.freedesktop.org
10 years agoglsl: Make sure row-major array-of-structure get correct layout
Ian Romanick [Tue, 9 Sep 2014 01:25:15 +0000 (18:25 -0700)]
glsl: Make sure row-major array-of-structure get correct layout

Whether or not the field is row-major (because it might be a bvec2 or
something) does not affect the array itself.  We need to know whether an
array element in its entirety is row-major.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506
Cc: mesa-stable@lists.freedesktop.org
10 years agoglsl: Make sure fields after small structs have correct padding
Ian Romanick [Mon, 8 Sep 2014 19:23:39 +0000 (12:23 -0700)]
glsl: Make sure fields after small structs have correct padding

Previously the linker would correctly calculate the layout, but the
lower_ubo_reference pass would not apply correct alignment to fields
following small (less than 16-byte) nested structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83533
Cc: mesa-stable@lists.freedesktop.org
10 years agoilo: give gen6_draw_session a better prefix
Chia-I Wu [Thu, 25 Sep 2014 08:54:28 +0000 (16:54 +0800)]
ilo: give gen6_draw_session a better prefix

gen6_draw_session is not GEN dependent.  Rename it to ilo_render_draw_session.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make ilo_render opaque
Chia-I Wu [Thu, 25 Sep 2014 08:41:31 +0000 (16:41 +0800)]
ilo: make ilo_render opaque

It is not used outside the render code.  There are also too many details in it
that we do not want other components to access directly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make ilo_render_emit_draw() direct
Chia-I Wu [Thu, 25 Sep 2014 04:02:33 +0000 (12:02 +0800)]
ilo: make ilo_render_emit_draw() direct

Remove emit_draw() and ILO_RENDER_DRAW indirections.  With all emit functions
being direct now, ilo_render_estimate_size() and more can also be removed.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make ilo_render_emit_rectlist() direct
Chia-I Wu [Thu, 25 Sep 2014 04:02:33 +0000 (12:02 +0800)]
ilo: make ilo_render_emit_rectlist() direct

Remove emit_rectlist() and ILO_RENDER_RECTLIST indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: clean up draw and rectlist state emission
Chia-I Wu [Thu, 25 Sep 2014 05:22:19 +0000 (13:22 +0800)]
ilo: clean up draw and rectlist state emission

Add these new high-level functions

  ilo_render_get_draw_dynamic_states_len()
  ilo_render_emit_draw_dynamic_states()
  ilo_render_get_rectlist_dynamic_states_len()
  ilo_render_emit_rectlist_dynamic_states()
  ilo_render_get_draw_surface_states_len()
  ilo_render_emit_draw_surface_states()

for draw and rectlist state emission.  They are implemented in the new
ilo_render_dynamic.c and ilo_render_surface.c.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: sanity check ilo_render_get_*_len()
Chia-I Wu [Thu, 25 Sep 2014 04:44:53 +0000 (12:44 +0800)]
ilo: sanity check ilo_render_get_*_len()

Assert that we never write more than what ilo_render_get_*_len() returns.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: simplify ilo_render_get_query_len()
Chia-I Wu [Thu, 25 Sep 2014 04:32:21 +0000 (12:32 +0800)]
ilo: simplify ilo_render_get_query_len()

For all supported query types, we always emit a PIPE_CONTROL.  Call
ilo_render_get_flush_len() for simplicity and clarity.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make ilo_render_emit_query() direct
Chia-I Wu [Thu, 25 Sep 2014 04:10:00 +0000 (12:10 +0800)]
ilo: make ilo_render_emit_query() direct

Remove emit_query() and ILO_RENDER_QUERY indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make ilo_render_emit_flush() direct
Chia-I Wu [Thu, 25 Sep 2014 04:02:33 +0000 (12:02 +0800)]
ilo: make ilo_render_emit_flush() direct

Remove emit_flush() and ILO_RENDER_FLUSH indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: simplify ilo_render invalidation
Chia-I Wu [Wed, 24 Sep 2014 07:24:25 +0000 (15:24 +0800)]
ilo: simplify ilo_render invalidation

ilo_render is based on ilo_builder.  We should only care if the builder
buffers are invalidated, or if the hardware context is invalidated.  Replace
ilo_render_invalidate() with flags by ilo_render_invalidate_builder() and
ilo_render_invalidate_hw().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: add ilo_builder_{dynamic,surface}_used()
Chia-I Wu [Thu, 25 Sep 2014 06:53:34 +0000 (14:53 +0800)]
ilo: add ilo_builder_{dynamic,surface}_used()

Return how many DWords are used in dynamic and surface buffers respectively.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: rename state buffer to dynamic buffer
Chia-I Wu [Thu, 25 Sep 2014 06:46:33 +0000 (14:46 +0800)]
ilo: rename state buffer to dynamic buffer

Both dynamic buffer and surface buffer are state buffers.  We should not use
state buffer to refer to the former.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: constify ilo_render in ilo_render_get_sample_position()
Chia-I Wu [Wed, 24 Sep 2014 07:18:02 +0000 (15:18 +0800)]
ilo: constify ilo_render in ilo_render_get_sample_position()

It is a getter and is not supposed to modify ilo_render.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: rename 3d_pipeline to render
Chia-I Wu [Wed, 24 Sep 2014 06:31:07 +0000 (14:31 +0800)]
ilo: rename 3d_pipeline to render

Follow the file renaming.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: remove struct ilo_3d
Chia-I Wu [Wed, 24 Sep 2014 05:11:25 +0000 (13:11 +0800)]
ilo: remove struct ilo_3d

Move members of ilo_3d that still make sense to ilo_context.  With ilo_3d
gone, rename functions whose names begin with ilo_3d to something more
appropriate.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: rename ilo_3d_pipeline*.[ch] to ilo_render*.[ch]
Chia-I Wu [Wed, 24 Sep 2014 04:27:23 +0000 (12:27 +0800)]
ilo: rename ilo_3d_pipeline*.[ch] to ilo_render*.[ch]

They are used to build render engine commands, which can be more than 3D.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: rename ilo_3d.[ch] to ilo_draw.[ch]
Chia-I Wu [Wed, 24 Sep 2014 05:06:45 +0000 (13:06 +0800)]
ilo: rename ilo_3d.[ch] to ilo_draw.[ch]

There is not much left in struct ilo_3d.  We want to kill it and ilo_3d.[ch]
will be bad names.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agost/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers
Michel Dänzer [Thu, 25 Sep 2014 06:29:56 +0000 (15:29 +0900)]
st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers

Such buffers can only be useful by reading from them with the CPU, so we
need to make sure CPU reads are fast.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable@lists.freedesktop.org
10 years agoglsl: remove unused link_assign_uniform_block_offsets
Tapani Pälli [Wed, 24 Sep 2014 11:09:23 +0000 (14:09 +0300)]
glsl: remove unused link_assign_uniform_block_offsets

ubo offsets are assigned by link_uniform_blocks since 514f8c7e

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Structures must have same name to be considered same type.
Kalyan Kondapally [Mon, 22 Sep 2014 12:11:29 +0000 (15:11 +0300)]
glsl: Structures must have same name to be considered same type.

According to GLSL(4.2) and GLSL-ES (1.0, 3.0) spec, Structures must
have the same name to be considered same type. We currently ignore
the name check while checking if two records are same. This patch
fixes this.

Patch fixes failing tests in WebGL conformance test
'shaders-with-uniform-structs' when running Chrome on OpenGL ES.

v2: Do not force name comparison with unnamed types (Tapani)
v3: Cleanups (Matt)

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83934

10 years agoglsl: fix uniform location count used for glsl types
Tapani Pälli [Wed, 27 Aug 2014 11:12:27 +0000 (14:12 +0300)]
glsl: fix uniform location count used for glsl types

Patch fixes the slot count used by vector types and adds 1 slot
to be used by image and sampler types.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82921

10 years agogm107/ir: take relative pfetch offset into account
Ilia Mirkin [Fri, 26 Sep 2014 04:18:38 +0000 (00:18 -0400)]
gm107/ir: take relative pfetch offset into account

There is no dedicated instruction for this, so just combine it with the
constant offset.

Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
10 years agogallivm: More fallout from disabling with LLVM 3.6
Michel Dänzer [Thu, 25 Sep 2014 03:23:02 +0000 (12:23 +0900)]
gallivm: More fallout from disabling with LLVM 3.6

The draw module would still try to use gallivm, causing many piglit tests
to fail with an assertion failure. llvmpipe might have been similarly
affected.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agogm107/ir: add support for indirect const buffer selection
Ilia Mirkin [Thu, 25 Sep 2014 21:14:30 +0000 (17:14 -0400)]
gm107/ir: add support for indirect const buffer selection

This was missed in the commit that enabled it for fermi/kepler as part
of ARB_gpu_shader5

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
10 years agogm107/ir: fix texture argument order
Ilia Mirkin [Thu, 25 Sep 2014 07:51:37 +0000 (03:51 -0400)]
gm107/ir: fix texture argument order

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
10 years agogm107/ir: fix manual TXD for array targets
Ilia Mirkin [Thu, 25 Sep 2014 04:27:31 +0000 (00:27 -0400)]
gm107/ir: fix manual TXD for array targets

This parallels the fixes in commit afea9bae.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
10 years agonouveau: fix glCompressedTexImage
Ilia Mirkin [Sat, 13 Sep 2014 22:14:46 +0000 (18:14 -0400)]
nouveau: fix glCompressedTexImage

mesa_texstore expects pixel data, not compressed data. For compressed
textures, we want to just copy the bits in without any conversion.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
10 years agonv50/ir: avoid deleting pseudo instructions too early
Ilia Mirkin [Thu, 25 Sep 2014 01:45:07 +0000 (21:45 -0400)]
nv50/ir: avoid deleting pseudo instructions too early

What happens is that a SPLIT operation is part of the spill node, and as
a pseudo op, the instruction gets erased after processing its first def.
However the later defs still need to refer to it, so instead delay
deleting until after that whole RA node is done processing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79462
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
10 years agomesa/st: NumLayers is only valid for array textures
Ilia Mirkin [Wed, 24 Sep 2014 04:58:07 +0000 (00:58 -0400)]
mesa/st: NumLayers is only valid for array textures

For 3d textures, NumLayers is set to 1, which is not what we want. This
fixes the newly added gl-layer-render-storage test (which constructs
immutable 3d textures). Fixes regression introduced in d82bd7eb060.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84145
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agonv50/ir: add some comments on edge classification
Ilia Mirkin [Fri, 19 Sep 2014 05:21:52 +0000 (01:21 -0400)]
nv50/ir: add some comments on edge classification

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonv50,nvc0: fix 3d blit logic for odd depth/stencil formats
Ilia Mirkin [Fri, 12 Sep 2014 23:02:14 +0000 (19:02 -0400)]
nv50,nvc0: fix 3d blit logic for odd depth/stencil formats

Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonv50,nvc0: add missing depth/stencil formats to tile flag selection
Ilia Mirkin [Fri, 12 Sep 2014 05:26:15 +0000 (01:26 -0400)]
nv50,nvc0: add missing depth/stencil formats to tile flag selection

Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agovc4: Switch from errx() to fprintf() and abort().
Eric Anholt [Thu, 25 Sep 2014 23:38:38 +0000 (16:38 -0700)]
vc4: Switch from errx() to fprintf() and abort().

These are pretty catastrophic, "should never happen" failure paths (though
4 tests in piglit hit them currently, due to a single bug).  An abort()
that you can gdb on easily is probably more useful than a clean exit,
particularly since a bug in piglit framework right now is causing early
exit(1)s to simply not be recorded in the results at all.

10 years agovc4: Fix miplevel validation for raster textures.
Eric Anholt [Thu, 25 Sep 2014 04:14:44 +0000 (21:14 -0700)]
vc4: Fix miplevel validation for raster textures.

We were using the un-minified value, meaning we'd reject correctly laid
out textures.

10 years agomesa: Replace IS_NEGATIVE(x) with x < 0.0f.
Matt Turner [Mon, 22 Sep 2014 04:03:14 +0000 (21:03 -0700)]
mesa: Replace IS_NEGATIVE(x) with x < 0.0f.

I only made IS_NEGATIVE(x) use signbit in commit 0f3ba405 in an attempt
to fix 54805, but it didn't help. We didn't use signbit on some
platforms and instead defined it to x < 0.0f.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoradeon: Use PRINTLIKE macro.
Matt Turner [Mon, 22 Sep 2014 01:43:09 +0000 (18:43 -0700)]
radeon: Use PRINTLIKE macro.

10 years agoconfigure.ac: Replace gallium_check_st with gallium_require_drm.
Matt Turner [Sun, 21 Sep 2014 21:58:07 +0000 (14:58 -0700)]
configure.ac: Replace gallium_check_st with gallium_require_drm.

10 years agoconfigure.ac: Drop gallium directory tracking.
Matt Turner [Sun, 21 Sep 2014 21:52:27 +0000 (14:52 -0700)]
configure.ac: Drop gallium directory tracking.

Was only tracked to be printed at the end of configure, but configure
quits if it can't build something we requested, rather than silently
dropping it, so printing these directories has little use.

10 years agoconfigure.ac: Use autoconf macro for GNU make.
Matt Turner [Sun, 21 Sep 2014 20:32:35 +0000 (13:32 -0700)]
configure.ac: Use autoconf macro for GNU make.

10 years agoralloc: Mark ralloc functions with gcc's malloc attribute.
Matt Turner [Sun, 21 Sep 2014 21:31:05 +0000 (14:31 -0700)]
ralloc: Mark ralloc functions with gcc's malloc attribute.

Cuts a few hundred bytes from the DRI drivers, so it must give gcc some
extra information.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Replace a priori knowledge of gcc attributes with configure tests.
Matt Turner [Mon, 22 Sep 2014 01:14:01 +0000 (18:14 -0700)]
mesa: Replace a priori knowledge of gcc attributes with configure tests.

Note that I had to add support for testing the packed attribute to
m4/ax_gcc_func_attribute.m4.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [C bits]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Replace a priori knowledge of gcc builtins with configure tests.
Matt Turner [Mon, 22 Sep 2014 00:25:49 +0000 (17:25 -0700)]
mesa: Replace a priori knowledge of gcc builtins with configure tests.

Presumbly this will let clang and other compilers use the built-ins as
well.

Notice two changes specifically:
   - in _mesa_next_pow_two_64(), always use __builtin_clzll and add a
     static assertion that this is safe.
   - in macros.h, remove the clang-specific definition since it should
     be able to detect __builtin_unreachable in configure.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [C bits]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/compaction: Document instruction compaction capabilities.
Matt Turner [Thu, 28 Aug 2014 06:17:27 +0000 (23:17 -0700)]
i965/compaction: Document instruction compaction capabilities.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Emit ELSE/ENDIF JIP with type D on Gen 7.
Matt Turner [Thu, 28 Aug 2014 01:40:46 +0000 (18:40 -0700)]
i965: Emit ELSE/ENDIF JIP with type D on Gen 7.

The spec says the type must be W (JIP is 16-bits after all), but we've
been emitting it with a UD type all along and have experienced no
adverse effects. Changing the type to D allows ELSE and ENDIF
instructions to be compacted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Support compaction of control flow instructions.
Matt Turner [Thu, 28 Aug 2014 01:57:55 +0000 (18:57 -0700)]
i965/compaction: Support compaction of control flow instructions.

We're currently emitting compactable control flow instruction the wrong
types, preventing their compaction. The next patch will fix this and
actually enable compaction.

On chips that cannot compact control flow instructions, attempts to find
a match in the datatype table will fail.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Add support for G45.
Matt Turner [Wed, 20 Aug 2014 18:43:29 +0000 (11:43 -0700)]
i965/compaction: Add support for G45.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965: Add BRW_OPCODE_NENOP for G45.
Matt Turner [Sat, 14 Jun 2014 03:42:54 +0000 (20:42 -0700)]
i965: Add BRW_OPCODE_NENOP for G45.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Add support for Gen5.
Matt Turner [Thu, 24 Apr 2014 08:02:35 +0000 (10:02 +0200)]
i965/compaction: Add support for Gen5.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/compaction: Reduce size of compacted_counts[] array.
Matt Turner [Sun, 24 Aug 2014 00:00:07 +0000 (17:00 -0700)]
i965/compaction: Reduce size of compacted_counts[] array.

The array was previously indexed in units of brw_compact_inst (8-bytes),
but before compaction all instructions are uncompacted, so every odd
element was unused.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Use sizeof brw_inst/brw_compact_inst.
Matt Turner [Sat, 23 Aug 2014 16:55:39 +0000 (09:55 -0700)]
i965/compaction: Use sizeof brw_inst/brw_compact_inst.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Increment offset in for loop.
Matt Turner [Sat, 23 Aug 2014 05:13:41 +0000 (22:13 -0700)]
i965/compaction: Increment offset in for loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/compaction: Make src_offset local to the for loop.
Matt Turner [Sat, 23 Aug 2014 05:08:54 +0000 (22:08 -0700)]
i965/compaction: Make src_offset local to the for loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Remove unnecessary is-compacted? check.
Matt Turner [Wed, 24 Sep 2014 17:01:23 +0000 (10:01 -0700)]
i965/compaction: Remove unnecessary is-compacted? check.

Used to pass over previously compacted instructions in this loop, but no
longer. No point in checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
10 years agoi965/compaction: Don't set UIP on ELSE on Gen < 8.
Matt Turner [Thu, 21 Aug 2014 23:46:49 +0000 (16:46 -0700)]
i965/compaction: Don't set UIP on ELSE on Gen < 8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/compaction: Rework 3-src compaction logic.
Matt Turner [Thu, 28 Aug 2014 02:44:02 +0000 (19:44 -0700)]
i965/compaction: Rework 3-src compaction logic.

It may be possible to create a contrived example in which a 3-src
instruction would have been compacted on Gen < 8. I'd rather not
discover it in the wild.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/sf: Disable instruction compaction.
Matt Turner [Sun, 24 Aug 2014 07:03:37 +0000 (00:03 -0700)]
i965/sf: Disable instruction compaction.

Currently a no-op, since instruction compaction isn't implemented for the
generations that have a programmable strips-and-fans unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Set JumpCount, not JIP, on ENDIF on Gen 6.
Matt Turner [Thu, 28 Aug 2014 20:34:22 +0000 (13:34 -0700)]
i965: Set JumpCount, not JIP, on ENDIF on Gen 6.

Despite what the Sandybridge PRM says, ENDIF has Jump Count in <dst>,
not JIP in <src1>. (The same mistake appears about WHILE as well).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Use VertexArray, not _VertexArray, in array size expressions.
Kenneth Graunke [Sat, 23 Aug 2014 06:01:15 +0000 (23:01 -0700)]
mesa: Use VertexArray, not _VertexArray, in array size expressions.

Both sizes are VERT_ATTRIB_MAX, so this has no effect.  But it drops a
few trivial uses of the derived state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Set correct array element in vbo_exec_vtx_init.
Kenneth Graunke [Mon, 15 Sep 2014 06:45:38 +0000 (23:45 -0700)]
mesa: Set correct array element in vbo_exec_vtx_init.

I'm not familiar with this code, but this sure appears to be a typo.
It looks like the intent is to set each array element, not arrays[0]
each time.  Notably, the loop just below uses "array", not "arrays".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
10 years agomesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).
Kenneth Graunke [Mon, 15 Sep 2014 04:24:45 +0000 (21:24 -0700)]
mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).

The code in get.c that handles this uses ctx->Array.VAO->VertexAttrib,
which is a gl_vertex_attrib_array structure, not a gl_client_array.

The offsets of all fields happened to be the same in both structures, at
least on x86_64.  "Size," "Type," and "Stride" are obviously the same:
both structures start with the same fields, in the same order.

"Enabled" is dicier: there are different fields before it in both
structures, including pointer sized values which might need special
alignment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
10 years agomesa: Remove some dead helper functions.
Kenneth Graunke [Mon, 15 Sep 2014 06:21:48 +0000 (23:21 -0700)]
mesa: Remove some dead helper functions.

Dead since the _MaxElement removal, but these functions seemed generally
applicable, so I decided to remove them in a separate patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agovc4: Compute max_index instead of trusting the rest of userspace.
Eric Anholt [Tue, 12 Aug 2014 22:01:30 +0000 (15:01 -0700)]
vc4: Compute max_index instead of trusting the rest of userspace.

max_index was coming from either the user telling us as part of
glDrawRangeElements, or from an incidental calculation as part of some
sort of primitive conversion fallback.  Sometimes, it was just set to the
default "I don't know" ~0 value.

If it wasn't set to the actual max index, then the kernel would reject the
draw call for allowing out-of-bounds VBO reads.  So, compute the max index
from the sizes of the VBOs, which isn't too expensive (unlike mapping and
reading the index buffer) and is reliable.

Fixes piglit vao-element-array-buffer.

10 years agovc4: Move shader record setup before the draw call.
Eric Anholt [Tue, 12 Aug 2014 21:57:39 +0000 (14:57 -0700)]
vc4: Move shader record setup before the draw call.

The flush only happens after both are written, so we can do them in either
order.  This will let me compute max_index during the shader record setup.

10 years agoi965/vec4: Call calculate_cfg() in test programs to avoid crashing.
Matt Turner [Wed, 24 Sep 2014 23:05:50 +0000 (16:05 -0700)]
i965/vec4: Call calculate_cfg() in test programs to avoid crashing.

Reported-by: Mark Janes <mark.a.janes@intel.com>
10 years agovc4: Add support for gl_PointCoord.
Eric Anholt [Wed, 24 Sep 2014 21:47:06 +0000 (14:47 -0700)]
vc4: Add support for gl_PointCoord.

Fixes piglit glsl-fs-pointcoord, point-sprite, and fbo-gl_pointcoord.

10 years agovc4: Add support for point size setting.
Eric Anholt [Wed, 24 Sep 2014 21:23:25 +0000 (14:23 -0700)]
vc4: Add support for point size setting.

This is the support for both the global and per-vertex modes.