mesa.git
12 years agost/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.
Vinson Lee [Sat, 18 Feb 2012 19:16:18 +0000 (11:16 -0800)]
st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.

Fixes this GCC warning.
native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but not
used [-Wunused-function]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agollvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()
José Fonseca [Fri, 17 Feb 2012 16:22:18 +0000 (16:22 +0000)]
llvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()

Reviewed-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: check for no state change in glPrimitiveRestartIndex()
Brian Paul [Mon, 20 Feb 2012 02:50:32 +0000 (19:50 -0700)]
mesa: check for no state change in glPrimitiveRestartIndex()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: check for no state change in Enable/DisableVertexAttribArray()
Brian Paul [Mon, 20 Feb 2012 02:50:31 +0000 (19:50 -0700)]
mesa: check for no state change in Enable/DisableVertexAttribArray()

Avoid setting dirty state flags when enabling or disabling a vertex
attribute arrays when there's no change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: add missing return after _mesa_error() in update_array()
Brian Paul [Mon, 20 Feb 2012 02:50:31 +0000 (19:50 -0700)]
mesa: add missing return after _mesa_error() in update_array()

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agor300g: Fix build when libdrm is installed to non-standard dir
Tom Stellard [Mon, 20 Feb 2012 00:37:30 +0000 (19:37 -0500)]
r300g: Fix build when libdrm is installed to non-standard dir

12 years agoi965: Make the dummy fragment shader work in SIMD16 mode.
Kenneth Graunke [Sat, 18 Feb 2012 21:08:29 +0000 (13:08 -0800)]
i965: Make the dummy fragment shader work in SIMD16 mode.

If you're resorting to the dummy shader, you've probably already turned
off SIMD16 mode.  But if you didn't, it would die in a fire.

We could either fail to compile in SIMD16 mode...or just fix it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Fix GPU hangs in the dummy fragment shader.
Kenneth Graunke [Sat, 18 Feb 2012 20:59:40 +0000 (12:59 -0800)]
i965: Fix GPU hangs in the dummy fragment shader.

The dummy FB write failed to specify EOT and a message length, causing
the GPU to hang.  Now we can enjoy "everyone's favorite color" again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/vega: Remove unused variable.
Vinson Lee [Sat, 18 Feb 2012 08:32:53 +0000 (00:32 -0800)]
st/vega: Remove unused variable.

Fixes this GCC warning.
mask.c: In function ‘mask_layer_fill’:
mask.c:387:12: warning: variable ‘alpha_color’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/glx: Remove unused variables.
Vinson Lee [Sat, 18 Feb 2012 08:18:52 +0000 (00:18 -0800)]
st/glx: Remove unused variables.

Fixes these GCC warnings.
glx_api.c: In function ‘choose_visual’:
glx_api.c:678:8: warning: variable ‘trans_value’ set but not used
[-Wunused-but-set-variable]
glx_api.c:677:8: warning: variable ‘trans_type’ set but not used
[-Wunused-but-set-variable]
glx_api.c:663:8: warning: variable ‘min_ci’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agodraw: add missing streamout state setup for draw/llvm.
Dave Airlie [Sat, 18 Feb 2012 12:43:37 +0000 (12:43 +0000)]
draw: add missing streamout state setup for draw/llvm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agovbo: Eliminate short-circuiting in invalid-start case.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:24 +0000 (05:08 -0800)]
vbo: Eliminate short-circuiting in invalid-start case.

Now that we have a index_range_invalid flag, we can just use that rather
than calling vbo_validated_drawrangeelements directly and returning.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agovbo: Rework checking of 'end' against _MaxElement.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:23 +0000 (05:08 -0800)]
vbo: Rework checking of 'end' against _MaxElement.

This failed to take basevertex into account:

If basevertex < 0:
   (end + basevertex) might actually be in-bounds while 'end' is not.
   We would have clamped in this case when we probably shouldn't.
   This could break application drawing.

If basevertex > 0:
   'end' might be in-bounds while (end + basevertex) might not.
   We would have failed to clamp in this place.  There's a comment
   indicating the TNL module depends on max_index being in-bounds;
   if so, it would likely break horribly.

