mesa.git
10 years agogallium: new, unified pipe_context::set_sampler_views() function
Brian Paul [Tue, 8 Oct 2013 00:16:22 +0000 (18:16 -0600)]
gallium: new, unified pipe_context::set_sampler_views() function

The new function replaces four old functions: set_fragment/vertex/
geometry/compute_sampler_views().

Note: at this time, it's expected that the 'start' parameter will
always be zero.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agosvga: remove unneeded include of u_double_list.h
Brian Paul [Sat, 19 Oct 2013 17:22:33 +0000 (11:22 -0600)]
svga: remove unneeded include of u_double_list.h

10 years agoi965: Expose write_reg() as brw_store_register_mem64().
Kenneth Graunke [Tue, 28 May 2013 02:51:35 +0000 (19:51 -0700)]
i965: Expose write_reg() as brw_store_register_mem64().

Writing a 64-bit register value to memory is sufficiently complicated
that it makes sense to reuse this function rather than duplicating it.

Exposing it outside of gen6_queryobj.c means it needs a more descriptive
function name.  It could probably be moved to brw_util.c or somewhere
else, but this works too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Move flushing out of write_reg and into the callers.
Kenneth Graunke [Tue, 28 May 2013 02:44:44 +0000 (19:44 -0700)]
i965: Move flushing out of write_reg and into the callers.

The current callers just want to write a single register, so combining
the register read with a pipeline flush made sense.  However, in the
future we'll want to do multiple register reads back to back, and we'll
only want to flush once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Simplify the interface to link_invalidate_variable_locations
Ian Romanick [Fri, 4 Oct 2013 17:46:29 +0000 (10:46 -0700)]
glsl: Simplify the interface to link_invalidate_variable_locations

The unit tests added in the previous commits prove some things about the
state of some internal data structures.  The most important of these is
that all built-in input and output variables have explicit_location
set.  This means that link_invalidate_variable_locations doesn't need to
know the range of non-generic shader inputs or outputs.  It can simply
reset location state depending on whether explicit_location is set.

There are two additional assumptions that were already implicit in the
code that comments now document.

  - ir_variable::is_unmatched_generic_inout is only used by the linker
    when connecting outputs from one shader stage to inputs of another
    shader stage.

  - Any varying that has explicit_location set must be a built-in.  This
    will be true until GL_ARB_separate_shader_objects is supported.

As a result, the input_base and output_base parameters to
link_invalidate_variable_locations are no longer necessary, and the code
for resetting locations and setting is_unmatched_generic_inout can be
simplified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl/tests: Unit test vertex shader in / out with link_invalidate_variable_locations
Ian Romanick [Tue, 22 Oct 2013 22:10:16 +0000 (15:10 -0700)]
glsl/tests: Unit test vertex shader in / out with link_invalidate_variable_locations

Validates:

  - ir_variable::explicit_location should not be modified.

  - If ir_variable::explicit_location is not set, ir_variable::location,
    ir_variable::location_frac, and
    ir_variable::is_unmatched_generic_inout must be reset to 0.

  - If ir_variable::explicit_location is set, ir_variable::location
    should not be modified.  ir_variable::location_frac, and
    ir_variable::is_unmatched_generic_inout must be reset to 0.
    Previous unit tests have shown that all non-generic inputs / outputs
    have explicit_location set.

v2: Split the link_invalidate_variable_locations interface change out to
a separate patch.  Remove the vertex_in_builtin_without_explicit and
vertex_out_builtin_without_explicit tests.  There was a lot of good
discussion about this on the mailing list to which I refer the
interested reader.  Both changes suggested by Paul.

    http://lists.freedesktop.org/archives/mesa-dev/2013-October/046652.html

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl: Modify interface to link_invalidate_variable_locations
Ian Romanick [Tue, 22 Oct 2013 22:07:00 +0000 (15:07 -0700)]
glsl: Modify interface to link_invalidate_variable_locations

This will make it easier to unit test this function in successive
patches.  Also, correct the prototype in linker.h.  It was... wrong.

v2: Split the interface change from adding the unit tests.  Suggested by
Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl/tests: Verify geometry shader built-ins generated by _mesa_glsl_initialize_variables
Ian Romanick [Thu, 3 Oct 2013 22:21:53 +0000 (15:21 -0700)]
glsl/tests: Verify geometry shader built-ins generated by _mesa_glsl_initialize_variables

