mesa.git
10 years agoilo: remove unused headers
Chia-I Wu [Sun, 13 Apr 2014 16:55:01 +0000 (00:55 +0800)]
ilo: remove unused headers

Remove intel_*.h.  brw_*.h is still needed by the state dumper and
disassembler.

10 years agoilo: use only defines from genhw headers
Chia-I Wu [Sun, 13 Apr 2014 12:07:40 +0000 (20:07 +0800)]
ilo: use only defines from genhw headers

Stop including classic driver headers in genhw.h, with some formatting fixes.

10 years agoilo: scripted conversion to genhw headers
Chia-I Wu [Sun, 13 Apr 2014 15:37:04 +0000 (23:37 +0800)]
ilo: scripted conversion to genhw headers

Hopefully my four hundred line sed script is correct.

10 years agoilo: add genhw headers
Chia-I Wu [Sat, 12 Apr 2014 16:33:00 +0000 (00:33 +0800)]
ilo: add genhw headers

All except genhw.h are generated by https://github.com/olvaffe/envytools/.
intel_chipset.h is deprecated.

10 years agoilo: avoid brw_wm_barycentric_interp_mode in compiler
Chia-I Wu [Fri, 11 Apr 2014 19:17:33 +0000 (03:17 +0800)]
ilo: avoid brw_wm_barycentric_interp_mode in compiler

In preparation for genhw.

10 years agoilo: add TOY_OPCODE_DO
Chia-I Wu [Fri, 11 Apr 2014 18:26:46 +0000 (02:26 +0800)]
ilo: add TOY_OPCODE_DO

We used to give BRW_OPCODE_DO a special meaning, while we should have used
TOY_OPCODE_DO.

10 years agogtest: Update to 1.7.0.
Vinson Lee [Thu, 27 Feb 2014 06:54:24 +0000 (22:54 -0800)]
gtest: Update to 1.7.0.

This patch fixes gtest build errors on Mac OS X 10.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73106
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Consider gl_VertexID and gl_InstanceID active attribs
Chris Forbes [Sat, 12 Apr 2014 09:20:43 +0000 (21:20 +1200)]
mesa: Consider gl_VertexID and gl_InstanceID active attribs

Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Extract is_active_attrib() in shaderapi
Chris Forbes [Sat, 12 Apr 2014 09:20:42 +0000 (21:20 +1200)]
mesa: Extract is_active_attrib() in shaderapi

The rules are about to get a bit more complex to account for
gl_InstanceID and gl_VertexID, which are system values.

Extracting this first avoids introducing duplication.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Fix typo in interface block comment
Chris Forbes [Sun, 13 Apr 2014 05:01:07 +0000 (17:01 +1200)]
glsl: Fix typo in interface block comment

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoegl-static: fix build after recent radeon winsys changes
Simone Scanzoni [Sun, 13 Apr 2014 00:36:20 +0000 (02:36 +0200)]
egl-static: fix build after recent radeon winsys changes

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agomesa: Fix typo in error message
Chris Forbes [Sat, 12 Apr 2014 23:53:16 +0000 (11:53 +1200)]
mesa: Fix typo in error message

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: glClearBuffer() should only clear a single buffer.
Iago Toral Quiroga [Mon, 31 Mar 2014 12:17:08 +0000 (14:17 +0200)]
i965: glClearBuffer() should only clear a single buffer.

glClearBuffer() is currently clearing all active draw color buffers (all
buffers that have not been set to GL_NONE when calling glDrawBuffers) instead
of only clearing the one it receives as parameter. Altough brw_clear()
receives a bit mask indicating the color buffers that should be cleared,
this mask is ignored when calling brw_blorp_clear_color().

This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test.

The patch provides the bit mask to brw_blorp_clear_color() so it can limit
clearing to the color buffers present in the mask.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add comment to explain the weird-looking shadow compares.
Chris Forbes [Sat, 12 Apr 2014 10:32:21 +0000 (22:32 +1200)]
i965: Add comment to explain the weird-looking shadow compares.

This always looks crazy when I stumble across it, until I remember
what the hardware is doing. Describing it ought to short-circuit
that process next time :)