Rather than trying to clamp correctly in the face of basevertex, simply
delete the clamping code and indicate that we don't have a valid range.
This causes _tnl_vbo_draw_prims to use vbo_get_minmax_indices() to
compute the actual bounds, which is much safer.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agovbo: Ignore invalid element ranges which are outside VBO bounds.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:22 +0000 (05:08 -0800)]
vbo: Ignore invalid element ranges which are outside VBO bounds.

Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agovbo: Remove pedantic warning about 'end' beind out of bounds.
Kenneth Graunke [Wed, 8 Feb 2012 13:08:21 +0000 (05:08 -0800)]
vbo: Remove pedantic warning about 'end' beind out of bounds.

The application supplied [start, end] range is merely a conservative
hint of the ranges of index values inside the index buffer.  There is no
requirement that all vertices in the range [start, end] be referenced.

Passing an 'end' value larger than the maximum legal index is perfectly
acceptible; applications can legally pass 0xffffffff when they don't
have a tighter bound readily available.

Thus, the warning doesn't indicate a correctness issue; it could only
indicate a performance issue.  However, it does not even do that.

glDrawRangeElements is designed to optimize non-VBO vertex data uploads
by providing an upper bound on the size of buffers a driver would need
to allocate.  With VBOs, the data is already in an uploaded buffer, so
the range doesn't help.

The clincher is: we only know _MaxElement for VBOs.  For user-space
arrays, we just set it to 2,000,000,000 (see mesa/main/varray.h:63.)
So we can only check this in the case where it is not useful.

Many applications, including the Unigine demos, currently trigger this
warning, which suggests the applications are buggy when they're actually
fine.  Eliminating the warning should confuse users less while not
actually losing any benefit to application developers.

NOTE: This is a candidate for release branches.

Suggested-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agointel: Fix rendering from textures after RenderTexture().
Eric Anholt [Fri, 10 Feb 2012 20:54:25 +0000 (12:54 -0800)]
intel: Fix rendering from textures after RenderTexture().

There's a serious trap for drivers: RenderTexture() does not indicate
that the texture is currently bound to the draw buffer, despite
FinishRenderTexture() signaling that the texture is just now being
unbound from the draw buffer.

We were acting as if RenderTexture() *was* the start of rendering and
that we could make texturing incoherent with the current contents of
the renderbuffer.  This caused intel oglconform sRGB
Mipmap.1D_textures to fail, because we got a call to TexImage() and
thus RenderTexture() on a texture bound to a framebuffer that wasn't
the draw buffer, so we skipped validating the new image into the
texture object used for rendering.

We can't (easily) make RenderTexture() indicate the start of drawing,
because both our driver and gallium are using it as the moment to set
up the renderbuffer wrapper used for things like MapRenderbuffer().
Instead, postpone the setup of the workaround render target miptree
until update_renderbuffer time, so that we no longer need to skip
validation of miptrees used as render targets.  As a bonus, this
should make GL_NV_texture_barrier possible.

(This also fixes a regression in the gen4 small-mipmap rendering since
3b38b33c1648b07e75dc4d8340758171e109c598, which switched
set_draw_offset from image->mt to irb->mt but didn't move the irb->mt
replacement up before set_draw_offset).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
NOTE: This is a candidate for the 8.0 branch.

12 years agointel: Improve the fallback debug for framebuffer status checks.
Eric Anholt [Fri, 10 Feb 2012 20:24:50 +0000 (12:24 -0800)]
intel: Improve the fallback debug for framebuffer status checks.

12 years agomesa: Only end render-to-texture at bind time for drawbuffers.
Eric Anholt [Fri, 10 Feb 2012 20:05:16 +0000 (12:05 -0800)]
mesa: Only end render-to-texture at bind time for drawbuffers.

If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?

12 years agogallivm: fetch immediates to correct type (v2)
Dave Airlie [Mon, 6 Feb 2012 18:48:17 +0000 (18:48 +0000)]
gallivm: fetch immediates to correct type (v2)

