Commit Graph

48669 Commits

Author SHA1 Message Date
Dave Airlie
784026139c draw: fix missing include for u_format.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:57:12 +00:00
Dave Airlie
a103c61d27 st/mesa: add support for clip vertex.
We need to pass the pre-projection matrix clip planes into the driver,
instead of the post for the case we have a vertex shader that writes clip
vertex.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:25 +00:00
Dave Airlie
9cea86f501 gallium: add new semantic for clip vertex.
This is to match the gl_ClipVertex output from GLSL 1.20.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:24 +00:00
Dave Airlie
17707d89f4 draw: don't translate non-floats to float.
translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types.

This fixes a bunch of piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:31:43 +00:00
Dave Airlie
e1ff84371c st/mesa: fix default interpolation for colors.
Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

this is the final version that fixes the reflect regression.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:30:23 +00:00
Kenneth Graunke
be21ded2ae glsl/builtins: Add missing mix(genType, genType, bvec) built-ins.
The IR for mix(float, float, bool) was missing a write mask, causing the
IR reader to die horribly.  Furthermore, I neglected to add any of the
new prototypes to the 1.30 profiles.

Fixes oglconform's glsl-bif-com advanced.mix test cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44477
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-06 18:18:15 -08:00
Kenneth Graunke
7ccf04ebcf i965/vs: Fix invalid array access in copy propagation.
Accessing virtual_grf_reg_map[inst->dst.reg] is invalid if
inst->dst.file != GRF.  Since is_direct_copy already implies a GRF
destination, we can just move the check earlier.

Fixes a regression in commit 07ee9f374f.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44302
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 18:17:46 -08:00
Kenneth Graunke
de88e00c94 configure.ac: Remove unused GLUT substitutions.
GLUT was removed from the main tree a while ago; nothing uses these
substitutions.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-06 18:16:10 -08:00
Ian Romanick
1f125374e7 glsl: Don't mark assignment temporaries as read-only
The various l-value errors this was designed to catch are now caught
by other means.  Marking the temporaries as read-only now just
prevents sensible error messages from being generated.  It's

0:0(0): error: function parameter 'out p' references the read-only variable '_post_incdec_tmp'

versus

0:13(5): error: function parameter 'out p' references a post-decrement operation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Ian Romanick
208b5b113f glsl: Emit extra errors for l-value violations in 'out' or 'inout' parameters
Somethings, like pre-increment operations, were not previously caught.
After the 8.0 release, this code needs some major refactoring and
clean-up.  It's a mess. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
e9015e99d0 glsl: Emit errors for assignments to non-l-value expressions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
fa0a9ac5cd glsl: Track descriptions of some expressions that can't be l-values
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Brian Paul
c87247f6a8 mesa: remove gl_framebuffer:_DepthBuffer, _StencilBuffer fields
These were used by swrast to make a combined depth+stencil buffer look
like separate depth and stencil buffers.  But that's no longer needed
after rewriting the depth/stencil code in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:34 -07:00
Brian Paul
21b28d520f swrast: remove s_depthstencil.[ch] files
The code is no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:29 -07:00
Brian Paul
030e408181 swrast: remove calls to _swrast_update_depth/stencil_buffer()
These functions updated the gl_renderbuffer::_DepthBuffer and
_StencilBuffer fields.  But those fields are no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:19 -07:00
Eric Anholt
deb6dd6b4d i965: Turn on ARB_depth_buffer_float by default.
Everything about this that we have tests for works except for the
deprecated metaops.  The conclusion we came to on IRC sounded like we
were OK with turning it on as long as core functionality works.  The
remaining failures (copypixels, drawpixels) should just be a matter of
finishing the MapRenderbuffer for them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:49:21 -08:00
Eric Anholt
3786a3e644 swrast: Convert the glBlitFramebuffer(GL_NEAREST) path to MapRenderbuffer().
Fixes on i965:
ARB_depth_buffer_float/fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit
ARB_depth_buffer_float/fbo-stencil-GL_DEPTH32F_STENCIL8-blit

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:15 -08:00
Eric Anholt
61ea677bdd mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.
We were converting our ubyte stencil value to a float.  Just write it
as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't
matter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:08 -08:00
Eric Anholt
38c6f1e6ca swrast: Fix use of uninitialized value in rbmapping changes.
I'm so surprised that gcc didn't catch this that I feel like I must be
misreading.  srcMap is what we initialize (along with dstMap) from
this map value right after this check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:01 -08:00
Eric Anholt
fb5252a351 swrast: Use the fast copypixels code to implement fast glBlitFramebuffer().
They were meaning to do the same thing of memcpying rows, so just
write the code once.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:55 -08:00
Eric Anholt
cedbfc0050 swrast: Move the check for fast_copy_pixels() ability to caller.
I'm going to reuse this function from glBlitFramebuffer() handling,
which wants to do the same thing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:47 -08:00
Eric Anholt
60982976ee i965: Add sensible disasm for the JMPI instruction.
We care about the jump distance, not that the first src is always the
ip register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:48:32 -08:00
Eric Anholt
cd2a24a4c2 i965/gen7: Enable transform feedback as long as kernel support is present.
The last major issue (intervening-read) is fixed, so let's turn this
on for real.  The only other known issue is a hardware limitation for
tesselation with flat shading.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-06 09:17:17 -08:00
Eric Anholt
6c0b70e774 i965/gen7: Fix up the transform feedback buffer pointers on later batches.
Fixes piglit EXT_transform_feedback/intervening-read

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:14 -08:00
Eric Anholt
7f91c8bf2b i965/gen7: Flush the batch between transform feedbacks.
We need the kernel to reset our pointers to 0 in between.  Note that
the initialization of function pointer had to move to after
InitContext since we didn't have intel->gen set up yet.