V2: Fix indents to 6 spaces, not 7.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Ignore loop-too-large heuristic if there's bad variable indexing.
Kenneth Graunke [Wed, 9 Apr 2014 01:09:43 +0000 (18:09 -0700)]
glsl: Ignore loop-too-large heuristic if there's bad variable indexing.

Many shaders use a pattern such as:

for (int i = 0; i < NUM_LIGHTS; i++) {
   ...access a uniform array, or shader input/output array...
}

where NUM_LIGHTS is a small constant (such as 2, 4, or 8).

The expectation is that the compiler will unroll those loops, turning
the array access into constant indexing, which is more efficient, and
which may enable array splitting and other optimizations.

In many cases, our heuristic fails - either there's another tiny nested
loop inside, or the estimated number of instructions is just barely
beyond the threshold.  So, we fail to unroll the loop, leaving the
variable indexing in place.

Drivers which don't support the particular flavor of variable indexing
will call lower_variable_index_to_cond_assign(), which generates piles
and piles of immensely inefficient code.  We'd like to avoid generating
that.

This patch detects unsupported forms of variable-indexing in loops, where
the array index is a loop induction variable.  In that case, it bypasses
the loop-too-large heuristic and forces unrolling.

Improves performance in various microbenchmarks: Gl32PSBump8 by 47%,
Gl32ShMapVsm by 80%, and Gl32ShMapPcf by 27%.  No changes in shader-db.

v2: Check ir->array for being an array or matrix, rather than the
    ir_dereference_array itself.
v3: Fix and expand statistics in commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Rename loop_unroll_count::fail to "nested_loop."
Kenneth Graunke [Tue, 8 Apr 2014 22:33:27 +0000 (15:33 -0700)]
glsl: Rename loop_unroll_count::fail to "nested_loop."

The "fail" flag is set if loop_unroll_count encounters a nested loop;
calling the flag "nested_loop" is a bit clearer.

The original reasoning was that count is inaccurate (too small) if there
are nested loops, as we don't do any sort of analysis on the inner loop.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Pass gl_shader_compiler_optimizations to unroll_loops().
Kenneth Graunke [Wed, 9 Apr 2014 02:58:36 +0000 (19:58 -0700)]
glsl: Pass gl_shader_compiler_optimizations to unroll_loops().

Loop unrolling will need to know a few more options in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Drop do_common_optimization's max_unroll_iterations parameter.
Kenneth Graunke [Tue, 8 Apr 2014 22:43:46 +0000 (15:43 -0700)]
glsl: Drop do_common_optimization's max_unroll_iterations parameter.

Now that we pass in gl_shader_compiler_options, it makes sense to just
use options->MaxUnrollIterations, rather than passing a separate
parameter.

Half of the invocations already passed options->MaxUnrollIterations,
while the other half passed in a hardcoded value of 32.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.
Kenneth Graunke [Wed, 9 Apr 2014 01:31:19 +0000 (18:31 -0700)]
i965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.

This will prevent the two from getting out of sync again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Correct EmitNoIndirect shader compiler option flags.
Kenneth Graunke [Wed, 9 Apr 2014 01:29:01 +0000 (18:29 -0700)]
i965: Correct EmitNoIndirect shader compiler option flags.

These were out of sync with the flags used to control
lower_variable_index_to_cond_assign in brw_shader.cpp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Reset reg_from when we can't coalesce.
Matt Turner [Wed, 9 Apr 2014 21:04:10 +0000 (14:04 -0700)]
i965/fs: Reset reg_from when we can't coalesce.

Not setting this would prevented coalescing after a failed attempt if
the sources for both MOVs were the same.

total instructions in shared programs: 1654531 -> 1650224 (-0.26%)
instructions in affected programs:     423167 -> 418860 (-1.02%)
GAINED:                                2
LOST:                                  0

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fill in a bunch of gen7/hsw data cache-related disasm.
Eric Anholt [Mon, 31 Mar 2014 16:23:24 +0000 (09:23 -0700)]
i965: Fill in a bunch of gen7/hsw data cache-related disasm.

This gets us disasm of atomic ops.

