Vinson Lee
5e90971475
gallivm: Remove unnecessary header.
2010-10-08 14:03:10 -07:00
José Fonseca
3fde8167a5
gallivm: Help for combined extraction and broadcasting.
...
Doesn't change generated code quality, but saves some typing.
2010-10-08 19:48:16 +01:00
José Fonseca
438390418d
llvmpipe: First minify the texture size, then broadcast.
2010-10-08 19:11:52 +01:00
José Fonseca
f5b5fb32d3
gallivm: Move into the as much of the second level code as possible.
...
Also, pass more stuff trhough the sample build context, instead of
arguments.
2010-10-08 19:11:52 +01:00
José Fonseca
6b0c79e058
gallivm: Warn when doing inefficient integer comparisons.
2010-10-08 17:43:15 +01:00
Keith Whitwell
e191bf4a85
gallivm: round rather than truncate in new 4x4f->1x16ub conversion path
2010-10-08 17:30:08 +01:00
José Fonseca
f91b4266c6
gallivm: Use the wrappers for SSE pack intrinsics.
...
Fixes assertion failures on LLVM 2.6.
2010-10-08 17:30:08 +01:00
Keith Whitwell
607e3c542c
gallivm: special case conversion 4x4f to 1x16ub
...
Nice reduction in the number of operations required for final color
output in many shaders.
2010-10-08 17:30:08 +01:00
José Fonseca
eb605701aa
gallivm: Implement brilinear filtering.
2010-10-08 15:50:28 +01:00
José Fonseca
c8179ef5e8
gallivm: Fix copy'n'paste typo in previous commit.
2010-10-08 14:09:22 +01:00
José Fonseca
df7a2451b1
gallivm: Clamp mipmap level and zero mip weight simultaneously.
2010-10-08 14:06:38 +01:00
José Fonseca
0d84b64a4f
gallivm: Use lp_build_ifloor_fract for lod computation.
...
Forgot this one before.
2010-10-08 14:06:38 +01:00
José Fonseca
4f2e2ca4e3
gallivm: Don't compute the second mipmap level when frac(lod) == 0
2010-10-08 14:06:37 +01:00
José Fonseca
05fe33b71c
gallivm: Simplify lp_build_mipmap_level_sizes' interface.
2010-10-08 14:06:37 +01:00
José Fonseca
4eb222a3e6
gallivm: Do not do mipfiltering when magnifying.
...
If lod < 0, then invariably follows that ilevel0 == ilevel1 == 0.
2010-10-08 14:06:37 +01:00
José Fonseca
321ec1a224
gallivm: Vectorize the rho computation.
2010-10-07 22:08:42 +01:00
José Fonseca
87dd859b34
gallivm: Compute lod as integer whenever possible.
...
More accurate/faster results for PIPE_TEX_MIPFILTER_NEAREST. Less
FP <-> SI conversion overall.
2010-10-06 18:51:25 +01:00
José Fonseca
1c32583581
gallivm: Only apply min/max_lod when necessary.
2010-10-06 18:50:57 +01:00
Keith Whitwell
5849a6ab64
gallivm: don't apply zero lod_bias
2010-10-06 18:49:32 +01:00
José Fonseca
af05f61576
gallivm: Combined ifloor & fract helper.
...
The only way to ensure we don't do redundant FP <-> SI conversions.
2010-10-06 18:47:01 +01:00
José Fonseca
012d57737b
gallivm: Fast implementation of iround(log2(x))
...
Not tested yet, but should be correct.
2010-10-06 18:46:59 +01:00
José Fonseca
4648846bd6
gallivm: Use a faster (and less accurate) log2 in lod computation.
2010-10-06 18:46:29 +01:00
José Fonseca
df3505b193
gallivm: Take the type signedness in consideration in round/ceil/floor.
2010-10-06 18:46:08 +01:00
Brian Paul
542d6cb1b8
gallivm: added some comments
2010-09-30 16:42:17 -06:00
Brian Paul
874f3a57ce
gallivm: check for level=0 case in lp_build_minify()
...
This lets us avoid the shift and max() operations.
2010-09-30 10:53:30 -06:00
José Fonseca
4e6f5e8d43
gallivm: More comprehensive border usage logic.
2010-09-30 17:42:01 +01:00
José Fonseca
e3ccfd4e03
gallivm: Use SSE4.1's ROUNDSS/ROUNDSD for scalar rounding.
2010-09-29 22:29:23 +01:00
Brian Paul
3446af0179
llvmpipe: fix swizzling of texture border color
...
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-27 15:06:23 -06:00
Brian Paul
4e2f53bacb
gallivm: fix repeat() function for NPOT textures
...
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-25 13:37:05 -06:00
José Fonseca
a69a96d85e
gallivm: Remove dead experimental code.
2010-09-25 12:40:01 +01:00
José Fonseca
2a8d1fd3ce
gallivm: Fetch the lod from the dynamic state when min_lod == max_lod.
2010-09-25 12:21:19 +01:00
Roland Scheidegger
049a8cce76
gallivm: optimize yuv decoding
...
this is more a proof to show vector shifts on x86 with per-element shift count
are evil. Since we can avoid the shift with a single compare/select, use that
instead. Replaces more than 20 instructions (and slow ones at that) with about 3,
and cuts compiled shader size with mesa's yuvsqure demo by over 10%
(no performance measurements done - but selection is blazing fast).
Might want to revisit that for future cpus - unfortunately AVX won't have vector
shifts neither, but AMD's XOP will, but even in that case using selection here
is probably not slower.
2010-09-25 12:19:31 +01:00
Roland Scheidegger
46d05d4ef9
gallivm: don't use URem/UDiv when calculating offsets for blocks
...
While it's true that llvm can and will indeed replace this with bit
arithmetic (since block height/width is POT), it does so (llvm 2.7) by element
and hence extracts/shifts/reinserts each element individually.
This costs about 16 instructions (and extract is not really fast) vs. 1...
2010-09-25 12:19:31 +01:00
Roland Scheidegger
26dc60d0a3
gallivm: fix copy&paste bug
...
looks like pot_depth should be used, not pot_height
(found by accident, not verified)
2010-09-25 12:19:31 +01:00
Brian Paul
d1a4dd4217
llvmpipe: make texture border_color dynamic state
2010-09-24 09:48:32 -06:00
Brian Paul
61b7da074e
llvmpipe: make min/max lod and lod bias dynamic state
...
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-24 09:47:37 -06:00
José Fonseca
162b0efff6
gallivm: Add unorm support to lp_build_lerp()
...
Unfortunately this can cause segfault with LLVM 2.6, if x is a constant.
2010-09-22 15:02:39 +01:00
Brian Paul
ffa2d203fb
gallivm: fix lp_build_sample_compare()
...
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-21 15:31:32 -06:00
Brian Paul
b2ad8b5c22
gallivm: remove debug code
2010-09-20 11:21:44 -06:00
Brian Paul
c70d539e24
gallivm: added missing case for PIPE_TEXTURE_RECT
...
Fixes fd.o bug 30245
2010-09-17 12:16:45 -06:00
Vinson Lee
b54d10b62e
gallivm: Remove unnecessary header.
2010-09-16 15:34:24 -07:00
Brian Paul
7aadd5ecb5
gallivm: fix wrong return value in bitwise functions
2010-09-16 20:20:49 +01:00
José Fonseca
6d173da5c8
gallivm: Clamp indirect register indices to file_max.
...
Prevents crashes with bogus data, or bad shader translation.
2010-09-16 20:20:49 +01:00
José Fonseca
795eb3d64a
gallivm: Start collecting bitwise arithmetic helpers in a new module.
2010-09-16 20:20:49 +01:00
José Fonseca
3d5b9c1f2d
gallivm: Fix address register swizzle.
...
We're actually doing a double swizzling:
indirect_reg->Swizzle[indirect_reg->SwizzleX]
instead of simply
indirect_reg->SwizzleX
2010-09-16 20:20:49 +01:00
Keith Whitwell
045ee46011
gallivm: make lp_build_sample_nop public
2010-09-16 17:04:01 +01:00
Brian Paul
7640151c3d
gallivm: move i32_vec_type inside the #ifdef
2010-09-16 09:00:54 -06:00
Brian Paul
3c9f4c7b75
gallivm: fix incorrect vector shuffle datatype
...
The permutation vector must always be a vector of int32 values.
2010-09-16 08:56:34 -06:00
Vinson Lee
d94c7841b2
gallivm: Remove unnecessary headers.
2010-09-15 18:14:18 -07:00
Brian Paul
0a7824862e
gallivm: expand AoS sampling to cover all filtering modes
...
...and all texture targets (1D/2D/3D/CUBE).
2010-09-15 17:04:31 -06:00