Fixes piglit EXT_transform_feedback/immediate-reuse

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:04 -08:00
Eric Anholt
c4089d444a i965/gen7: Use the updated interface for SO write pointer resetting.
The new kernel patch I submitted makes the interface opt-in, so all
batchbuffers aren't preceded by the 4 MI_LOAD_REGISTER_IMMs.  This
requires the updated i915_drm.h present in libdrm 2.4.30.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:16:32 -08:00
Alex Deucher
e60daf7e25 r600g: remove obsolete MULTIWRITE comment
fs writes all is implemented in the shader on eg+.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-06 10:15:37 -05:00
Kenneth Graunke
938490c3fe glsl_to_tgsi: Remove the obsolete remove_output_reads pass.
This is now handled by the GLSL compiler, so this code is dead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:37:02 +00:00
Vincent Lejeune
10937e6512 glsl_to_tgsi: Use the GLSL compiler's new remove-output-reads pass.
The existing glsl_to_tgsi::remove_output_read pass did not work properly
when indirect addressing was involved; this commit replaces it with a
lowering pass that occurs before TGSI code generation.

Fixes varying-array related piglit tests.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:52 +00:00
Vincent Lejeune
6d4b35c036 glsl: Add a lowering pass to remove reads of shader output variables.
This is similar to Gallium's existing glsl_to_tgsi::remove_output_read
lowering pass, but done entirely inside the GLSL compiler.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:44 +00:00
Dave Airlie
293a3916bd draw: fix piglit base vertex + user vertex array tests
This fixes
draw-elements-base-vertex user_varrays
draw-elements-instanced-base-vertex user_varrays
for softpipe with no llvm support (DRAW_USE_LLVM=false)

I'm not sure if this is the correct answer, but these tests were showing
a max_index of 7, then trying to fetch up to 43, maybe it should be fixing
max_index earlier somewhere to take care of this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:35 +00:00
ojab
2fe6c254f7 Strip LLVM svn rev from llvm-config --version output.
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2012-01-05 22:44:16 -08:00
Vinson Lee
44c089bd48 mesa: Remove 'texelBytes' declarations that are only used in assertions.
This patch silences these GCC warnings.
warning: unused variable 'texelBytes'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 22:37:06 -08:00
Paul Berry
33fe021116 mesa: Fix transform feedback of unsubscripted arrays.
It is not explicitly stated in the GL 3.0 spec that transform feedback
can be performed on a whole varying array (without supplying a
subscript).  However, it seems clear from context that this was the
intent.  Section 2.15 (TransformFeedback) says this:

    When writing varying variables that are arrays, individual array
    elements are written in order.

And section 2.20.3 (Shader Variables), says this, in the description
of GetTransformFeedbackVarying:

    For the selected varying variable, its type is returned into
    type. The size of the varying is returned into size. The value in
    size is in units of the type returned in type.

If it were not possible to perform transform feedback on an
unsubscripted array, the returned size would always be 1.

This patch fixes the linker so that transform feedback on an
unsubscripted array is supported.

Fixes piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{4,8}]-no-subscript" and
"EXT_transform_feedback/output_type *[2]-no-subscript".

Note: on back-ends that set
gl_shader_compiler_options::LowerClipDistance (for example i965),
tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]" still fail.  I hope to address this in
a later patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
cab179a165 Add .gitignore files to exclude unit test build artifacts from git
With the addition of unit tests in commit
3ef3ba4d2e, several additional build
artifacts are created:

  bin/depcomp
  bin/missing
  tests/Makefile
  tests/Makefile.in
  tests/glx/Makefile
  tests/glx/Makefile.in
  tests/glx/.deps/
  tests/glx/.gitignore

This patch adds all of these files to .gitignore.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
4357f8b4dc mesa: Avoid segfault when getting an unbound transform feedback buffer name.
Previously we were using
gl_transform_feedback_object::Buffers[i]->Name to service an indexed
get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING.  However, if no
buffer has been bound, gl_transform_feedback_object::Buffers[i] is
NULL, so this was causing a segfault.

This patch switches to using
gl_transform_feedback_object::BufferNames[i], which is equal to
gl_transform_feedback_object::Buffers[i]->Name if
gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is
NULL.