v2: Fix fallthrough on pre-gen7.  (bug caught by Ilia Mirkin).

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Stop setting up a 1:1 "attrib" member in our vertex inputs.
Eric Anholt [Sun, 6 Apr 2014 19:08:37 +0000 (12:08 -0700)]
i965: Stop setting up a 1:1 "attrib" member in our vertex inputs.

It's just the array index, so we can just go look at the array and see
which element we are.

No significant performance difference (n=140)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Skip a bunch of IB BO refcount twiddling.
Eric Anholt [Sun, 6 Apr 2014 18:16:48 +0000 (11:16 -0700)]
i965: Skip a bunch of IB BO refcount twiddling.

Improves cairo performance on glamor by 1.64828% +/- 1.04742% (n=65).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/gen7: Skip repeated NULL depth/stencil state emits.
Eric Anholt [Sun, 6 Apr 2014 17:49:49 +0000 (10:49 -0700)]
i965/gen7: Skip repeated NULL depth/stencil state emits.

Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs: Fix ubo indexing description
Chris Forbes [Fri, 11 Apr 2014 20:31:05 +0000 (08:31 +1200)]
docs: Fix ubo indexing description

Ian points out that this being unrestricted was an oversight in the
spec, and is corrected in GLSL4.40.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agodraw: remove unused 'start' variable in draw_stats_clipper_primitives()
Brian Paul [Fri, 11 Apr 2014 17:46:55 +0000 (11:46 -0600)]
draw: remove unused 'start' variable in draw_stats_clipper_primitives()

It was computed, but never actually used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Try vectorizing when seeing a repeated assignment to a channel.
Kenneth Graunke [Tue, 8 Apr 2014 23:55:23 +0000 (16:55 -0700)]
glsl: Try vectorizing when seeing a repeated assignment to a channel.

When considering assignment expressions like:

    v.x += u.x;
    v.x += u.x;

the vectorizer would incorrectly keep going, attempting to find more
instructions to vectorize.  It would overwrite the saved assignment
to point at the second one, and increment channels a second time,
resulting in try_vectorize thinking the expression was a vec2 instead of
a float.

Instead, if we see a repeated assignment to a channel, just try to
vectorize everything we've found so far.  This clears the saved state
so it will start over.

Fixes Piglit's repeated-channel-assignments.vert.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Propagate explicit binding information from the AST all the way to the linker
Ian Romanick [Thu, 3 Apr 2014 01:58:54 +0000 (18:58 -0700)]
glsl: Propagate explicit binding information from the AST all the way to the linker

Information about the binding was not being properly communicated from
the front-end compiler to the linker.  As a result, the linker never
knew that any UBOs had explicit bindings!

Fixes the piglit test arb_shading_language_420pack-binding-layout.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: github@socker.lepus.uberspace.de [v0]
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Set binding for all elements of UBO array
Ian Romanick [Fri, 4 Apr 2014 20:42:04 +0000 (13:42 -0700)]
linker: Set binding for all elements of UBO array

Previously, a UBO like

    layout(binding=2) uniform U {
        ...
    } my_constants[4];

wouldn't get any bindings set.  The code would try to set the binding of
U, but that would fail.  It should instead set the bindings for U[0],
U[1], ...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Set block bindings based on UniformBlocks rather than UniformStorage
Ian Romanick [Fri, 4 Apr 2014 19:46:01 +0000 (12:46 -0700)]
linker: Set block bindings based on UniformBlocks rather than UniformStorage

For blocks, gl_shader_program::UniformStorage isn't very useful.  The
names stored there are the names of the elements of the block, so
finding blocks with an instance name is hard.  There is also only one
entry in ::UniformStorage for each element of a block array, and that is
a deal breaker.

Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does.  I
contemplated sharing code between set_block_binding and
_mesa_GetUniformBlockIndex, but building the stand-alone compiler and
the unit tests make this hard.  I plan to return to this effort shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Clean up "unused parameter" warnings
Ian Romanick [Fri, 4 Apr 2014 18:11:18 +0000 (11:11 -0700)]
linker: Clean up "unused parameter" warnings

