Commit Graph

59682 Commits

Author SHA1 Message Date
Ian Romanick 15c3bac3d0 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>
2013-11-07 17:40:25 -08:00
Ian Romanick 7b140d1bda 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>
2013-11-07 17:40:05 -08:00
Ian Romanick 17c94de33b 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>
2013-11-07 17:31:16 -08:00
Ian Romanick 916bc4491a 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>
2013-11-07 16:41:38 -08:00
Ian Romanick a6eb04c3d8 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>
2013-11-07 16:41:38 -08:00
Ian Romanick 2fdc0ee19f 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>
2013-11-07 16:41:38 -08:00
Ian Romanick 114d360dfa 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>
2013-11-07 16:41:38 -08:00
Matt Turner 69b425efae st/xorg: Delete.
Acked-by: Lucas Stach <l.stach@pengutronix.de>
2013-11-07 16:14:25 -08:00
Matt Turner 48f4f59dc6 xorg-nouveau: Delete. 2013-11-07 16:14:25 -08:00
Matt Turner 11ff1725cc xorg-i915: Delete.
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Acked-by: Stéphane Marchesin <stephane.marchesin@gmail.com>
2013-11-07 16:14:25 -08:00
Ian Romanick cf0da87917 docs: Mark off ARB_shader_atomic_counters for i965
...and update relnotes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:02:03 -08:00
Francisco Jerez 597634556e i965/gen7: Expose ARB_shader_atomic_counters.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 15:56:57 -08:00
Francisco Jerez 5c114939b4 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>
2013-11-07 15:56:57 -08:00
Francisco Jerez e63bb29853 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>
2013-11-07 15:56:57 -08:00
Kenneth Graunke 30f61c471d Revert "i965: Add support for GL_AMD_performance_monitor on Ironlake."
This reverts most of commit 0f2da77307.
(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>
2013-11-07 15:52:02 -08:00
Kenneth Graunke 1bd6233169 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>
2013-11-07 15:52:02 -08:00
Fredrik Höglund c9ac891fa4 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>
2013-11-07 23:55:46 +01:00
Fredrik Höglund e420fb887f 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>
2013-11-07 23:51:44 +01:00
Fredrik Höglund bfc28e4aff 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>
2013-11-07 23:51:24 +01:00
Brian Paul fe9284a7bf 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
2013-11-07 15:23:36 -07:00
Brian Paul 6592a6d065 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>
2013-11-07 15:21:40 -07:00
Brian Paul 055dbd5c3e 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>
2013-11-07 15:21:40 -07:00
Matt Turner 6b990a7474 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>
2013-11-07 13:18:03 -08:00
Matt Turner 6f2e81ce4c 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>
2013-11-07 13:18:03 -08:00
Chris Forbes d41084a63d 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>
2013-11-08 09:57:29 +13:00
Anuj Phogat 735a777842 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>
2013-11-07 12:20:33 -08:00
Chris Forbes 4871e7b91f docs: update relnotes 2013-11-08 09:10:06 +13:00
Chris Forbes 2973f38f1c 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>
2013-11-08 09:10:06 +13:00
Chris Forbes 5e61c746d5 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>
2013-11-08 09:10:06 +13:00
Chris Forbes 7a95bb0a80 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>
2013-11-08 09:10:06 +13:00
Chris Forbes 48b6d70bef 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>
2013-11-08 09:10:06 +13:00
Chris Forbes fa14f8afa0 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>
2013-11-08 09:10:06 +13:00
Chris Forbes 1f092a9594 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>
2013-11-08 09:09:43 +13:00
Chris Forbes aba355b463 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>
2013-11-08 09:00:47 +13:00
Matthew McClure f9e2c24326 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>
2013-11-07 18:32:54 +00:00
Eric Anholt 185b5a54c9 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>
2013-11-07 10:20:33 -08:00
Matt Turner fd03dd6ddd build: Build gen_matypes and matypes.h from src/mesa.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 10:00:25 -08:00
Matt Turner d8abd6710e 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>
2013-11-07 10:00:25 -08:00
Matt Turner 957c7570ea configure.ac: Test $asm_arch directly.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 10:00:25 -08:00
Fredrik Höglund 23e69ad6ec docs: Mark ARB_vertex_attrib_binding as done, update relnotes
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:21:43 +01:00
Fredrik Höglund d2ac5d9a13 mesa: Enable ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-11-07 16:20:45 +01:00
Fredrik Höglund 193e8b4b93 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund 965900e830 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund fb370f89db 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund 59b01ca252 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund bb2d02c7b5 glapi: Add infrastructure for ARB_vertex_attrib_binding
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:45 +01:00
Fredrik Höglund ccb6286707 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund 12cbe995ed 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>
2013-11-07 16:20:45 +01:00
Fredrik Höglund d5543213f2 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>
2013-11-07 16:20:44 +01:00
Fredrik Höglund 6a650fa787 mesa: Restore gl_array_object::NewArray
This will be used by the ARB_vertex_attrib_binding implementation.
This reverts commit db38e9a0e1.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-11-07 16:20:44 +01:00