Fixes piglit test "EXT_transform_feedback/get-buffer-state
indexed_binding".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:12 -08:00
Paul Berry
456279bb33 mesa: Fix transform feedback of gl_ClipDistance.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), references to gl_ClipDistance (a float[8] array) will
be converted to references to gl_ClipDistanceMESA (a vec4[2] array).

This patch modifies the linker so that requests for transform feedback
of gl_ClipDistance are similarly converted.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipDistance".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
913a5c238b mesa: Make tfeedback_decl::var_name a const char *.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
367b83f890 gallium: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
e8357cb03d i965: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
2169331d40 mesa: Add gl_transform_feedback_info::ComponentOffset.
When using transform feedback, there are three circumstances in which
it is useful for Mesa to instruct a driver to stream out just a
portion of a varying slot (rather than the whole vec4):

(a) When a varying is smaller than a vec4, Mesa needs to instruct the
driver to stream out just the first one, two, or three components of
the varying slot.

(b) In the future, when we implement varying packing, some varyings
will be offset within the vec4, so Mesa will have to instruct the
driver to stream out an arbitrary contiguous subset of the components
of the varying slot (e.g. .yzw or .yz).

(c) On drivers that set gl_shader_compiler_options::LowerClipDistance,
if the client requests that an element of gl_ClipDistance be streamed
out using transform feedback, Mesa will have to instruct the driver to
stream out a single component of one of the gl_ClipDistance varying
slots.

Previous to this patch, only (a) was possible, since
gl_transform_feedback_info specified only the number of components of
the varying slot to stream out.  This patch adds
gl_transform_feedback_info::ComponentOffset, which indicates which
components should be streamed out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
989b5722dc i965: Fix transform feedback of gl_ClipVertex.
Previously, on i965 Gen6 and above, we weren't allocating space for
gl_ClipVertex in the VUE, since the VS was automatically converting it
to clip distances.  This prevented transform feedback from being able
to capture gl_ClipVertex.

This patch goes aheads and allocates space for gl_ClipVertex in the
VUE on Gen6 and above.  The old behavior is retained on Gen5 and
below, since (a) transform feedback is not yet supported on those
platforms, and (b) those platforms don't currently support
gl_ClipVertex anyhow.

Note: this constitutes a slight waste of VUE space for shaders that
use gl_ClipVertex and don't use transform feedback to capture it.
However, that seems preferable to making the VUE map (and all of the
state that depends on it) dependent on transform feedback settings.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipVertex".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
15f4bca2df i965: Fix transform feedback of gl_PointSize.
On i965 Gen6 and above, gl_PointSize is stored in component W of the
first VUE slot (which corresponds to VERT_RESULT_PSIZ in the VUE map).
Normally we store varying floats in component X of a VUE slot, so we
need special case logic for gl_PointSize.

For Gen6, we do this with a ".wwww" swizzle in the GS.  For Gen7, we
shift the component mask by 3 to select the W component.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_PointSize".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
1be0fd8c86 mesa: Fix extra memset in store_tfeedback_info()
Commit 9d36c96d6e (mesa: Fix
glGetTransformFeedbackVarying()) accidentally added an extra memset()
call to the store_tfeedback_info() function, causing
prog->LinkedTransformFeedback.NumBuffers to be erased.

This patch removes the extra memset and rearranges the other
operations in store_tfeedback_info() to be in the correct order.

Fixes piglit tests "EXT_transform_feedback/api-errors *unbound*"

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-05 13:26:48 -08:00
Brian Paul
a44d715d2b swrast: use memmove() instead of memcpy() in the SHIFT_ARRAY macro
The src/dst arrays would overlap but dst was less than src so a simple
version of memcpy() would do the right thing.  But this isn't guaranteed
when memcpy() is optimized.

Fixes demos/copypix when the dest region was clipped by the left side of
the window.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-05 12:49:45 -07:00
Bryan Cain
59be691638 st/mesa: add support for gl_ClipDistance 2012-01-05 13:03:26 -06:00
Bryan Cain
6951870e57 gallium: add support for clip distances 2012-01-05 13:03:25 -06:00
Marek Olšák
f82d40d4b1 glx/dri2: print FPS when env var LIBGL_SHOW_FPS is 1 (v2)
This is useful for apps which don't print FPS.
Only enabled in SwapBuffers.

v2: track state per drawable, use libGL prefix

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2012-01-05 18:29:11 +01:00
Marek Olšák
c77efc6bb6 r300/compiler: fix buffer underflow when setting SEM_WAIT on last instruction
Do it after we check whether inst_end != -1.
Also move the code structure at the beginning of r300_fragment_shader_code
to detect underflows easily with valgrind.
2012-01-05 18:29:11 +01:00
Marek Olšák
c2cc630f28 u_vbuf: use cso_cache to cache vertex element states
Improves performance to 28 fps in Cogs.
2012-01-05 18:29:11 +01:00