../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'type' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'type' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Fold set_uniform_binding into call site
Ian Romanick [Fri, 4 Apr 2014 18:08:00 +0000 (11:08 -0700)]
linker: Fold set_uniform_binding into call site

In the next patch, we'll see that using
gl_shader_program::UniformStorage is not correct for uniform blocks.
That means we can't use ::UniformStorage to select between the sampler
path and the block path.  Instead we want to just use the type of the
variable.  That's never passed to set_uniform_binding, and it's easier
to just remove the function (especially for later patches in the series)
than to add another parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Various trivial clean-ups in set_sampler_binding
Ian Romanick [Fri, 4 Apr 2014 17:52:31 +0000 (10:52 -0700)]
linker: Various trivial clean-ups in set_sampler_binding

- Remove the spurious block left from the previous commit and re-indent.

- Constify elements.

- Make the spec reference in the code look like other spec references in
  the compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Split set_uniform_binding into separate functions for blocks and samplers
Ian Romanick [Fri, 4 Apr 2014 17:45:38 +0000 (10:45 -0700)]
linker: Split set_uniform_binding into separate functions for blocks and samplers

The two code paths are quite different, and there are some problems in
the handling of uniform blocks.  Future changes will cause these paths
to diverge further.  Ultimately, selecting between the two functions
will happen at the set_uniform_binding call site, and
set_uniform_binding will be deleted.

NOTE: This patch just moves code around.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agosoftpipe: fix shadow sampling
Heinrich Janzing [Thu, 10 Apr 2014 11:54:30 +0000 (13:54 +0200)]
softpipe: fix shadow sampling

And remove nonsensical approximation of linear interpolation behavior
for shadow samplers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
10 years agosoftpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases
Brian Paul [Fri, 11 Apr 2014 01:03:58 +0000 (19:03 -0600)]
softpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases

To silence compiler warnings.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions

Instead of switch statements.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoswrast: use macros to initialize texfetch_funcs[] table
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
swrast: use macros to initialize texfetch_funcs[] table

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoswrast: fix more fetch_texel function names
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
swrast: fix more fetch_texel function names

These were missed/typo'd in the previous patch series:
s/R8G8B8A/R8G8B8A8/
s/rgba_16/RGBA_UNORM16/
s/rgba_uint/RGBA_UINT/
s/rgba_int/RGBA_SINT/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoegl-static: Fix missing radeon_surface.h includes.
José Fonseca [Fri, 11 Apr 2014 15:46:02 +0000 (16:46 +0100)]
egl-static: Fix missing radeon_surface.h includes.

Fixes

  fatal error: radeon_surface.h: No such file or directory

when libdrm is not present, or non-Linux OSes.

Trivial.

10 years agogallium/radeon: fix missing winsys include in pipe-loader.
Knut Andre Tidemann [Fri, 11 Apr 2014 06:59:11 +0000 (08:59 +0200)]
gallium/radeon: fix missing winsys include in pipe-loader.

The commit 3b0b44f7def0acb4f7a7aef086c0bece321418a6 introduced a build
error:

error: dereferencing pointer to incomplete type

This patch fixes this issue in all the affected files.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/omx/enc: separate input buffer private and task structure
Christian König [Sun, 6 Apr 2014 15:07:41 +0000 (17:07 +0200)]
st/omx/enc: separate input buffer private and task structure

Keep tasks as linked list, this way we can associate
more than one encoding task with each buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: implement B-frame support
Christian König [Fri, 4 Apr 2014 15:14:26 +0000 (17:14 +0200)]
radeon/vce: implement B-frame support

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: add proper CPB backtrack
Christian König [Fri, 4 Apr 2014 13:29:18 +0000 (15:29 +0200)]
radeon/vce: add proper CPB backtrack

Remember what frames we encoded at which position.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agovl: add interface for H264 B-frame encoding
Christian König [Fri, 4 Apr 2014 12:22:16 +0000 (14:22 +0200)]
vl: add interface for H264 B-frame encoding

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES
Christian König [Mon, 7 Apr 2014 15:26:31 +0000 (17:26 +0200)]
radeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES

