mesa.git
11 years agoi965: Refactor the vendor string out of intelGetString
Ian Romanick [Fri, 11 Oct 2013 19:16:39 +0000 (12:16 -0700)]
i965: Refactor the vendor string out of intelGetString

This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi915: Refactor the vendor string out of intelGetString
Ian Romanick [Fri, 15 Feb 2013 00:25:44 +0000 (16:25 -0800)]
i915: Refactor the vendor string out of intelGetString

This will soon be used in intel_screen.c from a function that doesn't
have a gl_context.

v2: Remove spurious break after return.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodri: Add interface definition for DRI_RENDERER_QUERY extension
Ian Romanick [Thu, 14 Feb 2013 23:51:52 +0000 (15:51 -0800)]
dri: Add interface definition for DRI_RENDERER_QUERY extension

This will be used to let apps query hardware and driver limits before
creating a GL context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Enable DRI_Robustness extension
Ian Romanick [Tue, 11 Sep 2012 08:08:44 +0000 (11:08 +0300)]
i965: Enable DRI_Robustness extension

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Propagate the GPU reset notifiction strategy down into the driver
Ian Romanick [Tue, 11 Sep 2012 08:07:25 +0000 (11:07 +0300)]
i965: Propagate the GPU reset notifiction strategy down into the driver

If the application requests reset notifiction, connect up the reset
status query method and set gl_context::ResetStrategy.

v2: Update based on kernel interface / libdrm changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Add function to query the GPU reset status for a context
Ian Romanick [Tue, 11 Sep 2012 08:05:57 +0000 (11:05 +0300)]
i965: Add function to query the GPU reset status for a context

v2: Update based on kernel interface / libdrm changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Handle __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag
Ian Romanick [Tue, 11 Sep 2012 07:31:13 +0000 (10:31 +0300)]
i965: Handle __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa/dri: Move context flag validation down into the drivers
Ian Romanick [Mon, 10 Sep 2012 14:31:24 +0000 (17:31 +0300)]
mesa/dri: Move context flag validation down into the drivers

Soon some drivers will support a different set of flags than other
drivers.  If some flags have to be filtered in the driver, we might as
well filter all of them in the driver.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

v2: Fix some rebase failures noticed by Ken (returning the wrong types,
etc.).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification strategy
Ian Romanick [Mon, 10 Sep 2012 14:11:33 +0000 (17:11 +0300)]
mesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification strategy

No drivers advertise the DRI2 extension yet, so no driver should ever
see a value other than false for notify_reset.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Implement proper tracking logic for glGetGraphicsResetStatusARB
Ian Romanick [Thu, 6 Sep 2012 05:31:59 +0000 (22:31 -0700)]
mesa: Implement proper tracking logic for glGetGraphicsResetStatusARB

Drivers still have to implement dd_function_table::GetGraphicsResetStatus.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Add gl_shared_state::ShareGroupReset and gl_context::ShareGroupReset
Ian Romanick [Thu, 6 Sep 2012 05:30:43 +0000 (22:30 -0700)]
mesa: Add gl_shared_state::ShareGroupReset and gl_context::ShareGroupReset

These will be used to determine whether to signal a GPU reset after
another context in the share group has observed a reset.

v2: Change ShareGroupReset from GLboolean to bool.  Suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Add dd_function_table::GetGraphicsResetStatus
Ian Romanick [Thu, 6 Sep 2012 05:26:01 +0000 (22:26 -0700)]
mesa: Add dd_function_table::GetGraphicsResetStatus

This allows drivers to determine whether a GPU reset has occured.  It
should return non-zero status if a reset was observed by the specified
context.  Another mechanism will be used to observe resets occuring in
other contexts in the share group.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Remove gl_context::ResetStatus
Ian Romanick [Thu, 6 Sep 2012 05:21:36 +0000 (22:21 -0700)]
mesa: Remove gl_context::ResetStatus

This isn't going to be used in the actual implemenation of
glGetGraphicsResetStatus.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/xorg: Delete.
Matt Turner [Sun, 27 Oct 2013 00:25:11 +0000 (17:25 -0700)]
st/xorg: Delete.

Acked-by: Lucas Stach <l.stach@pengutronix.de>
11 years agoxorg-nouveau: Delete.
Matt Turner [Thu, 7 Nov 2013 05:40:05 +0000 (21:40 -0800)]
xorg-nouveau: Delete.

