Commit Graph

38706 Commits

Author SHA1 Message Date
Eric Anholt 50a3349bee mesa: Set the base format of GL_ALPHA FBOs and teach swrast about it.
Fixes assertion failures in fbo-alpha with a debug build of Mesa.
Bug #29781.
2010-09-07 14:34:23 -07:00
Eric Anholt acd7c21541 ir_to_mesa: Fix warning in last commit.
I swear there was some git option for "don't push things when you've
got uncommitted changes", but I can't find it now.
2010-09-07 14:26:53 -07:00
Eric Anholt 6c0ba32fd1 ir_to_mesa: Move the STATE_VAR elements of a builtin uniform to a temp (v2).
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

v2: Continue referencing the STATE_VAR[] file directly when the
uniform will land in STATE_VAR[] formatted exactly as we'd put into a
temporary.  When there's array dereferencing, we don't copy-propagate
in Mesa IR (not knowing where the array is in register space), so
smarts here are required or we'll massively increase the temp count.
2010-09-07 13:59:29 -07:00
Ian Romanick 956f049fd2 glsl2: Early return with visit_continue in loop_analysis::visit(ir_dereference_variable *)
Returning early with visit_continue_with_parent prevented the
then-statements and else-statements of if-statements such as the
following from being processed:

	  if (some_var) { ... } else { ... }

Fixes piglit test case glsl-fs-loop-nested-if and bugzilla #30030.
2010-09-07 13:36:32 -07:00
Kenneth Graunke 0427228bbc glsl: Change grammar rules for selection statements to match the spec.
Fixes piglit test case loop-06.vert.