Fetch float/uint/int immediates.

v2: bitcast to uint/int to floats as per Jose's suggestions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: enable stores of integer types. (v2) + fix ARL
Dave Airlie [Mon, 6 Feb 2012 15:37:56 +0000 (15:37 +0000)]
gallivm: enable stores of integer types. (v2) + fix ARL

Infer from the operand the type of value to store.
MOV is untyped but we use the float store path.

v2: make MOV use float store path.

I've had to squash merge the ARL fix to be stored
as an integer in here to avoid regressions in a number
of piglit tests.

From now on ARL stores to an integer just like HW does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: enable fetch for integer opcodes. (v2)
Dave Airlie [Mon, 6 Feb 2012 15:35:05 +0000 (15:35 +0000)]
gallivm: enable fetch for integer opcodes. (v2)

The infers the type of data required using the opcode,
and casts the input to the appropriate type.

So far this only handles non-indirect constant and temporaries.

v2: as per Jose suggestion, fetch immediates via floats

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: add uint/int bld to the base builder. (v2)
Dave Airlie [Mon, 6 Feb 2012 15:28:45 +0000 (15:28 +0000)]
gallivm: add uint/int bld to the base builder. (v2)

These are used inside the action handlers for the integer opcodes.

v2: use uint_bld/int_bld, drop higher level uint_bld.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: fix build gather to take a bld context
Dave Airlie [Tue, 7 Feb 2012 09:52:00 +0000 (09:52 +0000)]
gallivm: fix build gather to take a bld context

Then pass the correct build context to it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: pass build context to exec_mask_store.
Dave Airlie [Mon, 6 Feb 2012 13:35:46 +0000 (13:35 +0000)]
gallivm: pass build context to exec_mask_store.

For now just pass the current context, but when we want to
store int or unsigned we need to pass those later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agotgsi: add source/destination type from opcodes. (v2)
Dave Airlie [Tue, 24 Jan 2012 11:55:14 +0000 (11:55 +0000)]
tgsi: add source/destination type from opcodes. (v2)

These two functions produce the src/dst types for an opcode.

MOV is special since it can be used to mov float->float and int->int,
so just return VOID.

v2: use a new enum for the opcode type as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: Initialize x86 disassembler on x86_64 too.
José Fonseca [Fri, 17 Feb 2012 17:22:23 +0000 (17:22 +0000)]
gallivm: Initialize x86 disassembler on x86_64 too.

12 years agollvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.
José Fonseca [Fri, 17 Feb 2012 16:17:28 +0000 (16:17 +0000)]
llvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.

Instead of assuming 4 wide vectors.

12 years agollvmpipe: Specify lp_test_arit's target precision per function.
José Fonseca [Fri, 17 Feb 2012 16:10:22 +0000 (16:10 +0000)]
llvmpipe: Specify lp_test_arit's target precision per function.

12 years agollvmpipe: Add a negation test to lp_test_arit.
José Fonseca [Fri, 17 Feb 2012 15:57:54 +0000 (15:57 +0000)]
llvmpipe: Add a negation test to lp_test_arit.

12 years agodocs: News and release notes link for 8.0.1
Ian Romanick [Fri, 17 Feb 2012 07:31:28 +0000 (23:31 -0800)]
docs: News and release notes link for 8.0.1

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodocs: Add 8.0.1 release md5sums
Ian Romanick [Fri, 17 Feb 2012 07:25:14 +0000 (23:25 -0800)]
docs: Add 8.0.1 release md5sums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d38a2952895d6e859e04bc5dc6d7cfa9f8c36f17)

12 years agodocs: Add 8.0.1 release notes
Ian Romanick [Fri, 17 Feb 2012 02:55:18 +0000 (18:55 -0800)]
docs: Add 8.0.1 release notes

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fe77fd3983ba3da16ec53c58a790c381b07387ce)

12 years agor300g: don't use pipe_screen::winsys
Marek Olšák [Fri, 17 Feb 2012 00:39:48 +0000 (01:39 +0100)]
r300g: don't use pipe_screen::winsys

