Roland Scheidegger
d302804deb
util: fix strict aliasing issues in u_format_r11g11b10f.h
2011-06-09 01:14:51 +02:00
Roland Scheidegger
b3d5822e93
util: add gcc version check for builtins
...
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12
util: better logbase2/next_power_of_two implementations
...
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
Brian Paul
5f2deba9f3
gallium: s/bool/boolean/
2011-06-08 08:05:40 -06:00
Stéphane Marchesin
cec2082ae5
Gallium: fix indentation in u_blitter.c
2011-06-06 12:35:59 -07:00
Marcin Slusarz
155cf15ce2
util: add \n to debug_checkpoint_full
...
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Dave Airlie
970726dd6f
u_prim: convert u_trim_pipe_prim to table driven.
...
This makes this function not be an always miss for the branch predictor.
Noticed using cachegrind, makes a minor difference to gears numbers on r600g.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
f62e1f41b4
util: faster logbase2
2011-06-02 08:45:27 -06:00
Marek Olšák
390196ecc7
u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset
2011-05-17 01:21:30 +02:00
Marek Olšák
51095f74cf
u_vbuf_mgr: fix max_index computation once again
...
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.
Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)
This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Matt Turner
c5ac8a8aa2
Remove redundant util_unsigned_logbase2
...
util_logbase2 is exactly the same function.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8
u_math.h: Remove redundant mingw32 ffs definition
...
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Marek Olšák
b48359184e
util: implement R11G11B10_FLOAT pack/unpack functions
...
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615
mesa, util: move RGB9E5 conversion functions to gallium/util
...
Also use MAX3 and incorporate Ian's suggestion in texformat.c.
I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36
util: implement R9G9B9E5 pack and unpack functions
...
softpipe and llvmpipe support done (sampler only).
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
b8de75d537
util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient
2011-04-27 13:16:35 +02:00
Marek Olšák
4ad63659c0
galahad,util: warn on resource target mismatch in copy_region
...
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4
util: add a simple memcpy path for copying buffers in util_resource_copy_region
...
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
75fa5c99a8
gallium: add and use generic function for querying patented format support (v2)
...
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0
gallium: add A/L/LA/I floating point formats
2011-04-15 05:08:00 +02:00
pepp
45920d2ecb
u_vbuf_mgr: fixed vbo max_index calculation
...
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-11 17:35:28 +02:00
Marek Olšák
a0d154dc13
u_vbuf_mgr: fix crash with unsupported vertex format in hw VBOs
2011-04-08 19:31:26 +02:00
Brian Paul
ef2c80f506
util: add cpu detection for sse 4.2 and avx
2011-04-07 13:41:52 -06:00
Brian Paul
1e105741f1
util: simplify bit shifting in util_cpu_detect()
2011-04-07 13:41:52 -06:00
José Fonseca
3733da31e8
draw: Prevent out-of-bounds vertex buffer access.
...
Based on some code and ideas from Keith Whitwell.
2011-04-01 20:18:18 +01:00
Jerome Glisse
ebe304fa54
gallium: list use inline function to avoid macro shot coming
...
Macro can lead to hard to debug list bugs. For instance consider
the following :
LIST_ADD(item, list->prev)
3 instruction of the macro became :
(list->prev)->next->prev = item
which is equivalent to :
list->prev = item
Thus list prev field changes and next instruction in the macro
(list->prev)->next = item
became :
item->next = item
And you endup with list corruption, other case lead to similar
list corruption. Inline function are not affected by this short
coming
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-03-30 17:03:00 -04:00
Marek Olšák
2af1da1546
gallium: add EXT_texture_snorm support
2011-03-29 12:04:55 +02:00
Mathias Fröhlich
65942e141f
gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.
...
Additionally, to discarding the whole buffer, use
PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write when the
write covers only part of the buffer.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:38 +01:00
José Fonseca
d2332569d2
util: Silence gcc unitialized member warning
2011-03-13 18:56:19 +00:00
Jakob Bornecrantz
1a79064da1
gallium: Delay the creation of simple helper shaders
2011-03-12 19:39:45 +01:00
Henri Verbeet
ab21147c89
u_blitter: Do blits in linear color space.
...
Blits between sRGB and linear formats should happen in linear color space.
This fixes piglit fbo/fbo-srgb-blit.
2011-03-12 16:43:58 +01:00
Marek Olšák
e968975cb5
gallium: remove the geom_flags param from is_format_supported
2011-03-11 21:39:30 +01:00
Marek Olšák
25485f4b69
gallium: kill is_resource_referenced
...
Only st/xorg used it and even incorrectly with regards to pipelined transfers.
2011-03-11 21:39:30 +01:00
José Fonseca
f0ea6395b6
util: Fix typo in u_upload_flush().
...
upload->offset is how much we used. upload->size is the whole buffer size.
2011-03-11 11:54:26 +00:00
Marek Olšák
bdf1038940
st/mesa: remove unnecessary flushes
...
The framebuffer cache flush should be implicit when calling
set_framebuffer_state.
There is no need to flush the command stream either.
2011-03-11 02:02:16 +01:00
Brian Paul
7dcf019af2
gallium/util: new polygon stipple utility helper
...
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc). Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
José Fonseca
d5249b7d89
util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write.
2011-03-09 11:17:45 +00:00
Keith Whitwell
05efcee46e
util: add ensure_sanity checks, fix a bug
...
Add ensure_sanity checks.
Fix a bug which caused us to misplace entries adding to a full cache.
2011-03-09 11:17:14 +00:00
Keith Whitwell
20962bf547
util: improve cache collision behaviour
...
Add linear probing on collisions.
Expand entry array by a fixed scale (currently 2) to help avoid
collisions.
Use a LRU approach to ensure that the number of entries stored in the
cache doesn't exceed the requested size.
2011-03-09 11:16:53 +00:00
Alex Corscadden
d00cbf46cd
util: Add remove to util_cache
...
I need to be able to remove entries from util_cache caches. This change
enables that functionality.
2011-03-09 11:16:49 +00:00
Alex Corscadden
eb2e8167fa
util: Allow util_draw_texquad to draw quads with non-integer coordinates.
2011-03-09 11:16:49 +00:00
Marek Olšák
b39bccbd4e
gallium: add timeout parameter to fence_finish
...
This is a follow-up to the ARB_sync patch for st/mesa and completes
the ARB_sync implementation.
2011-03-08 23:52:37 +01:00
Marek Olšák
23f92c20d7
gallium/util: add LATC support
...
Again, a lot of code is shared with RGTC.
The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Dave Airlie
8d62b2aca9
gallium: add RGTC UNORM support to u_format.
...
SNORM needs a bit of work in the state tracker in order for mipmap
generation to work I believe.
I'm also not sure that having unorm fetches for an snorm format is
sane.
2011-03-02 15:30:16 +10:00
Marek Olšák
fbedd9c73a
u_vbuf_mgr: compute user buffer size for instance data from instance_count
2011-03-01 00:46:58 +01:00
Christian König
bce4f9ac39
st/mesa & v_bug_mgr: two small instanced drawing fixes
2011-02-28 02:19:39 +01:00
Jakob Bornecrantz
ca8a91ff7e
util: Don't destroy shaders null shaders
...
Fixes regression from a08e612fd8
2011-02-26 02:32:22 +01:00
Jakob Bornecrantz
a08e612fd8
util: Don't create array texture shaders if the driver doesn't support it
2011-02-26 00:50:52 +01:00
Dave Airlie
179ff0551c
gallium/util: add 1d/2d mipmap generation support
...
so far only hw mipmap generation is testing on softpipe,
passes test added to piglit.
this requires another patch to mesa to let array textures mipmaps
even start to happen.
2011-02-25 16:06:15 +10:00
Fabian Bieler
728695b435
gallium/utils: Fix vertex element setup
...
Check if element was translated per element instead of per buffer.
2011-02-24 15:05:10 +01:00