summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915/i915_fragprog.c
AgeCommit message (Collapse)Author
2011-03-07i915: Derive the gl_fragment_program from i915_fragment_program.Henri Verbeet
Instead of using the current gl_fragment_program. These aren't necessarily the same, for example when translate_program() is called by i915ValidateFragmentProgram().
2011-02-21i915: Emit a single relocation per vboChris Wilson
Reducing the number of relocations has lots of nice knock-on effects, not least including reducing batch buffer size, auxilliary array sizes (vmalloced and copied into the kernel), processing of uncached relocations etc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-10i915: Calculate partial result to temp register firstIan Romanick
Previously the SNE and SEQ instructions would calculate the partial result to the destination register. This would cause problems if the destination register was also one of the source registers. Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal, glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal, glsl-fs-vec4-operator-notequal. NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01i915: Only mark a register as available if all components are writtenIan Romanick
Previously a register would be marked as available if any component was written. This caused shaders such as this: 0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D; 1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx; 2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1]; 3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2]; 4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx; 5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D; 6: MOV TEMP[0].w, TEMP[1].wwww; 7: MOV OUTPUT[2], TEMP[0]; 8: END to produce incorrect code such as this: BEGIN DCL S[0] DCL T_TEX0 R[0] = MOV T_TEX0.xyyy U[0] = TEXLD S[0],R[0] R[0].xyz = MOV U[0] R[1] = MUL CONST[0], R[0].xxxx R[2] = MAD CONST[1], R[0].yyyy, R[1] R[1] = MAD CONST[2], R[0].zzzz, R[2] R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx R[0] = MOV T_TEX0.xyyy U[0] = TEXLD S[0],R[0] R[1].w = MOV U[0] R[0].w = MOV R[1].wwww oC = MOV R[0] END Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are still expected to hold a calculated value. Fixes piglit tests draw-elements-vs-inputs, fp-kill, and glsl-fs-color-matrix. It also fixes Meego bugzilla #13005. NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-16i915: Fix INTEL_DEBUG=wm segmentation faultShuang He
The program should be disassembled after it's uploaded
2010-12-01i915: Correctly generate unconditional KIL instructionsIan Romanick
Fixes piglit test glsl-fs-discard-03. NOTE: This is a candidate for the 7.9 branch.
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-09-10intel: Remove noise opcode support from i915 and i965 driversIan Romanick
With recent changes to the GLSL compiler, these opcode should never be seen in these drivers.
2010-08-17i915: Add support for SSG opcode.Eric Anholt
Fixes glsl-fs-sign and many of the tests of trig builtins.
2010-08-17i915: Add support for reading output regs in the FS.Eric Anholt
Fixes glsl-unused-varying and many others, since we produce an output reg read any time gl_FragColor is written inside an if statement.
2010-08-17i915: Add support for OPCODE_DP2.Eric Anholt
Fixes glsl-fs-dot-vec2.
2010-06-10mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul
2010-04-27i915: Add debugging for just prorgam compile under INTEL_DEBUG=wmEric Anholt
2010-04-27i915: Provide counts in the error messages for program limits.Eric Anholt
2010-04-20i915: Map sampler indices to texture units correctly for fragment shaders.Eric Anholt
Fixes hang with "gst-launch-0.10 videotestsrc ! video/x-raw-rgb ! glupload ! gleffects effect=heat ! glimagesink" which uses 2 samplers pointing at GL_TEXTURE1 and GL_TEXTURE2, and piglit glsl-fs-sampler-numbering.
2010-04-20i915: Add missing break; after handling the stub NOISE instructions.Eric Anholt
Bug #27348
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-22i915: Fix use of uninitialized variable in OPCODE_NOISE stub.Eric Anholt
We don't actually care which register is used since we're just swizzling (0,0,0,0), but it should be a valid variable number. Detected by clang.
2009-11-19tnl: Replace deprecated TexCoordPtr with AttribPtr[_TNL_ATTRIB_TEX*]Eric Anholt
2009-10-01i915: Add optional support for ARB_fragment_shader under a driconf option.Eric Anholt
Other vendors have enabled ARB_fragment_shader as part of OpenGL 2.0 enablement even on hardware like the 915 with no dynamic branching or dFdx/dFdy support. But for now we'll leave it disabled because we don't do any flattening of ifs or loops, which is rather restrictive. This support is not complete, and may be unstable depending on your shaders. It passes 10/15 of the piglit glsl tests, but hangs on glean glsl1.
2009-10-01i915: Add support or fallbacks for GLSL fragment shader opcodes.Eric Anholt
2009-10-01i915: Add support for varying inputs.Eric Anholt
2009-10-01i915: Update and translate the fragment program along with state updates.Eric Anholt
Previously, we were doing it in the midst of the pipeline run, which gave an opportunity to enable/disable fallbacks, which is certainly the wrong time to be doing so. This manifested itself in a NULL dereference for PutRow after transitioning out of a fallback during a run_pipeline in glean glsl1.
2009-10-01i915: Let i915_program_error take a format string, and don't use _mesa_problem.Eric Anholt
It's misleading to report things like the program having too many native instructions as a Mesa implementation error, when the program may just be too big for the hardware.
2009-04-16Merge branch 'register-negate'Brian Paul
2009-04-15i915: Use DEBUG_WM (like 965) for printing the fragment program out.Eric Anholt
This is nice when paired with INTEL_DEBUG=batch for debugging what's going out to the hardware.
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-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-01-21i915: Add decode for PS in batchbuffers.Eric Anholt
2008-12-24i915: separate the fog term from the specular color term.Xiang, Haihao
Previously fog parameter and specular color are packed into the same dword. Note specular color should be packed in BGRA for device, so if fog parameter and specular color all are present, fog parameter will dirty the alpha term of specular color. This fixes rendering issue when playing 'Yo Frankie' on 915/945.
2008-09-18mesa: added "main/" prefix to includes, remove some -I paths from ↵Brian Paul
Makefile.template
2008-02-15i915: set fogcoord to (f,0,0,1). fix #10788 issue on 915.Xiang, Haihao
2008-02-06[915] Fix COS function using same plan as SIN.Eric Anholt
The previous COS function failed badly outside of [-pi/2, pi/2].
2008-02-06[915] Use a quartic term to improve the accuracy of SIN results.Eric Anholt
This is described in the link in the comment, and is the same technique that r300 uses.
2008-02-06[915] Fix fp SIN function, and use a quadratic approximation instead of Taylor.Eric Anholt
The Taylor series notably fails at producing sin(pi) == 0, which leads to discontinuity every 2*pi. The quadratic gets us sin(pi) == 0 behavior, at the expense of going from 2.4% THD with working Taylor series to 3.8% THD (easily seen on comparative graphs of the two). However, our previous implementation was producing sin(pi) < -1 and worse, so any reasonable approximation is an improvement. This also fixes the repeating behavior, where the previous implementation would repeat sin(x) for x>pi as sin(x % pi) and the opposite for x < -pi.
2008-01-07i915: Keith Whitwell's swizzling TEX patch. fix #8283Xiang, Haihao
2007-09-24Move i915tex driver into place as just i915.Eric Anholt
2007-09-24Remove the old i915 driver now that i915tex works without TTM.Eric Anholt
2007-09-11Fix-up #includes to remove some -I options.Brian
eg: #include "shader/program.h" and remove -I$(TOP)/src/mesa/program
2007-07-29fix cos/sin range reduction for i915 driver tooRoland Scheidegger
2007-05-22i915/i915tex: minor cleanup (remove unneeded function callRoland Scheidegger
2007-02-23Update DRI drivers for new glsl compiler.Brian
Mostly: - update #includes - update STATE_* token code
2006-11-02Fix fragment program fog problems found with Glean.Brian Paul
1. add PROGRAM_CONSTANT to switch() in src_vector(). 2. use _mesa_append_fog_code() to handle fog options in i915ProgramStringNotify(). 3. Re-enable some vertex attribute emit code that was previously disabled in i915ValidateFragmentProgram().
2006-11-01fix compiler warningsKeith Whitwell
2006-11-01Patch from <haihao.xiang@intel.com> -- pass program stringKeith Whitwell
notification callback through to tnl/ module, fixes glean crash.
2006-10-10Use the mesa-provided texenv program rather than rolling our own.Keith Whitwell
Turn on texture crossbar support.
2006-07-20Some structure renaming. Prefix vertex/fragment-related structs withBrian Paul
"gl_" to match other structs.
2005-11-22Use correct enums for program output variables. FixesKeith Whitwell
fp/tri-depthwrite.
2005-11-20s/Saturate/SaturateMode/Brian Paul
2005-11-20Make Saturate a 2-bit field again, renamed to SaturateMode with threeBrian Paul
possible values: SATURATE_OFF, SATURATE_ZERO_ONE and SATURATE_PLUS_MINUS_ONE.