Commit Graph

42670 Commits

Author SHA1 Message Date
Marek Olšák 38104a767c r300g: disable linear filtering for float textures 2011-02-16 00:55:39 +01:00
Chad Versace 62c8c77333 glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.
2011-02-15 15:46:12 -08:00
Chad Versace f2e9981e43 Revert "glsl: Fix constant-folding for reciprocal expressions"
This reverts commit b3cf92aa91.

The reverted commit prevented constant-folding of reciprocal expressions
when the reciprocated expression was 0. However, since the spec allows
division by zero, constant-folding *is* permissible in this case.

From Section 5.9 of the GLSL 1.20 spec:
    Dividing by zero does not cause an exception but does result in an
    unspecified value.
2011-02-15 15:46:12 -08:00
Chad Versace a231ac23f4 tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

Fixes bug: http://bugs.freedesktop.org/show_bug.cgi?id=34047

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 15:39:22 -08:00
Dave Airlie 632918d3ec r600g: add srgb compressed formats to the list. 2011-02-16 08:54:14 +10:00
Marek Olšák eafb7f234d gallium: add usage parameter to pipe_buffer_create
And set a reasonable buffer usage flag everywhere instead of
just PIPE_USAGE_DEFAULT.
2011-02-15 22:44:21 +01:00
Fabian Bieler 82a9794a35 r600g: Fix RGB10_A2 format handling 2011-02-15 12:31:30 -05:00
Dave Airlie 4b81c5f6e1 r600g: fix regression in r6/7xx since mipmap rework
I typod this when copy-pasting.
2011-02-15 18:43:56 +10:00
Vinson Lee cd8af3b60b nvc0: Fix uninitialized variable warning.
Fixes this GCC warning.
nvc0_tgsi_to_nc.c: In function 'bld_tex':
nvc0_tgsi_to_nc.c:1392: warning: 'dim' may be used uninitialized in this function
2011-02-15 00:27:16 -08:00
Marek Olšák b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Dave Airlie 8e0437914b r600g: add support for s3tc formats.
On r600, s3tc formats require a 1D tiled texture format,
so we have to do uploads using a blit, via the 64-bit and 128-bit formats

Based on the r600c code we use a 64 and 128-bit type to do the
blits.

Still requires R600_ENABLE_S3TC until the kernel fixes are in,
this has only been tested on evergreen where the kernel doesn't
yet get in the way.
2011-02-15 14:44:09 +10:00
Dave Airlie a661dacf14 r600g: fix miptree calculations
the miptree setup and pitch storing didn't work so well for block
based things like compressed textures. The CB takes blocks, where
the texture sampler takes pixels, and transfers need bytes,

So now we store blocks/bytes and translate to pixels in the sampler.

This is necessary for s3tc to work properly.
2011-02-15 14:44:08 +10:00
Dave Airlie ea7a548d07 r600g: drop tiled flag
we can work this out from the array_mode and it makes more sense
to do that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Dave Airlie fdb4373a20 st/mesa: fix compressed mipmap generation.
If the underlying transfer had a stride wider for hw alignment reasons,
the mipmap generation would generate badly strided images.

this fixes a few problems I found while testing r600g with s3tc

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Marek Olšák dc578188fa st/mesa: fix GLES build
Broken since d5062fb3a3.

I wonder why this code is hidden behind #if by default.
2011-02-15 04:56:09 +01:00
Marek Olšák 333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák 45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák 8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák 18b4978ac8 r300g: implement fences using dummy relocations
So finally we have them.
2011-02-15 04:00:46 +01:00
Marek Olšák 4faf11ad6c r300g: fix SIGFPE on debug builds 2011-02-15 01:19:54 +01:00
Marek Olšák 56029ce52b r300g: inline some of the pipe_buffer_map/unmap calls 2011-02-15 01:19:54 +01:00
Marek Olšák 20112cca26 r300g: do not track whether occlusion queries have been flushed
The winsys takes care of flushing automatically.
2011-02-14 23:36:12 +01:00
Marek Olšák 89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Vinson Lee ec21eabe2a st/python: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 14:10:05 -08:00
Vinson Lee 7582448016 graw: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 13:53:09 -08:00
Fabian Bieler a476ca1fd1 st/mesa: Use blend equation and function of first render target for all render targets if ARB_draw_buffers_blend is not supported
If EXT_draw_buffers2 is supported but ARB_draw_buffers_blend isn't
_mesa_BlendFuncSeparateEXT only sets up the blend equation and function for the
first render target. This patch makes sure that update_blend doesn't try to use
the data from other rendertargets in such cases.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-14 14:37:18 -07:00
Marek Olšák a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák 49579a4df8 pb_bufmgr_cache: add is_buffer_busy hook and use it instead of non-blocking map
This is cleaner and implementing the hook is optional.
2011-02-14 21:51:01 +01:00
Marek Olšák 588fa884d2 gallium: notify drivers about possible changes in user buffer contents
Also implement the redefine_user_buffer hook in the drivers.
2011-02-14 21:50:08 +01:00
Marek Olšák 2a904fd6a0 st/mesa: set vertex arrays state only when necessary
The vertex arrays state should be set only when (_NEW_ARRAY | _NEW_PROGRAM)
is dirty. This assumes user buffer content is mutable, which will be
sorted out in the next commit. The following usage case should be much faster
now:

