summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/translate/translate_generic.c
AgeCommit message (Collapse)Author
2010-08-16translate: Eliminate void pointer arithmetic.José Fonseca
Non-portable.
2010-08-16translate: add support for 8/16-bit indicesLuca Barbieri
Currently, only 32-bit indices are supported, but some use cases translate needs support for all types.
2010-08-16translate_generic: factor out common code between linear and indexedLuca Barbieri
This moves the common code into a separate ALWAYS_INLINE function.
2010-08-16translate_generic: use memcpy if possible (v3)Luca Barbieri
Changes in v3: - If we can do a copy, don't try to get an emit func, as that can assert(0) Changes in v2: - Add comment regarding copy_size When used in GPU drivers, translate can be used to simultaneously perform a gather operation, and convert away from unsupported formats. In this use case, input and output formats will often be identical: clearly it would make sense to use a memcpy in this case. Instead, translate will insist to convert to and from 32-bit floating point numbers. This is not only extremely expensive, but it also loses precision for 32/64-bit integers and 64-bit floating point numbers. This patch changes translate_generic to just use memcpy if the formats are identical, non-blocked, and with an integral number of bytes per pixel (note that all sensible vertex formats are like this).
2010-08-11translate: allow clients to ask for supported output formatsLuca Barbieri
Currently translate asserts on unsupported output formats, making it impossible to use for some purposes, such as testing whether it actually works on all formats it supports. Removing the assert was met with opposition, so this change allows clients to ask whether an output format is supported, and they are thus able to avoid attempting to use it. Since this is just an addition to the API, no adverse effect is possible, and it makes the testsuite work again.
2010-08-11Revert "translate_generic: return NULL instead of assert(0) if format not ↵Luca Barbieri
supported" This reverts commit 16b45ca7cefb3432b4133fe9d0b1dbfe3f286131. José Fonseca asked for a revert. Note that the testsuite will now segfault since it attempts to test all possible formats.
2010-08-11translate_generic: fix broken A8R8G8B8_UNORM outputLuca Barbieri
translate was attempting to output A8R8G8B8_UNORM as if it were R8G8B8A8_UNORM. Now the tests just added pass.
2010-08-11translate_generic: return NULL instead of assert(0) if format not supportedLuca Barbieri
This gives the caller a chance to recover (or crash anyway otherwise).
2010-08-03gallium/translate: make generic_run() and generic_run_elts() more alikeBrian Paul
Plus more debug code and do clamping in generic_run().
2010-06-16translate: don't crash on elts paths with instancesZack Rusin
2010-05-03translate: Make translate_generic truly generic.José Fonseca
PIPE_FORMAT_R10G10B10X2_USCALED, half floats, were not supported, so just rely on u_format for (almost) universal format support.
2010-04-26translate: Take and respect a max_index argument.José Fonseca
2010-03-12gallium: fix BGRA vertex color swizzlesMarek Olšák
The mapping for vertex_array_bgra: (gl -> st -> translate) GL_RGBA -> PIPE_FORMAT_R8G8B8A8 (RGBA) -> no swizzle (XYZW) GL_BGRA -> PIPE_FORMAT_A8R8G8B8 (ARGB) -> ZYXW (BGRA again??) Iẗ́'s pretty clear that PIPE_FORMAT_A8R8G8B8 here is wrong. This commit fixes the pipe format and removes obvious workarounds in util/translate. Tested with: softpipe, llvmpipe, r300g. Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-03-01translate: Rename pipe formats.José Fonseca
2009-12-30Add lame support for instanceID to draw module.Michal Krol
It's all screaming for integer support -- fake it with float for now.
2009-12-30Implement instanced indexed draw.Michal Krol
2009-12-29Implement draw_arrays_instanced() in softpipe.Michal Krol
Modify the translate module to respect instance divisors and accept instance id as a parameter to calculate input vertex offset.
2009-10-02gallium: replace // comments with /* */Brian Paul
2008-09-03gallium: silence warningsBrian Paul
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-06-24gallium: Avoid double arithmetic.José Fonseca
2008-06-23gallium: added support for fixed-point formats, drawingBrian Paul
2008-05-28Merge branch 'gallium-vertex-linear' into gallium-0.1Jakob Bornecrantz
Conflicts: src/gallium/auxiliary/draw/draw_pt_varray.c
2008-05-28gallium: Windows CE portability fixes.José Fonseca
2008-05-23translate: mark functions as PIPE_CDECLKeith Whitwell
2008-04-19translate: fix several bugsKeith Whitwell
- specify cdecl calling convention on WIN32 - fix load bgra8 function - fix previous don't crash fix.
2008-04-19translate: don't crash on failure to create sse versionKeith Whitwell
2008-04-16gallium: Get the translate module to build on msvc.José Fonseca
Appearently MSVC c-preprocessor parses "255.0f" as two tokens: "255.0" and "f", and performs variable substitution on "f".
2008-04-15gallium: Switch one vertex path over to new translate moduleKeith Whitwell
Will eventually do this for all instances where we are converting vertices from one format to another.
2008-04-15translate: typo in emit_B8G8R8A8_UNORMKeith Whitwell
2008-04-15gallium: add a generic vertex (or other) buffer translation moduleKeith Whitwell