11 years agoxorg-i915: Delete.
Matt Turner [Thu, 7 Nov 2013 05:38:39 +0000 (21:38 -0800)]
xorg-i915: Delete.

Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Acked-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
11 years agodocs: Mark off ARB_shader_atomic_counters for i965
Ian Romanick [Fri, 8 Nov 2013 00:02:03 +0000 (16:02 -0800)]
docs: Mark off ARB_shader_atomic_counters for i965

...and update relnotes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965/gen7: Expose ARB_shader_atomic_counters.
Francisco Jerez [Sun, 20 Oct 2013 21:11:27 +0000 (14:11 -0700)]
i965/gen7: Expose ARB_shader_atomic_counters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Linker support for ARB_shader_atomic_counters.
Francisco Jerez [Wed, 11 Sep 2013 19:14:46 +0000 (12:14 -0700)]
glsl: Linker support for ARB_shader_atomic_counters.

v2: Add comments on the purpose of the auxiliary data structures.
    Check for atomic counter overlaps.  Use the contains_atomic()
    convenience method.  Add static assert with the number of expected
    shader stages.
v3: Don't resize atomic arrays.
v4: Add comment on the reason why we don't resize atomic counter
    arrays.  Use 'strcmp(...) == 0' instead of '!strcmp(...)'.
v5 (idr):  Don't use STL in the linker.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Implement parser support for atomic counters.
Francisco Jerez [Sun, 20 Oct 2013 19:38:07 +0000 (12:38 -0700)]
glsl: Implement parser support for atomic counters.

v2: Mark atomic counters as read-only variables.  Move offset overlap
    code to the linker.  Use the contains_atomic() convenience method.
v3: Use pointer to integer instead of non-const reference.  Add
    comment so we remember to add a spec quotation from the next GLSL
    release once the issue of atomic counter aggregation within
    structures is clarified.
v4 (idr): Don't use std::map because it's overkill.  Add an assertion
    that ctx->Const.MaxAtomicBufferBindings <= MAX_COMBINED_ATOMIC_BUFFERS.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoRevert "i965: Add support for GL_AMD_performance_monitor on Ironlake."
Kenneth Graunke [Wed, 23 Oct 2013 05:55:33 +0000 (22:55 -0700)]
Revert "i965: Add support for GL_AMD_performance_monitor on Ironlake."

This reverts most of commit 0f2da773070c06b6d20ad264d3abb19c4dfd9761.
(I chose to leave the additions to brw_defines.h.)

My previous Ironlake implementation was somewhat broken: counter data
was global, rather than per-context.  This meant that performance
monitors captured data from your compositor, 2D driver, and other 3D
programs.

Originally, I believed that Sandybridge and later had an easy way to
avoid this problem (setting per-context flags in OACONTROL), while
Ironlake did not.  So I'd intended to leave it as a known limitation of
performance monitoring support on Ironlake.  However, this turned out
not to be true.

Unfortunately, our hardware only has one set of aggregating performance
counters shared between all 3D programs, and their values are not saved
or restored by hardware contexts.  Also, at least on Sandybridge and
Ivybridge, the counters lose their values if the GPU goes to sleep.

To work around both of these problems, we have to snapshot the
performance counters at the beginning and end of each batch, similar to
how we handle query objects on platforms that don't support hardware
contexts.

For occlusion queries, this batch bookending approach is fairly simple:
only one occlusion query can be active at a time, and the result is a
single integer.  Performance monitors are more complex: an arbitrary
number of monitors can be active at a time, each monitoring some subset
of our ~30 observability counters.  Individual monitors can be started
and stopped at any point during the batch.  Tracking where each monitor
started/ended relative to batch flushes ends up being a pain.  And you
can run out of space in the buffer.

Properly supporting this required some serious rearchitecting of the
code.  Rather than writing patches to try and morph a broken system into
a working one (which operates quite differently), I decided it would be
simplest to revert the old code and start fresh.  Parts will look
familiar, but other parts are new.

I also decided it would be best to include Sandybridge and Ivybridge
support from the start, since the newer platforms have added complexity
that I wanted to make sure worked.  They're also what most people care
about these days.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Enable dFdx, dFdy, and fwidth by default in GLSL ES 3.00.
Kenneth Graunke [Thu, 7 Nov 2013 22:39:23 +0000 (14:39 -0800)]
glsl: Enable dFdx, dFdy, and fwidth by default in GLSL ES 3.00.

Previously, we only exposed them in desktop GL or with:

   #extension GL_OES_standard_derivatives : enable

GLSL ES 3.00 includes these without an extension, so we need to expose
them by default.