Unfortunately, causes 1 shift/reduce conflict.
2010-09-07 13:17:05 -07:00
Eric Anholt 24c12e6c7f i965: Store the byte address in the VS constant buffer as an integer.
We carefully multiplied our two ints (since we want to be precise
after all) then stored them in a float, which is not specced to really
work, in addition to wasting precision.  Fixes
vp-arl-constant-array-huge-* things since the assertions were added.
2010-09-07 13:00:22 -07:00
Eric Anholt 32b84ef4ca i965: Make pixel_xy results UW.
There is a restriction on the destination of an operation involving a
vector immediate being 128-bit aligned and the destination horizontal
stride being equivalent to 2 bytes.  Fixes bad pixel_x results from
gl_FragCoord, where each pair had the same value.
2010-09-07 13:00:22 -07:00
Török Edvin c47b289972 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].
2010-09-07 12:27:07 -07:00
Kristian Høgsberg 3ea3f5e0a5 glx: Set an all NULL vtable for dummyContext
This reverts 6a6e6d7b0a 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.
2010-09-07 14:32:28 -04:00
Kristian Høgsberg 57d3f71132 glx: Fix compilation with out xf86vidmode 2010-09-07 14:24:25 -04:00
Kristian Høgsberg f84d8fab99 glx: Use GLX_BufferSwapComplete unconditionally, we require glproto 1.4.11 2010-09-07 14:24:25 -04:00
Michel Dänzer 6a6e6d7b0a 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. :)
2010-09-07 19:54:16 +02:00
Eric Anholt 5afdfa222f i965: Don't bother with RNDZ for f2i.
The default type conversion for MOV should be fine, and RNDZ actually
requires two instructions.
2010-09-07 10:34:10 -07:00
Eric Anholt a560a509fa 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.
2010-09-07 10:34:10 -07:00
Eric Anholt 0002069fd5 i965: Add assertion for another requirement about types.
This catches a failure in the FS backend.
2010-09-07 10:34:09 -07:00
Eric Anholt 3fb5377ba5 i965: Align the start of attribute interp coefficients in FS to use PLN. 2010-09-07 10:34:09 -07:00
Eric Anholt 3dbc9ea0a3 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.
2010-09-07 10:34:09 -07:00
Eric Anholt 42fc60cadc i965: Clean up fs_reg setup by using a helper for constructors. 2010-09-07 10:34:09 -07:00
Eric Anholt b157113e73 i965: When using the new FS backend, don't validate the Mesa IR version. 2010-09-07 10:34:09 -07:00
Eric Anholt 5c77792859 i965: Add a bit of validation for some ISA restrictions in the docs. 2010-09-07 10:34:09 -07:00
Eric Anholt e432fe09dd 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.
2010-09-07 10:34:09 -07:00
Jon TURNEY 2b9dac397b 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>
2010-09-07 13:30:19 -04:00
Kristian Høgsberg dd2658d0ac glx: Drop unused dri2proto.h include 2010-09-07 13:30:12 -04:00
Kristian Høgsberg 60fce15447 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>
2010-09-07 12:41:09 -04:00
Jon TURNEY ae9487c299 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>
2010-09-07 12:33:11 -04:00
nobled 6561a64a69 dri: Make it a little clearer that we're not dereferencing a NULL pointer 2010-09-07 12:26:33 -04:00
nobled 1b8c9fef11 dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early
if the requested API isn't recognized.
2010-09-07 12:26:33 -04:00
Chia-I Wu 28c790ab31 libgl-xlib: Fix --enable-gallium-llvm build.
Check MESA_LLVM and link to LLVM as other targets do.
2010-09-07 23:54:25 +08:00
Chia-I Wu d5c5a5aea0 llvmpipe: Add lp_rast_debug.c to Makefile. 2010-09-07 23:04:43 +08:00
Jon TURNEY 23e2dec1a1 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>
2010-09-07 09:07:23 -04:00
José Fonseca a7c4541d27 llvmpipe: Refactor lp_scene_add_resource_reference
Less goto spaghetti.
2010-09-07 14:02:29 +01:00
José Fonseca 9cd45b8edf llvmpipe: Fix negated logic in lp_scene_add_resource_reference().
Fixes performance regression.
2010-09-07 14:02:29 +01:00
Keith Whitwell 9df8a7565d llvmpipe: move more coef setup into lp_setup_coef.c 2010-09-07 14:02:29 +01:00
Keith Whitwell afba373cb1 llvmpipe: declare fence handle struct 2010-09-07 14:02:29 +01:00
Keith Whitwell f25836d7b2 llvmpipe: rasterization debugging helpers 2010-09-07 14:02:29 +01:00
Keith Whitwell 9f6e8e1d6b llvmpipe: use opcodes instead of function pointers in bins
Also, move some state from rasterizer struct to the scene.
2010-09-07 14:02:15 +01:00
Keith Whitwell 040e59851a llvmpipe: rearrange queries 2010-09-07 14:01:50 +01:00
Keith Whitwell 6419ecd02c llvmpipe: enforce fixed memory limit on scenes 2010-09-07 14:01:43 +01:00
Keith Whitwell c512ba88a7 llvmpipe: clean up deferred zstencil clears 2010-09-07 13:22:55 +01:00
Keith Whitwell 18452c1e87 llvmpipe: rework fences and queries 2010-09-07 13:22:55 +01:00
Keith Whitwell 5024d9b90e llvmpipe: move whole-tile emit into a function 2010-09-07 13:22:55 +01:00
Keith Whitwell 71e27ef21c llvmpipe: put fs variant dumping in a function 2010-09-07 13:22:54 +01:00
Tilman Sauerbeck 98e277111b Replace reference to tgsi-instruction-set.txt.
That file has been replaced by tgsi.rst.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-09-07 09:48:22 +01:00
Luca Barbieri 4a730b773f 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.
2010-09-07 08:22:43 +02:00
Luca Barbieri 09782c727d nvfx: fix return in vp main 2010-09-06 18:08:36 +02:00
José Fonseca 079c884060 mesa: Define C99's __func__ macro on MSVC. 2010-09-06 13:57:44 +01:00
Dave Airlie 35e01b79cb r600g: add error print for no literals for r700s as well 2010-09-06 10:38:29 +10:00
Dave Airlie 2caf6f5e84 r600g: fixup r700 assembler for clamp/relative addressing 2010-09-06 10:35:51 +10:00
Dave Airlie 48cdad70d9 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.
2010-09-06 10:28:08 +10:00
Dave Airlie 5b82777311 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.
2010-09-06 09:15:42 +10:00