summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Revert "glsl: Skip processing the first function's body in do_dead_functions()."Paul Berry2011-08-081-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opt_dead_functions contained a shortcut to skip processing the first function's body, based on the assumption that IR functions are topologically sorted, with callees always coming before their callers (therefore the first function cannot contain any calls). This assumption turns out not to be true in general. For example, the following code snippet gets translated to IR that violates this assumption: void f(); void g(); void f() { g(); } void g() { ... } In practice, the shortcut didn't cause bugs because of a coincidence of the circumstances in which opt_dead_functions is called: (a) we do inlining right before dead function elimination, and inlining (when successful) eliminates all calls. (b) for user-defined functions, inlining is always successful, because previous optimization passes (during compilation) have reduced them to a form that is eligible for inlining. (c) the function that appears first in the IR can't possibly call a built-in function, because built-in functions are always emitted before the function that calls them. It seems unnecessarily fragile to have opt_dead_functions depend on these coincidences. And the next patch in this series will break (c). So I'm reverting the shortcut. The consequence will be a slight increase in link time for complex shaders. This reverts commit c75427f4c8767e131e5fb3de44fbc9d904cb992d. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: inline st_prepare_fragment_program in st_translate_fragment_programBryan Cain2011-08-082-179/+162
| | | | | | | | | This reverts an unnecessary part of commit 4683529048ee and fixes misrendering and an assertion failure in Cogs. Fixes freedesktop.org bug 39888. Reviewed-by: Brian Paul <[email protected]>
* glsl: silence warning about trailing comma in enum listBrian Paul2011-08-081-1/+1
|
* gallium: silence warnings about trailing commas in enum listsBrian Paul2011-08-082-2/+2
|
* mesa: whitespace changesBrian Paul2011-08-081-5/+8
|
* d3d1x: adapt to resource_resolve interface changeChristoph Bumiller2011-08-071-3/+20
|
* nv50,nvc0: never convert in resource copy when format sizes matchChristoph Bumiller2011-08-072-2/+16
| | | | | | | If there are any cases left where the st thinks that RGBA -> BGRA will swap components, it will get what it deserves. Now the GPU's 2D engine goes unused. What a shame.
* st/mesa: don't resolve stencil twiceChristoph Bumiller2011-08-071-1/+3
|
* winsys/radeon: disable use of the buffer busy-for-write flagMarek Olšák2011-08-061-0/+12
|
* mesa: In validate_program(), initialize errMsg for safety.Kenneth Graunke2011-08-051-1/+1
| | | | | | | | | | | | | | | validate_program relies on validate_shader_program to fill in errMsg; empirically, there exist cases where that doesn't happen. While tracking those down may be worthwhile, initializing the string so we don't try to ralloc_strdup random garbage also seems wise. Fixes issues caught by valgrind while running some test case. NOTE: This is a candidate for stable release branches. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* intel: Fix warnings from gl_constant_parameter changes.Eric Anholt2011-08-053-11/+9
|
* glsl_to_tgsi: replace open-coded swizzle_for_size()Bryan Cain2011-08-051-8/+1
| | | | This is a port of commit 4c7e215c7bb to glsl_to_tgsi.
* glsl_to_tgsi: try to avoid emitting a MOV_SAT to saturate an expression treeBryan Cain2011-08-051-6/+26
| | | | | This is a port of commit 62722d9 to glsl_to_tgsi, with minor aesthetic changes (moved the declaration and assignment of new_inst inside the if block).
* ir_to_mesa: Replace open-coded swizzle_for_size()Eric Anholt2011-08-051-8/+1
|
* glx/dri2: Paper over errors in DRI2Connect when indirectChristopher James Halse Rogers2011-08-051-0/+9
| | | | | | | | | | | | DRI2 will throw BadRequest for this when the client is not local, but DRI2 is an implementation detail and not something callers should have to know about. Silently swallow errors in this case, and just propagate the failure through DRI2Connect's return code. Note: This is a candidate for the stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125 Signed-off-by: Christopher James Halse Rogers <[email protected]>
* ir_to_mesa: Try to avoid emitting a MOV_SAT to saturate an expression tree.Eric Anholt2011-08-051-4/+24
| | | | | | Fixes a regression in codegen quality for ff_fragment_shader conversion to GLSL -- glean texCombine produces 7.5% fewer Mesa IR instructions.
* prog_optimize: Add support for saturates to _mesa_merge_mov_into_inst.Eric Anholt2011-08-051-3/+5
| | | | | This fixes the remaining regression from ff_fragment_shader in Mesa IR instruction count, to now being a 1.9% win overall.
* i965: Add dumping for gen6 WM constants too.Eric Anholt2011-08-053-1/+22
| | | | This looks just like the VS dump for now.
* mesa: Remove dead "MemPool" field of gl_shader_state.Eric Anholt2011-08-051-2/+0
|
* i965/fs: Don't upload unused uniform components.Eric Anholt2011-08-052-4/+95
| | | | | | | | | This saves both register space and upload bandwidth for unused values. Note that previously we were relying on the visitor not initially generating references to different sets of uniforms between the 8-wide and 16-wide code generation, and now we're relying on them dead-code eliminating the same stuff, too.
* i965/fs: Don't allocate the old backend's compile structs for our compile.Eric Anholt2011-08-051-4/+7
| | | | This saves some 35MB when the program only uses GLSL shaders.
* winsys/radeon: do the CS cleanup in the CS ioctl threadMarek Olšák2011-08-051-2/+4
|
* winsys/radeon: fix space checkingMarek Olšák2011-08-054-5/+36
| | | | | | | We should remove the relocations which caused a validation failure from the list, so that the kernel receives only the validated ones. NOTE: This is a candidate for the 7.11 branch.
* st/dri: remove an unused-but-set variableMarek Olšák2011-08-051-7/+0
|
* st/dri: remove a dummy function dri2_create_contextMarek Olšák2011-08-051-15/+1
| | | | It does nothing besides calling dri_create_context with the same parameters.
* st/mesa: remove unused-but-set variables in st_glsl_to_tgsi.cppMarek Olšák2011-08-051-3/+2
|
* r300g: handle new CAPsMarek Olšák2011-08-051-9/+4
|
* r300g: adapt to the resource_resolve interface changeMarek Olšák2011-08-051-21/+22
|
* vbo: do not call _mesa_max_buffer_index in debug buildsMarek Olšák2011-08-051-3/+1
| | | | | | | | | That code drops performance in Unigine Heaven and Tropics by a factor of 10. That's too crazy even for a debug build. NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]>
* glsl: empty declarations should be validChia-I Wu2011-08-052-12/+8
| | | | | | | | | | | | | | | Unlike C++, empty declarations such as float; should be valid. The spec is not explicit about this actually. Some apps that generate their shader sources may rely on this. This was noted when porting one of them to Linux from Windows. Reviewed-by: Chad Versace <[email protected]> Note: this is a candidate for the 7.11 branch.
* mesa: Remove MSVC stdint typedefs from compiler.h.Vinson Lee2011-08-041-23/+1
| | | | MSVC can now include the stdint.h at include/c99/stdint.h.
* mesa: pass correct constant type to _mesa_fetch_state()Brian Paul2011-08-041-1/+1
| | | | Fixes assorted warnings about float vs. gl_constant_value pointers.
* mesa: use gl_constant_value type in ARB program parserBrian Paul2011-08-042-29/+30
|
* mesa: use gl_constant_value type in _mesa_[Get]ProgramNamedParameter4fNV()Brian Paul2011-08-041-10/+10
|
* mesa: add st_glsl_to_tgsi.cpp to SconscriptBrian Paul2011-08-041-0/+1
|
* mesa: fix out of bounds array access in rtgc debug codeBrian Paul2011-08-041-1/+1
| | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39841 This would only be hit if someone set RGTC_DEBUG=1.
* mesa: don't use K&R style function pointer callsBrian Paul2011-08-041-3/+3
|
* Merge branch 'glsl-to-tgsi'Bryan Cain2011-08-0443-323/+5610
|\ | | | | | | | | | | Conflicts: src/mesa/state_tracker/st_atom_pixeltransfer.c src/mesa/state_tracker/st_program.c
| * st/mesa: replace duplicated create_color_map_texture() function with shared ↵Bryan Cain2011-08-044-43/+26
| | | | | | | | function
| * glsl_to_tgsi: remove debugging printfBryan Cain2011-08-041-1/+0
| |
| * glsl_to_tgsi: copy reladdr in st_src_reg(st_dst_reg) constructorBryan Cain2011-08-011-1/+1
| | | | | | | | This is a glsl_to_tgsi port of commit f7cd9a858c04.
| * glsl_to_tgsi: add each relative address to the previousBryan Cain2011-08-011-0/+12
| | | | | | | | This is a glsl_to_tgsi port of commit d6e1a8f71437.
| * glsl_to_tgsi: lower all ir_quadop_vector expressionsBryan Cain2011-08-011-1/+1
| | | | | | | | Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
| * glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_listBryan Cain2011-08-011-47/+88
| |
| * glsl_to_tgsi: update commentsBryan Cain2011-08-011-12/+11
| |
| * glsl_to_tgsi: make coding style more consistentBryan Cain2011-08-011-137/+126
| |
| * glsl_to_tgsi: make assignment hack saferBryan Cain2011-08-011-3/+4
| | | | | | | | Fixes an assertion failure in piglit test glsl-texcoord-array.
| * glsl_to_tgsi: separate immediates from array constants during IR translationBryan Cain2011-08-011-48/+95
| | | | | | | | | | | | | | | | Before, if any uniform or constant array was accessed with indirect addressing, st_translate_program() would emit uniform constants in the place of immediates. This behavior was unavoidable with ir_to_mesa/mesa_to_tgsi, but glsl_to_tgsi can work around it since the GLSL IR backend and the TGSI emission are both inside the state tracker.
| * glsl_to_tgsi: fix mistakes in get_pixel_transfer_visitor()Bryan Cain2011-08-011-3/+3
| | | | | | | | I noticed these issues while working on get_bitmap_visitor().
| * st/mesa, glsl_to_tgsi: support glBitmap with a GLSL fragment shader activeBryan Cain2011-08-013-6/+105
| |