12 years agor300g: don't use pipe_context::winsys
Marek Olšák [Fri, 17 Feb 2012 00:26:21 +0000 (01:26 +0100)]
r300g: don't use pipe_context::winsys

12 years agomesa: Update the version string to 8.1-devel
Ian Romanick [Thu, 16 Feb 2012 23:28:29 +0000 (15:28 -0800)]
mesa: Update the version string to 8.1-devel

The numeric version was updated in 46883e0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodocs: replace gitweb link with cgit link
Brian Paul [Thu, 16 Feb 2012 20:35:02 +0000 (13:35 -0700)]
docs: replace gitweb link with cgit link

12 years agomesa: add missing texture integer test in glTexSubImage()
Brian Paul [Wed, 15 Feb 2012 22:29:29 +0000 (15:29 -0700)]
mesa: add missing texture integer test in glTexSubImage()

If the texture format is integer, the incoming user data must also be
integer (and similarly for non-integer textures).

NOTE: This is a candidate for the stable branches.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agor600g: remove the workaround for quads and provoking vertex
Marek Olšák [Thu, 16 Feb 2012 13:45:35 +0000 (14:45 +0100)]
r600g: remove the workaround for quads and provoking vertex

12 years agor600g: remove redundant r600_context::vs_so_stride_in_dw
Marek Olšák [Thu, 2 Feb 2012 14:04:13 +0000 (15:04 +0100)]
r600g: remove redundant r600_context::vs_so_stride_in_dw

12 years agoi965: Emit Ivybridge VS workaround flushes.
Kenneth Graunke [Thu, 19 Jan 2012 17:55:34 +0000 (09:55 -0800)]
i965: Emit Ivybridge VS workaround flushes.

I recently discovered this text in the BSpec.  It seems wise to comply,
though I haven't observed it to fix anything yet.

Fixes a regression in glean/fbo since 28cfa1fa213fe.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.
Eric Anholt [Mon, 13 Feb 2012 21:36:06 +0000 (13:36 -0800)]
mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.

Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fix push/pop of multisample coverage invert.
Eric Anholt [Mon, 13 Feb 2012 21:24:39 +0000 (13:24 -0800)]
mesa: Fix push/pop of multisample coverage invert.

In the table of of push/pop attributes, this one doesn't fall under
the enable group.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoswrast: Only avoid empty _TexEnvPrograms
Ian Romanick [Sat, 11 Feb 2012 00:00:27 +0000 (16:00 -0800)]
swrast: Only avoid empty _TexEnvPrograms

If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876

12 years agoglapi: Include GLES2 headers for ES2 extension functions
Ian Romanick [Wed, 8 Feb 2012 21:04:38 +0000 (13:04 -0800)]
glapi: Include GLES2 headers for ES2 extension functions

This fixes build errors like

In file included from glapi_dispatch.c:91:
../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
'glDrawBuffersNV'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
12 years agost/mesa: fix typo: s/patent/parent/
Brian Paul [Mon, 13 Feb 2012 23:14:44 +0000 (16:14 -0700)]
st/mesa: fix typo: s/patent/parent/

12 years agost/mesa: remove unused st_equal_formats() function
Brian Paul [Tue, 14 Feb 2012 15:47:28 +0000 (08:47 -0700)]
st/mesa: remove unused st_equal_formats() function

It was incomplete and didn't take byte swapping into account either.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()
Brian Paul [Tue, 14 Feb 2012 15:46:03 +0000 (08:46 -0700)]
st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()

st_equal_formats() is no longer used now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove INLINE qualifiers
Brian Paul [Mon, 13 Feb 2012 22:41:57 +0000 (15:41 -0700)]
st/mesa: remove INLINE qualifiers

from st_get/create_texture_sampler_view_from stobj() functions.
No real value in these cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: simplify st_create_texture_sampler_view()
Brian Paul [Mon, 13 Feb 2012 21:51:14 +0000 (14:51 -0700)]
st/mesa: simplify st_create_texture_sampler_view()

