Commit Graph

48947 Commits

Author SHA1 Message Date
Dave Airlie
2d80cad16e llvmpipe: disable native integers
llvmpipe shouldn't be reporting native integer support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 19:48:56 +00:00
Brian Paul
0a20051e6d xlib: stop calling XShmQueryVersion()
It caused an X protocol error in some (rare) situations.
This is a follow-on to the previous commits which fixes a bug reported
by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
7f6de60c58 st/glx/xlib: call register_with_display() in glXChooseFBConfig()
This is the same fix as the previous commit, except it's for the gallium
glx/xlib state tracker.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
ecbdb173bb xlib: call register_with_display() in Fake_glXChooseFBConfig()
as we do in Fake_glXChooseVisual().  This registers the MesaGLX
extension on the display so we can clean up buffers, etc. when
the display connection is closed.

Fixes a bug reported by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Christoph Bumiller
b424bf69df nv50/ir: handle TGSI_OPCODE_ISSG 2012-01-11 20:26:58 +01:00
Christoph Bumiller
9d503992d7 nv50/ir: handle TGSI_TEXTURE_SHADOWCUBE 2012-01-11 20:26:52 +01:00
Christoph Bumiller
f6b994b305 nv50,nvc0: zero out program struct on program_destroy
Prevent any state from carrying over to a new translation in cases
where we assume that data is still zero from initial calloc (these
would require us to do individual zeroing before translation which
would be more code).
2012-01-11 20:26:47 +01:00
Kristian Høgsberg
58dc1b28d1 wayland-drm: Drop the non-premul formats, use format codes from drm_fourcc.h 2012-01-11 14:24:00 -05:00
José Fonseca
1306644a67 draw: Store the new pre_clip_pos member as well.
Again, not much testing nor peer review, but should be better than what's
now.
2012-01-11 18:11:28 +00:00
Kristian Høgsberg
513d1feee4 egl_dri2: Put the _eglError call in the case switch case
Log an error in case we get an unknown format, not in case for XRGB32.
I botched the edit of Roberts patch.
2012-01-11 12:44:58 -05:00
Dave Airlie
3f80b69b5f st/mesa: rename translate_texture_target, and make translate_opcode static.
As suggested by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
fffca9046c softpipe: route correct coordinates for shadow cube sampling.
This fixes the shadow cube map sampling on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
2f275466f7 glsl_to_tgsi: add support for shadow cube map sampling.
This along with the TGSI support lets the piglit sampler-cube-shadow
test pass on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
0ec30805a4 tgsi: add TGSI_TEXTURE_SHADOWCUBEMAP
This adds support for shadow cubemap texture sampling instructions.

This is required for GL 3.0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
José Fonseca
ec4d691474 llvmpipe: Update for TGSI_INTERPOLATE_COLOR.
Not thoroughly tested nor reviewed. But should at least prevent the
assertion failure.
2012-01-11 17:35:14 +00:00
Robert Bragg
670f182a1f egl_dri2/wayland: handle creating xrgb8888 images
When creating an EGLImage from a struct wl_buffer * this ensures
that we create an XRGB8888 image if the wayland buffer doesn't have an
alpha channel. To determine if a wl_buffer has a valid alpha channel
this patch adds an internal wayland_drm_buffer_has_alpha() function.

It's important to get the internal format for an EGLImage right so that
if a GL texture is later created from the image then the GL driver will
know if it should sample the alpha from the texture or flatten it to
a constant of 1.0.

This avoids needing fragment program workarounds in wayland compositors
to manually ignore the alpha component of textures created from wayland
buffers.

krh: Edited to use wl_buffer_get_format() instead of wl_buffer_has_alpha().

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-01-11 12:16:47 -05:00
Paul Berry
765ed3a6a9 glx: Suppress unused variable warning for cmdlen
No functional change.  In the function
__indirect_glAreTexturesResident(), the variable cmdlen is only used
if USE_XCB is not defined.  This patch avoids a compile warning in the
event that USE_XCB is defined.

v2: just move cmdlen declaration inside the #else part.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 07:57:56 -08:00
Paul Berry
d3150ebc8c mesa: Move transform feedback error check to reduce array overflow risk.
Previous to this patch, we didn't do the limit check for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS until the end of the
store_tfeedback_info() function, *after* storing all of the transform
feedback info in the gl_transform_feedback_info::Outputs array.  This
meant that the limit check wouldn't prevent us from overflowing the
array and corrupting memory.

This patch moves the limit check to the top of tfeedback_decl::store()
so that there is no risk of overflowing the array.  It also adds
assertions to verify that the checks for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS are sufficient to avoid
array overflow.