Doesn't seems to be needed any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agodocs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.
Chris Forbes [Fri, 11 Apr 2014 09:20:13 +0000 (21:20 +1200)]
docs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.
Kenneth Graunke [Thu, 10 Apr 2014 05:54:11 +0000 (22:54 -0700)]
i965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.

The _Xmin/_Xmax/_Ymin/_Ymax values need to be guarded by _NEW_SCISSOR.

Fixes Piglit's scissor-many, and rendering in GNOME Shell.
Hopefully fixes similar issues with Unity and ChromeOS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75879
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: James Ausmus <james.ausmus@intel.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
10 years agomesa/st: set min/max texture gather offset to driver-reported value
Ilia Mirkin [Wed, 9 Apr 2014 18:59:25 +0000 (14:59 -0400)]
mesa/st: set min/max texture gather offset to driver-reported value

It was always getting set to -8/7 unconditionally.  Use the
driver-reported value instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agogallium: add a way to query min/max texture gather offsets
Ilia Mirkin [Wed, 9 Apr 2014 18:58:53 +0000 (14:58 -0400)]
gallium: add a way to query min/max texture gather offsets

Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For
nvc0, the offset can be -32/31.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoconfigure.ac: require libdrm_radeon 2.4.53
Marek Olšák [Thu, 10 Apr 2014 19:24:50 +0000 (21:24 +0200)]
configure.ac: require libdrm_radeon 2.4.53

We need latest radeon_drm.h.

10 years agowinsys/radeon: fix a race condition in initialization of radeon_winsys::screen
Marek Olšák [Tue, 8 Apr 2014 23:07:52 +0000 (01:07 +0200)]
winsys/radeon: fix a race condition in initialization of radeon_winsys::screen

Create the screen in the winsys while the mutex is locked.
This also results in a nice code cleanup!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: fix a race condition between winsys_create and winsys_destroy
Marek Olšák [Tue, 8 Apr 2014 22:26:32 +0000 (00:26 +0200)]
winsys/radeon: fix a race condition between winsys_create and winsys_destroy

This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: fix a race condition between 2 calls to radeon_winsys_create
Marek Olšák [Tue, 8 Apr 2014 21:36:53 +0000 (23:36 +0200)]
winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create

This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: remove unused radeon_info variables, move backend_map
Marek Olšák [Tue, 8 Apr 2014 20:39:09 +0000 (22:39 +0200)]
winsys/radeon: remove unused radeon_info variables, move backend_map

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: unify radeon_bo::flink and radeon_bo::name
Marek Olšák [Fri, 4 Apr 2014 18:22:55 +0000 (20:22 +0200)]
winsys/radeon: unify radeon_bo::flink and radeon_bo::name

Both contained the GEM flink name.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: remove definitions already present in radeon_drm.h
Marek Olšák [Fri, 4 Apr 2014 18:18:37 +0000 (20:18 +0200)]
winsys/radeon: remove definitions already present in radeon_drm.h

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: handle squared micro tiling from GEM_GET_TILING
Marek Olšák [Fri, 4 Apr 2014 18:16:36 +0000 (20:16 +0200)]
winsys/radeon: handle squared micro tiling from GEM_GET_TILING

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agogallium/u_gen_mipmap: rewrite using pipe->blit (v2)
Marek Olšák [Sun, 16 Mar 2014 02:45:27 +0000 (03:45 +0100)]
gallium/u_gen_mipmap: rewrite using pipe->blit (v2)

This replaces u_gen_mipmap with an extremely simple implementation based
on pipe->blit. st/mesa is also cleaned up.

Pros:
- less code
- correct mipmap generation for NPOT 3D textures (u_blitter uses a better
  formula)
- queries are not affected by mipmap generation if drivers disable them

v2: add "first_layer", "last_layer" parameters, drop "face"
v2.1: add format
v2.2: document the format parameter

10 years agost/mesa: properly implement MapTextureImage with multiple mapped slices (v2)
Marek Olšák [Mon, 10 Mar 2014 17:43:17 +0000 (18:43 +0100)]
st/mesa: properly implement MapTextureImage with multiple mapped slices (v2)

This is needed by _mesa_generate_mipmap.