Implement in terms of st_create_texture_sampler_view_format().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove unused st_get_texture_sampler_view()
Brian Paul [Mon, 13 Feb 2012 21:49:08 +0000 (14:49 -0700)]
st/mesa: remove unused st_get_texture_sampler_view()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use private pipe_sampler_view in decompress_with_blit()
Brian Paul [Mon, 13 Feb 2012 21:48:36 +0000 (14:48 -0700)]
st/mesa: use private pipe_sampler_view in decompress_with_blit()

Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use private pipe_sampler_view in st_render_mipmap()
Brian Paul [Mon, 13 Feb 2012 21:46:11 +0000 (14:46 -0700)]
st/mesa: use private pipe_sampler_view in st_render_mipmap()

Rather than the one in st_texture_object.  This sampler view really has
no connection to the one used for rendering.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: use z32f_x24s8 struct in format pack/unpack code
Brian Paul [Mon, 13 Feb 2012 17:06:54 +0000 (10:06 -0700)]
mesa: use z32f_x24s8 struct in format pack/unpack code

And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row().
As suggested by José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agost/mesa: assorted clean-ups in st_cb_fbo.c
Brian Paul [Sun, 12 Feb 2012 23:48:14 +0000 (16:48 -0700)]
st/mesa: assorted clean-ups in st_cb_fbo.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_framebuffer_renderbuffer()
Brian Paul [Sun, 12 Feb 2012 23:44:51 +0000 (16:44 -0700)]
st/mesa: remove st_framebuffer_renderbuffer()

Just use _mesa_framebuffer_renderbuffer().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_get_default_texture()
Brian Paul [Sun, 12 Feb 2012 23:30:28 +0000 (16:30 -0700)]
st/mesa: remove st_get_default_texture()

Just use _mesa_get_fallback_texture() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix _mesa_get_fallback_texture() to handle all texture targets
Brian Paul [Wed, 4 Jan 2012 21:55:32 +0000 (14:55 -0700)]
mesa: fix _mesa_get_fallback_texture() to handle all texture targets

Previously, this function only handled 2D textures.

The fallback texture is used when we try to sample from an incomplete
texture object.  GLSL says sampling an incomplete texture should return
(0,0,0,1).

v2: use a 1-texel texture image, per José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: improve assertion/check for stencil format
Brian Paul [Sun, 12 Feb 2012 23:17:53 +0000 (16:17 -0700)]
st/mesa: improve assertion/check for stencil format

12 years agogallium: fix some comments in p_state.h
Brian Paul [Sat, 11 Feb 2012 03:32:40 +0000 (20:32 -0700)]
gallium: fix some comments in p_state.h

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Brian Paul [Mon, 13 Feb 2012 15:49:34 +0000 (08:49 -0700)]
mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code

Added in _mesa_pack_uint_24_8_depth_stencil_row().  This could be hit
by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8)
into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()
Brian Paul [Sun, 12 Feb 2012 18:30:54 +0000 (11:30 -0700)]
st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
Brian Paul [Sat, 11 Feb 2012 01:57:15 +0000 (18:57 -0700)]
st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers

The st_renderbuffer_alloc_storage() function is used to allocate both
window-system buffers and user-created renderbuffers.  The later kind
are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
those surfaces.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: use u_surface_default_template() helper
Brian Paul [Sat, 11 Feb 2012 01:46:07 +0000 (18:46 -0700)]
st/mesa: use u_surface_default_template() helper

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove redundant memset(surface_template,0)
Brian Paul [Sat, 11 Feb 2012 01:43:17 +0000 (18:43 -0700)]
st/mesa: remove redundant memset(surface_template,0)

The subsequent u_surface_default_template() call does that for us.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_renderbuffer::stride
Brian Paul [Sat, 11 Feb 2012 01:40:02 +0000 (18:40 -0700)]
st/mesa: remove st_renderbuffer::stride

It was only used for software buffers and easily computed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: remove st_renderbuffer::format
Brian Paul [Sat, 11 Feb 2012 01:34:25 +0000 (18:34 -0700)]
st/mesa: remove st_renderbuffer::format