Checks that the variables generated meet certain criteria.

 - Geometry shader inputs have an explicit location.

 - Geometry shader outputs have an explicit location.

 - Fragment shader-only varying locations are not used.

 - Geometry shader uniforms and system values don't have an explicit
   location.

 - Geometry shader constants don't have an explicit location and are
   read-only.

 - No other kinds of geometry variables exist.

It does not verify that an specific variables exist.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl/tests: Verify fragment shader built-ins generated by _mesa_glsl_initialize_variables
Ian Romanick [Thu, 3 Oct 2013 22:14:35 +0000 (15:14 -0700)]
glsl/tests: Verify fragment shader built-ins generated by _mesa_glsl_initialize_variables

Checks that the variables generated meet certain criteria.

 - Fragment shader inputs have an explicit location.

 - Fragment shader outputs have an explicit location.

 - Vertex / geometry shader-only varying locations are not used.

 - Fragment shader uniforms and system values don't have an explicit
   location.

 - Fragment shader constants don't have an explicit location and are
   read-only.

 - No other kinds of fragment variables exist.

It does not verify that an specific variables exist.

v2: Use _mesa_varying_slot_in_fs in
fragment_builtin.inputs_have_explicit_location.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl/tests: Verify vertex shader built-ins generated by _mesa_glsl_initialize_variables
Ian Romanick [Thu, 3 Oct 2013 22:05:44 +0000 (15:05 -0700)]
glsl/tests: Verify vertex shader built-ins generated by _mesa_glsl_initialize_variables

Checks that the variables generated meet certain criteria.

 - Vertex shader inputs have an explicit location.

 - Vertex shader outputs have an explicit location.

 - Fragment shader-only varying locations are not used.

 - Vertex shader uniforms and system values don't have an explicit
   location.

 - Vertex shader constants don't have an explicit location and are
   read-only.

 - No other kinds of vertex variables exist.

It does not verify that an specific variables exist.

v2: Fix memory management mistakes in
common_builtin::string_starts_with_prefix.  Clean up error message
reporting in common_builtin::no_invalid_variable_modes.  Both suggested
by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoglsl: When constructing a variable with an interface type, set interface_type
Ian Romanick [Wed, 2 Oct 2013 23:19:59 +0000 (16:19 -0700)]
glsl: When constructing a variable with an interface type, set interface_type

Ever since the addition of interface blocks with instance names, we have
had an implicit invariant:

    var->type->is_interface() ==
        (var->type == var->interface_type)

The odd use of == here is intentional because !var->type->is_interface()
implies var->type != var->interface_type.

Further, if var->type->is_array() is true, we have a related implicit
invariant:

    var->type->fields.array->is_interface() ==
        (var->type->fields.array == var->interface_type)

However, the ir_variable constructor doesn't maintain either invariant.
That seems kind of silly... and I tripped over it while writing some
other code.  This patch makes the constructor do the right thing, and it
introduces some tests to verify that behavior.

v2: Add general-ir-test to .gitignore.  Update the description of the
ir_variable invariant for arrays in the commit message.  Both suggested
by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa/tests: Add simple, dumb test for _mesa_program_state_string
Ian Romanick [Tue, 15 Oct 2013 21:01:03 +0000 (14:01 -0700)]
mesa/tests: Add simple, dumb test for _mesa_program_state_string

After some discussions about the correct way to update
_mesa_program_state_string, I decided to make a unit test for the
function.  It turns out that the function didn't work quite the way I
thought.  The unit test proves that the code was already correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Anuj Phogat <anuj.phogat@gmail.com>
10 years agowayland: Don't leak wl_drm global when unbinding display
Ander Conselvan de Oliveira [Wed, 16 Oct 2013 12:04:03 +0000 (15:04 +0300)]
wayland: Don't leak wl_drm global when unbinding display

10 years agomesa: fixes for MSVC 2013
Scott Graham [Tue, 22 Oct 2013 14:37:44 +0000 (08:37 -0600)]
mesa: fixes for MSVC 2013

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: minor whitespace, comment changes in st_draw.c
Brian Paul [Sat, 19 Oct 2013 14:27:40 +0000 (08:27 -0600)]
st/mesa: minor whitespace, comment changes in st_draw.c

