aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965: Make the userclip flag for the VUE map come from VS prog data.Eric Anholt2012-02-2110-39/+29
| | | | | | | | This reduces recomputation of state based on non-clipping-related transform changes, and is a step toward removing VUE map recomputation. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix issues with texture border and array texturesAnuj Phogat2012-02-211-11/+59
| | | | | | | | | | | For a 1D texture array, the border only applies to the width. For a 2D texture array the border applies to the width and height but not the depth. Sucha cases were not handled correctly in _mesa_init_teximage_fields(). Note: This is a candidate for stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: check for no state change in glPrimitiveRestartIndex()Brian Paul2012-02-201-4/+5
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: check for no state change in Enable/DisableVertexAttribArray()Brian Paul2012-02-201-10/+22
| | | | | | | Avoid setting dirty state flags when enabling or disabling a vertex attribute arrays when there's no change. Reviewed-by: José Fonseca <[email protected]>
* mesa: add missing return after _mesa_error() in update_array()Brian Paul2012-02-201-0/+1
| | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* i965: Make the dummy fragment shader work in SIMD16 mode.Kenneth Graunke2012-02-181-5/+7
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix GPU hangs in the dummy fragment shader.Kenneth Graunke2012-02-181-0/+2
| | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Eliminate short-circuiting in invalid-start case.Kenneth Graunke2012-02-171-5/+1
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Rework checking of 'end' against _MaxElement.Kenneth Graunke2012-02-171-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: Ignore invalid element ranges which are outside VBO bounds.Kenneth Graunke2012-02-171-0/+25
| | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v1] Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: Remove pedantic warning about 'end' beind out of bounds.Kenneth Graunke2012-02-171-47/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* intel: Fix rendering from textures after RenderTexture().Eric Anholt2012-02-175-61/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* intel: Improve the fallback debug for framebuffer status checks.Eric Anholt2012-02-171-2/+17
|
* mesa: Only end render-to-texture at bind time for drawbuffers.Eric Anholt2012-02-171-5/+2
| | | | | If we're only starting for new draw buffers, why would we end for old read buffers along with draw buffers?
* mesa: Update the version string to 8.1-develIan Romanick2012-02-161-1/+1
| | | | | | The numeric version was updated in 46883e0. Signed-off-by: Ian Romanick <[email protected]>
* mesa: add missing texture integer test in glTexSubImage()Brian Paul2012-02-161-0/+11
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Emit Ivybridge VS workaround flushes.Kenneth Graunke2012-02-154-2/+29
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.Eric Anholt2012-02-151-2/+17
| | | | | | | Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix push/pop of multisample coverage invert.Eric Anholt2012-02-151-5/+0
| | | | | | | | In the table of of push/pop attributes, this one doesn't fall under the enable group. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Only avoid empty _TexEnvProgramsIan Romanick2012-02-151-1/+2
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Chad Versace <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
* st/mesa: fix typo: s/patent/parent/Brian Paul2012-02-151-1/+1
|
* st/mesa: remove unused st_equal_formats() functionBrian Paul2012-02-152-21/+0
| | | | | | It was incomplete and didn't take byte swapping into account either. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()Brian Paul2012-02-151-1/+3
| | | | | | st_equal_formats() is no longer used now. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove INLINE qualifiersBrian Paul2012-02-151-2/+2
| | | | | | | from st_get/create_texture_sampler_view_from stobj() functions. No real value in these cases. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: simplify st_create_texture_sampler_view()Brian Paul2012-02-151-12/+9
| | | | | | Implement in terms of st_create_texture_sampler_view_format(). Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove unused st_get_texture_sampler_view()Brian Paul2012-02-151-16/+0
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use private pipe_sampler_view in decompress_with_blit()Brian Paul2012-02-151-4/+18
| | | | | | | | | | 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 <[email protected]>
* st/mesa: use private pipe_sampler_view in st_render_mipmap()Brian Paul2012-02-151-3/+7
| | | | | | | 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 <[email protected]>
* mesa: use z32f_x24s8 struct in format pack/unpack codeBrian Paul2012-02-152-21/+30
| | | | | | | | And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row(). As suggested by José. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: assorted clean-ups in st_cb_fbo.cBrian Paul2012-02-151-19/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove st_framebuffer_renderbuffer()Brian Paul2012-02-151-14/+1
| | | | | | Just use _mesa_framebuffer_renderbuffer(). Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove st_get_default_texture()Brian Paul2012-02-154-57/+4
| | | | | | Just use _mesa_get_fallback_texture() instead. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix _mesa_get_fallback_texture() to handle all texture targetsBrian Paul2012-02-155-37/+113
| | | | | | | | | | | | 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 <[email protected]>
* st/mesa: improve assertion/check for stencil formatBrian Paul2012-02-151-8/+2
|
* mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack codeBrian Paul2012-02-151-0/+13
| | | | | | | | 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 <[email protected]>
* st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()Brian Paul2012-02-151-42/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffersBrian Paul2012-02-151-0/+6
| | | | | | | | | | | 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 <[email protected]>
* st/mesa: use u_surface_default_template() helperBrian Paul2012-02-151-3/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove redundant memset(surface_template,0)Brian Paul2012-02-151-1/+0
| | | | | | The subsequent u_surface_default_template() call does that for us. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove st_renderbuffer::strideBrian Paul2012-02-152-8/+6
| | | | | | It was only used for software buffers and easily computed. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: remove st_renderbuffer::formatBrian Paul2012-02-153-17/+10
| | | | | | We only used it in a few places that can implemented differently. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix comment typos in fbobject.cBrian Paul2012-02-151-2/+2
|
* i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.Kenneth Graunke2012-02-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965/fs: Add a new fs_inst::regs_written function.Kenneth Graunke2012-02-151-0/+12
| | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* meta: Avoid FBO resizing/reallocating in decompress_texture_imageAnuj Phogat2012-02-151-1/+1
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i915: Fix type of "specoffset" variable.Paul Berry2012-02-141-1/+1
| | | | | | | | | | | | | | | | | 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 <[email protected]>
* i965/fs: Enable register spilling on gen7 too.Eric Anholt2012-02-141-2/+0
| | | | | | | | | | 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 <[email protected]>
* i965: Report the failure message when failing to compile the fragment shader.Eric Anholt2012-02-141-0/+3
| | | | | | | | 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 <[email protected]>
* meta: Add pixel store/pack operations in decompress_texture_imageAnuj Phogat2012-02-131-5/+3
| | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV caseBrian Paul2012-02-131-0/+9
| | | | | | in _mesa_error_check_format_and_type(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967