summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_wm_fp.c
AgeCommit message (Collapse)Author
2010-12-07i965: Always hand the absolute value to RSQ.Eric Anholt
gen6 builtin RSQ apparently clamps negative values to 0 instead of returning the RSQ of the absolute value like ARB_fragment_program desires and pre-gen6 apparently does. Fixes: glean/fp1-RSQ test 2 (reciprocal square root of negative value) glean/vp1-RSQ test 2 (reciprocal square root of negative value)
2010-12-06i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.Eric Anholt
Fixes many assertion failures in that path.
2010-11-04i965: Silence uninitialized variable warning.Vinson Lee
Silences this GCC warning. brw_wm_fp.c: In function 'brw_wm_pass_fp': brw_wm_fp.c:966: warning: 'last_inst' may be used uninitialized in this function brw_wm_fp.c:966: note: 'last_inst' was declared here
2010-11-04i965: Silence uninitialized variable warning.Vinson Lee
Silences this GCC warning. brw_wm_fp.c: In function 'precalc_tex': brw_wm_fp.c:666: warning: 'tmpcoord.Index' may be used uninitialized in this function
2010-11-03intel: Annotate debug printout checks with unlikely().Eric Anholt
This provides the optimizer with hints about code hotness, which we're quite certain about for debug printouts (or, rather, while we developers often hit the checks for debug printouts, we don't care about performance while doing so).
2010-10-08i965: Initialize member variables.Vinson Lee
Fixes these GCC warnings. brw_wm_fp.c: In function 'search_or_add_const4f': brw_wm_fp.c:92: warning: 'reg.Index2' is used uninitialized in this function brw_wm_fp.c:84: note: 'reg.Index2' was declared here brw_wm_fp.c:92: warning: 'reg.RelAddr2' is used uninitialized in this function brw_wm_fp.c:84: note: 'reg.RelAddr2' was declared here
2010-10-08i965: Handle swizzles in the addition of YUV texture constants.Eric Anholt
If someone happened to land a set in a different swizzle order, we would have assertion failed.
2010-10-08i965: Drop the check for YUV constants in the param list.Eric Anholt
_mesa_add_unnamed_constant() already does that.
2010-10-08i965: Drop the check for duplicate _mesa_add_state_reference.Eric Anholt
_mesa_add_state_reference does that check for us anyway.
2010-09-28i965: Fix all non-snb regression in the snb attribute interpolation commit.Eric Anholt
This apparently had never been tested elsewhere before being merged to master.
2010-09-28i965: Add support for attribute interpolation on Sandybridge.Eric Anholt
Things are simpler these days thanks to barycentric interpolation parameters being handed in in the payload.
2010-08-04i965: Settle on printing our program debug to stdout.Eric Anholt
Mixing stderr (_mesa_print_program, _mesa_print_instruction, _mesa_print_alu) with stdout means that when writing both to a file, there isn't a consistent ordering between the two.
2010-08-02Initialize a couple of HasIndex2 fields on Mesa IR src regs.Eric Anholt
2010-06-10mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul
2010-02-19Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg
2009-11-19mesa: Remove gratuitous padding in prog_dst_register.Eric Anholt
The padding was there to indicate the amount of space left from the number of expected bytes in the struct minus allocated bits. But uint bitfields get packed so that they don't cross uint boundaries, and we ended up allocating an extra dword to hold the pad field!
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-11-10i965: avoid memsetting all the BRW_WM_MAX_INSN arrays for every compile.Eric Anholt
For an app that's blowing out the state cache, like sauerbraten, the memset of the giant arrays ended up taking 11% of the CPU even when only a "few" of the entries got used. With this, the WM program compile drops back down to 1% of CPU time. Bug #24981 (bisected to BRW_WM_MAX_INSN increase).
2009-11-06i965: Share emit_fb_write() between brw_wm_emit.c and brw_wm_glsl.cEric Anholt
This should fix issues with antialiased lines in GLSL.
2009-11-06i965: Remove an XXX comment for testing some code that seems to work.Eric Anholt
2009-10-30i965: Add an index assert on get_fp_inst array like other compiler arrays.Eric Anholt
2009-10-29i965: remove unused varBrian Paul
2009-10-29i965: don't use context state in emit_fb_write()Brian Paul
Put the state that we care about in the hash key. Issue spotted by Keith Whitwell.
2009-10-29i965: use macros to get/set prog_instruction::Aux fieldBrian Paul
This makes things a bit easier to remember/understand.
2009-10-29i965: minor code reformattingBrian Paul
2009-09-11i965: Move OPCODE_DDX/DDY to brw_wm_emit.c and make it actually work.Eric Anholt
Previously, it was trying to mess around with the varying's WM setup data to produce a result. Along with not actually working when passed a varying, this wouldn't work if you did dFd[xy]() on a temporary. Instead, just calculate the derivative using the neighbors in the subspan.
2009-08-26i965: init the tex_units_used fieldBrian Paul
2009-08-26i965: keep track of which texture units the fragment shader accessesBrian Paul
We'll use this for debug/sanity checking.
2009-08-25i965: add some texture unit/target assertionsBrian Paul
2009-08-12Merge branch 'new-frag-attribs'Brian Paul
This branch introduces new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputs for GLSL gl_FrontFacing and gl_PointCoord. Before, these attributes were packed with the FOG attribute. That made things complicated elsewhere.
2009-08-12i965: Make the cube mapping RCP use a writemask.Eric Anholt
Fixes cube mapping since the scalar changes.
2009-08-12i965: Handle scalar result swizzling in shared GLSL/non-GLSL code.Eric Anholt
This is preparation for merging of brw_wm_glsl.c and brw_wm_emit.c, and glsl.c doesn't swizzle channel results around.
2009-08-04i965: Fix RECT shadow sampling by not losing the other texcoords.Eric Anholt
Bug #20821
2009-07-29mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul
Previously, the FOGC attribute contained the fragment fog coord, front/back- face flag and the gl_PointCoord.xy values. Now each of those things are separate fragment program attributes. This simplifies quite a few things in Mesa and gallium. Need to test i965 driver and fix up point coord handling in the gallium/draw module...
2009-06-16Merge branch 'mesa_7_5_branch'Brian Paul
Conflicts: src/mesa/main/api_validate.c
2009-06-16i965: fix bugs in projective texture coordinatesBrian Paul
For the TXP instruction we check if the texcoord is really a 4-component atttibute which requires the divide by W step. This check involved the projtex_mask field. However, the projtex_mask field was being miscalculated because of some confusion between vertex program outputs and fragment program inputs. 1. Rework the size_masks calculation so we correctly set bits corresponding to fragment program input attributes. 2. Rename projtex_mask to proj_attrib_mask since we're interested in more than just texcoords (generic varying vars too). 3. Simply the indexing of the size_masks and proj_attrib_mask fields. 4. The tracker::active[] array was mis-dimensioned. Use MAX_PROGRAM_TEMPS instead of a magic number. 5. Update comments, add new assertions. With these changes the Lightsmark demo/benchmark renders correctly, until we eventually hit a GPU lockup...
2009-06-12i965: interpolate colors with perspective correction by defaultBrian Paul
...rather than with linear interpolation. Modern hardware should use perspective-corrected interpolation for colors (as for texcoords). glHint(GL_PERSPECTIVE_CORRECTION_HINT, mode) can be used to get linear interpolation if mode = GL_FASTEST.
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-03-23i965: Fix glFrontFacing in twoside GLSL demo.Eric Anholt
This also cuts instructions by just using the existing bit in the payload rather than computing it from the determinant in the SF unit and passing it as a varying down to the WM. Something still goes wrong with getting the backface color right, but a simpler shader appears to get the right result.
2009-03-23i965: Fix fog coordinate g,b,a values when glFrontFacing isn't used.Eric Anholt
Previously, we would sample (f,glFrontFacing,undef,undef) instead of the (f,0,0,1) that fragment.fogcoord is supposed to return. Due to glFrontFacing's presence in FOGC.y, we'll still give bad results there when glFrontFacing is used. Bug #19122, piglit testcase fp-fog.
2009-03-23i965: Clean up a bit of mess with unneeded variables in emit_interp.Eric Anholt
2009-03-05i965: init dest reg CondMask = COND_TR (the proper default)Brian Paul
Plus fix up a debug printf.
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-26i965: rename draw_regions -> color_regionsroot
Be a little more specific about what these are.
2009-02-26mesa: replace old prog_instruction::Sampler field with Aux fieldBrian Paul
The i965 driver needs an extra instruction field for color output information. It was using the Sampler field for this. Use the Aux field instead. This will probaby be revisited at some point...
2009-02-26i965: whitespace/indentation fixesBrian Paul
2009-02-20i965: use the new prog_instruction::TexShadow fieldBrian Paul
GLSL shadow() sampler calls are properly propogated down to the driver now. The glean glsl1 shadow() tests work (except for the alpha channel).
2009-02-20i965: separate emit_op() and emit_tex_op() functionsBrian Paul
2009-02-13i965: rewrite the code for handling shader subroutine callsBrian Paul
Previously, the prog_instruction::Data field was used to map original Mesa instructions to brw instructions in order to resolve subroutine calls. This was a rather tangled mess. Plus it's an obstacle to implementing dynamic allocation/growing of the instruction buffer (it's still a fixed size). Mesa's GLSL compiler emits a label for each subroutine and CAL instruction. Now we use those labels to patch the subroutine calls after code generation has been done. We just keep a list of all CAL instructions that needs patching and a list of all subroutine labels. It's a simple matter to resolve them. This also consolidates some redundant post-emit code between brw_vs_emit.c and brw_wm_glsl.c and removes some loops that cleared the prog_instruction::Data fields at the end. Plus, a bunch of new comments.
2009-02-13i965: code clean-ups, comments, and minor refactoringBrian Paul