This adds an array of pipe_transfers to st_texture_image. Each transfer is
for mapping a single layer.

v2: allocate the array of transfers on demand

10 years agomesa: remove the MALLOC, CALLOC and FREE macros
Brian Paul [Thu, 10 Apr 2014 01:35:27 +0000 (19:35 -0600)]
mesa: remove the MALLOC, CALLOC and FREE macros

No longer used anywhere.  These also caused trouble in the Gallium
state tracker code where we include both core Mesa and Gallium util
headers (and the macros were defined differently in each world.)
Removing these macros should help avoid macro mix-ups in the future.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoxlib: s/FREE/free/
Brian Paul [Thu, 10 Apr 2014 01:30:58 +0000 (19:30 -0600)]
xlib: s/FREE/free/

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: s/FREE/free/ in vdpau code
Brian Paul [Thu, 10 Apr 2014 01:28:47 +0000 (19:28 -0600)]
mesa: s/FREE/free/ in vdpau code

Reviewed-by: Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agomesa: s/FREE/free/ in _mesa_free_errors_data()
Brian Paul [Thu, 10 Apr 2014 01:28:18 +0000 (19:28 -0600)]
mesa: s/FREE/free/ in _mesa_free_errors_data()

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: use malloc/free instead of MALLOC/FREE in attrib stack code
Brian Paul [Thu, 10 Apr 2014 01:27:06 +0000 (19:27 -0600)]
mesa: use malloc/free instead of MALLOC/FREE in attrib stack code

We moved away from MALLOC/FREE in the rest of core Mesa a while ago.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agost/mesa: fix sampler_view REALLOC/FREE macro mix-up
Brian Paul [Thu, 10 Apr 2014 01:22:11 +0000 (19:22 -0600)]
st/mesa: fix sampler_view REALLOC/FREE macro mix-up

We were using REALLOC() from u_memory.h but FREE() from imports.h.
This mismatch caused us to trash the heap on Windows after we
deleted a texture object.

This fixes a regression from commit 6c59be7776e4d.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agodocs: Expand ARB_gpu_shader5 to describe status of individual features
Chris Forbes [Tue, 8 Apr 2014 06:55:06 +0000 (18:55 +1200)]
docs: Expand ARB_gpu_shader5 to describe status of individual features

This extension is a huge grab-bag of "stuff that's in DX11". Break it
apart to make it clear what still needs to be done.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agodocs: Mark off ARB_texture_view and add to release notes for 10.2.
Chris Forbes [Sat, 15 Feb 2014 03:27:58 +0000 (16:27 +1300)]
docs: Mark off ARB_texture_view and add to release notes for 10.2.

V4: Don't claim Gen8 yet.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Enable ARB_texture_view on Gen7
Chris Forbes [Sat, 15 Feb 2014 03:26:20 +0000 (16:26 +1300)]
i965: Enable ARB_texture_view on Gen7

V4: Don't enable this for Gen8 yet -- that still needs wired up.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Account for view parameters in blit CTSI path
Chris Forbes [Fri, 14 Mar 2014 19:49:35 +0000 (08:49 +1300)]
i965: Account for view parameters in blit CTSI path

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Account for MinLayer/MinLevel in blorp CTSI path
Chris Forbes [Fri, 14 Mar 2014 19:16:42 +0000 (08:16 +1300)]
i965: Account for MinLayer/MinLevel in blorp CTSI path

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Account for view parameters in fast depth clears
Chris Forbes [Sat, 15 Feb 2014 03:25:12 +0000 (16:25 +1300)]
i965: Account for view parameters in fast depth clears

V2: - No need for layer_multiplier; multisampled depth surfaces are IMS.
    - Remove unused num_layers.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965/blorp: Account for nonzero MinLayer in layered clears.
Chris Forbes [Tue, 21 Jan 2014 08:59:02 +0000 (21:59 +1300)]
i965/blorp: Account for nonzero MinLayer in layered clears.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965/blorp: Use irb->layer_count in clear
Chris Forbes [Tue, 21 Jan 2014 08:55:38 +0000 (21:55 +1300)]
i965/blorp: Use irb->layer_count in clear

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add layer_count to intel_renderbuffer
Chris Forbes [Tue, 21 Jan 2014 08:45:28 +0000 (21:45 +1300)]
i965: Add layer_count to intel_renderbuffer