10 years agost/dri: minor formatting clean-ups in dri_context.c
Brian Paul [Sat, 19 Oct 2013 14:23:10 +0000 (08:23 -0600)]
st/dri: minor formatting clean-ups in dri_context.c

10 years agomesa: fix a couple issues with U_FIXED, I_FIXED macros
Brian Paul [Sat, 19 Oct 2013 14:21:38 +0000 (08:21 -0600)]
mesa: fix a couple issues with U_FIXED, I_FIXED macros

Silence a bunch of MSVC type conversion warnings.

Changed return type of S_FIXED to int32_t (signed).  The result
is the same.  It just seems more intuitive that a signed conversion
function should return a signed value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agomesa: remove GL_MESA_program_debug bits from gl.h
Brian Paul [Sat, 19 Oct 2013 14:21:38 +0000 (08:21 -0600)]
mesa: remove GL_MESA_program_debug bits from gl.h

The code for this was removed from Mesa some time ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: remove remnants of GL_MESA_shader_debug
Brian Paul [Sat, 19 Oct 2013 14:21:38 +0000 (08:21 -0600)]
mesa: remove remnants of GL_MESA_shader_debug

This extension never saw any real use so remove it.

v2: also update tests/num_strings.cpp for 'make check'

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Only emit interpolation setup if there are actual FS inputs.
Kenneth Graunke [Sun, 20 Oct 2013 04:27:37 +0000 (21:27 -0700)]
i965: Only emit interpolation setup if there are actual FS inputs.

Dead code elimination would get rid of the extra instructions, but
skipping this saves iterations through the optimization loop.

From shader-db:

      N     Min     Max        Median           Avg        Stddev
