Commit Graph

52013 Commits

Author SHA1 Message Date
Eric Anholt e119f98472 i965/vs: Add support for copying user edge flags.
Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Olivier Galibert 7426d9d769 i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.
If there was an edge flag or a two-side-color pair present, we'd end up
mismatched and read values from earlier in the VUE for later FS inputs.

v2: Fix regression in gles2conform shaders generating point size. (change by
    anholt)

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 branch.
2012-08-09 09:07:49 -07:00
Vinson Lee 3466538171 st/mesa: Initialize tgsi_texture_offset Padding field.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 22:36:27 -07:00
Kenneth Graunke 68bccc40f5 glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.
If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0.  (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-08 17:15:21 -07:00
Tapani Pälli 94f22fbe78 intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2
Patch changes i915 and i965 drivers to use fixed function version of
meta clear when running on ES 1.1. This fixes rendering errors seen with
Google Maps, Angry Birds and Gallery3D on Android platform.

Change 88128516d4 exposes all extensions
internally to be available independent of GL flavour, therefore check
against ARB_fragment_shader does not work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 17:15:21 -07:00
Kenneth Graunke 5deb1d1a1f i965: Rework the extra flushes surrounding occlusion queries.
This removes the CS stall on Ivybridge.

On Sandybridge, the depth stall needs to be preceded by a non-zero
post-sync op, which requires a CS stall, which needs a stall at
scoreboard.  Emit the full workaround.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 17:15:21 -07:00
Eric Anholt b0adbda75a i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.
I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates.  Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:31 -07:00
Eric Anholt 9b4053cabd i965: Drop the confusing saturate argument to math instruction setup.
This was ridiculous.  We were ignoring the inst->header.saturate flag in the
case of math and only math.  On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument.  On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:30 -07:00
Eric Anholt 33dfdc735e i965: Make brw_set_saturate() use stdbool.
There was a chance for brw_wm_emit.c to screw up and pass (1 << 4) instead of
1, which would get converted to 0 when stored.  Instead, use stdbool which
converts nonzero to true/1 like we want.
2012-08-08 16:21:30 -07:00
Eric Anholt 1b148e660e mesa: In conditional rendering fallback, check the query status.
Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Eric Anholt 4bbd120368 mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting.  It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Ian Romanick 9f7b3d1713 Make shared-glapi the default
You can't practically have desktop OpenGL and OpenGL ES on the same system
without this.  The benefits of not having it (e.g., a more compact dispatch
table) are irrelevant.

v2: Don't mark shared-glapi as experimental.  Review suggestion by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick 5602f0f955 mesa/tests: Fix trivial typos in src/mapi/glapi tests
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick 45d3d0ad21 mesa/tests: Add tests for the generated shared-glapi dispatch table
These are largely based on the src/mapi/glapi/tests.  However,
shared-glapi provides less external visibility into the dispatch table,
so there is less to test.  Also, shared-glapi does not implement
_glapi_get_proc_name, so that test was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick d9f899bb93 glapi: Prevent accidental use of lies w/shared-glapi
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick 99fee476a1 glx: Don't use glapitable.h at all
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  Avoiding the use of glapitable.h avoids the lies.  The only
entries used in this code are entries that are ABI.  For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick f5dffb7e36 glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  There are two completely separate code generation paths used to
assign dispatch offset.  Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed.  There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi.  So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick 52d6df8aa7 mesa/tests: Don't build glapi tests with shared-glapi
This fixes 'make check' on with --enable-shared-glapi.  This test cannot work
in that environment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:25 -07:00
Kenneth Graunke e45a9ce474 i965: Use 64-bit writes for occlusion queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:23 -07:00
Kenneth Graunke 20c09b82d0 i965: Refactor depth count write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:21 -07:00
Kenneth Graunke a2cdd5ada8 i965: Emit a CS stall before timestamp writes.
This implements one of the Sandybridge PIPE_CONTROL workarounds.  It
doesn't appear to be required for Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:19 -07:00
Kenneth Graunke c4c78c275a i965: Use 64-bit writes for timestamp queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:16 -07:00
Kenneth Graunke 03f14664b6 i965: Refactor timestamp write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:14 -07:00
Kenneth Graunke 61d0b9f52c intel: Make the length for PIPE_CONTROL explicit.
PIPE_CONTROL has variable length, depending upon generation and whether
we want to do 32-bit or 64-bit data writes.  Make it explicit, rather
than hiding a length of 4 in the #define for _3DSTATE_PIPE_CONTROL.

Generated by s/3DSTATE_PIPE_CONTROL/3DSTATE_PIPE_CONTROL | (4 - 2)/g.
This is equivalent since the #define used to have | 2 in it.  A grep
through the sources shows that all instances have been converted, so
it's safe to remove the | 2 from the #define.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:23:57 -07:00
Brian Paul ecac178aa2 swrast: add missing switch case for API_OPENGL_CORE
To silence compiler warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul b4d6502fcd gallivm: remove unused src_elem_type variable
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul f21669e9a2 svga: remove unused svga_shader::use_sm30 field, add comments
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul 16a289195e svga: remove unused svga_winsys_handle type
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Michel Dänzer 82cd9c0fc2 radeonsi: If pixel shader compilation fails, use a dummy shader.
Otherwise we're likely to hang the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 15:33:38 +02:00
Christian König be42a45e02 radeonsi: fix memory leak and/or segfaults
Fix a stupid typo that could lead to memory
leaks and/or segfaults.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:36:49 +02:00
Christian König 8c44e5a144 radeon/winsys: fix winsys VM handling
Move releasing the VM area after closing the bo handle.

This partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45018

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:35:10 +02:00
Vinson Lee 7528e2104f translate: Fix typo in is_legal_int_format_combo.
Fixes same on both sides defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-07 22:34:28 -07:00
Marek Olšák 1ea263fccb r600g: remove unused parameters in texture functions 2012-08-07 23:39:52 +02:00
Eric Anholt 4a078516b6 i965: Enable uniform buffer objects on gen6+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt 04871058eb i965/vs: Add support for loading uniform buffer variables as pull constants.
Unlike the FS side in the previous commit, this does variable indexing just
fine, using the same code as we used for other variable-indexed pull
constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt 90de96ff0d i965/fs: Add support for loading uniform buffer variables as pull constants.
Variable array indexing isn't finished, because the lowering pass
turns it all into conditional moves of constant index accesses so I
can't test it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt bb020d09c3 i965/vs: Add a surface index to VS_OPCODE_PULL_CONSTANT instructions.
Similar to the previous commit for the fragment shader, now we have a buffer
index and an offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 454dc83f66 i965/fs: Communicate the pull constant block read parameters through fs_regs.
I wanted to add the surface index as a variable value for UBO support,
and a reg seemed like the obvious way to go.  This exposes more of the
information to CSE, which we'll probably want to apply to pull
constant loads for UBOs eventually (you might access 4 floats in a
row, each of which would produce an oword block read of the same
block).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 25d2bf3845 i965: Bind UBOs as surfaces like we do for pull constants.
v2: Comment fix, drop extraneous parens (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 5bffbd7ba2 i965: Add an offset argument to constant buffer setup.
We'll use this for UBO surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 5fc5b29a54 mesa: Add support for glUniformBlockBinding() in display lists.
Fixes piglit GL_ARB_uniform_buffer_object/dlist.

v2: Use the .ui fields instead of .i for type consistency (review by Brian
    Paul)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt bfa046b5f2 mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 1eb3c06ae8 mesa: Default to GL 3.1's limits on uniform blocks.
The ARB spec lets you get away with the default block counting against the
blocks for combined size limits.  The core spec says you need to be able to
support the maximum size of default block *and* the maximum size of each
uniform block.  I see no reason that any driver would have a problem with
that.

Fixes gl 3.1/minmax (with an associated fix to the test)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 803262a5f5 glsl: Refuse to parse uniform block declarations when UBOs aren't available.
Fixes piglit
GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt e45f1b11c0 glsl: Align GL_UNIFORM_BLOCK_DATA_SIZE according to std140 rules.
Fixes piglit GL_ARB_uniform_buffer_object/data-size test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt 86e0045578 glsl: Only flag RowMajor on matrix-type variables.
We were only propagating it to the API when the variable was a matrix type,
but we were still tripping over it in lower_ubo_reference when it was set on a
vector.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt ffb2d43059 glsl: Fix calculation of std140 offset alignment for mat2s.
We were getting the base offset of a vec2, not of a vec2[2] like the quoted
spec text says we should.

v2: Fix swapped then/else cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt 300315fe69 glsl: Fix glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX).
Previously, we were returning the index into the UniformBlocks of one of the
linked shaders, when it's supposed to be the program global index.

Fixes piglit getactiveuniformsiv-uniform_block_index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt af3fc6bb28 ir_to_mesa: Don't whack the ->location field of uniform block variables.
Fixes some failures in GL_ARB_uniform_buffer_object/maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt 56e82e30cb mesa: Make glBindBufferBase/glBindBufferRange() work on just-genned names.
In between glGenBuffers() and glBindBuffer(), the buffer object points to this
dummy buffer with a name of 0, and a glBindBufferBase() would point to that.
It seems pretty clear, given that glBindBufferBase() only cares about the
current size of the buffer at render time, that it should bind up the buffer
that you passed in instead of pointing it at this useless dummy buffer.

However, what should glBindBufferRange() do?  As of this patch, it will
promote the genned buffer to a proper buffer like it had been
glBindBuffer()ed, and then detect that the size is greater than the buffer's
current size of 0 and throw INVALID_VALUE.  It seems like the most reasonable
answer here.

Note that this also changes the behavior of these two on non-glGenBuffers() bo
names.  We haven't yet set up the error throwing for glBindBuffers() on gl
3.1+, and my assumption is that these two functions should inherit their
behavior on un-genned names from glBindBuffers().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00