Note that the above #extension line results in an error or desktop GL,
so we don't need to worry about this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agodocs: Mark off ARB_vertex_type_10f_11f_11f_rev for r600g
Fredrik Höglund [Thu, 7 Nov 2013 20:58:36 +0000 (21:58 +0100)]
docs: Mark off ARB_vertex_type_10f_11f_11f_rev for r600g

...and update relnotes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements
Fredrik Höglund [Thu, 7 Nov 2013 20:49:43 +0000 (21:49 +0100)]
r600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agost/mesa: Add support for ARB_vertex_type_10f_11f_11f_rev
Fredrik Höglund [Thu, 7 Nov 2013 20:48:34 +0000 (21:48 +0100)]
st/mesa: Add support for ARB_vertex_type_10f_11f_11f_rev

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agomesa: fix return statements in varray.c
Brian Paul [Thu, 7 Nov 2013 22:23:34 +0000 (15:23 -0700)]
mesa: fix return statements in varray.c

Return false, not GL_FALSE.  Add missing return value.

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

11 years agosvga: always return 4 for PIPE_MAX_COLOR_BUFS
Brian Paul [Thu, 7 Nov 2013 21:29:50 +0000 (14:29 -0700)]
svga: always return 4 for PIPE_MAX_COLOR_BUFS

Even if the query returns 8, only 4 really work.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agosvga: return true for the PIPE_CAP_SM3 query
Brian Paul [Wed, 6 Nov 2013 00:24:22 +0000 (17:24 -0700)]
svga: return true for the PIPE_CAP_SM3 query

This just tells the state tracker to turn on the GL_ARB_shader_texture_lod
extension.  This simply allows the GLSL compiler to emit TXL and TXD
instructions for both vertex and fragment shaders.  We already support
these opcodes in the svga driver.  Though, the shadow2DGrad() Piglit
tests are failing.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoi965: Add an implementation of intel_miptree_map using streaming loads.
Matt Turner [Mon, 4 Nov 2013 20:06:17 +0000 (12:06 -0800)]
i965: Add an implementation of intel_miptree_map using streaming loads.