x 14672       3      16             3     3.1334515    0.59904168
+ 14672       1      16             3     2.8955153    0.77732963
Difference at 95.0% confidence
        -0.237936 +/- 0.0158798
        -7.59342% +/- 0.506783%
        (Student's t, pooled s = 0.693935)

Embarassingly, the classic shadow mapping shader:

   void main() { }

used to require three iterations through the optimization loop.
With this patch, it only requires one (which makes no progress).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Fix accidental type conversion in header setup
Chris Forbes [Sat, 12 Oct 2013 23:39:47 +0000 (12:39 +1300)]
i965/fs: Fix accidental type conversion in header setup

Previously one side could be UD while the other was float.

V2: Prefer float; apparently IVB can dispatch float ops faster. (Thanks
Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Fix handling of sampler messages with header but zero offset
Chris Forbes [Sat, 12 Oct 2013 23:20:03 +0000 (12:20 +1300)]
i965/fs: Fix handling of sampler messages with header but zero offset

Gather unconditionally uses a header, but in some cases the
texture_offset value will be zero.

V2: Don't introduce a bogus conversion.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Optimize -(-expr) into expr.
Matt Turner [Wed, 16 Oct 2013 23:56:45 +0000 (16:56 -0700)]
glsl: Optimize -(-expr) into expr.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Optimize abs(-expr) and abs(abs(expr)) into abs(expr).
Matt Turner [Wed, 16 Oct 2013 23:56:44 +0000 (16:56 -0700)]
glsl: Optimize abs(-expr) and abs(abs(expr)) into abs(expr).

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Use saved values instead of recomputing them.
Matt Turner [Wed, 16 Oct 2013 23:56:43 +0000 (16:56 -0700)]
glsl: Use saved values instead of recomputing them.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodocs: Mark GLSL 1.50, 3.30, and geometry shaders done for i965.
Matt Turner [Fri, 18 Oct 2013 22:12:33 +0000 (15:12 -0700)]
docs: Mark GLSL 1.50, 3.30, and geometry shaders done for i965.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs: Update docs for ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Mon, 21 Oct 2013 09:11:36 +0000 (11:11 +0200)]
docs: Update docs for ARB_texture_mirror_clamp_to_edge.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Implement ARB_texture_mirror_clamp_to_edge.
Kenneth Graunke [Mon, 21 Oct 2013 03:19:53 +0000 (20:19 -0700)]
i965: Implement ARB_texture_mirror_clamp_to_edge.

This passes Piglit's texwrap tests.

v2: Remove _EXT suffix.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Rico Schüller <kgbricola@web.de>
10 years agoi965: Drop unused simple_list.h includes.
Kenneth Graunke [Tue, 22 Oct 2013 03:56:44 +0000 (20:56 -0700)]
i965: Drop unused simple_list.h includes.

These don't appear to be necessary.  Everything compiles just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agogbm-dri: Support importing RGB565 buffers
Kristian Høgsberg [Fri, 18 Oct 2013 04:21:41 +0000 (21:21 -0700)]
gbm-dri: Support importing RGB565 buffers

10 years agoglsl/linker: Allow mixing of desktop GLSL versions.
Paul Berry [Mon, 14 Oct 2013 01:01:11 +0000 (18:01 -0700)]
glsl/linker: Allow mixing of desktop GLSL versions.

Previously, Mesa followed the linkage rules outlined in the GLSL
1.20-1.40 specs, which (collectively) said that GLSL versions 1.10 and
1.20 could be linked together, but no other versions could be linked.

In GLSL 4.30, the linkage rules were relaxed so that any two desktop
GLSL versions can be linked together.  This change was made because it
reflected the behaviour of nearly all existing implementations (see
Khronos bug 8463).  Mesa was one of the few (perhaps the only)
exceptions to prohibit cross-linking of some GLSL versions.

Since the GLSL linkage rules were deliberately relaxed in order to
match the behaviour of existing implementations, it seems appropriate
to relax the rules in Mesa too (even though Mesa doesn't support GLSL
4.30 yet).

Note that linking ES and desktop shaders is still prohibited, as is
linking ES shaders having different GLSL versions.

Fixes piglit tests "shaders/version-mixing {interstage,intrastage}".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoclover: Improve region and pitch argument handling in memory transfer APIs.
Francisco Jerez [Sat, 19 Oct 2013 01:14:28 +0000 (18:14 -0700)]
clover: Improve region and pitch argument handling in memory transfer APIs.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Add a pixel_size() method to the image class.
Francisco Jerez [Fri, 18 Oct 2013 23:25:36 +0000 (16:25 -0700)]
clover: Add a pixel_size() method to the image class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Implement support for the ICD extension.
Francisco Jerez [Sun, 6 Oct 2013 20:52:02 +0000 (13:52 -0700)]
clover: Implement support for the ICD extension.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Make sure hidden is the default symbol visibility.
Francisco Jerez [Wed, 24 Jul 2013 10:13:40 +0000 (12:13 +0200)]
clover: Make sure hidden is the default symbol visibility.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Prepare the build system for ICD support.
Tom Stellard [Wed, 18 Sep 2013 07:36:55 +0000 (00:36 -0700)]
clover: Prepare the build system for ICD support.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
10 years agoclover: Fix memory leak when initializing a device object fails.
Francisco Jerez [Thu, 19 Sep 2013 03:57:39 +0000 (20:57 -0700)]
clover: Fix memory leak when initializing a device object fails.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Tidy up resource::mapping.
Francisco Jerez [Mon, 16 Sep 2013 06:07:10 +0000 (23:07 -0700)]
clover: Tidy up resource::mapping.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Simplify command_queue::flush().
Francisco Jerez [Mon, 16 Sep 2013 06:04:28 +0000 (23:04 -0700)]
clover: Simplify command_queue::flush().

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Clean up the kernel and program object interface.
Francisco Jerez [Tue, 17 Sep 2013 04:50:40 +0000 (21:50 -0700)]
clover: Clean up the kernel and program object interface.

[ Tom Stellard: Make sure to bind global arguments before retrieving handles. ]
Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Clean up the interface of the context object slightly.
Francisco Jerez [Tue, 17 Sep 2013 04:38:32 +0000 (21:38 -0700)]
clover: Clean up the interface of the context object slightly.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Delete copy constructors and assignment operators in all non-copiable objects.
Francisco Jerez [Tue, 17 Sep 2013 04:44:36 +0000 (21:44 -0700)]
clover: Delete copy constructors and assignment operators in all non-copiable objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Define a few convenience equality operators.
Francisco Jerez [Tue, 17 Sep 2013 04:11:16 +0000 (21:11 -0700)]
clover: Define a few convenience equality operators.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Simplify the platform object by using util/range.
Francisco Jerez [Tue, 17 Sep 2013 04:44:19 +0000 (21:44 -0700)]
clover: Simplify the platform object by using util/range.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Add property list helpers with a syntax consistent with other API objects.
Francisco Jerez [Tue, 17 Sep 2013 04:13:47 +0000 (21:13 -0700)]
clover: Add property list helpers with a syntax consistent with other API objects.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch samplers to the new model.
Francisco Jerez [Mon, 16 Sep 2013 05:20:43 +0000 (22:20 -0700)]
clover: Switch samplers to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch memory objects to the new model.
Francisco Jerez [Tue, 1 Oct 2013 19:00:51 +0000 (12:00 -0700)]
clover: Switch memory objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch kernel and program objects to the new model.
Francisco Jerez [Wed, 18 Sep 2013 06:20:11 +0000 (23:20 -0700)]
clover: Switch kernel and program objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch command queues to the new model.
Francisco Jerez [Tue, 1 Oct 2013 18:57:32 +0000 (11:57 -0700)]
clover: Switch command queues to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch event objects to the new model.
Francisco Jerez [Tue, 1 Oct 2013 18:54:07 +0000 (11:54 -0700)]
clover: Switch event objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch context objects to the new model.
Francisco Jerez [Mon, 16 Sep 2013 03:50:30 +0000 (20:50 -0700)]
clover: Switch context objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch device objects to the new model.
Francisco Jerez [Mon, 16 Sep 2013 03:06:57 +0000 (20:06 -0700)]
clover: Switch device objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch platform objects to the new model.
Francisco Jerez [Tue, 17 Sep 2013 01:26:04 +0000 (18:26 -0700)]
clover: Switch platform objects to the new model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Define helper classes for the new object model.
Francisco Jerez [Sun, 6 Oct 2013 20:51:01 +0000 (13:51 -0700)]
clover: Define helper classes for the new object model.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Clean up property query functions by using a new property_buffer helper class.
Francisco Jerez [Sun, 6 Oct 2013 20:49:49 +0000 (13:49 -0700)]
clover: Clean up property query functions by using a new property_buffer helper class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Switch to the new utility code.
Francisco Jerez [Sun, 6 Oct 2013 20:49:05 +0000 (13:49 -0700)]
clover: Switch to the new utility code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Name include guards consistently.
Francisco Jerez [Sun, 15 Sep 2013 22:29:34 +0000 (15:29 -0700)]
clover: Name include guards consistently.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Replace a bunch of double underscores with single underscores.
Francisco Jerez [Wed, 18 Sep 2013 06:13:48 +0000 (23:13 -0700)]
clover: Replace a bunch of double underscores with single underscores.

Identifiers with double underscores are reserved, and using them has
undefined behavior according to the C++ spec.  It's unlikely to make
any difference, but...

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Clean up the event profiling code.
Francisco Jerez [Sun, 6 Oct 2013 20:48:23 +0000 (13:48 -0700)]
clover: Clean up the event profiling code.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Import new utility library.
Francisco Jerez [Sun, 6 Oct 2013 20:47:19 +0000 (13:47 -0700)]
clover: Import new utility library.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Require GCC 4.7 or higher to build.
Francisco Jerez [Sun, 29 Sep 2013 00:26:50 +0000 (17:26 -0700)]
clover: Require GCC 4.7 or higher to build.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoclover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX
Tom Stellard [Wed, 2 Oct 2013 15:56:20 +0000 (11:56 -0400)]
clover: Use std::numeric_limits<std::size_t>::max() instead of SIZE_MAX

This prevents a build failure on some systems.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agollvmpipe: enable seamless cube filtering
Roland Scheidegger [Fri, 18 Oct 2013 18:54:01 +0000 (20:54 +0200)]
llvmpipe: enable seamless cube filtering

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallivm: implement seamless cube filtering
Roland Scheidegger [Fri, 18 Oct 2013 18:52:26 +0000 (20:52 +0200)]
gallivm: implement seamless cube filtering

For seamless cube filtering it is necessary to determine new faces and new
coords per sample. The logic for this is _seriously_ complex (what needs
to happen is very "asymmetric" wrt face, x/y under/overflow), further
complicated by the fact that if the 4 samples are in a corner (meaning we
only have actually 3 samples, and all 3 are on different faces) then
falling off the edge is happening _both_ on x and y axis simultaneously.
There was a noticeable performance hit in mesa's cubemap demo when seamless
filtering was forced on (just below 10 percent or so in a debug build, when
disabling all filtering hacks, otherwise it would probably be a bit more) and
when always doing the logic, hence use a branch which it only does it if any
of the pixels in a quad (or in two quads) actually hit this. With that there
was no measurable performance hit in the cubemap demo (neither in a debug nor
release buidl), but this will vary (cubemap demo very rarely hits edges).
Might also be different on other cpus, as this forces SoA sampling path which
potentially can be quite a bit slower.
Note that as for corners, this code gets all the 3 samples which actually
exist right, and the 4th texel will simply be the same as one of the others,
meaning that filter weights will be a bit wrong. This however should be
enough for full OpenGL (but not d3d10) compliance.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agowinsys/radeon: cleanup CS offloading
Christian König [Sat, 12 Oct 2013 16:51:25 +0000 (18:51 +0200)]
winsys/radeon: cleanup CS offloading

Using atomic function for ncs is superfluous since it is
protected by a mutex anyway. Also lock the mutex only once
while retrieving the next CS for submission.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeon: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:59 +0000 (12:39 +0200)]
radeon: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
10 years agor200: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:58 +0000 (12:39 +0200)]
r200: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
10 years agogallium: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:57 +0000 (12:39 +0200)]
gallium: Enable ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
10 years agoswrast: Enable ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:56 +0000 (12:39 +0200)]
swrast: Enable ARB_texture_mirror_clamp_to_edge.

