Commit Graph

35319 Commits

Author SHA1 Message Date
Brian Paul dd28b4c1fc mesa: implement uint texstore code
We used float temporary images before which could lose precision for
uint-valued texture images.
2010-11-07 18:33:42 -07:00
Brian Paul 90c52c26d8 mesa: rename vars in pixel pack/unpack code 2010-11-07 18:33:20 -07:00
Brian Paul e54d5a9d68 mesa: consolidate pixel packing/unpacking code 2010-11-07 18:33:07 -07:00
Vinson Lee 3a223c3098 mesa: Clean up header file inclusion in arrayobj.h. 2010-11-07 14:29:21 -08:00
Henri Verbeet 9f06411645 r600g: Mention AMD in the renderer string. 2010-11-07 18:40:12 +01:00
Vinson Lee 6bf0ac0916 mesa: Include mfeatures.h in api_validate.c for FEATURE_* symbols. 2010-11-06 21:13:40 -07:00
Vinson Lee d421149cc8 mesa: Include mfeatures.h in api_loopback for FEATURE_beginend. 2010-11-06 21:05:16 -07:00
Vinson Lee fb83400f6b mesa: Clean up header file inclusion in api_validate.h. 2010-11-06 20:56:15 -07:00
Vinson Lee af12de279e mesa: Clean up header file inclusion in api_loopback.h. 2010-11-06 20:50:13 -07:00
Vinson Lee 31bdc53057 mesa: Clean up header file inclusion in version.h. 2010-11-06 20:40:13 -07:00
Vinson Lee 7a33b1c0a9 mesa: Clean up header file inclusion in accum.h. 2010-11-06 20:27:45 -07:00
Eric Anholt d348b0c72d mesa: Fix delayed state flagging for EXT_sso-related program changes.
Flushing the vertices after having already updated the state doesn't
do any good.  Fixes useshaderprogram-flushverts-1.  As a side effect,
by moving it to the right place we end up skipping no-op state changes
for traditional glUseProgram.
2010-11-06 11:44:32 -07:00
Francisco Jerez 8eaa97592a meta: Don't try to disable cube maps if the driver doesn't expose the extension.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 02:40:21 +01:00
Francisco Jerez 2e64c2209e vbo: Avoid unnecessary copy to/from current in vertex format upgrade.
Rebuilding the vertex format from scratch every time we see a new
vertex attribute is rather costly, new attributes can be appended at
the end avoiding a copy to current and then back again, and the full
attr pointer recalculation.

In the not so likely case of an already existing attribute having its
size increased the old behavior is preserved, this could be optimized
more, not sure if it's worth it.