for (i = 0; i < 1000; i++) {
   glDrawElements(...);
}

Or even:

for (i = 0; i < 1000; i++) {
   glSomeStateChangeOtherThanArraysOrProgram(...);
   glDrawElements(...);
}

The performance increase from this may be significant in some apps and
negligible in others. It is especially noticable in the Torcs game (r300g):
    Before: 15.4 fps
    After: 20 fps

Also less looping over attribs in st_draw_vbo yields slight speed-up
in apps with lots of glDraw* calls.
2011-02-14 21:50:08 +01:00
Marek Olšák cdca3c58aa gallium: remove pipe_vertex_buffer::max_index
This is redundant to pipe_draw_info::max_index and doesn't really fit
in the optimizations I plan.
2011-02-14 21:50:08 +01:00
Marek Olšák d5062fb3a3 gallium: always save and restore vertex buffers using cso_cache 2011-02-14 21:50:07 +01:00
Marek Olšák cfaf217135 vbo: bind arrays only when necessary
We don't need to call bind_arrays in the vbo module if the states
which the function depends on are not dirty.
2011-02-14 21:50:07 +01:00
Marek Olšák 5a01361cea vbo: notify a driver that we change buffer offsets, strides, etc. 2011-02-14 21:50:07 +01:00
Vinson Lee d123959ff7 r300g: Remove redundant initialization.
Remove redundant initialization from commit
3b01b52bd7 noticed by tstellar.
2011-02-14 10:47:58 -08:00
Alex Deucher 9e96ea0652 r600g: add alignment cases for linear aligned
Matches the drm and ddx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-14 13:07:29 -05:00
José Fonseca 07eb660fc9 draw: Don't define the last two mipmap levels in aa lines.
Some hardware needs to make a seperate copy of all levels to obey
max_lod, so simply do not define the last two levels instead of
clamping.
2011-02-14 10:56:48 +00:00
José Fonseca 9305e93114 svga: Set the appropriate flags when creating sampler/surface views. 2011-02-14 10:53:54 +00:00
Marek Olšák a0c293ec11 r300g: put indices in CS if there's just a few of them and are in user memory 2011-02-14 11:43:14 +01:00
Marek Olšák 437583ea63 r300g: cleanup the draw functions 2011-02-14 11:43:14 +01:00
Marek Olšák 476cec37d6 r300g: do not create a user buffer struct for misaligned ushort indices fallback 2011-02-14 11:43:14 +01:00
Marek Olšák d173f1ba8a r300g: fix fallback for misaligned ushort indices with num vertices >= 65535 2011-02-14 11:43:14 +01:00
Marek Olšák 3d5ac32f3b r300g: consolidate emission of common draw regs 2011-02-14 11:43:14 +01:00
Sedat Dilek 0f912534fd docs: Fix typo in GL3.txt 2011-02-14 00:45:44 -08:00
Vinson Lee 3b01b52bd7 r300g: Move declaration before code.
Fixes SCons build.
2011-02-14 00:07:07 -08:00
Marek Olšák e9d993e9b9 r600g: do not destroy the original index buffer when translating indices
Because we only translate a subrange of the buffer.
2011-02-14 07:45:14 +01:00
Marek Olšák 5a6ba08c21 r300g: emit 3D_LOAD_VBPNTR only when necessary
I thought I couldn't skip emitting this packet in some cases.
Well it looks like I can.
2011-02-14 07:45:14 +01:00
Marek Olšák 004dd01583 r300g: fix reference counting when translating indices 2011-02-14 07:45:14 +01:00
Marek Olšák 9a90eeee67 u_index_modify: map buffers with PIPE_TRANSFER_UNSYNCHRONIZED 2011-02-14 07:45:14 +01:00
Marek Olšák 5197b09bee r300g: remove the relocation after AARESOLVE_PITCH 2011-02-14 07:45:14 +01:00