Commit graph

36100 commits

Author SHA1 Message Date
Luca Barbieri
684aeb366f translate_generic: fix broken A8R8G8B8_UNORM output
translate was attempting to output A8R8G8B8_UNORM as if it were
R8G8B8A8_UNORM.

Now the tests just added pass.
2010-08-11 16:27:58 +02:00
Luca Barbieri
945e38c73b translate: add testsuite
Currently only checks all possible format conversions, and doesn't
attempt to test whether multiple buffers/elements or indices work.
2010-08-11 16:27:58 +02:00
Luca Barbieri
16b45ca7ce translate_generic: return NULL instead of assert(0) if format not supported
This gives the caller a chance to recover (or crash anyway otherwise).
2010-08-11 16:27:57 +02:00
Luca Barbieri
deb809ec98 auxiliary: fix util_framebuffer_copy
util_framebuffer_copy was attempting to copy all elements of the
source framebuffer state.

However, this breaks if the user does not zero initialize the structure.
Instead, only copy the elements up to nr_cbufs, and clear elements up
to dst->nr_cbufs, if the destination was larger than the source.
2010-08-11 16:27:57 +02:00
José Fonseca
10ce6779e8 gallivm: Use lp_build_div instead of lp_build_mul + lp_build_rcp.
Single divide, so let lp_build_div decide how to implement this.

This will save a multiplication in architectures which don't have
a RCP intrinsic.
2010-08-11 15:14:10 +01:00
José Fonseca
f8533482f4 gallivm: Use unsigned shift in lp_build_minify.
Texture dimensions are unsigned.
2010-08-11 15:14:10 +01:00
José Fonseca
66f57235d5 llvmpipe: Debug code to dump interpolation coefficients. 2010-08-11 15:14:10 +01:00
José Fonseca
3deca2e284 llvmpipe: Use single precision divide for one over area computation. 2010-08-11 15:14:10 +01:00
Marek Olšák
4b20ad7559 util: copy the u_staging commit message to the code 2010-08-11 15:11:42 +02:00
Luca Barbieri
b85c71d4e1 auxiliary: support for transfers using staging resources
Direct3D 10/11 has no concept of transfers. Applications instead
create resources with a STAGING or DYNAMIC usage, copy between them
and the real resource and use Map to map the STAGING/DYNAMIC resource.

This util module allows to implement Gallium drivers as a Direct3D
driver would be implemented: transfers allocate a resource with
PIPE_USAGE_STAGING, and copy the data between it and the real resource
with resource_copy_region.
2010-08-11 13:03:00 +02:00
Luca Barbieri
6f3c4819ec gallium: add ALWAYS_INLINE
Used when we want to be sure the compiler inlines a large function into
an inner loop.
2010-08-11 11:27:46 +02:00
Luca Barbieri
5668526c91 u_surfaces: add util_surfaces_peek
Used to find out if a surface exists without creating one.
2010-08-11 11:20:16 +02:00
Luca Barbieri
e45b2ce2c3 u_surfaces: use cso_hash instead of util_hash_table
Using cso_hash directly is the right thing since util_hash_table
adds useless overhead and is harder to use for this application.
2010-08-11 11:19:23 +02:00
Luca Barbieri
24f5ebb1d7 u_surfaces: fix surface leak due to off by one 2010-08-11 11:17:35 +02:00
Luca Barbieri
58b104d7f0 auxiliary: make primitive splitter assert on unimplemented adjacency prims
They are unimplemented, even though the framework makes it possible to
implement them well, and nv50 needs them.
2010-08-11 11:08:51 +02:00
Luca Barbieri
eee5cea385 auxiliary: fix u_split_prim naming convention
Current practice is to start identifiers with "util_" instead of "u_".
2010-08-11 11:08:51 +02:00
Luca Barbieri
0dcf0f9dfa auxiliary: move Ben Skeggs' primitive splitter to common code
This is a simple framework that handles splitting primitives in an
abstract way.

The user has to specify the primitive start, start index and count.

Then, it can ask the primitive splitter to "draw" a chunk of the
primitive, staying under a given vertex/index budget.

The primitive splitter will then call user-supplied functions to
emit a range of vertices/indices, as well as switch the edgeflag
on or off.

This is particularly useful for hardware that either has limits
on the vertex count field, or where vertices are pushed on a FIFO
or temporary buffer of limited size.

