aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: Don't advertise GLES extensions in GL contextsChad Versace2012-09-061-5/+6
| | | | | | | | | | | | | | | | glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so returned all internally enabled GLES extensions from a GL context. Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the context's API. Note: This is a candidate for the 8.0 and 9.0 branches. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]> (cherry picked from commit f29a4b0157c6a7a31d2a2991a431b4211d01d162) Conflicts: src/mesa/main/extensions.c
* android: do not expose single buffered eglconfigsTapani Pälli2012-08-311-11/+8
| | | | | | | | | | | | | On Android we want to add only double buffered configs for visuals. Earlier implementation set the SurfaceType as 0 for single buffered configs but driver still exposed these configs that were not compatible with any egl surface type. This caused Khronos conformance test runs to fail on Android. This patch fixes the issue by skipping single buffered configs earlier and not exposing them. Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]> (cherry picked from commit d58ca43b809593314907694e744780ab9b28d590)
* xmlconfig: use __progname when building for AndroidTapani Pälli2012-08-311-1/+1
| | | | | | | | __progname symbol and strrchr are available with bionic. Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chad Versace <[email protected]> (cherry picked from commit 4d02b018f456c447e2c24ebd1460c27d6e5fb385)
* i965: Fix bug in the old FS backend's projtex() calculation.Eric Anholt2012-08-261-3/+1
| | | | | | | | | | | | In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not just texcoords. Now that we have _mesa_vert_result_to_frag_attrib(), we can fill in the other FS inputs with correct proj_attrib_mask info. NOTE: This is a candidate for stable branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644 Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use GLdouble for depthMax in final unpack conversions.Kenneth Graunke2012-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | The final step of _mesa_unpack_depth_span is to take the temporary GLfloat depth values and convert them to the desired format. When converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use double-precision math to avoid overflow and precision problems. Or at least that's the idea. Unfortunately GLdouble z = depthValues[i] * (GLfloat) depthMax; actually causes single-precision multiplication, since both operands are GLfloats. Casting depthMax to GLdouble causes the scaling to be done with double-precision math. Fixes a regression in oglconform's depth-stencil basic.read.ds test since c60ac7b17993d28af65b04f9bbbf3ee74c35358c, where the expected and actual values differed slightly. For example, 0xcfa7a6 vs. 0xcfa7a4. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772 Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: fix html in shortlog_mesa.sh scriptAndreas Boll2012-08-161-4/+4
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: added Ian's shortlog_mesa.sh script in bin/Brian Paul2012-08-161-0/+23
|
* i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.Paul Berry2012-08-052-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | In i965 Gen7, Mesa has for a long time used the "depth coordinate offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to render to miplevels other than 0. Unfortunately, this doesn't work, because these offsets must be aligned to multiples of 8, and miplevels in the depth buffer are only guaranteed to be aligned to multiples of 4. When the offsets aren't aligned to a multiple of 8, the GPU sometimes hangs. As a temporary measure, to avoid GPU hangs, this patch smashes the 3 LSB's of "depth coordinate offset X/Y" to 0. This results in incorrect rendering to mipmapped depth textures, but that seems like a reasonable stopgap while we figure out a better solution. Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at texture sizes that are not powers of 2. Reviewed-by: Chad Verace <[email protected]> Cherry-picked from 714b4f6184db84a738cf2d063980f0e19ab03b4b Conflicts: src/mesa/drivers/dri/i965/gen7_misc_state.c Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50271
* i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.Paul Berry2012-08-052-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In i965 Gen6, Mesa has for a long time used the "depth coordinate offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to render to miplevels other than 0. Unfortunately, this doesn't work, because these offsets must be aligned to multiples of 8, and miplevels in the depth buffer are only guaranteed to be aligned to multiples of 4. When the offsets aren't aligned to a multiple of 8, the GPU sometimes hangs. As a temporary measure, to avoid GPU hangs, this patch smashes the 3 LSB's of "depth coordinate offset X/Y" to 0. This results in incorrect rendering to mipmapped depth textures, but that seems like a reasonable stopgap while we figure out a better solution. (Note that we have only ever observed this GPU hang on Gen6 when HiZ is enabled, so another possible stopgap would be to disable HiZ). Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at texture sizes that are not powers of 2. Reviewed-by: Chad Verace <[email protected]> Cherry-picked from a683012a80a3408b3b71f22b2a97d9eaaac11a46 Conflicts: src/mesa/drivers/dri/i965/brw_misc_state.c Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50271
* st/egl: fix uninitialized pointer bugBrian Paul2012-07-311-1/+1
| | | | | | | If no format is matched in the loop the value of xconf was undefined. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit fe2a7b7e7fca599659b1d248e160d480f2b92ba2)
* mesa: remove assertions that do not allow compressed 2D_ARRAY texturesMarek Olšák2012-07-311-4/+2
| | | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Alex Deucher <[email protected]> (cherry picked from commit 13b0af721a6ff9e98d47a2c0a740fe843c034016)
* i965/fs: Invalidate live intervals in passes that remove an instruction.Eric Anholt2012-07-311-0/+6
| | | | | | | | | | Since live intervals are based on ip, removing an instruction trashes the intervals unless we were to go do some surgery. These happen to usually remove a use of a grf, so it's time to recalculate, anyway. Reviewed-by: Kenneth Graunke <[email protected]> NOTE: This is a candidate for the 8.0 release branch. (cherry picked from commit 2343fe9a5d1786413453e6e8e5c7700143d68a26)
* i965: Avoid unnecessary recompiles for shaders that don't use dFdy().Paul Berry2012-07-314-14/+10
| | | | | | | | | | | | | | | | | The i965 back-end needs to compile dFdy() differently for FBOs and window system framebuffers, because Y coordinates are flipped between the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs). This patch avoids unnecessarily recompiling shaders that don't use dFdy(), by only setting render_to_fbo in the wm program key if the shader actually uses dFdy(). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit d08fdacd58dfa6b1926e9df4707dd9e8dd5370c5) Conflicts: src/mesa/drivers/dri/i965/brw_wm.c
* mesa: Add UsesDFdy to struct gl_fragment_program.Paul Berry2012-07-312-0/+3
| | | | | | | | | | | | | The i965 back-end needs to compile dFdy() differently for FBOs and window system framebuffers, because Y coordinates are flipped between the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs). This boolean will allow it to avoid unnecessarily recompiling shaders that don't use dFdy(). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit 5e310e9f8300a357d6bdaf098c72098518b564f3)
* i965: Compute dFdy() correctly for FBOs.Paul Berry2012-07-316-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On i965, dFdx() and dFdy() are computed by taking advantage of the fact that each consecutive set of 4 pixels dispatched to the fragment shader always constitutes a contiguous 2x2 block of pixels in a fixed arrangement known as a "sub-span". So we calculate dFdx() by taking the difference between the values computed for the left and right halves of the sub-span, and we calculate dFdy() by taking the difference between the values computed for the top and bottom halves of the sub-span. However, there's a subtlety when FBOs are in use: since FBOs use a coordinate system where the origin is at the upper left, and window system framebuffers use a coordinate system where the origin is at the lower left, the computation of dFdy() needs to be negated for FBOs. This patch modifies the fragment shader back-ends to negate the value of dFdy() when an FBO is in use. It also modifies the code that populates the program key (brw_wm_populate_key() and brw_fs_precompile()) so that they always record in the program key whether we are rendering to an FBO or to a window system framebuffer; this ensures that the fragment shader will get recompiled when switching between FBO and non-FBO use. This will result in unnecessary recompiles of fragment shaders that don't use dFdy(). To fix that, we will need to adapt the GLSL and NV_fragment_program front-ends to record whether or not a given shader uses dFdy(). I plan to implement this in a future patch series; I've left FIXME comments in the code as a reminder. Fixes Piglit test "fbo-deriv". NOTE: This is a candidate for stable release branches. Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit 82d25963a838cfebdeb9b080169979329ee850ea)
* intel: use _mesa_is_winsys/user_fbo() helpersBrian Paul2012-07-3116-32/+48
| | | | | Reviewed-by: Eric Anholt <[email protected]> (cherry picked from commit 4433b0302d0aa9dc61002e8bb4fd1b752b0be338)
* mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functionsBrian Paul2012-07-317-48/+52
| | | | | | | Rather than testing the fbo's name against zero. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 36ede89687fe2de213f2637ab7acfb80cfd856cd)
* i965/gen7: Reduce GT1 WM thread count according to updated BSpec.Eric Anholt2012-07-271-1/+1
| | | | | | | Acked-by: Kenneth Graunke <[email protected]> https://bugs.freedesktop.org/show_bug.cgi?id=52382 (cherry picked from commit fbf86c7f0f1f12e52b927e3870535073879d0a4d)
* docs/relnotes-8.0.4: fix html markupAndreas Boll2012-07-101-44/+41
| | | | (cherry picked from commit 40742fa6864000d431b81c3769a3136b7ff4a0d1)
* docs: Add 8.0.4 release md5sumsIan Romanick2012-07-101-1/+3
| | | | Signed-off-by: Ian Romanick <[email protected]>
* docs: Add 8.0.4 release notesmesa-8.0.4Ian Romanick2012-07-102-0/+203
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: Bump version number to 8.0.4Ian Romanick2012-07-103-4/+4
| | | | Signed-off-by: Ian Romanick <[email protected]>
* st/mesa: don't do srgb->linear conversion in decompress_with_blitMarek Olšák2012-07-061-0/+1
| | | | | | | | | This fixes piglit/getteximage-formats on r600g. NOTE: This is a candidate for stable branches. Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit 5e7e7d96b341e937d3b795e94ac4a863c357f724)
* gallium/targets: pass ldflags parameter to MKLIBThomas Gstädtner2012-07-061-1/+1
| | | | | | | | | | | | Without passing the -ldflags parameter before $(LDFLAGS) in some cases flags will be passed to MKLIB which it does not understand. This might be -m64, -m32 or similar. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Thomas Gstädtner <[email protected]> Signed-off-by: Brian Paul <[email protected]> (cherry picked from commit 93594f38be75227879b835a2037b7466adbd70ef)
* st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.Vinson Lee2012-07-061-0/+4
| | | | | | | | | | Fixes uninitialized member defects reported by Coverity. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit 70d038e46eb877ffa922003c78630eb7eb76c0f3)
* r600g: check gpr count limitVadim Girlin2012-07-061-0/+8
| | | | | | | | | | | This should help to prevent gpu lockups. See https://bugs.freedesktop.org/show_bug.cgi?id=48472 NOTE: This is a candidate for the stable branches. Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (cherry picked from commit 783e4da72aa203a645737dec81b001341951a942)
* st/mesa: fix max_offset computation for base vertexBrian Paul2012-07-061-2/+18
| | | | | | | | | | | | | | | Add the maximum base vertex offset to max_index for computing the buffer size. Fixes a failed assertion in the u_upload_mgr.c code with the VMware svga driver. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48141 v2: incorporate Marek's suggestions. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 299c9052e832712654865af8dbd0ed4bf055d124)
* glsl: Don't trust loop analysis in the presence of function calls.Kenneth Graunke2012-07-062-0/+34
| | | | | | | | | | | | | | | | | | | | | | Function calls may have side effects that alter variables used inside the loop. In the fragment shader, they may even terminate the shader. This means our analysis about loop-constant or induction variables may be completely wrong. In general it's impossible to determine whether they actually do or not (due to the halting problem), so we'd need to perform conservative static analysis. For now, it's not worth the complexity: most functions will be inlined, at which point we can unroll them successfully. Fixes Piglit tests: - shaders/glsl-fs-unroll-out-param - shaders/glsl-fs-unroll-side-effect NOTE: This is a candidate for release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit 0405bd08ca0e01ebc68891ee1ff47d320983f775)
* draw: fix missing immediates bug in polygon stipple codeBrian Paul2012-07-061-0/+5
| | | | | | | | | The function that counts the number of TGSI immediates also needs to emit the immediates. This fixes assorted failures when using polygon stipple with fragment shaders that have their own immediates. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 7f16246acef4089570abca76a59580691ec6cf68)
* st/mesa: fix mipmap image size computation w.r.t. texture arraysBrian Paul2012-07-061-3/+15
| | | | | | | | | | The image height or depth is the array_size for array textures. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742 NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Jakob Bornecrantz <[email protected]> (cherry picked from commit 318669f196ca922337da02af9d72773e76e70b45)
* st/mesa: add null pointer check in st_texture_image_map()Brian Paul2012-07-061-0/+3
| | | | | | | | | | | | | If we failed to allocate a memory resource for the texture we'd crash when we tried to map it. Now we propogate the NULL back up to the texstore code and generate GL_OUT_OF_MEMORY. Fixes a crash with the upcoming piglit max-texture-size test. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 03f8a97d718502f60d16000aead251d88a751149)
* st/mesa: use private pipe_sampler_view in decompress_with_blit()Brian Paul2012-07-061-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]> (cherry picked from commit 0315cb9f8f3ec38fa9594860754fb53a67cf4c23)
* st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffersBrian Paul2012-07-061-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]> (cherry picked from commit 5a70e12fc0897a3178c73b20d99fc0f11b180374)
* draw: Ensure that prepare is always run after LLVM garbagge collection.José Fonseca2012-07-061-0/+5
| | | | | | | | | | | Should avoid dangling pointer derreference with glean --run results --overwrite --quick --tests texSwizzle NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]> (cherry picked from commit 07635a4799b15a7575e1feb8859ecc7734850deb)
* svga: reset vertex buffer offset in svga_release_user_upl_buffers()Brian Paul2012-07-061-0/+11
| | | | | | | | | | | | | | | This function releases the buffer that contains user-space vertex data. The buffer_offset field points into that buffer. So reset the buffer_offset to zero when we release the buffer so that subsequent draws don't inadvertantly get a bad offset. Fixes error messages / failed assertions (in the draw module's bounds/size checking code) when running piglit's polygon-mode test. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 04341e51cea32d6e54d99019dd00ec56e77e27f9)
* svga: move svga_texture() casts/calls in svga_surface_copy()Brian Paul2012-07-061-2/+4
| | | | | | | | | | | | | | | To fix failed assertions when calling glCopyBufferSubData(). svga_texture() asserts that the resource is a texture. Simply move the calls to svga_texture() after the code that handles non-texture copies so that we don't call it with non-texture resources. Fixes glean bufferObject failure. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 7f2e12812a2208330ef8704e7c4721ececd2aab3)
* st/mesa: copy num_immediates field when copying the immediates arrayBrian Paul2012-07-061-1/+5
| | | | | | | | | | | | | | | | Two assignments to num_immediates were missing in get_pixel_transfer_visitor() and get_bitmap_visitor(). The uninitialized value led to valgrind errors and crashes in some cases. Added new assertions to catch future problems in this area. Also changed num_immediates to unsigned to avoid signed/unsigned comparison warnings. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit fdae0eaf222f271bfbc7e71d8561eb8b90685ae5)
* st/mesa: add fallback pipe formats for (compressed) R, RG formatsBrian Paul2012-07-061-12/+22
| | | | | | | | | | | | If we don't find an exact PIPE_FORMAT_x for a GL_(COMPRESSED)_RED/RG format, try uncompressed formats. We were already doing this for the RGB(A) formats. Fixes piglit arb_texture_compression-internal-format-query test. NOTE: This is a candidate for the stable branches. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 75f37ddba7e5a297390299be0dab8377ea40f5c8)
* i915g: Don't avoid flushing when we have a pending fence.Stéphane Marchesin2012-07-061-1/+4
| | | | | | | | Otherwise the fence will never arrive. Also check for a NULL i915->batch. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 32b07bb1496f5772ca16e719bb87e1702ceff196)
* i915g: Don't invert signalled/unsignalled fencesStéphane Marchesin2012-07-061-2/+2
| | | | | NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 2b4afdba05abe3408f6347be82465b6420f50aab)
* svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0Brian Paul2012-07-061-1/+1
| | | | | | | | | | The legal range for the device is apparently [-16.0, +15.0]. Limiting the range to [-15, +15] fixes piglit's lodbias test. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit a9eda41539bd63ed1835556ad3afc77ee01f6a6a)
* svga: fix min/max lod clampingBrian Paul2012-07-061-4/+6
| | | | | | | | | | | The interaction between the mipmap lod min/max limits and the texture base/max level limits is kind of tricky. Changing the base level didn't work as expected before. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit fd890873b20de553078fc96d977fbd858238c7d9)
* svga: add 0.5 in float->int conversion of sample min/max lodBrian Paul2012-07-061-2/+2
| | | | | | | | | This makes lod clamping more consistent with other drivers. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]> (cherry picked from commit 5abcd198b8e644c0d97c6766c6707e20fe22f0fb)
* st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium driversBrian Paul2012-07-062-0/+4
| | | | | | | when mapping renderbuffers or texture images. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 84c7c14697c82fe25586f8186b4f47d80a6f05f9)
* glsl: Fix pi/2 constant in acos built-in functionIan Romanick2012-07-061-4/+4
| | | | | | | | | | | | | | | | | In single precision, 1.5707963 becomes 1.5707962513 which is too small. However, 1.5707964 becomes 1.5707963705 which is just right. The value 1.5707964 is already used in asin.ir. NOTE: This is a candidate for stable release branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Olivier Galibert <[email protected]> Reviewed-by: Paul Berry <[email protected]> (cherry picked from commit 4bfdc8313592ec8a8794d6b7bc33a5c44df34ed4) Conflicts: src/glsl/builtins/ir/acos.ir
* mesa: Free uniforms correclty.Antoine Labour2012-07-061-1/+2
| | | | | | | | | This is an array of uniforms, not a single one. Reviewed-by: Ian Romanick <[email protected]> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit e2e9b4b10fcf3ba6358b9be54638f850523af82e)
* meta: Cleanup the resources we allocate.Antoine Labour2012-07-061-6/+66
| | | | | | | | | | | | When we have multiple shared contexts, and one of them is long-running, this will lead to never freeing those resources since they are shared. Instead, free them right away on context destruction since we know the other context isn't using them. Reviewed-by: Ian Romanick <[email protected]> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 53feb8ecdc74502c940a749b9ce89e68625c69a5)
* glx: Handle a null reply in QueryVersion.Stéphane Marchesin2012-07-061-0/+3
| | | | | | | | | Works around crashes when X connections break. Reviewed-by: Ian Romanick <[email protected]> NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 0256edd709d976198d5354fdd88143d8da9e51d5)
* glsl: Hook up loop_variable_state destructor to plug a memory leak.Kenneth Graunke2012-07-061-0/+17
| | | | | | | | | | | | | | While ~loop_state() is already freeing the loop_variable_state objects via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor was never getting called, so the hash table inside loop_variable_state was never getting destroyed. Fixes a memory leak in any shader with loops. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> (cherry picked from commit 3603fdcebfa25e2217f1dbfb0a99261be3e84b02)
* i965/fs: Fix user-defined FS outputs with less than four components.Kenneth Graunke2012-07-062-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenGL allows you to declare user-defined fragment shader outputs with less than four components: out ivec2 color; This makes sense if you're rendering to an RG format render target. Previously, we assumed that all color outputs had four components (like the built-in gl_FragColor/gl_FragData variables). This caused us to call emit_color_write for invalid indices, incrementing the output virtual GRF's reg_offset beyond the size of the register. This caused cascading failures: split_virtual_grfs would allocate new size-1 registers based on the virtual GRF size, but then proceed to rewrite the out-of-bounds accesses assuming that it had allocated enough new (contiguously numbered) registers. This resulted in instructions that accessed size-1 GRFs which register numbers beyond virtual_grf_next (i.e. registers that were never allocated). Finally, this manifested as live variable analysis and instruction scheduling accessing their temporary array with an out of bounds index (as they're all sized based on virtual_grf_next), and the program would segfault. It looks like the hardware's Render Target Write message requires you to send four components, even for RT formats such as RG or RGB. This patch continues to use all four MRFs, but doesn't bother to fill any data for the last few, which should be unused. +2 oglconforms. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (cherry picked from commit 2f18698220d8b27991fab550c4721590d17278e0) Conflicts: src/mesa/drivers/dri/i965/brw_fs.h Signed-off-by: Ian Romanick <[email protected]>