v2: fix commit message

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Rico Schüller <kgbricola@web.de>
10 years agomesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.
Rico Schüller [Sun, 20 Oct 2013 10:39:55 +0000 (12:39 +0200)]
mesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Rico Schüller <kgbricola@web.de>
10 years agoscons: Fix Haiku missing library
Alexander von Gluck IV [Sun, 20 Oct 2013 04:31:50 +0000 (23:31 -0500)]
scons: Fix Haiku missing library

* The softpipe add-on needs libtranslation
  due to the use of BTranslatorRoster

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agodocs: Updating forgotten GL feature completion for r600
Alexandre Demers [Sun, 20 Oct 2013 17:48:05 +0000 (13:48 -0400)]
docs: Updating forgotten GL feature completion for r600

10 years agor300g/compiler: Fix unsigned comparison with less than zero
David Heidelberger [Mon, 7 Oct 2013 16:06:11 +0000 (18:06 +0200)]
r300g/compiler: Fix unsigned comparison with less than zero

rc_find_free_temporary_list() returns signed integer
(in case of lack of free temporary registers returns -1),
so new_index in radeon_rename_regs() should be signed.

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

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agor600g/sb: Initialize shader::dce_flags.
Vinson Lee [Sat, 19 Oct 2013 02:15:37 +0000 (19:15 -0700)]
r600g/sb: Initialize shader::dce_flags.

Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vadim Girlin <vadimgirlin@gmail.com>
10 years agoi965: Mark G45 as having surface tile offset support.
Kenneth Graunke [Fri, 18 Oct 2013 23:14:05 +0000 (16:14 -0700)]
i965: Mark G45 as having surface tile offset support.

