summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Use foreach_list in lower_jumps.cppPaul Berry2011-07-081-1/+12
| | | | | | | | | | | | | | | | | | | | | | | The visitor class in lower_jumps.cpp never removes or replaces the instruction being visited, but it frequently alters or removes the instructions that follow it. Therefore, to make sure the altered IR is visited, it needs to iterate through exec_lists using foreach_list rather than visit_exec_list(). Without this patch, lower_jumps.cpp may require multiple passes in order to lower all jumps. This results in sub-optimal output because lower_jumps.cpp produces a brand new set of temporary variables each time it is run, and the redundant temporary variables are not guaranteed to be eliminated by later optimization passes. Also, certain invariants assumed by lower_jumps.cpp may fail to hold, causing assertion failures. Fixes unit tests test_lower_pulled_out_jump, test_lower_unified_returns, test_lower_guarded_conditional_break, test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: lower unconditional returns and continues in loops.Paul Berry2011-07-081-8/+54
| | | | | | | | | | | | | | | | | Previously, lower_jumps.cpp would only lower return and continue statements that appeared inside conditionals. This patch makes it lower unconditional returns and continue statements that occur inside a loop. Such unconditional flow control statements would be unlikely to be explicitly coded by a reasonable user, however they might arise as a result of other optimizations. Without this patch, lower_jumps.cpp might not lower certain return and continue statements, causing some backends to fail. Fixes unit tests test_lower_return_void_at_end_of_loop and test_remove_continue_at_end_of_loop.
* glsl: Lower unconditional return statements.Paul Berry2011-07-081-0/+14
| | | | | | | | | | Previously, lower_jumps.cpp only lowered return statements that appeared inside of an if statement. Without this patch, lower_jumps.cpp might not lower certain return statements, causing some back-ends to fail (as in bug #36669). Fixes unit test test_lower_returns_1.
* glsl: Refactor logic for determining whether to lower return statements.Paul Berry2011-07-081-7/+12
| | | | | | | | Previously, do_lower_jumps.cpp determined whether to lower return statements in ir_lower_jumps_visitor::should_lower_jumps(). Moved this logic to ir_lower_jumps_visitor::visit(ir_function_signature *), so that it can be used in determining whether to lower a return statement at the end of a function.
* glsl: Add explanatory comments to lower_jumps.cpp.Paul Berry2011-07-081-14/+322
| | | | | | No functional change. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Make ir_reader able to read plain (return) statements.Paul Berry2011-07-081-11/+13
| | | | | | | | | Previously ir_reader was only able to handle return of non-void. This patch is necessary in order to allow optimization passes to be tested in isolation. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Remove unused function prototypes.Paul Berry2011-07-081-2/+0
| | | | | No functional change. Remove prototypes for do_mod_to_fract() and do_sub_to_add_neg(), which haven't existed since November 2010.
* gallivm: Fix build with llvm-3.0Gustaw Smolarczyk2011-07-081-9/+7
| | | | | | | | | | LLVM 3.0svn changes pretty rapidly. The change in Target->createMCInstPrinter() signature which inspired commits 40ae214067673edbda79371969d1730b6194d83e and 92e29dc5b0474c073b0f05d60629fc6c3decfca4 has been reverted. Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* st/mesa: handle float formats in st_format_datatypeMarek Olšák2011-07-081-2/+14
| | | | | | NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: use the first non-VOID channel in st_format_datatypeMarek Olšák2011-07-081-3/+16
| | | | | | | | Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail. NOTE: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Brian Paul <[email protected]>
* mesa/st: Fix piglit read-front with new drawable invalidation v2Thomas Hellstrom2011-07-081-0/+9
| | | | | | | | | | | | | When the state tracker adds a front buffer, nothing triggers a validate drawable call, since the state tracker manager is never notified. Force a validate drawable call by invalidating the framebuffer's stamp, so that the window system's renderbuffer (if any) is picked up. This fixes bug 38988 https://bugs.freedesktop.org/show_bug.cgi?id=38988 Signed-off-by: Thomas Hellstrom <[email protected]>
* i915g: Make the optimizer more generic.Stéphane Marchesin2011-07-071-27/+58
|
* intel: add null src pointer check in intel_region_reference()Brian Paul2011-07-071-1/+2
| | | | | | | | Fixes segfault when running cubemap demo on i945. This happened when intel_region_reference() was called in i915_set_draw_region() with depth_region=NULL. Reviewed-by: Eric Anholt <[email protected]>
* glsl: use casts to silence warningBrian Paul2011-07-071-1/+1
|
* scons: Generate libGL.so.1.5 and libGL.so.1 symlinks.José Fonseca2011-07-071-5/+8
| | | | In build/xxx/src/gallium/targets/libgl-xlib/SConscript
* intel: Fix use of freed buffer if glBitmap is called after a swap.Eric Anholt2011-07-071-3/+4
| | | | | | | | Regions looked up from the framebuffer are invalid after intel_prepare_render(). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266 Tested-by: Thomas Jones <[email protected]>
* intel: Remove dead comment about software clears -- it's handled just above.Eric Anholt2011-07-071-1/+0
|
* i915: Fix leak of ViewportMatrix data on context destroy.John2011-07-071-0/+2
| | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
* intel: Remove gratuitous context checks in intel_delete_renderbuffer().Eric Anholt2011-07-071-14/+5
| | | | | | | | | Even if we don't have a current context, if we're freeing the rb we should free its region (and BO). The renderbuffer unreference checks appear to be just cargo-cult from the region unreference code. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217 Reviewed-by: Chad Versace <[email protected]>
* intel: Remove now trivial intel_renderbuffer_set_{hiz_,}region().Eric Anholt2011-07-073-57/+19
| | | | | | | | | As a result of this cleanup, a bug in intel_process_dri2_buffer_no_separate_stencil() became quite apparent. We were associating the NULL pointer after an unreference with the STENCIL attachment -- clarify the logic and attach the right region. Reviewed-by: Chad Versace <[email protected]>
* intel: Rely on intel_region_reference()'s support of *dst != NULL.Eric Anholt2011-07-074-18/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* intel: Allow intel_region_reference() with *dst != NULL.Eric Anholt2011-07-071-4/+6
| | | | | | | This should help us avoid leaking regions in region reference code by making the API more predictable. Reviewed-by: Chad Versace <[email protected]>
* intel: Mark MESA_FORMAT_X8_Z24 as always supported.Eric Anholt2011-07-071-1/+1
| | | | | | | | | | This prevents developer surprise at seeing a GL_DEPTH_COMPONENT texture have stencil bits, and avoids the metaops path accidentally copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is broken). Acked-by: Chad Versace <[email protected]>
* i965: Remove unused structures for command packets.Kenneth Graunke2011-07-071-433/+0
| | | | | | | | | We simply emit these using OUT_BATCH and bitshifting, as it results in better compiled code than packed structures. Since our documentation is public, it's not terribly useful to keep these around for reference. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Convert system instruction pointer to OUT_BATCH style.Kenneth Graunke2011-07-072-14/+5
| | | | | | | | Also rename it from CMD_STATE_INSN_POINTER to CMD_STATE_SIP to match the documentation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Convert PIPELINE_SELECT to OUT_BATCH style.Kenneth Graunke2011-07-071-10/+4
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.Kenneth Graunke2011-07-072-18/+4
| | | | | | | | This is a little different from most because it's a single DWord; there's no length field. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.Kenneth Graunke2011-07-072-19/+5
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix the BindSampler unit limit.Henri Verbeet2011-07-071-1/+1
| | | | | | | | | | | I'm not sure about this one. The current code actually follows the spec, but considering the spec is supposed to be written against GL 3.2 I'd say the spec is broken. I filled out a spec feedback form over a month ago, but either the form is broken, or nobody cares. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix a couple of TexEnv unit limits.Henri Verbeet2011-07-071-3/+3
| | | | | | | | NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Use the Elements macro for the sampler index assert in ↵Henri Verbeet2011-07-071-1/+1
| | | | | | | | | | | | validate_samplers(). This is probably nicer if the array size ever changes. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.Henri Verbeet2011-07-073-4/+4
| | | | | | | | | | | | The total number of units used by a shader is limited to MAX_TEXTURE_UNITS, but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS, since they're shared between vertex and fragment shaders. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Check the texture against all units in unbind_texobj_from_texunits().Henri Verbeet2011-07-071-1/+1
| | | | | | | | NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nv50,nvc0: use screen instead of context for flush notifierChristoph Bumiller2011-07-078-30/+26
| | | | | Context may become NULL and we still have to be able to flush pending fences.
* nv50: more formats for nv50_resource_copy_region conversion pathChristoph Bumiller2011-07-071-16/+7
| | | | | | | It's not supposed to do conversion, but st sometimes asks us to. Sometimes conversion is even wrong (e.g. between UNORM and SRGB). This should now include all formats the 2D engine supports.
* i915g: Apply optimization to ADDS/MUL and only if we're not saturating.Stéphane Marchesin2011-07-071-6/+27
|
* st/xa: Fix up error reporting. Disable component alpha.Thomas Hellstrom2011-07-071-11/+26
| | | | | | Component alpha is temporarily disabled since it seems a bit buggy. Signed-off-by: Thomas Hellstrom <[email protected]>
* st/xa: Fix render to xa_format_a8, which is backed by a gallium L8 textureThomas Hellstrom2011-07-075-38/+87
| | | | Signed-off-by: Thomas Hellstrom <[email protected]>
* i915g: move code after declarationBrian Paul2011-07-061-1/+2
|
* linker: Assign locations for fragment shader outputIan Romanick2011-07-061-33/+75
| | | | | | | | | | | | | | | | | | | | | Fixes an assertion failure in the piglib out-01.frag ARB_explicit_attrib_location test. The locations set via the layout qualifier in fragment shader were not being applied to the shader outputs. As a result all of these variables still had a location of -1 set. This may need some more work for pre-3.0 contexts. The problem is dealing with generic outputs that lack a layout qualifier. There is no way for the application to specify a location (glBindFragDataLocation is not supported) or query the location assigned by the linker (glGetFragDataLocation is not supported). NOTE: This is a candidate for the 7.10 and 7.11 branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624 Reviewed-by: Eric Anholt <[email protected]> Cc: Kenneth Graunke <[email protected]> Cc: Vinson Lee <[email protected]>
* glsl: Don't choke when printing an anonymous function parameterIan Romanick2011-07-061-0/+10
| | | | | | | NOTE: This is a candidate for the 7.10 and 7.11 branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584 Reviewed-by: Kenneth Graunke <[email protected]>
* ir_to_mesa: Allocate temporary instructions on the visitor's ralloc contextIan Romanick2011-07-061-16/+12
| | | | | | | | | | | | And don't delete them. Let ralloc clean them up. Deleting the temporary IR leaves dangling references in the prog_instruction. That results in a bad dereference when printing the IR with MESA_GLSL=dump. NOTE: This is a candidate for the 7.10 and 7.11 branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Track initial mask in constant propagation live setIan Romanick2011-07-061-3/+14
| | | | | | | | | | | | | The set of values initially available (before any kills) must be tracked with each constant in the set. Otherwise the wrong component can be selected after earlier components have been killed. NOTE: This is a candidate for the 7.10 and 7.11 branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383 Reviewed-by: Eric Anholt <[email protected]> Cc: Kenneth Graunke <[email protected]> Cc: Matthias Bentrup <[email protected]>
* i915g: Fix optimize so that it actually gets used.Stéphane Marchesin2011-07-061-1/+1
|
* mesa: fix texstore addressing bugs for depth/stencil formatsBrian Paul2011-07-061-12/+9
| | | | | | | | | | Using GLuint pointers worked when the pixel size was four bytes or the row stride was a multiple of four but was otherwise broken. Fixes failures found with the piglit fbo-stencil test. This helps to fix https://bugs.freedesktop.org/show_bug.cgi?id=38729 NOTE: This is a candidate for the 7.11 branch.
* softpipe: add missing stencil format case in convert_quad_stencil()Brian Paul2011-07-061-0/+1
| | | | | | Part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=38729 NOTE: This is a candidate for the 7.11 branch
* tgsi: add some debug/print code in exec_tex(), disabledBrian Paul2011-07-061-0/+11
|
* softpipe: minor clean-ups in sp_quad_depth_test.cBrian Paul2011-07-061-5/+5
|
* i915g: Fix optimization, also make it more generic.Stéphane Marchesin2011-07-061-2/+26
|
* mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)Eric Anholt2011-07-061-1/+1
| | | | | | | | | | | The existing error result doesn't appear in the GL 2.1 or 3.2 compatibility specs, and triggers an unexpected GL error in Intel's oglconform when it tries to reset the feedback state after usage so that the "diff the state at error time vs. context init time" code doesn't generate spurious diffs. The unexpected GL error then translates into testcase failure. Brian wants the safety check on buffer = NULL, though, so that people can't as easily set up a broken buffer.