summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/translate
Commit message (Collapse)AuthorAgeFilesLines
* translate: implement translation of 10_10_10_2 typesMarek Olšák2012-01-051-0/+148
| | | | | | | | | This is for GL_ARB_vertex_type_2_10_10_10_rev. I just took the code from u_format_table.c. It's based on pack_rgba_float. I had no other choice. The u_format hooks are not exactly compatible with translate. The cleanup of it is left for future work. Reviewed-by: Dave Airlie <[email protected]>
* translate: implement translation of (pure) integer formatsMarek Olšák2012-01-051-94/+252
| | | | | | | The conversion is limited to only a few cases, because converting to any other type shouldn't happen in any driver. Reviewed-by: Dave Airlie <[email protected]>
* translate: implement translation of half floats in the generic codepathMarek Olšák2012-01-051-0/+21
|
* translate: check for PIPE_SUBSYSTEM_EMBEDDEDBrian Paul2011-09-221-1/+1
|
* rtasm,translate: Disable on Mingw-w64.José Fonseca2011-09-061-1/+1
| | | | | | Causes crash and stack corruption. Needs more investigation. Disable for now.
* translate: disable clamping of instanced array indexesBrian Paul2011-04-192-9/+16
| | | | | | This fixes piglit's draw-instanced-divisor test for softpipe on both the generic and SSE paths. This is temporary until we have the correct per-array max_index information.
* translate: s/varient/variant/Brian Paul2011-04-151-44/+44
|
* translate: Respect translate_buffer::max_index.José Fonseca2011-04-011-2/+17
|
* secure malloc in translate_cache_createTim Wiederhake2011-01-241-0/+4
| | | | Signed-off-by: Brian Paul <[email protected]>
* translate: remove unused prototypesBrian Paul2010-10-251-9/+0
|
* translate: use function typedefs, casts to silence warningsBrian Paul2010-10-252-27/+35
|
* translate_sse: clear state for each function emissionLuca Barbieri2010-08-241-3/+3
| | | | Fixes #29771.
* translate_sse: fix x86-64Luca Barbieri2010-08-231-0/+1
|
* translate_sse: add R32G32B32A32_FLOAT -> X8X8X8X8_UNORM for EMIT_4UBJakob Bornecrantz2010-08-221-0/+26
| | | | Changed by me to use movd instead of movss to avoid penalties.
* translate_sse: refactor constant managementLuca Barbieri2010-08-221-81/+76
|
* translate_sse: Silence uninitialized variable warnings.Vinson Lee2010-08-211-0/+14
| | | | Initialize variables on error paths.
* translate_sse: enable on Win64Luca Barbieri2010-08-201-2/+1
| | | | According to Vinson, enabling it causes no regressions
* translate_sse: fix emit_load_sse2Luca Barbieri2010-08-191-0/+2
|
* translate_sse: don't overwrite source buffer pointerLuca Barbieri2010-08-181-5/+5
| | | | | We were putting the source pointer in a register used as a temporary, breaking all paths that don't read the data in a single instruction.
* translate: Move loop variable declaration outside for loop.Vinson Lee2010-08-161-1/+2
| | | | Fixes MSVC build.
* translate: Remove unused temporary register.José Fonseca2010-08-161-1/+0
| | | | Assuming the side-effect of x86_make_reg is also unnecessary.
* translate: Eliminate void pointer arithmetic.José Fonseca2010-08-161-1/+1
| | | | Non-portable.
* translate_sse: major rewrite (v5)Luca Barbieri2010-08-162-239/+936
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: Win64 is untested, and is thus currently disabled. If you have such a system, please enable it and report whether it works. To enable it, change src/gallium/auxiliary/translate/translate.c Changes in v5: - On Win64, preserve %xmm6 and %xmm7 as required by the ABI - Use _WIN64 instead of WIN64 Changes in v4: - Use x86_target() and x86_target_caps() - Enable translate_sse in x86-64, but not in Win64 Changes in v3: - Win64 support (untested) - Use u_cpu_detect.h constants instead of #ifs Changes in v2: - Minimize #ifs - Give a name to magic number CHANNELS_0001 - Add support for CPUs without SSE (only memcpy and swizzles, like non SSE2) - Fixed comments translate_sse is currently very limited to the point of being useless in essentially all cases. In particular, it only support some float32 and unorm8 formats and doesn't work on x86-64. This commit rewrites it to support: 1. Dumb memory copy for any pair of identical formats 2. All formats that are swizzles of each other 3. Converting 32/64-bit floats and all 8/16/32-bit integers to 32-bit float 4. Converting unorm8/snorm8 to snorm16 and uscaled8/sscaled8 to sscaled16 5. Support for x86-64 (doesn't take advantage of it in any way though) This new translate can even be useful to translate index buffers for cards that lack 8-bit index support. It passes the testsuite I wrote, but note that this is a major change, and more testing would be great.
* translate: add support for 8/16-bit indicesLuca Barbieri2010-08-163-19/+92
| | | | | Currently, only 32-bit indices are supported, but some use cases translate needs support for all types.
* translate_sse: remove useless generated function wrappersLuca Barbieri2010-08-161-51/+4
| | | | | | | | | | Currently translate_sse puts two trivial wrappers in the translate vtable. These slow it down and enlarge the source code for no gain, except perhaps the ability to set a breakpoint there, so remove them. Breakpoints can be set on the caller of the translate functions, with no loss of functionality.
* translate_generic: factor out common code between linear and indexedLuca Barbieri2010-08-161-115/+62
| | | | This moves the common code into a separate ALWAYS_INLINE function.
* translate_generic: use memcpy if possible (v3)Luca Barbieri2010-08-161-33/+75
| | | | | | | | | | | | | | | | | | | | | | | | 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).
* translate: allow clients to ask for supported output formatsLuca Barbieri2010-08-113-0/+88
| | | | | | | | | | | | | 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.
* Revert "translate_generic: return NULL instead of assert(0) if format not ↵Luca Barbieri2010-08-111-6/+9
| | | | | | | | | | | 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.
* translate_generic: fix broken A8R8G8B8_UNORM outputLuca Barbieri2010-08-111-3/+9
| | | | | | | translate was attempting to output A8R8G8B8_UNORM as if it were R8G8B8A8_UNORM. Now the tests just added pass.
* translate_generic: return NULL instead of assert(0) if format not supportedLuca Barbieri2010-08-111-9/+6
| | | | This gives the caller a chance to recover (or crash anyway otherwise).
* gallium/translate: make generic_run() and generic_run_elts() more alikeBrian Paul2010-08-031-19/+44
| | | | Plus more debug code and do clamping in generic_run().
* translate: don't crash on elts paths with instancesZack Rusin2010-06-161-10/+13
|
* translate: Make translate_generic truly generic.José Fonseca2010-05-031-301/+90
| | | | | PIPE_FORMAT_R10G10B10X2_USCALED, half floats, were not supported, so just rely on u_format for (almost) universal format support.
* translate: Take and respect a max_index argument.José Fonseca2010-04-263-8/+24
|
* gallium: fix BGRA vertex color swizzlesMarek Olšák2010-03-122-6/+6
| | | | | | | | | | | | | | 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 <[email protected]>
* translate: Rename pipe formats.José Fonseca2010-03-012-6/+6
|
* gallium: Handle InstanceID as a true 32-bit uint.Michal Krol2010-01-051-18/+5
|
* Merge branch 'master' into instanced-arraysMichal Krol2010-01-052-24/+0
|\ | | | | | | | | | | Conflicts: src/gallium/auxiliary/tgsi/tgsi_dump.c src/gallium/include/pipe/p_shader_tokens.h
| * gallium: Generate a single library for auxiliaries with Make too.José Fonseca2010-01-011-12/+0
| |
| * scons: Aggregate all tiny libraries in a single library.José Fonseca2010-01-011-12/+0
| | | | | | | | | | Makes integration of gallium into out of tree components much easier. No pratical change for components in this tree,
* | Add lame support for instanceID to draw module.Michal Krol2009-12-303-31/+71
| | | | | | | | It's all screaming for integer support -- fake it with float for now.
* | Implement instanced indexed draw.Michal Krol2009-12-303-12/+23
| |
* | translate: Fix a call to indexed SSE run.Michal Krol2009-12-301-0/+2
| |
* | translate: Implement instancing for linear SSE run.Michal Krol2009-12-301-34/+120
| |
* | Implement draw_arrays_instanced() in softpipe.Michal Krol2009-12-293-3/+16
| | | | | | | | | | Modify the translate module to respect instance divisors and accept instance id as a parameter to calculate input vertex offset.
* | translate: Fix translate_key_compare().Michal Krol2009-12-291-2/+7
|/ | | | Sizes of translate keys must also match.
* gallium: replace // comments with /* */Brian Paul2009-10-021-1/+1
|
* translate: Avoid unused variable warning.José Fonseca2009-03-251-0/+2
|
* gallium: Improve makefiles for librariesJakob Bornecrantz2009-02-201-3/+0
| | | | | | | | The template makefile that most libraries in gallium included was based on dri and had a bunch unrelevant junk in it. Update it and improve the depending makefiles.