It's a modest improvement in FlightGear (that game punishes the VBO
module pretty hard in general, framerate goes from some 46 FPS to 50
FPS with the nouveau classic driver).

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-06 01:59:59 +01:00
Jakob Bornecrantz f1600d3a97 scons: Unify state tracker SConscripts 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz 7e9f5eab4e scons: Move dependancy checks to the main gallium scons file 2010-11-05 20:58:49 +00:00
Jakob Bornecrantz c0db7854d5 scons: Check for libdrm_[intel|radeon] as well
And run SConscripts if they are present.
Also make dri depend on both drm and x11.
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz b4ac0adb75 scons: Detabify
Drivers scons files for a later time
2010-11-05 20:58:49 +00:00
Jakob Bornecrantz 834cde5844 scons: Remove old pipebuffer SConscript 2010-11-05 20:58:49 +00:00
Brian Paul e82fddfcd3 softpipe: disable vertex texturing with draw/llvm
This is a temporary work around to prevent crashes with glean/glsl1
(for example) which try to do vertex shader texturing.
2010-11-05 14:41:40 -06:00
Brian Paul 55c5408ad0 gallivm: add const qualifiers, fix comment string 2010-11-05 08:51:53 -06:00
Brian Paul e8d6b2793f gallivm: alloca() was called too often for temporary arrays
Need to increment the array index to point to the last value.
Before, we were calling lp_build_array_alloca() over and over for
no reason.
2010-11-05 08:49:57 -06:00
Vinson Lee 3168c6ff1a i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'brw_wm_pass_fp':
brw_wm_fp.c:966: warning: 'last_inst' may be used uninitialized in this function
brw_wm_fp.c:966: note: 'last_inst' was declared here
2010-11-04 17:42:00 -07:00
Vinson Lee 03577f8250 i965: Silence uninitialized variable warning.
Silences this GCC warning.
brw_wm_fp.c: In function 'precalc_tex':
brw_wm_fp.c:666: warning: 'tmpcoord.Index' may be used uninitialized in this function
2010-11-04 17:39:17 -07:00
Vinson Lee eba2ad6de2 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_dataflow.c: In function 'get_readers_normal_read_callback':
radeon_dataflow.c:472: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:25:16 -07:00
Brian Paul c8f1687ce7 llvmpipe: added some debug assertions, but disabled 2010-11-04 18:21:45 -06:00
Vinson Lee 86559ce2d8 r300/compiler: Move declaration before code.
Fixes this GCC warning with linux-x86 build.
radeon_pair_schedule.c: In function 'merge_presub_sources':
radeon_pair_schedule.c:312: warning: ISO C90 forbids mixed declarations and code
2010-11-04 17:18:46 -07:00
Francisco Jerez 7831994868 meta: Fix incorrect rendering of the bitmap alpha component.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:54 -06:00
Francisco Jerez d846362389 meta: Don't leak alpha function/reference value changes.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-11-04 13:58:02 -06:00
Brian Paul ef6b7e0a30 tgsi: remove unused function 2010-11-04 13:35:20 -06:00
Tilman Sauerbeck 646a8b7e1d st/mesa: Reset the constant buffers before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-04 20:01:25 +01:00
Brian Paul e7f5d19a11 gallivm: implement execution mask for scatter stores 2010-11-04 10:01:28 -06:00
Brian Paul fb94747b66 gallivm: added lp_elem_type() 2010-11-04 10:00:58 -06:00
Brian Paul ede232e989 gallivm: add pixel offsets in scatter stores
We want to do the scatter store to sequential locations in memory
for the vector of pixels we're processing in SOA format.
2010-11-04 09:31:59 -06:00
Brian Paul 5b294a5d17 gallivm: added debug code to dump temp registers 2010-11-04 09:28:06 -06:00
Michal Krol 5d28d2f9d4 graw/gdi: Fix window dimensions.
The requested window size is of the client area,
so account for surrounding borders and bars when
creating the window.
2010-11-04 15:12:47 +01:00
Michal Krol c69979f243 scons: Hook-up graw-gdi target. 2010-11-04 14:34:27 +01:00
Michal Krol 29beaed6dc graw/gdi: Initial commit. 2010-11-04 14:34:27 +01:00
Guillermo S. Romero 560ad7e599 r300g: Do not use buf param before checking for NULL.
Commit 8dfafbf086 forgot to update r300g.
There is a buf == NULL check, but buf is used before for var init.