We only used it in a few places that can implemented differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix comment typos in fbobject.c
Brian Paul [Fri, 10 Feb 2012 23:22:33 +0000 (16:22 -0700)]
mesa: fix comment typos in fbobject.c

12 years agoi965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:22 +0000 (12:43 -0800)]
i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.

Commit dc7f449d1ac53a66e6efb56ccf2a5953418a26ca introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

NOTE: This is a candidate for the 8.0 branch (with the previous commit).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Add a new fs_inst::regs_written function.
Kenneth Graunke [Tue, 14 Feb 2012 20:43:21 +0000 (12:43 -0800)]
i965/fs: Add a new fs_inst::regs_written function.

Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

NOTE: This is a candidate for the 8.0 branch (dependency of a fix).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agollvmpipe: fix fogcoord writing (v2)
Dave Airlie [Sat, 4 Feb 2012 17:55:56 +0000 (17:55 +0000)]
llvmpipe: fix fogcoord writing (v2)

this fixes the fogcoord related piglit tests, like I fixed them in softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agometa: Avoid FBO resizing/reallocating in decompress_texture_image
Anuj Phogat [Mon, 13 Feb 2012 18:48:45 +0000 (10:48 -0800)]
meta: Avoid FBO resizing/reallocating in decompress_texture_image

Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/vdpau: fix a small memory leak
Christian König [Mon, 13 Feb 2012 11:10:47 +0000 (12:10 +0100)]
st/vdpau: fix a small memory leak

The matrix filter wasn't freed on mixer destruction.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: fix low strength denoise filter
Christian König [Mon, 13 Feb 2012 10:41:23 +0000 (11:41 +0100)]
vl: fix low strength denoise filter

A filter strength of zero or one doesn't make any
sense. Thanks to Andy Furniss for pointing this out.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agor600g: fix tiling with cayman and virtual memory
Jerome Glisse [Tue, 14 Feb 2012 21:26:12 +0000 (16:26 -0500)]
r600g: fix tiling with cayman and virtual memory

The virtual address but follow the alignment requirement of the
tiled surface. The bo from handle case is not properly fix. Need
bigger change for a proper fix. Work around that by enforcing 1M
alignment for those bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
12 years agoi915: Fix type of "specoffset" variable.
Paul Berry [Sat, 11 Feb 2012 03:51:55 +0000 (19:51 -0800)]
i915: Fix type of "specoffset" variable.

Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Enable register spilling on gen7 too.
Eric Anholt [Fri, 10 Feb 2012 00:35:49 +0000 (16:35 -0800)]
i965/fs: Enable register spilling on gen7 too.

It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Report the failure message when failing to compile the fragment shader.
Eric Anholt [Thu, 9 Feb 2012 18:23:45 +0000 (10:23 -0800)]
i965: Report the failure message when failing to compile the fragment shader.

We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor600g: Use a fake reloc to sleep for fences
Simon Farnsworth [Tue, 14 Feb 2012 12:06:20 +0000 (12:06 +0000)]
r600g: Use a fake reloc to sleep for fences

r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Note: this is a candidate for the stable branches.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: consolidate set_blend_color code
Marek Olšák [Tue, 14 Feb 2012 14:24:25 +0000 (15:24 +0100)]
r600g: consolidate set_blend_color code

12 years agor600g: consolidate more translate functions
Marek Olšák [Tue, 14 Feb 2012 14:19:27 +0000 (15:19 +0100)]
r600g: consolidate more translate functions

12 years agor600g: inline r600_translate_ds_func
Marek Olšák [Tue, 14 Feb 2012 14:14:58 +0000 (15:14 +0100)]
r600g: inline r600_translate_ds_func

12 years agor600g: remove unused variable
Marek Olšák [Tue, 14 Feb 2012 14:13:16 +0000 (15:13 +0100)]
r600g: remove unused variable

12 years agor600g: consolidate some translate functions
Marek Olšák [Tue, 14 Feb 2012 14:12:49 +0000 (15:12 +0100)]
r600g: consolidate some translate functions