Improves performance of RoboHornet's 2D Canvas toDataURL benchmark
[http://www.robohornet.org/#e=canvastodataurl] by approximately 5x
on Baytrail on ChromiumOS.

Elapsed time drops by -81.4861% +/- 1.22619% (n=3 s=14.9105, confidence=95%).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agomesa: Add a streaming load memcpy implementation.
Matt Turner [Mon, 4 Nov 2013 20:02:24 +0000 (12:02 -0800)]
mesa: Add a streaming load memcpy implementation.

Uses SSE 4.1's MOVNTDQA instruction (streaming load) to read from
uncached memory without polluting the cache.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agodocs: Mark off some more things.
Chris Forbes [Thu, 7 Nov 2013 20:57:26 +0000 (09:57 +1300)]
docs: Mark off some more things.

These have been supported on i965/Gen7+ for a while, and are listed
in the 10.0 release notes.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoi965: Fix 'SIMD16 only' dispatch of fragment shader in case of sample shading
Anuj Phogat [Mon, 4 Nov 2013 22:48:51 +0000 (14:48 -0800)]
i965: Fix 'SIMD16 only' dispatch of fragment shader in case of sample shading

This patch make changes to correctly set up the Dispatch GRF Start
Register in case of 'SIMD16 only' FS dispatch.

This fixes an issue of incorrect rendering on dolphin emulator with
GL_SAMPLE_SHADING enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agodocs: update relnotes
Chris Forbes [Thu, 7 Nov 2013 20:02:53 +0000 (09:02 +1300)]
docs: update relnotes

11 years agodocs: Mark off ARB_vertex_type_10f_11f_11f_rev.
Chris Forbes [Thu, 7 Nov 2013 09:46:22 +0000 (22:46 +1300)]
docs: Mark off ARB_vertex_type_10f_11f_11f_rev.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Enable ARB_vertex_type_10f_11f_11f_rev on Gen6+.
Chris Forbes [Thu, 7 Nov 2013 08:26:15 +0000 (21:26 +1300)]
i965: Enable ARB_vertex_type_10f_11f_11f_rev on Gen6+.

This theoretically works on earlier hardware as well, but the extension
requires at least GL3.0.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: add support for UNSIGNED_INT_10F_11F_11F_REV vertex attribs
Chris Forbes [Thu, 7 Nov 2013 10:19:30 +0000 (23:19 +1300)]
i965: add support for UNSIGNED_INT_10F_11F_11F_REV vertex attribs

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agovbo: add 10_11_11 support to vbo_attrib_tmp
Chris Forbes [Thu, 7 Nov 2013 09:24:06 +0000 (22:24 +1300)]
vbo: add 10_11_11 support to vbo_attrib_tmp

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Add support to _mesa_bytes_per_vertex_attrib for 10_11_11 format.
Chris Forbes [Thu, 7 Nov 2013 09:05:01 +0000 (22:05 +1300)]
mesa: Add support to _mesa_bytes_per_vertex_attrib for 10_11_11 format.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: add varray support for UNSIGNED_INT_10F_11F_11F_REV type
Chris Forbes [Thu, 7 Nov 2013 09:02:24 +0000 (22:02 +1300)]
mesa: add varray support for UNSIGNED_INT_10F_11F_11F_REV type

V2: fix interaction with VertexAttribFormat, since that landed after
this was originally written

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Add extension scaffolding for ARB_vertex_type_10f_11f_11f_rev
Chris Forbes [Thu, 7 Nov 2013 08:23:17 +0000 (21:23 +1300)]
mesa: Add extension scaffolding for ARB_vertex_type_10f_11f_11f_rev

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agodraw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_float
Matthew McClure [Tue, 29 Oct 2013 20:36:41 +0000 (13:36 -0700)]
draw,llvmpipe,util: add depth bias calculation for arb_depth_buffer_float

With this patch, the llvmpipe and draw modules will calculate the depth bias
according to floating point depth buffer semantics described in the
arb_depth_buffer_float specification, when the driver has a z buffer bound
with a format type of UTIL_FORMAT_TYPE_FLOAT.

By default, the driver will use the existing UNORM calculation for depth bias.

A new function, draw_set_zs_format, was added to calculate the Minimum
Resolvable Depth value and floating point depth sense for the draw module.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agoi965: Avoid flushing the batch for every blorp op.
Eric Anholt [Tue, 18 Jun 2013 20:52:03 +0000 (13:52 -0700)]
i965: Avoid flushing the batch for every blorp op.

This brings over the batch-wrap-prevention and aperture space checking
code from the normal brw_draw.c path, so that we don't need to flush the
batch every time.

There's a risk here if the intel_emit_post_sync_nonzero_flush() call isn't
high enough up in the state emit sequences -- before, we implicitly had
one at the batch flush before any state was emitted, so Mesa's workaround
emits didn't really matter.  Since the SNB fixes by Ken, I didn't see any
regressions after 3 piglit runs.

Improves cairo-gl performance by 13.7733% +/- 1.74876% (n=30/32)
Improves minecraft apitrace performance by 1.03183% +/- 0.482297% (n=90).
Reduces low-resolution GLB 2.7 performance by 1.17553% +/- 0.432263% (n=88)
Reduces Lightsmark performance by 3.70246% +/- 0.322432% (n=126)
No statistically significant performance difference on unigine tropics
(n=10)
No statistically significant performance difference on openarena (n=755)

The two apps that are hurt happen to include stalls on busy buffer
objects, so I think this is an effect of missing out on an opportune
flush.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agobuild: Build gen_matypes and matypes.h from src/mesa.
Matt Turner [Tue, 5 Nov 2013 21:56:14 +0000 (13:56 -0800)]
build: Build gen_matypes and matypes.h from src/mesa.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agobuild: Change HAVE_X86_ASM to mean x86 or x86-64 asm.
Matt Turner [Tue, 5 Nov 2013 21:53:45 +0000 (13:53 -0800)]
build: Change HAVE_X86_ASM to mean x86 or x86-64 asm.

I want a conditional that says generally "we have x86 assembly" in the
next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoconfigure.ac: Test $asm_arch directly.
Matt Turner [Tue, 5 Nov 2013 19:20:12 +0000 (11:20 -0800)]
configure.ac: Test $asm_arch directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agodocs: Mark ARB_vertex_attrib_binding as done, update relnotes
Fredrik Höglund [Tue, 5 Nov 2013 18:35:17 +0000 (19:35 +0100)]
docs: Mark ARB_vertex_attrib_binding as done, update relnotes

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Enable ARB_vertex_attrib_binding
Fredrik Höglund [Tue, 5 Nov 2013 18:34:16 +0000 (19:34 +0100)]
mesa: Enable ARB_vertex_attrib_binding

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Optimize rebinding the same VBO
Fredrik Höglund [Thu, 11 Apr 2013 14:49:44 +0000 (16:49 +0200)]
mesa: Optimize rebinding the same VBO

Check if the new buffer object has the same name as the current
buffer object before looking it up.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Handle zero-stride arrays in _mesa_update_array_max_element()
Fredrik Höglund [Thu, 4 Apr 2013 17:55:50 +0000 (19:55 +0200)]
mesa: Handle zero-stride arrays in _mesa_update_array_max_element()

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Add Get* support for ARB_vertex_attrib_binding
Fredrik Höglund [Thu, 4 Apr 2013 20:15:13 +0000 (22:15 +0200)]
mesa: Add Get* support for ARB_vertex_attrib_binding

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Add ARB_vertex_attrib_binding
Fredrik Höglund [Tue, 9 Apr 2013 18:54:25 +0000 (20:54 +0200)]
mesa: Add ARB_vertex_attrib_binding

update_array() and update_array_format() are changed to update the new
attrib and binding states, and the client arrays become derived state.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglapi: Add infrastructure for ARB_vertex_attrib_binding
Fredrik Höglund [Tue, 9 Apr 2013 18:44:58 +0000 (20:44 +0200)]
glapi: Add infrastructure for ARB_vertex_attrib_binding

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Make handle_bind_buffer_gen() non-static
Fredrik Höglund [Fri, 1 Nov 2013 18:09:58 +0000 (19:09 +0100)]
mesa: Make handle_bind_buffer_gen() non-static

...and rename it to _mesa_bind_buffer_gen().

This is so the function can be called from _mesa_BindVertexBuffer().

This patch also adds a caller parameter so we can report the right
entry point in error messages.

Based on a patch by Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Rename gl_array_object::VertexAttrib to _VertexAttrib
Fredrik Höglund [Wed, 3 Apr 2013 20:08:47 +0000 (22:08 +0200)]
mesa: Rename gl_array_object::VertexAttrib to _VertexAttrib

This will become derived state as part of the ARB_vertex_attrib_binding
support.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Split out the format code from update_array()
Fredrik Höglund [Wed, 3 Apr 2013 19:47:44 +0000 (21:47 +0200)]
mesa: Split out the format code from update_array()

Split out the code for updating the array format into a new function
called update_array_format(). This function will be called by both
update_array() and the new glVertexAttrib*Format() entry points in
ARB_vertex_attrib_binding.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Restore gl_array_object::NewArray
Fredrik Höglund [Sat, 11 May 2013 17:23:46 +0000 (19:23 +0200)]
mesa: Restore gl_array_object::NewArray

This will be used by the ARB_vertex_attrib_binding implementation.
This reverts commit db38e9a0e179441f59274f6f2a751912c29872e2.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Use has_surface_tile_offset in depth/stencil alignment workaround.
Kenneth Graunke [Wed, 6 Nov 2013 08:33:14 +0000 (00:33 -0800)]
i965: Use has_surface_tile_offset in depth/stencil alignment workaround.

Currently, has_surface_tile_offset is equivalent to gen == 4 && !is_g4x.

We already use it for related checks in brw_wm_surface_state.c, so it
makes sense to use it here too.  It's simpler and more future-proof.

Broadwell also lacks surface tile offsets.  With this patch, I won't
need to update any generation checking; I can simply not set the flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agogallium: fix build on GNU/kFreeBSD
Fabio Pedretti [Wed, 6 Nov 2013 09:55:28 +0000 (10:55 +0100)]
gallium: fix build on GNU/kFreeBSD

Patch from Debian package

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agoconfigure.ac: fix build on GNU/kFreeBSD
Fabio Pedretti [Wed, 6 Nov 2013 09:55:27 +0000 (10:55 +0100)]
configure.ac: fix build on GNU/kFreeBSD

Based on existing patch from Debian package.

Debian bug: http://bugs.debian.org/524690

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agomesa: add arm64 support
Fabio Pedretti [Tue, 5 Nov 2013 15:51:19 +0000 (16:51 +0100)]
mesa: add arm64 support

Patch from Ubuntu package

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agor600/compute: silence unused var warning
Fabio Pedretti [Tue, 5 Nov 2013 11:49:56 +0000 (12:49 +0100)]
r600/compute: silence unused var warning

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agoi965/gen6: Don't allow SIMD16 dispatch in 4x PERPIXEL mode with computed depth.
Paul Berry [Tue, 5 Nov 2013 02:48:17 +0000 (18:48 -0800)]
i965/gen6: Don't allow SIMD16 dispatch in 4x PERPIXEL mode with computed depth.

Hardware docs say we can only use SIMD8 dispatch in this condition.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoconfigure.ac: Drop no-out-of-tree notice.
Matt Turner [Tue, 5 Nov 2013 19:21:53 +0000 (11:21 -0800)]
configure.ac: Drop no-out-of-tree notice.

We do support out of tree builds now.

Tested-by: Colin Walters <walters@verbum.org>
11 years agomesa: Build program as part of libmesa.
Matt Turner [Mon, 4 Nov 2013 22:52:22 +0000 (14:52 -0800)]
mesa: Build program as part of libmesa.

11 years agomesa: Clean up use of top_srcdir/top_builddir.
Matt Turner [Mon, 4 Nov 2013 22:36:53 +0000 (14:36 -0800)]
mesa: Clean up use of top_srcdir/top_builddir.

11 years agoi965: Use unreachable() to silence a compiler warning.
Matt Turner [Tue, 5 Nov 2013 00:26:29 +0000 (16:26 -0800)]
i965: Use unreachable() to silence a compiler warning.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
11 years agomesa: Add unreachable() macro.
Matt Turner [Tue, 5 Nov 2013 00:24:35 +0000 (16:24 -0800)]
mesa: Add unreachable() macro.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
11 years agogallivm: fix indirect addressing of inputs
Roland Scheidegger [Wed, 6 Nov 2013 14:40:25 +0000 (15:40 +0100)]
gallivm: fix indirect addressing of inputs

We weren't adding the soa offsets when constructing the indices
for the gather functions. That meant that we were always returning
the data in the first element.
(Copied straight from the same fix for temps.)
While here fix up a couple of broken comments in the fetch functions,
plus don't name a straight float type float4 which is just confusing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
11 years agor600/llvm: Fix isampleBuffer on preEG
Vincent Lejeune [Mon, 21 Oct 2013 19:05:57 +0000 (21:05 +0200)]
r600/llvm: Fix isampleBuffer on preEG

11 years agor600/llvm: Fix texbuf for pre EG gen
Vincent Lejeune [Mon, 21 Oct 2013 16:48:21 +0000 (18:48 +0200)]
r600/llvm: Fix texbuf for pre EG gen

11 years agomesa: for GLSL_DUMP_ON_ERROR, also dump the info log
Brian Paul [Tue, 5 Nov 2013 23:58:15 +0000 (16:58 -0700)]
mesa: for GLSL_DUMP_ON_ERROR, also dump the info log

Since it's helpful to know why the shader did not compile.
Also, call fflush() for Windows.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agost/vdpau: resolve delayed rendering for GL interop v2
Grigori Goronzy [Tue, 5 Nov 2013 23:35:31 +0000 (00:35 +0100)]
st/vdpau: resolve delayed rendering for GL interop v2

Otherwise OutputSurface interop has funny results sometimes.
This fixes interop with the mpv media player.

v2 (chk): add proper locking

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agodocs: Mark off ARB_sample_shading; minor tidyup.
Chris Forbes [Wed, 6 Nov 2013 06:35:41 +0000 (19:35 +1300)]
docs: Mark off ARB_sample_shading; minor tidyup.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
11 years agoi965/fs: Gen4-5: Implement alpha test in shader for MRT
Chris Forbes [Sat, 26 Oct 2013 23:32:03 +0000 (12:32 +1300)]
i965/fs: Gen4-5: Implement alpha test in shader for MRT

V2: Add comment explaining what emit_alpha_test() is for;
    fix spurious temp and bogus whitespace.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/fs: Gen4-5: Setup discard masks for MRT alpha test
Chris Forbes [Sun, 27 Oct 2013 15:18:29 +0000 (04:18 +1300)]
i965/fs: Gen4-5: Setup discard masks for MRT alpha test

The same setup is required here as when the user-provided shader
explicitly uses KIL or discard.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Gen4-5: Include alpha func/ref in program key
Chris Forbes [Sat, 26 Oct 2013 23:09:51 +0000 (12:09 +1300)]
i965: Gen4-5: Include alpha func/ref in program key

V2: Better explanation of the rationale for doing this.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Gen4-5: Don't enable hardware alpha test with MRT
Chris Forbes [Sat, 26 Oct 2013 23:09:51 +0000 (12:09 +1300)]
i965: Gen4-5: Don't enable hardware alpha test with MRT

We have to do this in the shader instead, since these gens lack an
independent RT0 alpha value in their render target write messages.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Combine {brw,gen7}_update_texture_buffer_surface() functions.
Kenneth Graunke [Sat, 2 Nov 2013 03:05:27 +0000 (20:05 -0700)]
i965: Combine {brw,gen7}_update_texture_buffer_surface() functions.

Now that brw_update_texture_buffer_surface() uses the virtual
emit_buffer_surface_state() function, it works for Gen7+ too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Unvirtualize brw_create_constant_surface; delete Gen7+ variant.
Kenneth Graunke [Sat, 2 Nov 2013 00:37:10 +0000 (17:37 -0700)]
i965: Unvirtualize brw_create_constant_surface; delete Gen7+ variant.

Now that brw_create_constant_surface uses a virtual function internally,
it doesn't need to be virtual itself.  We can delete the Gen7+ variant
and simplify things.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Use the new emit_buffer_surface_state() vtable entry.
Kenneth Graunke [Sat, 2 Nov 2013 00:33:42 +0000 (17:33 -0700)]
i965: Use the new emit_buffer_surface_state() vtable entry.

This will allow us to combine the Gen4-6 and Gen7 variants of these
functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Virtualize emit_buffer_surface_state().
Kenneth Graunke [Fri, 25 Oct 2013 18:37:06 +0000 (11:37 -0700)]
i965: Virtualize emit_buffer_surface_state().

This entails adding "mocs" and "rw" parameters to the Gen4-5 version.
I made it actually pay attention to the rw flag (even though it is
always false), but mocs is always ignored.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Fix compiler warning.
Courtney Goeltzenleuchter [Wed, 30 Oct 2013 21:58:30 +0000 (15:58 -0600)]
i965: Fix compiler warning.

fix: intel_screen.c:1320:4: warning: initialization from
incompatible pointer type [enabled by default]

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Tell the unit states how many binding table entries we have.
Eric Anholt [Sat, 2 Nov 2013 00:43:43 +0000 (17:43 -0700)]
i965: Tell the unit states how many binding table entries we have.

Before the series with 3c9dc2d31b80fc73bffa1f40a91443a53229c8e2 to
dynamically assign our binding table indices, we didn't really track our
binding table count per shader, so we never filled in these fields.

Affects cairo-gl trace runtime by -2.47953% +/- 1.07281% (n=20)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Fix context initialization after 2f896627175384fd5
Eric Anholt [Mon, 4 Nov 2013 23:49:52 +0000 (15:49 -0800)]
i965: Fix context initialization after 2f896627175384fd5

You can't return stack-initialized values and expect anything good to
happen.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agogallivm: optimize lp_build_minify for sse
Roland Scheidegger [Tue, 5 Nov 2013 18:21:25 +0000 (19:21 +0100)]
gallivm: optimize lp_build_minify for sse

SSE can't handle true vector shifts (with variable shift count),
so llvm is turning them into a mess of extracts, scalar shifts and inserts.
It is however possible to emulate them in lp_build_minify with float muls,
which should be way faster (saves over 20 instructions per 8-wide
lp_build_minify). This wouldn't work for "generic" 32bit shifts though
since we've got only 24bits of mantissa (actually for left shifts it would
work by using sse41 int mul instead of float mul but not for right shifts).
Note that this has very limited scope for now, since this is only used with
per-pixel lod (otherwise we're avoiding the non-constant shift count by doing
per-quad shifts manually), and only 1d textures even then (though the latter
should change).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agonouveau: Use _NEW_SCISSOR instead of hooking through dd_function_table
Ian Romanick [Fri, 1 Nov 2013 21:56:53 +0000 (14:56 -0700)]
nouveau: Use _NEW_SCISSOR instead of hooking through dd_function_table