Tested-by: Guillermo S. Romero <gsromero@infernal-iceberg.com>
2010-11-04 13:26:24 +00:00
Michal Krol 420400f67f tgsi/build: Reduce interface clutter.
Make private those functions that are used internally only.
2010-11-04 12:20:14 +01:00
Michal Krol f93d6f929f tgsi/exec: Get rid of obsolete condition codes. 2010-11-04 11:51:10 +01:00
Michal Krol ee9366ab36 tgsi/exec: Cleanup the remaining arithmetic instructions.
As a result remove some nasty macros.
2010-11-04 11:37:24 +01:00
Vinson Lee d3fcadf840 dri/nouveau: Silence uninitialized variable warning.
Fixes this GCC warning.
nouveau_vbo_t.c: In function 'nv10_vbo_render_prims':
nouveau_render_t.c:161: warning: 'max_out' may be used uninitialized in this function
nouveau_render_t.c:161: note: 'max_out' was declared here
2010-11-03 18:20:22 -07:00
Brian Paul 3ded3e98ff gallivm: add some LLVM var labels 2010-11-03 17:34:07 -06:00
Brian Paul 2fefbc79ac gallivm: implement scatter stores into temp register file
Something is not quite right, however.  The piglit tests mentioned in
fd.o bug 31226 still don't pass.
2010-11-03 17:34:07 -06:00
Kenneth Graunke c180e95d26 ir_reader: Fix some potential NULL pointer dereferences.
Found by inspection.
2010-11-03 13:39:42 -07:00
Kenneth Graunke e751ce39bf ir_reader: Remove useless error check.
It's already been determined that length == 3, so clearly swiz->next is
a valid S-Expression.
2010-11-03 13:39:42 -07:00
Kenneth Graunke 0fd665ca63 ir_reader: Return a specific ir_dereference variant.
There's really no reason to return the base class when we have more
specific information about what type it is.
2010-11-03 13:39:42 -07:00
Kenneth Graunke d2c23ac82a glsl: Don't print a useless space at the end of an S-Expression list.
We really only want to print spaces -between- elements, not after each
element.  This cleans up error messages from IR reader, making them
(mildly) easier to read.
2010-11-03 13:39:41 -07:00
Kenneth Graunke 6c4a83ca3e Refresh autogenerated file builtin_function.cpp. 2010-11-03 13:39:41 -07:00
Kenneth Graunke 91b72864b0 glsl/builtins: Clean up some ugly autogenerated code in atan.
In particular, calling the abs function is silly, since there's already
an expression opcode for that.  Also, assigning to temporaries then
assigning those to the final location is rather redundant.
2010-11-03 13:39:41 -07:00
Kenneth Graunke 84566c770a glsl/builtins: Rename 'x' to 'y_over_x' in atan(float) implementation.
For consistency with the vec2/vec3/vec4 variants.
2010-11-03 13:39:41 -07:00
José Fonseca 01b39b053b r600g: Swap the util_blitter_destroy call order.
Trivial change that avoids a segmentation fault when the blitter state
happens to be bound when the context is destroyed.

The free calls should probably removed altogether in the future -- the
responsibility to destroy the state atoms lies with whoever created it,
and the safest thing for the pipe driver is to not touch any bound state
in its destructor.
2010-11-03 20:25:13 +00:00
Brian Paul b29ca2a561 mesa: code to unpack RGBA as uints 2010-11-03 11:18:52 -06:00
José Fonseca 54f2116877 xorg/vmwgfx: Link libkms when available. 2010-11-03 15:41:06 +00:00
José Fonseca d49dfe66cf st/xorg: Detect libkms with scons too. 2010-11-03 15:21:51 +00:00
José Fonseca 12376d8ea3 st/xorg: Add missing \n to error message. 2010-11-03 15:14:29 +00:00
José Fonseca ab2305b586 xorg/vmwgfx: Add missing source file to SConscript. 2010-11-03 14:02:40 +00:00
Eric Anholt 2aa738bf26 intel: Remove leftover dri1 locking fields in the context. 2010-11-03 06:08:27 -07:00
Eric Anholt 5716ad2425 intel: Remove duplicated teximage miptree to object miptree promotion.
intel_finalize_mipmap_tree() does this optimization too, just more
aggressively.
2010-11-03 06:08:27 -07:00
Eric Anholt 0300c9ab54 intel: Avoid taking logbase2 of several things that we max.
logbase2(max(width, height, depth)) ==
max(logbase2(width), logbase2(height), logbase2(depth)), but in 60
bytes less code.
2010-11-03 06:08:27 -07:00
Eric Anholt e42ce160b1 i965: Remove dead intel_structs.h file. 2010-11-03 06:08:27 -07:00
Eric Anholt 6ad0283f48 intel: Remove the magic unaligned memcpy code.
In testing on Ironlake, the histogram of clocks/pixel results for the
system memcpy and magic unaligned memcpy show no noticeable difference
(and no statistically significant difference with the 5510 samples
taken, though the stddev is large due to what looks like the cache
effects from the different texture sizes used).
2010-11-03 06:08:27 -07:00
Eric Anholt bb15408350 intel: Annotate debug printout checks with unlikely().
This provides the optimizer with hints about code hotness, which we're
quite certain about for debug printouts (or, rather, while we
developers often hit the checks for debug printouts, we don't care
about performance while doing so).
2010-11-03 06:08:27 -07:00
Brian Paul b19b858060 egl/gdi: fix typo: xsurf->gsurf 2010-11-03 07:04:42 -06:00
Keith Whitwell 32bb65217e evergreeng: set hardware pixelcenters according to gl_rasterization_rules 2010-11-03 11:16:04 +00:00
Keith Whitwell d6b6a0bc17 evergreeng: respect linewidth state, use integer widths only
Discard fractional bits from linewidth.  This matches the nvidia
closed drivers, my reading of the OpenGL SI and current llvmpipe
behaviour.