Fixes a regression since 02b632d8e8f2b14c155740d28c276b5869305c60.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Initialize per_vertex_accumulator::fields.
Vinson Lee [Sat, 12 Oct 2013 06:14:47 +0000 (23:14 -0700)]
glsl: Initialize per_vertex_accumulator::fields.

Fixes "Uninitialized pointer field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agomesa: Remove GLXContextID typedef from glx.h.
Vinson Lee [Sat, 19 Oct 2013 00:40:40 +0000 (17:40 -0700)]
mesa: Remove GLXContextID typedef from glx.h.

Fixes this build error.

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agodocs: Import 9.2.2 release notes, add news item.
Carl Worth [Sat, 19 Oct 2013 00:19:31 +0000 (17:19 -0700)]
docs: Import 9.2.2 release notes, add news item.

10 years agodocs: Note that we support OpenGL 3.3 in the release notes.
Kenneth Graunke [Fri, 18 Oct 2013 06:21:24 +0000 (23:21 -0700)]
docs: Note that we support OpenGL 3.3 in the release notes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Enable OpenGL 3.3 and GLSL 3.30.
Kenneth Graunke [Fri, 18 Oct 2013 06:14:23 +0000 (23:14 -0700)]
i965: Enable OpenGL 3.3 and GLSL 3.30.