12 years agoRevert "r600g: don't advertise integer textures without GLSL 1.3"
Marek Olšák [Tue, 14 Feb 2012 14:48:37 +0000 (15:48 +0100)]
Revert "r600g: don't advertise integer textures without GLSL 1.3"

This reverts commit 2c06bcb90982280e82a044b8be83be8fdf5a9590.

It breaks u_blitter trying to blit compressed textures as uint.

12 years agor600g: don't advertise integer textures without GLSL 1.3
Marek Olšák [Tue, 14 Feb 2012 14:04:51 +0000 (15:04 +0100)]
r600g: don't advertise integer textures without GLSL 1.3

12 years agometa: Add pixel store/pack operations in decompress_texture_image
Anuj Phogat [Sat, 11 Feb 2012 00:27:19 +0000 (16:27 -0800)]
meta: Add pixel store/pack operations in decompress_texture_image

This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

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

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
Brian Paul [Mon, 13 Feb 2012 14:20:27 +0000 (07:20 -0700)]
mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case

in _mesa_error_check_format_and_type().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967

12 years agogallivm: Replace architecture test with PIPE_ARCH_*
Stéphane Marchesin [Fri, 10 Feb 2012 03:50:59 +0000 (19:50 -0800)]
gallivm: Replace architecture test with PIPE_ARCH_*

X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

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

12 years agoi915g: Remove useless draw calls.
Stéphane Marchesin [Fri, 10 Feb 2012 04:39:00 +0000 (20:39 -0800)]
i915g: Remove useless draw calls.

12 years agoi915g: Add a way to profile the contents of command buffers.
Stéphane Marchesin [Thu, 9 Feb 2012 06:43:14 +0000 (22:43 -0800)]
i915g: Add a way to profile the contents of command buffers.

12 years agoi915g: Fix comments.
Stéphane Marchesin [Tue, 7 Feb 2012 23:09:26 +0000 (15:09 -0800)]
i915g: Fix comments.

12 years agoi915g: Don't emit state when it's already bound.
Stéphane Marchesin [Tue, 7 Feb 2012 22:33:31 +0000 (14:33 -0800)]
i915g: Don't emit state when it's already bound.

12 years agoi915g: Remove unused poly stipple state.
Stéphane Marchesin [Tue, 7 Feb 2012 22:33:12 +0000 (14:33 -0800)]
i915g: Remove unused poly stipple state.

12 years agoi915g: Implement stipple with draw.
Stéphane Marchesin [Tue, 7 Feb 2012 22:42:30 +0000 (14:42 -0800)]
i915g: Implement stipple with draw.

12 years agoi915g: Fix comment.
Stéphane Marchesin [Mon, 23 Jan 2012 07:44:31 +0000 (23:44 -0800)]
i915g: Fix comment.

12 years agoi915g: Move ureg defines to the header so we can share them.
Stéphane Marchesin [Tue, 7 Feb 2012 03:57:04 +0000 (04:57 +0100)]
i915g: Move ureg defines to the header so we can share them.

12 years agoi915g: Separate declarations and program in the fragment program struct.
Stéphane Marchesin [Sun, 22 Jan 2012 10:22:20 +0000 (02:22 -0800)]
i915g: Separate declarations and program in the fragment program struct.

We need this later to fixup fragment programs properly.

12 years agost/mesa: only resolve if number of samples is > 1
Dave Airlie [Wed, 30 Nov 2011 20:10:19 +0000 (20:10 +0000)]
st/mesa: only resolve if number of samples is > 1

Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
12 years agoswrast: fix span color type selection
Brian Paul [Fri, 3 Feb 2012 15:17:24 +0000 (08:17 -0700)]
swrast: fix span color type selection

Fixes a regression from commit 660ed923ded3552e023ef8c3dd9f92e6792f1bd2.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agoextensions: remove unused code.
Dave Airlie [Sun, 12 Feb 2012 16:07:19 +0000 (16:07 +0000)]
extensions: remove unused code.

Comparing an unsigned to < 0 is pointless.

Signed-off-by: Dave Airlie <airlied@redhat.com>