summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texenvprogram.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Move texenvprogram.c to ff_fragment_shader.cpp.Eric Anholt2011-03-111-1618/+0
| | | | | This file is about to change to generating a shader program instead of a fragment program.
* mesa: fix num_draw_buffers==0 in fixed-function fragment program generationBrian Paul2011-01-121-2/+2
| | | | | | | | This fixes a problem when glDrawBuffers(GL_NONE). The fragment program was writing to color output[0] but OutputsWritten was 0. That led to a failed assertion in the Mesa->TGSI translation code. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee2011-01-051-0/+1
| | | | | | Directly include mtypes.h if a file uses a gl_context struct. This allows future removal of headers that are not strictly necessary but indirectly include mtypes.h for a file.
* Track separate programs for each stageIan Romanick2010-10-271-4/+5
| | | | | The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-7/+7
|
* mesa: Fix printf-like warnings.Vinson Lee2010-09-021-1/+1
|
* mesa: fix texenv generation when num color bufs == 0Brian Paul2010-07-021-1/+4
| | | | | | | | | | | | Before, if there were no color buffers enabled (with glDrawBuffers(GL_NONE)) when the texenv program was generated, we'd emit writes to OUTPUT[1] but the OutputsWritten mask was 0. This inconsistency caused an assertion to fail later in the Mesa->TGSI translation. Fixes fd.o bug 28169 NOTE: this is a candidate for the 7.8 branch (and depends on commit b6b9b17d27c570cc99ae339e595cf2f63ca5e8d7).
* mesa: make the number of draw buffers part of the texenv program key stateBrian Paul2010-07-021-4/+8
| | | | | | | | All the state that effects the program should be in the key. This didn't help with bug 28169 but is a good fix anyway. NOTE: this is a low-priority candidate for the 7.8 branch. In practice, this issue might never be hit.
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-7/+7
|
* texenvprogram: fix for ARB_draw_buffers.Dave Airlie2010-04-081-15/+28
| | | | | | | piglit has a test called fbo-drawbuffers, this fails for me on r300g, and fixing the texenv program to use the DATA outputs fixes it. Signed-off-by: Dave Airlie <[email protected]>
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-1/+1
|
* Remove _mesa_memcmp in favor of plain memcmp.Kenneth Graunke2010-02-191-2/+2
| | | | This may break the SUNOS4 build, but it's no longer relevant.
* Remove _mesa_memset in favor of plain memset.Kenneth Graunke2010-02-191-1/+1
| | | | This may break the SUNOS4 build, but it's no longer relevant.
* mesa: add back-door support for cylindrical texture wrap modeBrian Paul2010-02-091-0/+12
| | | | | | | | | If the texture priority field is 0.125 set the PROG_PARAM_BIT_CYL_WRAP flag. The gallium state tracker will look for this flag. This feature is only for testing purposes and may be remove at some point. But if it's useful we could write a GL/Mesa extension to expose it properly.
* mesa: change ctx->Driver.ProgramStringNotify() to return GLbooleanBrian Paul2010-02-041-2/+9
| | | | | | | | | | | | | GL_TRUE indicates that the driver accepts the program. GL_FALSE indicates the program can't be compiled/translated by the driver for some reason (too many resources used, etc). Propogate this result up to the GL API: set GL_INVALID_OPERATION error if glProgramString() was called. Set shader program link status to GL_FALSE if glLinkProgram() was called. At this point, drivers still don't do any program checking and always return GL_TRUE.
* mesa: Remove an unnecessary store reported by clang.Eric Anholt2009-12-221-2/+0
| | | | | This was a workaround for a compiler warning that was showing a real error. The real error was later fixed.
* mesa: Remove _mesa_exit wrapper for exit().Eric Anholt2009-12-221-2/+2
| | | | | It does nothing else while being less useful than exit() because it lacks attributes that real exit() has.
* Merge branch 'outputswritten64'Ian Romanick2009-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
* mesa: added default case return to silence warningBrian Paul2009-09-241-0/+1
|
* mesa: in texenvprogram code, only do saturation when really needed.Brian Paul2009-09-101-8/+53
| | | | | For some env modes (like modulate or replace) we don't have to clamp because we know the results will be in [0,1].
* mesa: compute tex env program key size based on nr_enabled_unitsBrian Paul2009-09-031-8/+18
| | | | | | | When no textures are enabled, the key size is 4 bytes. If unit[0] is enabled, the key size is 16 bytes. Inspired by a patch from Chris Wilson.
* Revert "mesa: fix the non-GNU C bit-field case"Brian Paul2009-09-021-2/+2
| | | | | | This reverts commit 4b08e7498230eac30eea1721f33994b30999acd4. Don't know what I was thinking there.
* mesa: fix the non-GNU C bit-field caseBrian Paul2009-09-021-2/+2
|
* mesa: silence gcc bit-field warningGary Wong2009-09-021-2/+2
|
* mesa: remove accidentally committed printfBrian Paul2009-09-021-1/+0
|
* mesa: added #ifdef __GNUC__ around GLubyte bitfield usageBrian Paul2009-09-021-0/+5
| | | | | | | | | It would be nice if there were a #pragma or something to disable the warnings: main/texenvprogram.c:87: warning: type of bit-field ‘Source’ is a GCC extension main/texenvprogram.c:88: warning: type of bit-field ‘Operand’ is a GCC extension but there doesn't appear to be a way to do that.
* mesa: Compact state key for TexEnv program cacheChris Wilson2009-09-021-3/+5
| | | | | | By rearranging the bitfields within the key we can reduce the size of the key from 644 to 196 bytes, reducing the cost of both the hashing and equality tests.
* mesa: more clean-upsBrian Paul2009-09-011-24/+31
|
* mesa: change conditional to match the previous oneBrian Paul2009-09-011-1/+1
|
* mesa: updated #includesBrian Paul2009-09-011-2/+1
|
* mesa: remove unused texenv_fragment_program::ctx fieldBrian Paul2009-09-011-2/+0
|
* mesa: remove unused ureg::abs fieldBrian Paul2009-09-011-5/+2
|
* mesa: remove unused ureg:negateabs fieldBrian Paul2009-09-011-4/+1
|
* mesa: more comments, clean-upsBrian Paul2009-09-011-10/+10
|
* mesa: simplify translate_tex_src_bit()Brian Paul2009-09-011-20/+3
|
* mesa: minor code clean-ups, commentsBrian Paul2009-09-011-24/+34
|
* mesa: replace 8 with MAX_TEXTURE_UNITSBrian Paul2009-09-011-1/+1
|
* mesa: added const qualifiers, move local varBrian Paul2009-08-311-7/+8
|
* mesa: fix saturation logic in emit_texenv()Brian Paul2009-08-311-1/+7
| | | | | | We need to clamp/saturate after each texenv stage, not just the last one. Fixes glean texEnv failure for softpipe (and probably other fragment program- based drivers).
* mesa: reformat code to allow setting breakpoints on the true-statementBrian Paul2009-08-071-4/+8
|
* texenv: Use VP->Current, since _Current isn't updated at this point.Eric Anholt2009-08-031-1/+1
|
* texenv: Match state.c in deciding whether we'll be using a vertex shader.Eric Anholt2009-08-031-0/+1
|
* texenv: Calculate whether we need to do secondary color on our own.Eric Anholt2009-07-161-3/+15
| | | | | | | | The _TriangleCaps bit is deprecated, not updated when we require, and is set based on state that hasn't been updated at that point in _mesa_update_state_locked(). Fixes incorrect clear color in glsl/twoside.c with meta_clear_tris.
* Fix state flag dependencies for fixed function fragment program updates.Eric Anholt2009-07-141-0/+10
| | | | | I started looking into why _NEW_ARRAY punishes us, and while annotating dependencies noticed that a bunch of dependencies were missing.
* mesa: Always return a value.José Fonseca2009-06-151-0/+1
|
* mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul2009-04-141-2/+1
| | | | | | There's really no need for two negation fields. This came from the GL_NV_fragment_program extension. The new, unified Negate bitfield applies after the absolute value step.
* mesa: texture combine clean-upsBrian Paul2009-04-011-8/+5
| | | | | | Use MAX_COMBINER_TERMS instead of 4. Rename some vars. Update comments.
* mesa: add support for ATI_envmap_bumpmapRoland Scheidegger2009-03-121-9/+90
| | | | | | | | add new entrypoints, new texture format, etc translate in texenvprogram.c for drivers using the mesa-generated tex env fragment program also handled in swrast, but not tested (cannot work due to negative texel results not handled correctly)
* mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul2009-02-281-3/+3
| | | | | | | s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
* mesa: add TexShadow field to prog_instructionBrian Paul2009-02-201-6/+13
| | | | | If the instruction is TEX/TXP/TXL/etc the TexShadow field will be true if the instruction is a texture fetch with shadow compare.