Everything necessary for these appears to be implemented.  We'll want to
add more tests to guard against bugs, but it should be functionally
complete.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agotranslate_sse: Fix generated code argument handling for msabi on x86_64
Jon TURNEY [Thu, 3 Oct 2013 20:15:11 +0000 (21:15 +0100)]
translate_sse: Fix generated code argument handling for msabi on x86_64

translate_sse.c contains code for msabi on x86_64, but it appears to be
untested.

Currently arguments 1 and 2 passed to the generated code are moved as 32-bit
quantities into the registers used by sysvabi, irrespective of the architecture.
Since these may be pointers, they must be moved as 64-bit quantities to avoid
truncation.

Commit f4dd0991719ef3e2606920c5100b372181c60899 disabled tranlate_sse.c on MinGW
x86_64, I don't know if was due to this issue, or a different one...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agortasm: Cygwin uses the msabi calling convention on x86_64
Jon TURNEY [Thu, 3 Oct 2013 20:11:52 +0000 (21:11 +0100)]
rtasm: Cygwin uses the msabi calling convention on x86_64

Cygwin also uses the msabi calling convention on x86_64, not the sysvabi calling
convention

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
ignored, and an empty message aborts the commit.

10 years agortasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation...
Jon TURNEY [Sat, 21 Sep 2013 16:16:37 +0000 (17:16 +0100)]
rtasm: The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation which uses mmap()

The heap is NX on 64-bit Cygwin, so use the rtasm_exec_malloc() implementation
which uses mmap() to allocate an anonymous page with execute permission, rather
than the one which just uses malloc().

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoscons: Simplified fix of llvm cxxflags for rtti
Alexander von Gluck IV [Thu, 17 Oct 2013 01:24:13 +0000 (20:24 -0500)]
scons: Simplified fix of llvm cxxflags for rtti

* Based on ideas of Jose Fonseca
* A rework of ce8eadb6e8

Tested-by: Vinson Lee <vlee@freedesktop.org>
10 years agoglsl: Fix MSVC build (missing strcasecmp())
Paul Berry [Thu, 17 Oct 2013 20:47:35 +0000 (13:47 -0700)]
glsl: Fix MSVC build (missing strcasecmp())

MSVC doesn't have a strcasecmp() function; it uses _stricmp() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agoi965: Fold brwInitVtbl() into brwCreateContext().
Kenneth Graunke [Tue, 15 Oct 2013 23:17:15 +0000 (16:17 -0700)]
i965: Fold brwInitVtbl() into brwCreateContext().

With most of the virtual functions gone, brwInitVtbl() is now tiny.

Merging it into the caller allows us to delete the entire file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Merge brw_destroy_context() into intelDestroyContext().
Kenneth Graunke [Tue, 15 Oct 2013 23:13:45 +0000 (16:13 -0700)]
i965: Merge brw_destroy_context() into intelDestroyContext().

Now that i915 and i965 have been split, the separation between
intelDestroyContext and brw_destroy_context is kind of arbitrary.

This patch replaces the only brw->vtbl.destroy() call with the body
of brw_destroy_context (the only implementation of that virtual
function).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Replace dri_bo_release with drm_intel_bo_unreference.
Kenneth Graunke [Tue, 15 Oct 2013 23:09:22 +0000 (16:09 -0700)]
i965: Replace dri_bo_release with drm_intel_bo_unreference.

dri_bo_release is a helper function that calls drm_intel_bo_unreference
but then also sets the pointer to NULL.  This is unnecessary, since
brw_destroy_context is called from intelDestroyContext, which also frees
brw completely.

If you're still trying to access them, you've got bigger problems.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Unindent the body of intelDestroyContext.
Kenneth Graunke [Tue, 15 Oct 2013 23:06:59 +0000 (16:06 -0700)]
i965: Unindent the body of intelDestroyContext.

