summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tex_sample.c
AgeCommit message (Collapse)Author
2009-11-19gallium: don't use arrays for texture width,height,depthKeith Whitwell
2009-09-24softpipe: Use portable INLINE macro.José Fonseca
2009-09-23softpipe: replace macros with inline functionsBrian Paul
And update comments.
2009-09-23softpipe: white-space/formatting fixes and updated commentsBrian Paul
2009-09-23Merge branch 'softpipe-opt'Keith Whitwell
Conflicts: progs/demos/cubemap.c src/gallium/drivers/softpipe/sp_tex_sample.c src/gallium/drivers/softpipe/sp_texture.c
2009-09-22softpipe: fix bugs in POT texture sampling when texture is not squareroot
Before, if level was greater than the logbase2(base size) we were doing a negative bit shift and winding up with garbage values.
2009-09-22softpipe: additional assertionsBrian Paul
2009-09-18softpipe: Fix cube face selection.Michal Krol
If arx and ary are equal, we still want to choose from one of them, and not arz.
2009-08-24softpipe: use one fewer divide in sample_cubeKeith Whitwell
GCC won't do this for us. Makes a bigger difference to cubemap fps than previous set of compilcated rearrangements.
2009-08-24softpipe: separate out 2d and cube img filter functionsKeith Whitwell
2009-08-24softpipe: make the various get_texel routines more similarKeith Whitwell
Remove arguments, return const float * by default. Add specialized 3d versions and remove 3d texture support from the others.
2009-08-23softpipe: lift tex_address construction up to img_filterKeith Whitwell
For fastpaths at least, can avoid recalculating this sometimes.
2009-08-23Merge branch 'tex-tilecache' into softpipe-optKeith Whitwell
Conflicts: src/gallium/drivers/softpipe/sp_state_derived.c src/gallium/drivers/softpipe/sp_state_sampler.c src/gallium/drivers/softpipe/sp_tex_sample.c src/gallium/drivers/softpipe/sp_tex_sample.h src/gallium/drivers/softpipe/sp_tile_cache.c
2009-08-21softpipe: remove tex sample dependencies on softpipeBrian Paul
The texture sampling code doesn't really have any dependencies on the rest of softpipe, just the tile cache.
2009-08-21softpipe: per-unit sampler varientsBrian Paul
Can't share sampler varients across multiple tex units because the texture pointer is in the sampler varient. That prevents different textures per unit. Fixes progs/demos/multiarb, progs/glsl/samplers, etc.
2009-08-21softpipe: add missing PIPE_TEXTURE_CUBE case in get_lambda_func()Brian Paul
Fixes progs/demos/cubemap
2009-08-21softpipe: add missing sp_sampler_varient_destroyKeith Whitwell
2009-08-21softpipe: remove redundant comparison, make test easier to understandBrian Paul
2009-08-21softpipe: fix min/mag filter typoBrian Paul
2009-08-21softpipe: fix s/t/p typosBrian Paul
2009-08-21softpipe: rework texture sampling codeKeith Whitwell
Split into component pieces, stitch together at runtime using function pointers. Make it possible to utilize the existing fastpaths as image-level filters for generic mip-filtering routines. Remove special case for rectangle filtering, as it can now be handled by the 2d path. As most of the mesa demo texturing was already covered by fast paths, its harder to find examples of speedups, but tunnel gets a boost as mip-nearest filtering is now able to access the img_2d_linear_wrap_POT functions for sampling within a mipmap level.
2009-08-20softpipe: allow the existing sampler routines to be hooked up directlyKeith Whitwell
Let eg. sp_get_samples_rect be hooked directly in as the tgsi sampler routine. Add a field to determine whether this is a vertex or fragment sampling call, and massage parameters to match the tgsi call.
2009-08-20softpipe: fix xpot calculation typo in sp_get_samples_2d_nearest_clamp_POTKeith Whitwell
2009-08-20softpipe: slightly optimized tiling calculationKeith Whitwell
2009-08-20softpipe: fix glitch in texel lookups on fastpathsKeith Whitwell
Fixes two issues - firstly for mipmap levels with one or more dimensions smaller than tilesize, the code was sampling off the edge of the texture (but still within the tile). Secondly, in the linear_mipmap_linear case, both the default code and new fastpath were incorrect. This change fixes the fastpath and adds a comment to the default path, which still needs to be fixed. Basically the issue is that the coordinates in the smaller texture level are/were being computed by just dividing thecoordinates from the larger texture level by two, as in: x0[j] /= 2; y0[j] /= 2; x1[j] /= 2; y1[j] /= 2; The issues with this are signficant. Initially x1 is most often equal to x0+1, but after this, it will likely be equal to x0, so we will not actually be performing the linear blend within the smaller mipmap. The fastpath code avoided this (recalculated x1), but was still using the weighting factors from the larger mipmap level (xw, yw), which were incorrect. Change the fastpath code to do two full, independent linear samples of the two mipmap levels before blending. The default code needs to do the same thing.
2009-08-20softpipe: optimized path for simple mipmap samplingKeith Whitwell
linear-mip-linear-repeat-POT sampling faspath, provides a very nice speedup to apps that do this common type of texturing. Test case: demos/terrain, turn fog off, turn texturing on. Without patch: 12 fps With patch: 20 fps.
2009-08-18softpipe: split texture and surface tile cachesKeith Whitwell
These do similar jobs but with largely disjoint code. Will want to evolve them separately going forward.
2009-07-27softpipe: fix off-by-one in nearest texcoord routinesKeith Whitwell
Stray '- 0.5' copied from linear versions.
2009-07-27softpipe: example fast paths for simple samplersKeith Whitwell
All these fastpaths are examples of the types of things we'd code-generate in a more sophisticated version of softpipe.
2009-07-22softpipe: shortcircuit repeated lookups of the same tileKeith Whitwell
The sp_tile_cache is often called repeatedly to look up the same tile. Add a cache (to the cache) of the single tile most recently retreived and make a quick inline check to see if this matches the subsequent request. Add a tile_address bitfield struct to make this check easier.
2009-07-22softpipe: remove backwards dependency from tilecache to softpipeKeith Whitwell
The tile cache is a utility, it shouldn't know anything about the entity which is making use of it (ie softpipe). Remove softpipe parameter to all the tilecache function calls, and also remove the need to keep a softpipe pointer in the sampler structs.
2009-06-29softpipe: use shadow_compare4() to compare texcoord to four texture samplesBrian Paul
2009-06-29softpipe: pass sampler state to shadow_compare()Brian Paul
2009-06-19softpipe: return alpha=1 in shadow_compare() functionBrian Paul
The alpha value wasn't set at all before so we got unpredictable results. Note that we don't currently obey GL_DEPTH_TEXTURE_MODE in the state tracker. For now, we return the result in the default mode (r,r,r,1).
2009-02-11softpipe: rename sp_headers.h to sp_quad.hBrian
This header describes the quad-related datatypes afterall.
2008-12-17softpipe: fix vertex shader texture samplingBrian Paul
Need to disable/bypass lambda calculation since derivatives of texcoords are meaningless for adjacent vertices.
2008-12-01softpipe: minor tweaks, clean-upsBrian
2008-12-01softpipe: compute nearest/linear texcoords four at a time.Brian
A small step toward SIMD-izing the code.
2008-12-01gallium: minor texture-related clean-ups, comments, etcBrian
2008-11-23softpipe: remove old/unneeded dependencies between TGSI exec and softpipeBrian
Use tgsi_sampler struct as a base class. Softpipe subclasses it and adds the fields it needs.
2008-08-24gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.hBrian Paul
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-22gallium: stop using ifloor(), FABSF(), etcBrian Paul
2008-08-22gallium: replace LOG2() macro with util_fast_log2() inline funcBrian Paul
2008-08-07gallium: s/pf_sprint_name/pf_name/Brian Paul
2008-08-07gallium: s/printf/debug_printf/Brian Paul
2008-08-07gallium: new/better debug code (disabled)Brian Paul
2008-08-07softpipe: Silence compiler warnings on Windows.Michal Krol
2008-08-06softpipe: add texture border color codeBrian Paul
2008-07-28Merge tgsi/exec and tgsi/util directories.José Fonseca
2008-05-02gallium: new debug code (disabled)Brian Paul