Note that unlike other splitters, it does not manipulate data in
any way, and merely asks a callback to do so, in vertex intervals.
2010-08-11 11:08:46 +02:00
Vinson Lee
0578acbe18 mesa: Include missing header in prog_noise.h.
Include glheader.h for GLfloat symbol.
2010-08-11 01:10:54 -07:00
Vinson Lee
f36a4b3c9e mesa: Clean up header file inclusion in prog_instruction.h.
Remove mfeatures.h.
Include glheader.h for GL symbols.
2010-08-11 01:06:58 -07:00
Vinson Lee
c20e92c3e0 mesa: Include missing header in prog_execute.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:43:28 -07:00
Vinson Lee
2a5bf7b4d2 mesa: Include missing header in prog_cache.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:35:34 -07:00
Vinson Lee
1c5a077e1b mesa: Include missing header in nvvertparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:33:02 -07:00
Vinson Lee
13887f389f mesa: Include missing header in nvfragparse.h.
Include mtypes.h for GLcontext symbol.
2010-08-11 00:29:26 -07:00
Vinson Lee
48f8495040 mesa: Remove unnecessary header from hash_table.h. 2010-08-11 00:26:05 -07:00
M.Froehlich@science-computing.de
c8e714df01 swrast: fix span color array pointer assignment for 32-bit/channel rendering
See fd.o bug 29487.

NOTE: This is a candidate for the 7.8 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 21:21:26 -06:00
Marek Olšák
ca5227ce8b r300g: initialize VAP_VTX_STATE_CNTL
This got lost during the rasterizer rewrite.
2010-08-11 04:48:56 +02:00
Marek Olšák
683ef52e19 r300g: implement gl_FrontFacing 2010-08-11 04:48:56 +02:00
Vinson Lee
cc732bf894 swrast: Remove unnecessary header. 2010-08-10 18:05:52 -07:00
Vinson Lee
61205f6189 svga: Remove unnecessary headers. 2010-08-10 17:53:08 -07:00
Vinson Lee
34cdad62dd r300g: Remove unnecessary header. 2010-08-10 17:39:13 -07:00
Nigel Stewart
6768afbe9f glut: also check for GLX_ARB_multisample
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-10 17:28:33 -06:00
Brian Paul
bbfdcc16df mesa: use switch stmt in init_program_limits() 2010-08-10 17:27:56 -06:00
Brian Paul
f6ca938bcb mesa: remove obsolete comments 2010-08-10 17:27:55 -06:00
Tom Stellard
8dd4308b5e r300/compiler: Use predicate bit for IF statements in r500 vertex shaders 2010-08-10 13:17:25 -07:00
Tom Stellard
c298bab60e r300/compiler: Implement hardware assisted loops for vertex shaders.
Single loops work, but nested loops do not.
2010-08-10 13:17:25 -07:00
Tom Stellard
5c7b7da798 r300/compiler: Correctly transform nested loops. 2010-08-10 13:17:25 -07:00
Jerome Glisse
72f8edfc0b r600g: avoid reemiting literal, avoid scheduling empty cs
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-10 11:53:05 -04:00
José Fonseca
247b253d32 util: Add util_format_srgb().
To convert RGB -> SRGB format.
2010-08-10 16:37:19 +01:00
Brian Paul
f263fdee81 gallivm: fix non-SSE4.1 case in lp_build_pack2()
Since there's no SSE instruction for this case, fall through to the
generic shuffle code.

Fixes bug fd.o 29468.
2010-08-10 08:56:57 -06:00
Brian Paul
4567b47953 mesa: additional program limit assertions 2010-08-10 08:38:19 -06:00
Brian Paul
b80a830cd8 mesa: fix comment typo 2010-08-10 08:38:19 -06:00
nobled
20b3e40f16 gallivm: Fix bitwise operations for floats, division for integers
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
a44a6960fa gallivm: Even more type checking
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
nobled
e9f3994b16 llvmpipe: Always use floating-point operators for floating-point types
See:
http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
Henri Verbeet
e165453f84 radeon: Use MESA_FORMAT_SARGB8 for sRGB formats
This can be supported on r600 without using the endian swapper, and is a
better fit for (typical) uploads using GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
anyway.
2010-08-09 15:06:02 -04:00
Henri Verbeet
08933b5a17 r600c: Disable alpha test during blits 2010-08-09 15:03:27 -04:00
José Fonseca
6e1f9bc8f6 gallivm: More type checks. 2010-08-09 17:31:18 +01:00
José Fonseca
8a3a971743 gallivm: Don't call LLVMBuildFNeg on llvm-2.6.
It didn't exist yet.
2010-08-09 17:31:18 +01:00
nobled
fc9a49b638 gallivm: Always use floating-point operators for floating-point types
This fixes the assert added in LLVM 2.8:
assert(getType()->isIntOrIntVectorTy() &&
       "Tried to create an integer operation on a non-integer type!")

But it also fixes some subtle bugs, since we should've been doing this
since LLVM 2.6 anyway.

Includes a modified patch from steckdenis@yahoo.fr for the
FNeg instructions in emit_fetch(); thanks for pointing those out.

http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-09 17:31:18 +01:00
José Fonseca
65b9747a54 util: Move _mm_shuffle_epi8() to u_sse.h.
It's bound to be useful elsewhere.
2010-08-09 17:31:18 +01:00