Note: strictly speaking this patch isn't necessary, since the maximum
possible number of varyings is MAX_VARYING (16), whereas the size of
the Outputs array is MAX_PROGRAM_OUTPUTS (64), so it's impossible to
have enough varyings to overflow the array.  However it seems prudent
to do the limit check before the array access in case these limits
change in the future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-11 07:57:56 -08:00
Paul Berry
642e5b413e mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), we need to handle transform feedback of gl_ClipDistance
specially, to account for the fact that the hardware represents it as
an array of vec4's rather than an array of floats.

The previous way this was accounted for (translating the request for
gl_ClipDistance[n] to a request for a component of
gl_ClipDistanceMESA[n/4]) doesn't work when performing transform
feedback on the whole unsubscripted array, because we need to keep
track of the size of the gl_ClipDistance array prior to the lowering
pass.  So I replaced it with a boolean is_clip_distance_mesa, which
switches on the special logic that is needed to handle the lowered
version of gl_ClipDistance.

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript".

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Paul Berry
be4e9f7a0c mesa: Fix computation of transform feedback num_components.
The function tfeedback_decl::num_components() was not correctly
accounting for transform feedback of whole arrays and gl_ClipDistance.
The bug was hard to notice in tests, because it only affected the
checks for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS.

This patch fixes the computation, and adds an assertion to verify
num_components() even when MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
and MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS are not exceeded.

The assertion requires keeping track of components_so_far in
tfeedback_decl::store(); this will be useful in a future patch to fix
non-multiple-of-4-sized gl_ClipDistance.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Dave Airlie
c62e02000d st_extensions: fixup GLSL 1.30 related enables (v3)
This just fixes up the enables for native integers and EXT_texture_integer
support in st/mesa.

It also set the MaxClipPlanes to 8.

We should consider exposing caps for MCP vs MCD, but since core
mesa doesn't care yet maybe we can wait for now.

v2: use 32-bit formats as per Marek's mail.

v3: add calim's fix for INT_DIV_TO_MUL_RCP disabling.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
cc94f0541c st_glsl_to_tgsi: use ISSG and fixup IABS
It doesn't look like the GLSL compiler will produce sign op
for an unsigned anyways (seems insane anyways).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
b6cbc28533 tgsi: add ISSG support
This adds integer version of SSG that GLSL 1.30 can produce.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
0fe2b397bb softpipe: enable clamping control
This enables fragment clamping in softpipe, it passes more
tests than it did previously with no regressions, There are still
a couple of failures in the SNORM types to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
e809b7a678 softpipe: fix texel fetch swizzles
This fixes a number of texelFetch swizzle tests, and consoldiates
the swizzle handling in a new function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Stéphane Marchesin
3235435e80 i915g: Fix bugs in the shader optimizer. 2012-01-11 02:25:42 -08:00
Dave Airlie
5840ec2d41 softpipe: fix llvm build
Thanks to Wubbbi on #dri-devel for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 10:16:56 +00:00
Dave Airlie
1865f341d8 draw: clipdistance support (v2)
Add support for using the clipdistance instead of clip plane.

Passes all piglit clipdistance tests.

v2: fixup some comments from Brian in review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:20:11 +00:00
Dave Airlie
f7e3e46f72 tgsi_scan: add support to count number of output clip distances
Just add support to the scanner to count the number of clip distances.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:08:12 +00:00
Dave Airlie
40c5987ed8 draw/softpipe: add clip vertex support. (v2)
softpipe always clipped using the position vector, however for unclipped
vertices it stored the position in window coordinates, however when position
and clipping are separated, we need to store the clip-space position and
the clip-space vertex clip, so we can interpolate both separately.

This means we have to take the clip space position and store it to use later.

This allows softpipe to pass all the clip-vertex piglit tests.

v2: fix llvm draw regression, the structure being passed into llvm needed
updating, remove some hardcoded ints that should have been enums while there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
34a78b7ef6 tgsi/softpipe: add VertexID support.
This required changing the system value semantics, so we stored
a system value per vertex, instance id is the only other system
value we currently support, so I span it across the channels.

This passes the 3 vertexid-* piglit tests + lots of instanceid tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
02932f37fa softpipe: allow softpipe to set shader params depending on runtime llvm (v3)
If draw isn't using llvm we can support vertex texture and integers,
These will be fixed up later, but for now allow this check to happen
at run-time.

v2: since 3e22c7a253 we can ask draw for a non-llvm
context. Just track if ask and set the vars accordingly. This probably isn't perfect but should cover the cases we care about.

v3: use debug option, restructure to store in screen, as suggested by Jakob.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:27 +00:00
Dave Airlie
092cf9a5b5 mesa/clear: fix crashes with illegal clear tests.
Mesa shouldn't call into the drivers if there are no renderbuffers
bound to the attachments for the buffers to be cleared.