It looks a lot nicer & avoids ugliness where lines alternate between n
and n+1 pixels in width along their length.

Also fix up r600g to match.
2010-11-03 10:55:22 +00:00
Keith Whitwell ee07e0e39a r600g: don't call debug_get_bool_option for tiling more than once 2010-11-03 10:55:22 +00:00
Keith Whitwell b3462601cb evergreeng: protect against null constant buffers
Should do better than this and actually unbind the buffer, but haven't
yet gotten it to work.
2010-11-03 10:55:22 +00:00
Chia-I Wu 3f7876d76f st/egl: Use native_display_buffer for EGL_MESA_drm_image.
native_display_buffer is just a wrapper to resource_{from,get}_handle
for drm backend.
2010-11-03 17:50:25 +08:00
Chia-I Wu af977b5382 st/egl: Add native_display_buffer interface.
The interface is a wrapper to pipe_screen::resource_from_handle and
pipe_screen::resource_get_handle.  A winsys handle is
platform-dependent.
2010-11-03 17:47:08 +08:00
Chia-I Wu a5f4338fc4 st/egl: Add extern "C" wrapper to native.h.
This allows a backend to be written in C++.
2010-11-03 17:47:08 +08:00
Keith Whitwell c3974dc837 r600g: set hardware pixel centers according to gl_rasterization_rules
These were previously being left in the default (D3D) mode.  This mean
that triangles were drawn slightly incorrectly, but also because this
state is relied on by the u_blitter code, all blits were half a pixel
off.
2010-11-03 09:36:01 +00:00
Keith Whitwell 7b120ceac8 r600g: remove unused flink, domain fields from r600_resource
These were being set but not used anywhere.
2010-11-03 09:36:01 +00:00
Keith Whitwell d4fab99c1c r600g: use a buffer in GTT as intermediate on texture up and downloads
Generalize the existing tiled_buffer path in texture transfers for use
in some non-tiled up and downloads.

Use a staging buffer, which the winsys will restrict to GTT memory.

GTT buffers have the major advantage when they are mapped, they are
cachable, which is a very nice property for downloads, usually the CPU
will want to do look at the data it downloaded.
2010-11-03 09:36:01 +00:00
Keith Whitwell 29c4a15bf6 r600g: propogate resource usage flags to winsys, use to choose bo domains
This opens the question of what interface the winsys layer should
really have for talking about these concepts.

