Age | Commit message (Collapse) | Author |
|
Non-portable.
|
|
Currently, only 32-bit indices are supported, but some use cases
translate needs support for all types.
|
|
This moves the common code into a separate ALWAYS_INLINE function.
|
|
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).
|
|
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.
|
|
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 was attempting to output A8R8G8B8_UNORM as if it were
R8G8B8A8_UNORM.
Now the tests just added pass.
|
|
This gives the caller a chance to recover (or crash anyway otherwise).
|
|
Plus more debug code and do clamping in generic_run().
|
|
|
|
PIPE_FORMAT_R10G10B10X2_USCALED, half floats, were not supported, so
just rely on u_format for (almost) universal format support.
|
|
|
|
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>
|
|
|
|
It's all screaming for integer support -- fake it with float for now.
|
|
|
|
Modify the translate module to respect instance divisors and accept
instance id as a parameter to calculate input vertex offset.
|
|
|
|
|
|
Also, rename p_tile.[ch] to u_tile.[ch]
|
|
|
|
|
|
Conflicts:
src/gallium/auxiliary/draw/draw_pt_varray.c
|
|
|
|
|
|
- specify cdecl calling convention on WIN32
- fix load bgra8 function
- fix previous don't crash fix.
|
|
|
|
Appearently MSVC c-preprocessor parses "255.0f" as two tokens:
"255.0" and "f", and performs variable substitution on "f".
|
|
Will eventually do this for all instances where we are converting vertices
from one format to another.
|
|
|
|
|