summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
AgeCommit message (Collapse)Author
2011-03-07llvmpipe: clamp texcoords in lp_build_sample_compare()Brian Paul
See previous commit for more info. NOTE: This is a candidate for the 7.10 branch.
2011-02-26gallivm: Initialize stack valuesJakob Bornecrantz
valgrind gives me a warning with llvmpipe with profile builds but not debug builds, this seems to fix the issue at least.
2010-12-14gallivm: do texture swizzle after shadow compareBrian Paul
We need to swizzle after the shadow comparison so that the GL_DEPTH_MODE functionality is handled properly. This fixes all the piglit glsl-fs-shadow2d*.shader_test cases, except for glsl-fs-shadow2dproj-bias.shader_test which fails because of a bug in the GLSL compiler (fd.o 32395).
2010-11-30gallivm/llvmpipe: squash merge of the llvm-context branchBrian Paul
This branch defines a gallivm_state structure which contains the LLVMBuilderRef, LLVMContextRef, etc. All data structures built with this object can be periodically freed during a "garbage collection" operation. The gallivm_state object has to be passed to most of the builder functions where LLVMBuilderRef used to be used. Conflicts: src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c src/gallium/drivers/llvmpipe/lp_state_setup.c
2010-10-17gallivm: Fix SoA cubemap derivative computation.José Fonseca
Derivatives are now scalar. Broken since 17dbd41cf23e7e7de2f27e5e9252d7f792d932f3.
2010-10-13gallivm: fix different handling of [non]normalized coords in linear soa pathRoland Scheidegger
There seems to be no reason for it, so do same math for both (except the scale mul, of course).
2010-10-11gallivm: Eliminate unsigned integer arithmetic from texture coordinates.José Fonseca
SSE support for 32bit and 16bit unsigned arithmetic is not complete, and can easily result in inefficient code. In most cases signed/unsigned doesn't make a difference, such as for integer texture coordinates. So remove uint_coord_type and uint_coord_bld to avoid inefficient operations to sneak in the future.
2010-10-09gallivm: Simplify if/then/else implementation.José Fonseca
No need for for a flow stack anymore.
2010-10-09gallivm: Factor out the SI->FP texture size conversion for SoA path tooJosé Fonseca
2010-10-09gallivm: Do size computations simultanously for all dimensions (AoS).José Fonseca
Operate simultanouesly on <width, height, depth> vector as much as possible, instead of doing the operations on vectors with broadcasted scalars. Also do the 24.8 fixed point scalar with integer shift of the texture size, for unnormalized coordinates. AoS path only for now -- the same thing can be done for SoA.
2010-10-09gallivm: optimize soa linear clamp to edge wrap mode a bitRoland Scheidegger
Clamp against 0 instead of -0.5, which simplifies things. The former version would have resulted in both int coords being zero (in case of coord being smaller than 0) and some "unused" weight value, whereas now the int coords will be 0 and 1, but weight will be 0, hence the lerp should produce the same value. Still not happy about differences between normalized and non-normalized...
2010-10-09gallivm: avoid unnecessary URem in linear wrap repeat caseRoland Scheidegger
Haven't looked at what code this exactly generates but URem can't be fast. Instead of using two URem only use one and replace the second one with select/add (this is what the corresponding aos code already does).
2010-10-09gallivm: more linear tex wrap mode calculation simplificationRoland Scheidegger
Rearrange order of operations a bit to make some clamps easier. All calculations should be equivalent. Note there seems to be some inconsistency in the clamp to edge case wrt normalized/non-normalized coords, could potentially simplify this too.
2010-10-09gallivm: optimize some tex wrap mode calculations a bitRoland Scheidegger
Sometimes coords are clamped to positive numbers before doing conversion to int, or clamped to 0 afterwards, in this case can use itrunc instead of ifloor which is easier. This is only the case for nearest calculations unfortunately, except linear MIRROR_CLAMP_TO_EDGE which for the same reason can use a unsigned float build context so the ifloor_fract helper can reduce this to itrunc in the ifloor helper itself.
2010-10-09gallivm: replace sub/floor/ifloor combo with ifloor_fractRoland Scheidegger
2010-10-08llvmpipe: First minify the texture size, then broadcast.José Fonseca
2010-10-08gallivm: Move into the as much of the second level code as possible.José Fonseca
Also, pass more stuff trhough the sample build context, instead of arguments.
2010-10-08gallivm: Clamp mipmap level and zero mip weight simultaneously.José Fonseca
2010-10-08gallivm: Don't compute the second mipmap level when frac(lod) == 0José Fonseca
2010-10-08gallivm: Simplify lp_build_mipmap_level_sizes' interface.José Fonseca
2010-10-08gallivm: Do not do mipfiltering when magnifying.José Fonseca
If lod < 0, then invariably follows that ilevel0 == ilevel1 == 0.
2010-10-07gallivm: Vectorize the rho computation.José Fonseca
2010-10-06gallivm: Compute lod as integer whenever possible.José Fonseca
More accurate/faster results for PIPE_TEX_MIPFILTER_NEAREST. Less FP <-> SI conversion overall.
2010-10-06gallivm: Combined ifloor & fract helper.José Fonseca
The only way to ensure we don't do redundant FP <-> SI conversions.
2010-09-30gallivm: More comprehensive border usage logic.José Fonseca
2010-09-27llvmpipe: fix swizzling of texture border colorBrian Paul
The pipe_sampler_view's swizzle terms also apply to the texture border color. Simply move the apply_sampler_swizzle() call after we fetch the border color. Fixes many piglit texwrap failures.
2010-09-25gallivm: fix repeat() function for NPOT texturesBrian Paul
The trick of casting the coord to an unsigned value only works for POT textures. Add a bias instead. This fixes a few piglit texwrap failures.
2010-09-25gallivm: fix copy&paste bugRoland Scheidegger
looks like pot_depth should be used, not pot_height (found by accident, not verified)
2010-09-24llvmpipe: make texture border_color dynamic stateBrian Paul
2010-09-24llvmpipe: make min/max lod and lod bias dynamic stateBrian Paul
Before, changing any of these sampler values triggered generation of new JIT code. Added a new flag for the special case of min_lod == max_lod which is hit during auto mipmap generation.
2010-09-21gallivm: fix lp_build_sample_compare()Brian Paul
The old code didn't really make sense. We only need to compare the X channel of the texture (depth) against the texcoord. For (bi)linear sampling we should move the calls to this function and compute the final result as (s1+s2+s3+s4) * 0.25. Someday. This fixes the glean glsl1 shadow2D() tests. See fd.o bug 29307.
2010-09-20gallivm: remove debug codeBrian Paul
2010-09-16gallivm: Start collecting bitwise arithmetic helpers in a new module.José Fonseca
2010-09-16gallivm: make lp_build_sample_nop publicKeith Whitwell
2010-09-15gallivm: Remove unnecessary headers.Vinson Lee
2010-09-15gallivm: expand AoS sampling to cover all filtering modesBrian Paul
...and all texture targets (1D/2D/3D/CUBE).
2010-09-11gallivm: nr_channels is only valid for formats with plain layout.José Fonseca
This is erroneously throwing non plain formats out of the faster AoS sampling path. Doing 8bit interpolation for single channels such as L8 should be no worse than with floating point. But this may need more investigation.
2010-09-11gallivm: Add a new debug flag to warn about performance issues.José Fonseca
2010-08-30gallivm: Compute the 4 texel offsets for linear filtering en ensemble.José Fonseca
2010-08-20gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT tooLuca Barbieri
Searched for them with: git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D' Behavior hasn't been changed.
2010-08-14gallivm: Remove unnecessary header.Vinson Lee
2010-08-14u_cpu_detect: remove arch and little_endianLuca Barbieri
This logic duplicates the one in p_config.h, so remove it and adjust the only two places that were using it.
2010-08-11gallivm: Use lp_build_div instead of lp_build_mul + lp_build_rcp.José Fonseca
Single divide, so let lp_build_div decide how to implement this. This will save a multiplication in architectures which don't have a RCP intrinsic.
2010-08-11gallivm: Use unsigned shift in lp_build_minify.José Fonseca
Texture dimensions are unsigned.
2010-08-09gallivm: Always use floating-point operators for floating-point typesnobled
This fixes the assert added in LLVM 2.8: assert(getType()->isIntOrIntVectorTy() && "Tried to create an integer operation on a non-integer type!") But it also fixes some subtle bugs, since we should've been doing this since LLVM 2.6 anyway. Includes a modified patch from steckdenis@yahoo.fr for the FNeg instructions in emit_fetch(); thanks for pointing those out. http://bugs.freedesktop.org/29404 http://bugs.freedesktop.org/29407 Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-07-07gallivm: restore const qualifierBrian Paul
2010-07-07gallivm: fix cube map LOD computationBrian Paul
First, this undoes commit e503af4baa2c709ae5743bb278b277d3faaba076 so we use iround() in lp_build_nearest_mip_level(). Second, in lp_build_sample_general() we need to check if we're sampling a cube map before anything else. Choose the cube face and then recompute the partial derivatives of (S,T) with respect to the chosen cube face. Before, we were using the directional (S,T,R) derivatives to compute the LOD. Third, work around an apparent bug in LLVM 2.7 where setting the lod variable to a const(0) value results in bad x86 code. See comments in the code.
2010-07-06gallivm: use trunc, not round in lp_build_nearest_mip_level()Brian Paul
Fixes fd.o bug 28036 (piglit fbo-cubemap.c regression)
2010-07-02gallivm: Do 4ubyte AoS texture filtering for any format that can be expressed.José Fonseca
Except if it has only one channel, as it would take the same number of instructions.
2010-07-02gallivm: Move lp_build_rgba8_to_f32_soa() to lp_bld_format_soa.cJosé Fonseca
It will be more useful here.