Fixes a number of the clearbuffer-* tests on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:06:25 +00:00
Dave Airlie
863554168e mesa: fix cubemap depth completeness test
This fixes the test to allow cube/depth combinations on GL3
or EXT_gpu_shader4.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:02:32 +00:00
Eric Anholt
916e206ef0 glsl: Add error checking for applying interpolation qualifiers to other vars.
Fixes piglit
glsl-1.30/compiler/interpolation-qualifiers/local-smooth-01.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
be4e46b21a i965: Claim to support 4 multisamples on gen6+.
We're not quite ready to actually support it in the implementation,
but at least this allows GL 3.0 API-reliant applications to hopefully
run successfully, though they won't get multisampling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
3d4efc583c i965: Increase the number of array texture levels to the hardware limit.
The EXT_texture_array required only 64, but GL 3.0 required 256.
Since we're already exposing values that can get us way beyond our
ability to map the single object directly, go ahead and expose all the
way to hardware limits.

Tested with new piglit EXT_texture_array/maxlayers on gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
057f9ae54b glsl: Fix copy_propagation_elements bug in handling self-copies.
We were doing the kill of the updated channels, then adding our copy
to the list of available stuff to copy.  But if the copy was updating
its own source channels, we didn't notice, breaking this code:

	R0.xyzw = arg0 + arg1;
	R0.xyzw = R0.wwwx;
	gl_FragColor.xyzw = clamp(R0.xyzw, 0.0, 1.0);

Fixes piglit glsl-copy-propagation-self-2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
254b24f195 i965: Fix compiler warnings from hiz changes. 2012-01-10 16:44:16 -08:00
Chad Versace
f7cbd80028 i965/gen7: Fix batch length for 3DSTATE_HIER_DEPTH_BUFFER
Change from 5 to 3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 16:31:52 -08:00
Chad Versace
06ad9adcb0 i965/gen7: Enable HiZ
This patch modifies all batches needed for HiZ. The batch length for
3DSTATE_HIER_DEPTH_BUFFER is also corrected from 4 to 3.

Performance +6.7% on Citybench.
    num-frames: 400
    resolution: 1918x1031
    avg-hiz-off: 127.90 fps
    avg-hiz-on: 136.50 fps
    kernel: git://people.freedesktop.org/~anholt/linux.git branch=gen7-reset-sol sha=23360e4

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:38 -08:00
Chad Versace
bebc91f0f3 i965: Replace references to stencil region size with buffer size
It is unwise to use a stencil region's size to determine its
renderbuffer's size, because at region creation we fudge the width and
height to accomodate interleaved rows. (See the comment for MESA_FORMAT_S8
in intel_miptree_create()). Most users of stencil_region->{width,height}
should be converted to use stencil_rb->{Width,Height}.

We have already done the replacement in several locations. This patch
continues the replacement in {brw,gen7}_emit_depthbuffer(). To make those
functions look consistent, I've also done the equivalent replacement for
the depth buffer.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:27 -08:00
Chad Versace
b755f5894c i965: Fix misnamed GEN7_WM_DEPTH_RESOLVE
It was named GEN6_WM_DEPTH_RESOLVE. Luckily, this caused no conflict,
because the value is identical for gen6 and gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:05 -08:00
Christoph Bumiller
bd38459fe9 nv50: fix clip state validation
Don't create clip outputs if no clip planes are enabled.

Move clip validation after program validation: we were calling
linkage validation in case the VP needed rebuilding before the
FP was validated.

The vertex program needs to be built first because when
ClipDistance is used we'll want to only enable those outputs that
are also written.
2012-01-10 21:45:31 +01:00
Brian Paul
8597c986d7 draw: remove unused 'so' variable in draw_pt_so_emit() 2012-01-10 12:40:10 -07:00
Brian Paul
991479ef51 mesa: fix > vs. >> typo in EXPAND_3_8() macro
Found by Eirik Byrkjeflot Anonsen.
2012-01-10 12:37:38 -07:00
Brian Paul
d6533df90d st/mesa: remove unnecessary memset()/zero call
The u_surface_default_template() function does the memset()/zero now.

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
2e87660ca6 util: use memset() to initialize surface, sampler_view templates
These initialization functions weren't initializing all the fields so
some had undefined values.  The callers of these functions sometimes use
a structure assignment to initialize new objects from these templates
so we'd just propagate the undefined values.  That made for some confusing
info when debugging, plus it could lead to bugs.

v2: fix surf pointer mix-up: "&surf" -> "surf"

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
6bf5daf331 mesa: use STATIC_ASSERT in a few more places 2012-01-10 12:37:37 -07:00
José Fonseca
f9b2d2fea5 scons: Fix libGL.so build. 2012-01-10 17:42:02 +00:00