For now I'm using the existing gallium resource usage concept, but
there is no reason not use terms closer to what the hardware
understands - eg. the domains themselves.
2010-11-03 09:36:01 +00:00
Keith Whitwell 14c0bbf469 r600g: propagate usage flags in texture transfers 2010-11-03 09:36:01 +00:00
Chia-I Wu 04ae53ca8a st/egl: Add support for EGL_MATCH_NATIVE_PIXMAP.
Added for completeness.  It makes sense to have such mechanism, but I am
not aware of any user of that..
2010-11-03 17:17:29 +08:00
Chia-I Wu b8cb14209a st/egl: Add support for swap interval and swap behavior.
The value of EGL_MAX_SWAP_INTERVAL and whether
EGL_SWAP_BEHAVIOR_PRESERVED_BIT is set will depend on the native
backend used.
2010-11-03 16:26:57 +08:00
Chia-I Wu 828d944fd6 st/egl: Remove flush_frontbuffer and swap_buffers.
They are deprecated by native_surface::present and there is no user of
them.
2010-11-03 16:08:47 +08:00
Chia-I Wu 250d81da25 d3d1x: Use native_surface::present.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:44 +08:00
Chia-I Wu 0ae4b23c53 st/egl: Use native_surface::present callback.
Replace native_surface::flush_frontbuffer and
native_surface::swap_buffers calls by native_surface::present calls.
2010-11-03 16:08:23 +08:00
Chia-I Wu 94bf657b23 st/egl: Add native_surface::present callback.
The callback presents the given attachment to the native engine.  It
allows the swap behavior and interval to be controlled.  It will replace
native_surface::flush_frontbuffer and native_surface::swap_buffers
shortly.
2010-11-03 16:04:59 +08:00
Chia-I Wu c9186bd588 egl: Set up the pthread key even TLS is used.
We have to rely on the pthread key destructor to free the current thread
info when a thread exits.
2010-11-03 13:34:17 +08:00
Vinson Lee 93a7e6d94e st/vega: Remove unnecessary headers. 2010-11-02 17:13:44 -07:00
Brian Paul 61f25216e3 mesa: silence new warnings in texobj.c
Silences warning such as:
main/texobj.c:442:40: warning: ISO C99 requires rest arguments to be used
main/texobj.c:498:58: warning: ISO C99 requires rest arguments to be used
2010-11-02 17:41:00 -06:00
Vinson Lee 6f90a7cbff savage: Remove unnecessary header. 2010-11-02 16:23:30 -07:00
Eric Anholt 689def8bbc intel: For batch, use GTT mapping instead of writing to a malloc and copying.
No measurable performance difference on cairo-perf-trace, but
simplifies the code and should have cache benefit in general.
2010-11-02 14:24:42 -07:00
Eric Anholt 1210aa7551 mesa: Don't compute an unused texture completeness debug string.
This showed up at about 1% on cairo-gl firefox-talos-gfx, where
glClear() is called while a texture is incomplete.
2010-11-02 14:24:42 -07:00
Tilman Sauerbeck 965c8a3f1d st/mesa: Reset the index buffer before destroying the pipe context.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:40 +01:00
Tilman Sauerbeck 52ba68d0b0 r600g: Destroy the winsys in r600_destroy_screen().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 907efeea18 r600g: Fixed two memory leaks in winsys.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck ecb1b8b98f r600g: Delete custom_dsa_flush on shutdown.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck c49dcaef65 r600g: We don't support PIPE_CAP_PRIMITIVE_RESTART.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 86778dadc5 r600g: Made radeon_bo::map_count signed.
That way assert(map_count >= 0) can actually fail when we screwed up.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 34e75b0ca8 r600g: Fixed unmap condition in radeon_bo_pb_destroy().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck b675266f0e r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck 4e34393162 r600g: Removed unused 'ptr' argument from radeon_bo().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Jakob Bornecrantz 1318b0ef9e graw: Tidy graw xlib scons file a bit 2010-11-02 18:20:30 +00:00
Brian Paul 2996ce72b1 llvmpipe: add a cast 2010-11-02 11:53:14 -06:00