This will enable removing the dd_function_table::Scissor hook in the
near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
11 years agonouveau: Use _NEW_VIEWPORT instead of hooking through dd_function_table
Ian Romanick [Fri, 1 Nov 2013 21:56:28 +0000 (14:56 -0700)]
nouveau: Use _NEW_VIEWPORT instead of hooking through dd_function_table

This will enable removing the dd_function_table::DepthRange hook in the
near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
11 years agoradeon / r200: Don't pass unused parameters to radeon_viewport
Ian Romanick [Fri, 1 Nov 2013 18:40:44 +0000 (11:40 -0700)]
radeon / r200: Don't pass unused parameters to radeon_viewport

The x, y, width, and height parameters aren't used by radeon_viewport,
so don't pass them.  This should make future changes to the
dd_function_table::Viewport interface a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
11 years agoi915: Bring sanity to the Viewport function
Ian Romanick [Fri, 1 Nov 2013 18:38:25 +0000 (11:38 -0700)]
i915: Bring sanity to the Viewport function

The i830 and the i915 driver have the same dd_function_table::Viewport
function... it just has two names and lives in two places.  Using a
single implementation allows cleaning up the saved_viewport nonsense
too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
11 years agoi965: Eliminate the saved_viewport wrapper
Ian Romanick [Fri, 1 Nov 2013 18:36:47 +0000 (11:36 -0700)]
i965: Eliminate the saved_viewport wrapper