Having almost the entire body of the function indented one level for a
check that should never happen seems silly.  Just early return.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Un-virtualize brw_new_batch().
Kenneth Graunke [Tue, 15 Oct 2013 23:00:16 +0000 (16:00 -0700)]
i965: Un-virtualize brw_new_batch().

Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Un-virtualize brw_finish_batch().
Kenneth Graunke [Tue, 15 Oct 2013 22:55:42 +0000 (15:55 -0700)]
i965: Un-virtualize brw_finish_batch().

Since the i915/i965 split, there's only one implementation of this
virtual function.  We may as well just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: In update_max_array_access, fix interface instance check.
Paul Berry [Tue, 15 Oct 2013 16:43:22 +0000 (09:43 -0700)]
glsl: In update_max_array_access, fix interface instance check.

In commit f878d20 (glsl: Update ir_variable::max_ifc_array_access
properly), I accidentally used the wrong kind of check to determine
whether the variable being accessed was an interface instance (I used
var->get_interface_type() != NULL when I should have used
var->is_interface_instance()).  As a result, if an unnamed interface
block contained a struct which contained an array,
update_max_array_access() would mistakenly interpret the struct as a
named interface block and try to dereference a null
var->max_ifc_array_access.

This patch corrects the check, fixing the null dereference.

Fixes piglit test interface-block-struct-nesting.

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

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Treat layout-qualifier-id's as case-insensitive in desktop GLSL.
Paul Berry [Wed, 16 Oct 2013 00:25:44 +0000 (17:25 -0700)]
glsl: Treat layout-qualifier-id's as case-insensitive in desktop GLSL.

In desktop GLSL, location qualifiers are case-insensitive.  In GLSL
ES, they are case-sensitive.  This patch handles the difference by
using a new function to match layout qualifiers,
match_layout_qualifier(), which calls either strcmp() or strcasecmp()
as appropriate.

Fixes piglit tests:
- layout-not-case-sensitive-in.geom
- layout-not-case-sensitive-max-vert.geom
- layout-not-case-sensitive-out.geom
- layout-not-case-sensitive.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC typedefs in gl.h
Brian Paul [Thu, 17 Oct 2013 18:10:26 +0000 (12:10 -0600)]
mesa: remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC typedefs in gl.h

Fixes error about duplicated typedefs (also in glext.h) reported on
NetBSD 6.1

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70546
Tested-by: Vinson Lee <vlee@freedesktop.org>
10 years agost/mesa: add a few comments in st_create_context_priv()
Brian Paul [Thu, 17 Oct 2013 15:28:17 +0000 (09:28 -0600)]
st/mesa: add a few comments in st_create_context_priv()

10 years agost/mesa: handle layer and primitive id output and point size input
Dave Airlie [Mon, 14 Oct 2013 07:27:48 +0000 (17:27 +1000)]
st/mesa: handle layer and primitive id output and point size input

This fixes a number of piglit crashes when running on a hacked up llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: add geometry shader ubo support
Dave Airlie [Mon, 14 Oct 2013 02:18:53 +0000 (12:18 +1000)]
st/mesa: add geometry shader ubo support

This just adds the missing bits so the ubo tests don't crash.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa/st: Allow geometry shaders without gl_Position export.
Fabian Bieler [Wed, 29 May 2013 22:54:55 +0000 (00:54 +0200)]
mesa/st: Allow geometry shaders without gl_Position export.

From the ARB_geometry_shader4 spec (section Geometry Shader outputs):
"The built-in special variable gl_Position is intended to hold the
homogeneous vertex position. Writing gl_Position is optional."

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa, glsl_to_tgsi: add support for geometry shaders
Bryan Cain [Fri, 15 Feb 2013 16:02:18 +0000 (10:02 -0600)]
st/mesa, glsl_to_tgsi: add support for geometry shaders

v2 (Bryan Cain <bryancain3@gmail.com>): fix 2D array indexing order.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().
Bryan Cain [Fri, 15 Feb 2013 14:53:20 +0000 (08:53 -0600)]
mesa/st: Add VARYING_SLOT_TEX[1-7] to st_translate_geometry_program().

v2 (Paul Berry <stereotype441@gmail.com>: Split out to separate patch
(previously this was part of "glsl: add builtins for geometry
shaders.")

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>