Török Edvin [Sat, 4 Sep 2010 10:48:24 +0000 (13:48 +0300)]
glsl2: check for _NumLinkedShaders being 0
Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.
This also fixes piglit test cases glsl-link-empty-prog-0[12].
Kristian Høgsberg [Tue, 7 Sep 2010 18:32:28 +0000 (14:32 -0400)]
glx: Set an all NULL vtable for dummyContext
This reverts
6a6e6d7b0a84e20f9754af02a575ae34081d310c and initializes
dummyContext with an all NULL vtable. The context vtable pointer is
supposed to always be non-NULL, but the vtable entries can be NULL.
Kristian Høgsberg [Tue, 7 Sep 2010 18:23:00 +0000 (14:23 -0400)]
glx: Fix compilation with out xf86vidmode
Kristian Høgsberg [Tue, 7 Sep 2010 18:18:01 +0000 (14:18 -0400)]
glx: Use GLX_BufferSwapComplete unconditionally, we require glproto 1.4.11
Michel Dänzer [Tue, 7 Sep 2010 17:49:06 +0000 (19:49 +0200)]
Fix crashes when some GLX API entrypoints are called with no current context.
I was hitting this with gliv.
The GLX spec explicitly mentions that glXWaitX, glXWaitGL and glXUseXFont calls
are ignored when there's no current context. Not sure what if anything the
GLX_EXT_texture_from_pixmap spec says about this, but I think ignoring the
calls makes more sense than crashing there as well. :)
Eric Anholt [Mon, 6 Sep 2010 03:55:39 +0000 (20:55 -0700)]
i965: Don't bother with RNDZ for f2i.
The default type conversion for MOV should be fine, and RNDZ actually
requires two instructions.
Eric Anholt [Sun, 5 Sep 2010 04:28:04 +0000 (21:28 -0700)]
i965: Add some validation on BRW_OPCODE_MUL and ADD's arguments.
Now that we're playing with other types in brw_fs.cpp, it's easy to
trip over issues like these.
Eric Anholt [Sun, 5 Sep 2010 04:04:58 +0000 (21:04 -0700)]
i965: Add assertion for another requirement about types.
This catches a failure in the FS backend.
Eric Anholt [Sat, 4 Sep 2010 00:21:49 +0000 (17:21 -0700)]
i965: Align the start of attribute interp coefficients in FS to use PLN.
Eric Anholt [Fri, 3 Sep 2010 21:29:57 +0000 (14:29 -0700)]
i965: Just assert when we flagged a compile error in the FS for now.
Dumping back to potentially 16-wide dispatch doesn't really work out
at the moment, and hopefully I'll just be able to resolve all the
failures so we never have to do this at all.
Eric Anholt [Fri, 3 Sep 2010 20:21:51 +0000 (13:21 -0700)]
i965: Clean up fs_reg setup by using a helper for constructors.
Eric Anholt [Thu, 2 Sep 2010 16:37:17 +0000 (09:37 -0700)]
i965: When using the new FS backend, don't validate the Mesa IR version.
Eric Anholt [Sat, 4 Sep 2010 04:37:00 +0000 (21:37 -0700)]
i965: Add a bit of validation for some ISA restrictions in the docs.
Eric Anholt [Sat, 4 Sep 2010 04:56:53 +0000 (21:56 -0700)]
i965: set the source width/stride when handling reladdr dests in the VS.
This is a requirement specified in the docs. No behavior change in
glsl-vs-varying-array.shader_test that violated these requirements.
Jon TURNEY [Wed, 21 Apr 2010 11:58:54 +0000 (12:58 +0100)]
Make XF86VIDMODE extension optional
Code in glx/glxcmds.c which uses the XF86VIDMODE extension is already guarded. Also use
that guard to control inclusion of the xf86vmode.h header, and only enable that guard if the
XF86VIDMODE extension is found by pkgconfig.
This changes the behaviour on platforms which XF86VIDMODE exists, in that XF86VIDMODE used to
be mandatory, but is now optional.
Presumably other build systems are already arranging for -DXF86VIDMODE to be supplied to the
complier when glxcmds.c is compiled, so are not affected by this change
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Kristian Høgsberg [Tue, 7 Sep 2010 16:54:02 +0000 (12:54 -0400)]
glx: Drop unused dri2proto.h include
Kristian Høgsberg [Tue, 7 Sep 2010 16:40:37 +0000 (12:40 -0400)]
glx: Move dpy and scr fields out of direct rendering conditional
Nothing direct rendering specific about these fields. Moving them out
makes no-direct-rendering compilation work again.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Jon TURNEY [Mon, 9 Aug 2010 13:47:26 +0000 (14:47 +0100)]
Some fixes for GLX_INDIRECT_RENDERING only build
This fixes some of the build issues with GLX_INDIRECT_RENDERING but !GLX_DIRECT_RENDERING due to recent changes.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
nobled [Tue, 7 Sep 2010 16:26:07 +0000 (12:26 -0400)]
dri: Make it a little clearer that we're not dereferencing a NULL pointer
nobled [Tue, 7 Sep 2010 16:20:15 +0000 (12:20 -0400)]
dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early
if the requested API isn't recognized.
Chia-I Wu [Tue, 7 Sep 2010 15:45:43 +0000 (23:45 +0800)]
libgl-xlib: Fix --enable-gallium-llvm build.
Check MESA_LLVM and link to LLVM as other targets do.
Chia-I Wu [Tue, 7 Sep 2010 15:04:43 +0000 (23:04 +0800)]
llvmpipe: Add lp_rast_debug.c to Makefile.
Jon TURNEY [Tue, 7 Sep 2010 10:36:07 +0000 (11:36 +0100)]
glx: Only clear the stored context tag when the context has been unbound
The calling order of ->bind and ->unbind changed and then ->unbind would
clear the currentContextTag of the old context before ->bind could reuse
it in the make current request, in the indirect case.
Instead, clear the old currentContextTag if and only if we send a request
to the server to actually unbind it or reassign it to another context.
https://bugs.freedesktop.org/show_bug.cgi?id=29977
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
José Fonseca [Thu, 26 Aug 2010 11:09:53 +0000 (12:09 +0100)]
llvmpipe: Refactor lp_scene_add_resource_reference
Less goto spaghetti.
José Fonseca [Thu, 26 Aug 2010 11:08:56 +0000 (12:08 +0100)]
llvmpipe: Fix negated logic in lp_scene_add_resource_reference().
Fixes performance regression.
Keith Whitwell [Wed, 1 Sep 2010 17:43:46 +0000 (18:43 +0100)]
llvmpipe: move more coef setup into lp_setup_coef.c
Keith Whitwell [Tue, 7 Sep 2010 12:10:15 +0000 (13:10 +0100)]
llvmpipe: declare fence handle struct
Keith Whitwell [Fri, 27 Aug 2010 18:24:51 +0000 (19:24 +0100)]
llvmpipe: rasterization debugging helpers
Keith Whitwell [Tue, 7 Sep 2010 13:02:15 +0000 (14:02 +0100)]
llvmpipe: use opcodes instead of function pointers in bins
Also, move some state from rasterizer struct to the scene.
Keith Whitwell [Tue, 7 Sep 2010 11:45:23 +0000 (12:45 +0100)]
llvmpipe: rearrange queries
Keith Whitwell [Fri, 27 Aug 2010 16:49:40 +0000 (17:49 +0100)]
llvmpipe: enforce fixed memory limit on scenes
Keith Whitwell [Fri, 27 Aug 2010 16:30:07 +0000 (17:30 +0100)]
llvmpipe: clean up deferred zstencil clears
Keith Whitwell [Fri, 27 Aug 2010 16:14:49 +0000 (17:14 +0100)]
llvmpipe: rework fences and queries
Keith Whitwell [Fri, 27 Aug 2010 16:51:21 +0000 (17:51 +0100)]
llvmpipe: move whole-tile emit into a function
Keith Whitwell [Tue, 24 Aug 2010 19:08:13 +0000 (20:08 +0100)]
llvmpipe: put fs variant dumping in a function
Tilman Sauerbeck [Tue, 7 Sep 2010 08:29:22 +0000 (01:29 -0700)]
Replace reference to tgsi-instruction-set.txt.
That file has been replaced by tgsi.rst.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Luca Barbieri [Tue, 7 Sep 2010 06:19:58 +0000 (08:19 +0200)]
nouveau: restore nouveau_class.h for nv04-nv20
Sorry, I deleted the Gallium copy without realizing that the DRI
one was just a symlink to it.
Luca Barbieri [Mon, 6 Sep 2010 03:13:55 +0000 (05:13 +0200)]
nvfx: fix return in vp main
José Fonseca [Mon, 6 Sep 2010 12:56:07 +0000 (13:56 +0100)]
mesa: Define C99's __func__ macro on MSVC.
Dave Airlie [Mon, 6 Sep 2010 00:38:29 +0000 (10:38 +1000)]
r600g: add error print for no literals for r700s as well
Dave Airlie [Mon, 6 Sep 2010 00:35:51 +0000 (10:35 +1000)]
r600g: fixup r700 assembler for clamp/relative addressing
Dave Airlie [Mon, 6 Sep 2010 00:27:55 +0000 (10:27 +1000)]
r600g: add script to generate header file with offsets into state objects.
This was inherently fragile as any changes to r600_states.h would also
need manual updating of all of the bits in radeon.h. Just add a simple
python script to do the conversion, its not hooked up to make at all.
This also will make adding evergreen a bit easier.
Dave Airlie [Sun, 5 Sep 2010 23:14:08 +0000 (09:14 +1000)]
r600g: fix up surface references
We end up referencing the new surf and derefing the old surface which
is a copy of the pointer to the new surf. So just bump the ref count directly.
Dave Airlie [Sun, 5 Sep 2010 23:13:50 +0000 (09:13 +1000)]
r600g: search for sampler views in context on removal.
Need to remove from context as well.
Dave Airlie [Sun, 5 Sep 2010 23:13:12 +0000 (09:13 +1000)]
r600g: add missing printf operand
Luca Barbieri [Sun, 5 Sep 2010 20:00:26 +0000 (22:00 +0200)]
nvfx: support nv30 simulation on nv40
Henri Verbeet [Sun, 5 Sep 2010 20:42:12 +0000 (22:42 +0200)]
radeon: Add radeon_buffer_objects.c.
Henri Verbeet [Sun, 5 Sep 2010 19:54:32 +0000 (21:54 +0200)]
r200: Add radeon_buffer_objects.c.
Henri Verbeet [Sat, 4 Sep 2010 16:03:17 +0000 (18:03 +0200)]
radeon: Make do_blit_readpixels() into a PBO work.
Luca Barbieri [Sun, 5 Sep 2010 15:57:12 +0000 (17:57 +0200)]
mesa: don't smash the stack in _mesa_find_used_registers
At some point this actually triggered, not sure if it still does.
Give a meaningful assert and refuse to smash the stack anyway.
Luca Barbieri [Tue, 24 Aug 2010 19:05:51 +0000 (21:05 +0200)]
mesa: don't expose unsupported GL_ARB_geometry_shader4 for now
The new GLSL compiler doesn't support it.
Advertising it prevents Unigine Heaven from working, since it attempts to
use it.
Luca Barbieri [Sun, 5 Sep 2010 08:34:55 +0000 (10:34 +0200)]
nouveau: delete nouveau_class.h, move nv50 regs to nv50_reg.h
nv50 should switch to rules-ng-ng too at some point.
The classic Mesa Nouveau driver also includes a copy of nouveau_class.h,
and should convert to rules-ng-ng too and remove it.
Luca Barbieri [Sun, 5 Sep 2010 08:45:55 +0000 (10:45 +0200)]
nvfx: move nv04_2d to rules-ng-ng
Luca Barbieri [Sun, 5 Sep 2010 08:10:09 +0000 (10:10 +0200)]
nvfx: switch to rules-ng-ng register headers
This is the new register generation toolkit in use by nouveau.
As far as I know, this is the best register description toolkit in
existence, and you should use it too for your hardware :)
Thanks to Marcin Kościelnicki for inventing it and performing
invaluable reverse engineering work of nVidia chips.
Luca Barbieri [Sun, 5 Sep 2010 07:17:32 +0000 (09:17 +0200)]
nvfx: remove remaining BEGIN_RING/eng3d uses
Luca Barbieri [Sun, 5 Sep 2010 06:27:12 +0000 (08:27 +0200)]
nvfx: pause occlusion queries during blitter usage
Thanks for Dave Airlie and Jerome Glisse for their code which made
me realize I need this too.
Luca Barbieri [Sun, 5 Sep 2010 04:42:04 +0000 (06:42 +0200)]
nvfx: properly return fogcoord.w == 1
Hardware sets it to 0, so we add an ADD to put an 1 there if the
application really wants the alpha channel.
Luca Barbieri [Sun, 5 Sep 2010 03:53:55 +0000 (05:53 +0200)]
nvfx: support saturate in vp
Completely untested, since Mesa apparently never uses this currently.
In particular, it might not work with scalar slot op.
Luca Barbieri [Sun, 5 Sep 2010 03:42:59 +0000 (05:42 +0200)]
nvfx: add rewritten swtnl support
The old swtnl code was broken by the new shader linkage support for
GLSL.
This is a rewrite of swtnl support, which should instead work properly,
be faster and more closer to the much more tested hardware pipeline.
Luca Barbieri [Sun, 5 Sep 2010 03:42:39 +0000 (05:42 +0200)]
nvfx: use a piglit-ignored format for unknown cap message
José Fonseca [Sun, 5 Sep 2010 09:40:38 +0000 (10:40 +0100)]
llvmpipe: Remove some broken MinGW hacks in the sin/cos reference code.
José Fonseca [Sun, 5 Sep 2010 09:16:30 +0000 (10:16 +0100)]
glsl: Add new files to sconscript.
José Fonseca [Sat, 4 Sep 2010 18:51:54 +0000 (19:51 +0100)]
llvmpipe: Fix perspective divide interpolation.
Intuition != mathematics, so this time I actually worked out the right
formula for first order approximation of perspective interpolation.
Ironically, per quad divide actually makes things slower when compared
with per pixel divide -- probably because the divide hardware unit is
rarely used, whereas the multiply unit is typically already saturated
and the first order approximation imply more multiplications.
José Fonseca [Sat, 4 Sep 2010 10:53:28 +0000 (11:53 +0100)]
util: Helper function to determined whether two formats can be memcpy'ed.
These are the non-trivial conversions that this function recognizes,
which was produced by u_format_compatible_test.c:
b8g8r8a8_unorm -> b8g8r8x8_unorm
a8r8g8b8_unorm -> x8r8g8b8_unorm
b5g5r5a1_unorm -> b5g5r5x1_unorm
b4g4r4a4_unorm -> b4g4r4x4_unorm
l8_unorm -> r8_unorm
i8_unorm -> l8_unorm
i8_unorm -> a8_unorm
i8_unorm -> r8_unorm
l16_unorm -> r16_unorm
z24_unorm_s8_uscaled -> z24x8_unorm
s8_uscaled_z24_unorm -> x8z24_unorm
r8g8b8a8_unorm -> r8g8b8x8_unorm
a8b8g8r8_srgb -> x8b8g8r8_srgb
b8g8r8a8_srgb -> b8g8r8x8_srgb
a8r8g8b8_srgb -> x8r8g8b8_srgb
a8b8g8r8_unorm -> x8b8g8r8_unorm
r10g10b10a2_uscaled -> r10g10b10x2_uscaled
r10sg10sb10sa2u_norm -> r10g10b10x2_snorm
State trackers and pipe drivers should be updated to take advantage of
this knowledge, e.g., in surface_copy.
José Fonseca [Fri, 3 Sep 2010 19:26:13 +0000 (20:26 +0100)]
llvmpipe: Relax the colormask constraint on opaque.
Also, include the color buffer in the key. Not having it there
causes a tight knots in the logic to determine when it is OK or not
to discard previous color buffer contents.
José Fonseca [Fri, 3 Sep 2010 19:21:33 +0000 (20:21 +0100)]
util: Utility function to determine the channels that can be written in a color format.
José Fonseca [Thu, 2 Sep 2010 12:44:29 +0000 (13:44 +0100)]
scons: Re-enable SSE on MinGW.
It seems to be working correctly with gcc 4.4, and enabling it allows to
test some of the llvmpipe instrinsics on Windows.
José Fonseca [Thu, 2 Sep 2010 10:32:09 +0000 (11:32 +0100)]
gallivm: Pass condition masks as an unsigned bitmask.
Much more convenient than boolean arrays.
José Fonseca [Thu, 2 Sep 2010 10:30:13 +0000 (11:30 +0100)]
gallivm: Cope with tgsi instruction reallocation failure.
Kenneth Graunke [Sun, 5 Sep 2010 07:58:34 +0000 (00:58 -0700)]
ir_reader: Only validate IR when a global 'debug' flag is set.
This extra validation is very useful when working on the built-ins, but
in general overkill - the results should stay the same unless the
built-ins or ir_validate have changed.
Also, validating all the built-in functions in every test case makes
piglit run unacceptably slow.
Marek Olšák [Sun, 5 Sep 2010 03:07:02 +0000 (05:07 +0200)]
r300g,r300c: memset the compiler struct to zeros
This should fix bogus reports "Too many temporaries." and maybe some others.
Tom Stellard [Sun, 5 Sep 2010 00:27:55 +0000 (17:27 -0700)]
r300/compiler: Remove stray break statement
This fixes glsl-fs-loop-nested.
Luca Barbieri [Sat, 4 Sep 2010 23:08:08 +0000 (01:08 +0200)]
nvfx: support unlimited constants and immediates in fp
Luca Barbieri [Sat, 4 Sep 2010 21:20:33 +0000 (23:20 +0200)]
nvfx: support using blitter to copy depth/stencil resources, fix Heaven
We might want to copy them as color ones though.
Also works around crash in Unigine Heaven due to failing to allocate
a 64 MB temporary in GART for a CPU copy.
Unigine Heaven now works on nv40, albeit with very heavy glitches (with
the floating branch with render_hdr 0).
Marek Olšák [Sat, 4 Sep 2010 22:43:34 +0000 (00:43 +0200)]
r300/compiler: fix the instruction limit in vertex shaders
Broken with commit
d774b0c710bb7d833d17bd12f5151a0176baad96.
Reported by Chris Rankin.
Luca Barbieri [Sat, 4 Sep 2010 19:29:43 +0000 (21:29 +0200)]
nvfx: support rendering to more formats
Luca Barbieri [Sat, 4 Sep 2010 18:16:54 +0000 (20:16 +0200)]
nvfx: move 2D format selection logic to 2D code
Luca Barbieri [Sat, 4 Sep 2010 15:12:02 +0000 (17:12 +0200)]
nvfx: fix swizzling of high bpp surfaces
Luca Barbieri [Sat, 4 Sep 2010 19:22:02 +0000 (21:22 +0200)]
nvfx: fix some subrectangle copies
Actually, we may want to get rid of the x/y coordinates for linear
surfaces, and realign the origin from scratch if necessary, instead
of doing this "on-demand realignment".
Luca Barbieri [Sat, 4 Sep 2010 19:21:34 +0000 (21:21 +0200)]
nvfx: fix inlinining in nv04_2d.c
Luca Barbieri [Sat, 4 Sep 2010 18:17:39 +0000 (20:17 +0200)]
nvfx: fix the temporary copying logic and add asserts
Luca Barbieri [Sat, 4 Sep 2010 15:48:19 +0000 (17:48 +0200)]
nvfx: prevent swizzled rendering into formats where it's not supported
Marek Olšák [Fri, 3 Sep 2010 22:42:36 +0000 (00:42 +0200)]
Revert "ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp."
This reverts commit
5ad74779cea07cc6a19a52874cdaef8b018e2f1b.
Sorry, but I had to revert this.
Any commit which needlessly increases the number of temporaries is wrong.
More temporaries mean less shader performance because of reduced parallelism
and therefore less efficient latency hiding. In this case, there is possible
performance degradation of every shader which uses GL state variables.
I cannot accept this.
Marek Olšák [Sat, 4 Sep 2010 17:04:51 +0000 (19:04 +0200)]
Revert "r300g: refuse to create a texture with size 0"
This reverts commit
5cdedaaf295acae13ac10feeb3143d83bc53d314.
https://bugs.freedesktop.org/show_bug.cgi?id=30002
Conflicts:
src/gallium/drivers/r300/r300_texture.c
Marek Olšák [Tue, 31 Aug 2010 03:37:28 +0000 (05:37 +0200)]
r300g: remove unnecessary assignments
Marek Olšák [Fri, 3 Sep 2010 22:02:57 +0000 (00:02 +0200)]
r300/compiler: indent printed instructions according to the branch depth
Marek Olšák [Fri, 3 Sep 2010 19:43:36 +0000 (21:43 +0200)]
r300g: skip draw calls with no vertex elements, fixing hardlocks
Marek Olšák [Fri, 3 Sep 2010 18:43:48 +0000 (20:43 +0200)]
r300/compiler: use limits from the compiler input instead of inline constants
Marek Olšák [Fri, 3 Sep 2010 18:26:43 +0000 (20:26 +0200)]
r300/compiler: improve register allocation with indexable temporaries for VS
Register allocation can now reallocate temporaries right after the last indexed
source operand, instead of being disabled for the whole shader.
Marek Olšák [Thu, 2 Sep 2010 08:21:52 +0000 (10:21 +0200)]
r300/compiler: fix handling of indexed temporaries in peephole
Marek Olšák [Thu, 2 Sep 2010 08:21:23 +0000 (10:21 +0200)]
r300/compiler: disable deadcode elimination for indexed dst operands
Marek Olšák [Thu, 2 Sep 2010 05:01:36 +0000 (07:01 +0200)]
r300/compiler: allocate at least FS inputs if register allocation is disabled
Marek Olšák [Wed, 1 Sep 2010 06:12:51 +0000 (08:12 +0200)]
r300g: add a new debug option which disables compiler optimizations
Those are:
- dead-code elimination
- constant folding
- peephole (mainly copy propagation)
- register allocation
There are some bugs which I need to track down.
Also fix up the descriptions of all the debug options.
Marek Olšák [Wed, 1 Sep 2010 06:10:32 +0000 (08:10 +0200)]
r300/compiler: compute the final number of temporaries during translation
And not during the register allocation, which may be skipped for debugging
purposes. Also the predicate register is now added to the number of temps.
Marek Olšák [Wed, 1 Sep 2010 04:14:58 +0000 (06:14 +0200)]
r300/compiler: make optimizations not use 0.5 swizzles in vertex shaders
Marek Olšák [Wed, 1 Sep 2010 03:25:34 +0000 (05:25 +0200)]
r300/compiler: use peephole and constant folding for vertex shaders too
Marek Olšák [Thu, 2 Sep 2010 00:42:42 +0000 (02:42 +0200)]
r300/compiler: remove unused enum OPCODE_REPL_ALPHA
We use RC_OPCODE_REPL_ALPHA instead.
Marek Olšák [Wed, 1 Sep 2010 03:01:19 +0000 (05:01 +0200)]
r300/compiler: refactor fragment shader compilation
This cleans up the mess in r3xx_compile_fragment_program.
Marek Olšák [Wed, 1 Sep 2010 02:59:22 +0000 (04:59 +0200)]
r300/compiler: add new compiler parameter max_constants
Marek Olšák [Wed, 1 Sep 2010 01:19:05 +0000 (03:19 +0200)]
r300/compiler: refactor vertex shader compilation
First list compiler passes in an array, then run the new function rc_run_compiler.
Every backend may need a different set of passes.
This cleans up the mess in r3xx_compile_vertex_program.