summaryrefslogtreecommitdiff
path: root/src/mesa/main/texenvprogram.c
AgeCommit message (Collapse)Author
2011-01-12mesa: fix num_draw_buffers==0 in fixed-function fragment program generationBrian Paul
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.
2011-01-05mesa: Include mtypes.h in files that use gl_context struct.Vinson Lee
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.
2010-10-27Track separate programs for each stageIan Romanick
The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-09-02mesa: Fix printf-like warnings.Vinson Lee
2010-07-02mesa: fix texenv generation when num color bufs == 0Brian Paul
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).
2010-07-02mesa: make the number of draw buffers part of the texenv program key stateBrian Paul
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.
2010-06-10mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul
2010-04-08texenvprogram: fix for ARB_draw_buffers.Dave Airlie
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 <airlied@redhat.com>
2010-02-19Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg
2010-02-19Remove _mesa_memcmp in favor of plain memcmp.Kenneth Graunke
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19Remove _mesa_memset in favor of plain memset.Kenneth Graunke
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-09mesa: add back-door support for cylindrical texture wrap modeBrian Paul
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.
2010-02-04mesa: change ctx->Driver.ProgramStringNotify() to return GLbooleanBrian Paul
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.
2009-12-22mesa: Remove an unnecessary store reported by clang.Eric Anholt
This was a workaround for a compiler warning that was showing a real error. The real error was later fixed.
2009-12-22mesa: Remove _mesa_exit wrapper for exit().Eric Anholt
It does nothing else while being less useful than exit() because it lacks attributes that real exit() has.
2009-11-17Merge branch 'outputswritten64'Ian Romanick
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
2009-09-24mesa: added default case return to silence warningBrian Paul
2009-09-10mesa: in texenvprogram code, only do saturation when really needed.Brian Paul
For some env modes (like modulate or replace) we don't have to clamp because we know the results will be in [0,1].
2009-09-03mesa: compute tex env program key size based on nr_enabled_unitsBrian Paul
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.
2009-09-02Revert "mesa: fix the non-GNU C bit-field case"Brian Paul
This reverts commit 4b08e7498230eac30eea1721f33994b30999acd4. Don't know what I was thinking there.
2009-09-02mesa: fix the non-GNU C bit-field caseBrian Paul
2009-09-02mesa: silence gcc bit-field warningGary Wong
2009-09-02mesa: remove accidentally committed printfBrian Paul
2009-09-02mesa: added #ifdef __GNUC__ around GLubyte bitfield usageBrian Paul
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.
2009-09-02mesa: Compact state key for TexEnv program cacheChris Wilson
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.
2009-09-01mesa: more clean-upsBrian Paul
2009-09-01mesa: change conditional to match the previous oneBrian Paul
2009-09-01mesa: updated #includesBrian Paul
2009-09-01mesa: remove unused texenv_fragment_program::ctx fieldBrian Paul
2009-09-01mesa: remove unused ureg::abs fieldBrian Paul
2009-09-01mesa: remove unused ureg:negateabs fieldBrian Paul
2009-09-01mesa: more comments, clean-upsBrian Paul
2009-09-01mesa: simplify translate_tex_src_bit()Brian Paul
2009-09-01mesa: minor code clean-ups, commentsBrian Paul
2009-09-01mesa: replace 8 with MAX_TEXTURE_UNITSBrian Paul
2009-08-31mesa: added const qualifiers, move local varBrian Paul
2009-08-31mesa: fix saturation logic in emit_texenv()Brian Paul
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).
2009-08-07mesa: reformat code to allow setting breakpoints on the true-statementBrian Paul
2009-08-03texenv: Use VP->Current, since _Current isn't updated at this point.Eric Anholt
2009-08-03texenv: Match state.c in deciding whether we'll be using a vertex shader.Eric Anholt
2009-07-16texenv: Calculate whether we need to do secondary color on our own.Eric Anholt
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.
2009-07-14Fix state flag dependencies for fixed function fragment program updates.Eric Anholt
I started looking into why _NEW_ARRAY punishes us, and while annotating dependencies noticed that a bunch of dependencies were missing.
2009-06-15mesa: Always return a value.José Fonseca
2009-04-14mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul
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.
2009-04-01mesa: texture combine clean-upsBrian Paul
Use MAX_COMBINER_TERMS instead of 4. Rename some vars. Update comments.
2009-03-12mesa: add support for ATI_envmap_bumpmapRoland Scheidegger
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)
2009-02-28mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul
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).
2009-02-20mesa: add TexShadow field to prog_instructionBrian Paul
If the instruction is TEX/TXP/TXL/etc the TexShadow field will be true if the instruction is a texture fetch with shadow compare.
2009-02-10Merge commit 'origin/gallium-master-merge'Brian Paul
This is the big merge of the gallium-0.2 branch into master. gallium-master-merge was just the staging area for it. Both gallium-0.2 and gallium-master-merge are considered closed now. Conflicts: progs/demos/Makefile src/mesa/main/state.c src/mesa/main/texenvprogram.c