This is the effective layer count, for clears etc. This differs from the
depth of the miptree level when views are involved.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper
Chris Forbes [Tue, 21 Jan 2014 08:53:21 +0000 (21:53 +1300)]
i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper

We're about to need this in another place.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add `layered` parameter to intel_update_renderbuffer_wrapper
Chris Forbes [Tue, 21 Jan 2014 08:44:05 +0000 (21:44 +1300)]
i965: Add `layered` parameter to intel_update_renderbuffer_wrapper

We're about to need this so we can determine the layer count of the
wrapper.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Adjust renderbuffer wrapper to account for MinLevel/MinLayer
Chris Forbes [Tue, 21 Jan 2014 10:20:11 +0000 (23:20 +1300)]
i965: Adjust renderbuffer wrapper to account for MinLevel/MinLayer

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Enable texture upload fast path with MinLevel
Chris Forbes [Mon, 20 Jan 2014 07:18:19 +0000 (20:18 +1300)]
i965: Enable texture upload fast path with MinLevel

We'll still avoid MinLayer here since the fast path doesn't understand
arrays at all, but it's straightforward to do levels.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Account for MinLevel in texture upload fast path
Chris Forbes [Mon, 20 Jan 2014 07:19:35 +0000 (20:19 +1300)]
i965: Account for MinLevel in texture upload fast path

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Adjust map/unmap code for MinLevel/MinLayer
Chris Forbes [Mon, 20 Jan 2014 08:30:35 +0000 (21:30 +1300)]
i965: Adjust map/unmap code for MinLevel/MinLayer

This allows core mesa's TexSubImage paths etc to work correctly
with views which have nonzero MinLevel or MinLayer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Don't try to use fast upload path for nontrivial views
Chris Forbes [Mon, 20 Jan 2014 07:01:35 +0000 (20:01 +1300)]
i965: Don't try to use fast upload path for nontrivial views

This will eventually be relaxed, but we'll get the fallback path
working first.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Adjust surface_state emission to account for view parameters
Chris Forbes [Tue, 21 Jan 2014 09:52:32 +0000 (22:52 +1300)]
i965: Adjust surface_state emission to account for view parameters

V4: Comment style, remove magic shift.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add _Format to intel_texobj.
Chris Forbes [Fri, 21 Feb 2014 18:15:59 +0000 (07:15 +1300)]
i965: Add _Format to intel_texobj.

This is the actual mesa_format to use. In non-view cases this is always
the same as the mt's format.

V4: Comment style

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add driver hook for TextureView
Chris Forbes [Tue, 21 Jan 2014 09:54:10 +0000 (22:54 +1300)]
i965: Add driver hook for TextureView

We need to wire the original texture's mt into the view. All the hard
work of setting up an appropriate tree of gl_texture_image structures
has already been done by core mesa.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Ensure that texture validation is skipped for immutable textures.
Chris Forbes [Tue, 21 Jan 2014 09:48:30 +0000 (22:48 +1300)]
i965: Ensure that texture validation is skipped for immutable textures.

If we were to relayout the miptree, we'd break any views that are
sharing it.