The i965 driver never installed a dd_function_table::Viewport function,
so this wrapper never actually did anything.

No piglit regressions on IVB on DRI2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jljusten@gmail.com>
Cc: Courtney Goeltzenleuchter <courtney@lunarg.com>
11 years agomesa: Remove last BEOS checks
Alexander von Gluck IV [Tue, 5 Nov 2013 01:31:26 +0000 (01:31 +0000)]
mesa: Remove last BEOS checks

* Goodbye BeOS, we hardly knew thee
* As BeOS was gcc2 only, there was little chance
  of this being useful.
* Doesn't effect Haiku in any meaningful way

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoutil/u_format: take normalized flag in consideration in util_format_is_rgba8_variant
José Fonseca [Fri, 25 Oct 2013 11:39:42 +0000 (12:39 +0100)]
util/u_format: take normalized flag in consideration in util_format_is_rgba8_variant

Just happened to notice it was missing while looking at it.

11 years agoglsl: Don't generate misleading debug names when packing gs inputs.
Paul Berry [Thu, 31 Oct 2013 00:01:01 +0000 (17:01 -0700)]
glsl: Don't generate misleading debug names when packing gs inputs.

Previously, when packing geometry shader input varyings like this:

    in float foo[3];
    in float bar[3];

lower_packed_varyings would declare a packed varying like this:

    (declare (shader_in flat) (array ivec4 3) packed:foo[0],bar[0])

