summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Don't append fog code for programs that don't output color.José Fonseca2011-05-111-0/+6
| | | | | | | | | Fixes fdo 36919. NOTE: This is a candidate for the stable branches. It should be cherry-picked to the sames branches that 3aa21f93dc1329c6f956277f2746c2a0bdae5446 was.
* ir_to_mesa: Emit TXD instruction.Kenneth Graunke2011-05-091-2/+11
| | | | | | | Mesa already supports this because of NV_fragment_program. Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Marek Olšák <[email protected]>
* mesa: document instructions ir_to_mesa emitsMarek Olšák2011-05-091-14/+14
| | | | | | | | | | | | | | | | | | | GLSL stopped using: BRA, EXP, LOG, LRP, NRM3, NRM4, XPD. GLSL started using: KIL, SCS, SSG, SWZ. (omg why SWZ? isn't proc_src_register flexible enough?) GLSL doesn't use these opcodes some Radeons do support: ARR, DP2A, DST, LRP, XPD. These opcodes are now unused: AND, NOT, NRM3, NRM4, OR, XOR. (plus maybe the NV extensions which are unused by Gallium) In addition to that, we don't use two-dimensional indirect addressing, which the Mesa IR can do.
* mesa: replace ONE_DIV_LN2 constant with M_LOG2EMatt Turner2011-05-061-1/+1
| | | | | | | | | | | | | 1/ln(2) is equivalent to log2(e), so define it as such. log2(e) = ln(e)/ln(2) = 1/ln(2) Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2 (right beside each other!) weren't the same. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Matt Turner <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa,st/mesa: fix WPOS adjustmentChristoph Bumiller2011-05-032-3/+3
| | | | Tested-by: Marek Olšák <[email protected]>
* ir_to_mesa: remove set-but-unused variablesMarek Olšák2011-05-011-3/+2
|
* ra: Add ra_set_node_reg()Tom Stellard2011-04-302-4/+25
| | | | | | | | This function can be used to avoid creating single register classes for input/payload registers. This makes optimistic coloring less likely to fail. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add a bunch of documentation to the register allocator.Eric Anholt2011-04-291-3/+65
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* prog_print: Add support for printing the TXD opcode.Kenneth Graunke2011-04-281-0/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: emit more info in program parser error messageBrian Paul2011-04-271-1/+5
|
* hash_table: Add an iterator for doing things like cleanup of the HT.Eric Anholt2011-04-262-0/+26
| | | | | | | Without this, consumers often have to keep linked lists of the entries, at additional malloc cost. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.Eric Anholt2011-04-231-3/+8
| | | | | | | | | Fixes a bug in Trine where fragment.color would write FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just the first target). Fixes piglit ATI_draw_buffers/arbfp-no-index.
* mesa: Kill gl_fragment_program::FogOption with fireIan Romanick2011-04-214-26/+30
| | | | | | | | | | | | All drivers expect this to always be GL_NONE. Don't let there be any opportunity for a bad value to leak out and infect some unsuspecting driver. If any driver for hardware that had fixed-function per-fragment fog (i915 and perhaps some r300-ish) was ever going to add support, it would have done it by now. Reviewed-by: Eric Anholt <[email protected]> Acked-by: Corbin Simpson <[email protected]> Acked-by: Alex Deucher <[email protected]>
* prog_optimize: Add simplify CMP optimization passTom Stellard2011-04-161-0/+78
| | | | | | | This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP instruction is the first instruction to write to register T0. This pass is useful for hardware that requires a lot of lowering passes that generate many CMP instructions.
* prog_optimize: get_src_arg_mask() respect writemask for more opcodesTom Stellard2011-04-161-0/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.Eric Anholt2011-04-131-0/+10
| | | | | | Tested by piglit ati_draw_buffers-arbfp. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.Eric Anholt2011-04-132-0/+30
| | | | | | | | Fixes fbo-drawbuffers-arbfp. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: silence signed/unsigned comparison warningsBrian Paul2011-04-111-2/+2
|
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-1/+1
| | | | | | gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
* mesa: core support for GL_ARB_texture_buffer_objectBrian Paul2011-04-051-2/+2
| | | | No GLSL or driver support yet.
* ir_to_mesa: Use gl_register_file enum type rather than 'int'.Kenneth Graunke2011-04-051-5/+5
| | | | | | src_reg already used this; make dst_reg use it too. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Unprefix ir_to_mesa_undef* and ir_to_mesa_address_reg.Kenneth Graunke2011-04-051-17/+13
| | | | | | Rename ir_to_mesa_undef to undef_src, for clarity. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Use emit overloads to avoid passing undef registers.Kenneth Graunke2011-04-051-4/+3
| | | | | | Makes the code just a little bit cleaner. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Rename ir_to_mesa_emit_*_opX methods to emit_*.Kenneth Graunke2011-04-051-211/+147
| | | | | | | | There's really no need for a prefix on member functions, and overloading takes care of the _op1/_op2 distinction quite nicely. Eric already made a similar change in the i965 FS backend. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Use constructors to convert between src_reg and dst_reg.Kenneth Graunke2011-04-051-51/+66
| | | | | | | | | | | | | Rather than ir_to_mesa_dst_reg_from_src and ir_to_mesa_src_reg_from_dst. The new constructors are marked 'explicit' so that the compiler can catch cases where source and destination registers were accidentally interchanged. This also necessitated using constructors to initialize the undef and address registers, as well as adding a default constructor. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Remove the "ir_to_mesa_" prefix on src_reg/dst_reg types.Kenneth Graunke2011-04-051-121/+121
| | | | | | | | | | Both classes are completely private to ir_to_mesa.cpp, so there won't be any name conflicts with other parts of Mesa. The prefix simply makes it harder to read. Also, use a class rather than typedef structs. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Rename src_reg and dst_reg variables to src and dst.Kenneth Graunke2011-04-051-104/+101
| | | | | | | This is in preparation from removing the "ir_to_mesa_" prefix on the src_reg and dst_reg types, which would cause a naming conflict. Reviewed-by: Ian Romanick <[email protected]>
* ir_to_mesa: Handle shadow compare w/projection and LOD bias correctlyIan Romanick2011-04-051-2/+26
| | | | | | | | | | | | | | | | The code would previously handle the projection, then swizzle the shadow comparitor into place. However, when the projection is done "by hand," as in the TXB case, the unprojected shadow comparitor would over-write the projected shadow comparitor. Shadow comparison with projection and LOD is an extremely rare case in real application code, so it shouldn't matter that we don't handle that case with the greatest efficiency. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> References: https://bugs.freedesktop.org/show_bug.cgi?id=32395
* prog_optimize: Fix reallocating registers for shaders with loopsTom Stellard2011-03-311-3/+14
| | | | | | | | | | | Registers that are used inside of loops need to be considered live starting with the first instruction of the outermost loop. https://bugs.freedesktop.org/show_bug.cgi?id=34370 NOTE: This is a candidate for the 7.9 and 7.10 branches. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix ugly indentation left from previous commitIan Romanick2011-03-291-16/+15
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* glsl: Calcluate Mesa state slots in front-end instead of back-endIan Romanick2011-03-291-39/+17
| | | | | | | | | | | | This should be the last bit of infrastructure changes before generating GLSL IR for assembly shaders. This commit leaves some odd code formatting in ir_to_mesa and brw_fs. This was done to minimize whitespace changes / reindentation in some loops. The following commit will restore formatting sanity. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: implement clamping controls (ARB_color_buffer_float)Marek Olšák2011-03-295-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: Author: Marek Olšák <[email protected]> mesa: fix getteximage so that it doesn't clamp values mesa: update the compute_version function mesa: add display list support for ARB_color_buffer_float mesa: fix glGet query with GL_ALPHA_TEST_REF and ARB_color_buffer_float commit b2f6ddf907935b2594d2831ddab38cf57a1729ce Author: Luca Barbieri <[email protected]> Date: Tue Aug 31 16:50:57 2010 +0200 mesa: document known possible deviations from ARB_color_buffer_float commit 5458935be800c1b19d1c9d1569dc4fa30a97e8b8 Author: Luca Barbieri <[email protected]> Date: Tue Aug 24 21:54:56 2010 +0200 mesa: expose GL_ARB_color_buffer_float commit aef5c3c6be6edd076e955e37c80905bc447f8a82 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:12:34 2010 +0200 mesa, mesa/st: handle read color clamping properly (I'll squash the st/mesa part to a separate commit. -Marek) We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where the operation mandates it. TODO: did I get the set of operations mandating it right? commit 3a9cb5e59b676b6148c50907ce6eef5441677e36 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:09:41 2010 +0200 mesa: respect color clamping in texenv programs (v2) Changes in v2: - Fix attributes other than vertex color sometimes getting clamped commit de26f9e47e886e176aab6e5a2c3d4481efb64362 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:05:53 2010 +0200 mesa: restore color clamps on glPopAttrib commit a55ac3c300c189616627c05d924c40a8b55bfafa Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:04:26 2010 +0200 mesa: clamp color queries if and only if fragment clamping is enabled commit 9940a3e31c2fb76cc3d28b15ea78dde369825107 Author: Luca Barbieri <[email protected]> Date: Wed Aug 25 00:00:16 2010 +0200 mesa: introduce derived _ClampXxxColor state resolving FIXED_ONLY To do this, we make ClampColor call FLUSH_VERTICES with the appropriate _NEW flag. We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging effects, despite being in the Color attrib group. This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g commit 6244c446e3beed5473b4e811d10787e4019f59d6 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 17:58:24 2010 +0200 mesa: add unclamped color parameters
* mesa: Remove the CompileShader driver hook; it's just a no-op.Kenneth Graunke2011-03-171-20/+0
|
* mesa: use BITFIELD64_BIT() macroBrian Paul2011-03-151-2/+2
|
* ir_to_mesa: do not check the number of uniforms against hw limitsMarek Olšák2011-03-141-5/+3
| | | | | | | | | | | | | | | | | | | | | The r300 compiler can eliminate unused uniforms and remap uniform locations if their number surpasses hardware limits, so the limit is actually NumParameters + NumUnusedParameters. This is important for some apps under Wine to run. Wine sometimes declares a uniform array of 256 vec4's and some Wine-specific constants on top of that, so in total there is more uniforms than r300 can handle. This was the main motivation for implementing the elimination of unused constants. We should allow drivers to implement fail & recovery paths where it makes sense, so giving up too early especially when comes to uniforms is not so good idea, though I agree there should be some hard limit for all drivers. This patch fixes: - glsl-fs-uniform-array-5 - glsl-vs-large-uniform-array on drivers which can eliminate unused uniforms.
* Revert "mesa: Convert fixed function fragment program generator to GLSL IR."Eric Anholt2011-03-121-1/+1
| | | | | This reverts commit 7cb87dffce2c7a37f960f3a865cf92fd193dd8c5. There were regressions (Bug #35244) and more review has been requested.
* mesa: Convert fixed function fragment program generator to GLSL IR.Eric Anholt2011-03-111-1/+1
| | | | | | | | This is a step towards providing a direct route for drivers accepting GLSL IR for codegen. Perhaps more importantly, it runs the fixed function fragment program through the GLSL IR optimization. Having seen how easy it is to make ugly fixed function texenv code that can do unnecessary work, this may improve real applicatinos.
* prog_cache: Add some support for shader_programs in prog_cache.Eric Anholt2011-03-112-4/+58
| | | | | | This is used in the upcoming fixed function shader_program generation, and shader_program and ARB programs are together in this code until both fragment and vertex ff get converted.
* mesa: test against MaxUniformComponents in check_resources()Brian Paul2011-03-111-3/+3
| | | | | | Since we're compiling/linking GLSL shaders we should check against the shader uniform limits, not the legacy vertex/fragment program parameter limits which are usually lower.
* mesa: move location of some geometry program limitsBrian Paul2011-03-111-1/+1
| | | | | | | The gl_program_constants struct is for limits that are applicable to any/all shader stages. Move the geometry shader-only fields into the gl_constants struct. Remove redundant MaxGeometryUniformComponents field too.
* mesa: use check_resources() to check program against limitsBrian Paul2011-03-111-0/+58
| | | | | | Without these checks we could create shaders with more samplers, constants than the driver could handle. Fail linking rather than dying later.
* mesa: added gl_program_constants::MaxAddressOffsetBrian Paul2011-03-022-2/+5
| | | | See https://bugs.freedesktop.org/show_bug.cgi?id=29418
* mesa: increase INST_INDEX_BITS to 12Brian Paul2011-03-021-1/+1
| | | | For more info see fd.o bug 29418.
* mesa: Fix build breakage caused by c73e6ceIan Romanick2011-03-011-7/+0
|
* Add generated parser / lexer files to gitignore listsIan Romanick2011-03-011-0/+3
|
* mesa: Remove files generated by flex and bison from GITIan Romanick2011-03-013-9620/+0
| | | | These files were for the ARB_vertex_program / ARB_fragement_program assembler.
* Use C-style system headers in C++ code to avoid issues with std:: namespaceIan Romanick2011-02-211-1/+0
|
* mesa: Do copy propagation across if-else-endif.José Fonseca2011-02-171-2/+28
| | | | | | | | Addresses excessive TEMP allocation in vertex shaders where all CONSTs are stored into TEMPS at the start, but copy propagation was failing due to the presence of IFs. We could do something about loops, but ifs are easy enough.
* ir_to_mesa: Don't dereference a NULL pointer during copy propagationIan Romanick2011-02-111-0/+3
| | | | | | The ACP may already be NULL, so don't try to make it NULL again. This should fix bugzilla #34119.
* mesa: Fix the Mesa IR copy propagation to not read past writes to the reg.Eric Anholt2011-02-081-7/+40
| | | | | | Fixes glsl-vs-post-increment-01. Reviewed-by: José Fonseca <[email protected]>