(Simplified based on suggestions from Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: refactor format selection for unsupported ETC* formats
Chris Forbes [Fri, 21 Feb 2014 20:06:57 +0000 (09:06 +1300)]
i965: refactor format selection for unsupported ETC* formats

We will need to call this to munge view formats.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: refactor format munging for separate stencil
Chris Forbes [Fri, 21 Feb 2014 19:51:41 +0000 (08:51 +1300)]
i965: refactor format munging for separate stencil

We will need this for munging the view's format.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Include #slices in miptree debug
Chris Forbes [Tue, 21 Jan 2014 09:47:26 +0000 (22:47 +1300)]
i965: Include #slices in miptree debug

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Adjust _MaxLevel computation to account for views
Chris Forbes [Fri, 24 Jan 2014 21:36:04 +0000 (10:36 +1300)]
mesa: Adjust _MaxLevel computation to account for views

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Prefer non-swizzled formats for most sized internalformats
Chris Forbes [Mon, 10 Mar 2014 08:36:22 +0000 (21:36 +1300)]
mesa: Prefer non-swizzled formats for most sized internalformats

These formats can be cast to others (with different component types or
sizes) via ARB_texture_view or ARB_shader_image_load_store. We want
them to be laid out consistently so that we can just reinterpret the
memory with a different format.

In V1, this was done conditionally on a 'prefer_no_swizzle' flag which
was set in TexStorage/TextureView paths, but we need the same behavior
for ARB_shader_image_load_store (which also works with images created
via TexImage, so we don't want it to be conditional.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Render R8G8B8X8 as R8G8B8A8
Chris Forbes [Sat, 29 Mar 2014 05:27:42 +0000 (18:27 +1300)]
i965: Render R8G8B8X8 as R8G8B8A8

The sampler can handle R8G8B8X8 (and substitute 1.0 for the fourth
component) but we can't use it as a render target.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Pretend we don't support BRW_SURFACEFORMAT_R16G16B16_FLOAT for textures.
Chris Forbes [Sat, 14 Dec 2013 04:40:03 +0000 (17:40 +1300)]
i965: Pretend we don't support BRW_SURFACEFORMAT_R16G16B16_FLOAT for textures.

None of the other 3-component 16bpc formats are directly supported, so
they get promoted to XRGB equivalents. *Not* promoting RGB16F the same
way makes texture views much more fiddly -- we don't want to have to do
crazy copying behind the scenes.

(with my other master + my experimental ARB_texture_view support) fixes
the piglit test: `spec/ARB_texture_view/view compare 48bit formats`

No regressions in gpu.tests on Haswell.

V4: Don't alter the formats table -- just don't match it to a mesa_format. [Kenneth]

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Enable R10G10B10A2_UNORM format
Chris Forbes [Sat, 15 Mar 2014 08:50:28 +0000 (21:50 +1300)]
i965: Enable R10G10B10A2_UNORM format

This is supported by all generations, and is required for memory layout
consistency for texture_view.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Enable R8G8B8A8_UNORM_SRGB format
Chris Forbes [Mon, 10 Mar 2014 09:00:44 +0000 (22:00 +1300)]
i965: Enable R8G8B8A8_UNORM_SRGB format

Now this is the preferred format for GL_SRGB8_ALPHA8.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agoswrast: Add support for fetching from MESA_FORMAT_R10G10B10A2_UNORM
Chris Forbes [Sat, 29 Mar 2014 04:29:37 +0000 (17:29 +1300)]
swrast: Add support for fetching from MESA_FORMAT_R10G10B10A2_UNORM

V4: Fix rebase conflicts with Brian's renaming of the texfetch
functions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: fix packing of float texels to GL_SHORT/GL_BYTE
Chris Forbes [Sun, 16 Mar 2014 19:03:38 +0000 (08:03 +1300)]
mesa: fix packing of float texels to GL_SHORT/GL_BYTE

Previously, we would unpack the texels to floats using *_TO_FLOAT_TEX,
and then pack them into the desired format using FLOAT_TO_*. Unfortunately,
this isn't quite the inverse operation, and so some texel values would
end up off-by-one.

This fixes the GL_RGB8_SNORM and GL_RGB16_SNORM subcases in piglit's
arb_texture_view-format-consistency-get test on i965. The similar 1-, 2-
and 4-component cases already worked because they took the memcpy path
rather than repacking.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agor600g: Don't leak bytecode on shader compile failure
Michel Dänzer [Wed, 9 Apr 2014 06:38:21 +0000 (15:38 +0900)]
r600g: Don't leak bytecode on shader compile failure

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agobuild: force .so extension for the gallium dri modules
Emil Velikov [Mon, 7 Apr 2014 14:24:46 +0000 (15:24 +0100)]
build: force .so extension for the gallium dri modules

While linux uses .so as a default extension for shared libraries that is
not the case for other platforms. The loader in libGL (and others) assumes
that the dri module will always have a .so extension, thus it will fail
to load on the affected platforms.

Spotted-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>