That's confusing, since the packed varying acutally stores all three
values of foo and all three values of bar.

This patch causes it to generate the more sensible declaration:

    (declare (shader_in flat) (array ivec4 3) packed:foo,bar)

Note that there should be no functional change for users of geometry
shaders, since the packed name is only used for generating debug
output.  But this should reduce confusion when using INTEL_DEBUG=gs.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agogallivm: Remove llvm::DisablePrettyStackTrace for LLVM >= 3.4.
Vinson Lee [Mon, 4 Nov 2013 04:27:13 +0000 (20:27 -0800)]
gallivm: Remove llvm::DisablePrettyStackTrace for LLVM >= 3.4.

LLVM 3.4 r193971 removed llvm::DisablePrettyStackTrace and made the
pretty stack trace opt-in rather than opt-out.

The default value of DisablePrettyStackTrace has changed to true in LLVM
3.4 and newer.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60929
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agotarget/haiku-softpipe: Fix viewport issues
Alexander von Gluck IV [Mon, 4 Nov 2013 18:51:41 +0000 (18:51 +0000)]
target/haiku-softpipe: Fix viewport issues

* Call mesa viewport call on winndow resize
* Add initial postprocessing code
* Pass hgl_context to private statetracker
  as it is more useful than GalliumContext
* Use Lock and Unlock functions to standardize
  GalliumContext locking
* Create texture resources in texture validation

Acked-by: Brian Paul <brianp@vmware.com>
11 years agomesa: remove __alpha__ && CCPML check
Brian Paul [Tue, 5 Nov 2013 01:07:37 +0000 (18:07 -0700)]
mesa: remove __alpha__ && CCPML check

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agomesa: remove OPENSTEP stuff
Brian Paul [Tue, 5 Nov 2013 00:47:19 +0000 (17:47 -0700)]
mesa: remove OPENSTEP stuff

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agomesa: remove macintosh preprocessor stuff
Brian Paul [Tue, 5 Nov 2013 00:47:19 +0000 (17:47 -0700)]
mesa: remove macintosh preprocessor stuff

IIRC, this is MacOS 9.x stuff.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agomesa: remove __QUICKDRAW__ tests
Brian Paul [Tue, 5 Nov 2013 00:47:19 +0000 (17:47 -0700)]
mesa: remove __QUICKDRAW__ tests

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agomesa: remove WGLAPI macro
Brian Paul [Tue, 5 Nov 2013 00:47:19 +0000 (17:47 -0700)]
mesa: remove WGLAPI macro

WGLAPI was defined in glheader.h but wasn't used anywhere.

Reviewed-by: Matt Turner <mattst88@gmail.com>