Commit Graph

38252 Commits

Author SHA1 Message Date
Eric Anholt 76e96d74f4 glsl: Cleanly fail when a function has an unknown return type.
Bug #29608.
2010-08-23 13:27:36 -07:00
Henri Verbeet 6fb39f0fa2 r600g: Add support for PIPE_CAP_DEPTH_CLAMP. 2010-08-23 22:13:18 +02:00
Eric Anholt b75645d8ad glsl: Rebuild builtins for any() change. 2010-08-23 13:06:02 -07:00
Eric Anholt 5e9ac94cc4 mesa: Add new ir_unop_any() expression operation.
The previous any() implementation would generate arg0.x || arg0.y ||
arg0.z.  Having an expression operation for this makes it easy for the
backend to generate something easier (DPn + SNE for 915 FS, .any
predication on 965 VS)
2010-08-23 13:05:53 -07:00
Eric Anholt 47003a8f65 glsl: Regenerate builtins with the new sorting. 2010-08-23 12:58:07 -07:00
Eric Anholt 66afcb5607 ir_to_mesa: Implement f2b by comparing the arg to 0, not the result.
Fixes: glsl-fs-any
2010-08-23 12:58:07 -07:00
Eric Anholt 18a6023900 glsl: Count function call outvals as writing to variables for linker checks.
Fixes: glsl-vs-position-outval.  Bug #28138 (regnum online)
2010-08-23 12:57:59 -07:00
Ian Romanick 6dad5a4e8d glsl2: Include imports.h to get snprintf wrapper for MSVC
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Aras Pranckevicius 44a6c13ac3 mesa: Fix msvc build of glsl.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-23 20:55:50 +01:00
Luca Barbieri c0eb479e07 auxiliary: fix nvfx/nv50 primitive splitting for line loops
s->close_first was on the wrong side of the inequality.

Caught by blender.
Thanks to AndrewR for reporting this.
2010-08-23 21:47:47 +02:00
Jerome Glisse bcf7f66a93 r600g: export one component per pixel + r7xx uncompression shader
We need to always at least export one component (wether it's depth
or color. Add valid r7xx shader program for depth decompression.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-23 15:42:32 -04:00
Kenneth Graunke 6355ae2b80 generate_builtins.py: Generate output in sorted order. 2010-08-23 12:36:40 -07:00
Luca Barbieri 4ab1001ac2 nvfx: improve fp temp accounting 2010-08-23 20:35:56 +02:00
Brian Paul 4b2b5f8e30 tgsi: fix false CondStackTop==0 assertion 2010-08-23 12:15:40 -06:00
Eric Anholt ebef040117 ir_to_mesa: Fix constant array handling to return the temp we created.
We ended up returning CONST[loc] rather than TEMP[loc2].  Things would
*usually* end up working out OK, since the constants often ended up
getting allocated to CONST[loc..loc+columns] with no swizzle.  But for
the case where the contigous temporary copy of the swizzled constant
vec4 args was actually needed, we'd end up reading some other constant
values, possibly including ones not actually allocated.

Fixes: glsl-varying-mat3x2.
2010-08-23 11:03:13 -07:00
Carl Worth 61f73fec53 glcpp: Make standalone preprocessor work with a tty as stdin
Previously glcpp would silently abort if it couldn't fstat the file being
read, (so it would work with stdin redirected from a file, but would not
work with stdin as a tty). The stat was so that glcpp could allocate
a buffer for the file content in a single call.

We now use talloc_realloc instead, (even if the fstat is
possible). This is theoretically less efficient, but quite irrelevant,
(particularly because the standalone preprocessor is used only for
testing).
2010-08-23 10:48:10 -07:00
Carl Worth 21560c40e8 glcpp: Fix test suite to avoid flagging failed tests as valgrind errors.
We recently added several tests that intentionally trigger
preprocessor errors. During valgrind-based testing, our test script
was noticing the non-zero return value from the preprocessor and
incorrectly flagging the valgrind-based test as failing.

To fix this, we make valgrind return an error code that is otherwise
unused by the preprocessor.
2010-08-23 10:48:10 -07:00
Carl Worth cf8bb19a11 glcpp: Fix segfault in standalone preprocessor for "file not found", etc.
This error message was missing so that the program would simply
segfault if the provided filename could not be opened for some reason.

While we're at it, we add explicit support for a filename of "-" to
indicate input from stdin.
2010-08-23 10:48:10 -07:00
Carl Worth eab206510f glcpp: Update generated glcpp-lex.c for the last two changes.
This fixes both "#line 0" and "#line XXX YYY" as described in the two
most recent commits.
2010-08-23 10:48:10 -07:00
Carl Worth c2280e6381 glcpp: Fix handling of "#line 0"
The existing DECIMAL_INTEGER pattern is the correct thing to use when
looking for a C decimal integer, (that is, a digit-sequence not
starting with 0 which would instead be an octal integer).

But for #line, we really want to accept any digit sequence, (including
"0"), and always interpret it as a decimal constant. So we add a new
DIGITS pattern for this case.

This should fix the compilation failure noted in bug #28138

	https://bugs.freedesktop.org/show_bug.cgi?id=28138

(Though the generated file will not be updated until the next commit.)
2010-08-23 10:48:10 -07:00
Carl Worth ff10d239af glcpp: Fix source numbers set with "#line LINE_NUMBER SOURCE_NUMBER"
Previously, the YY_USER_ACTION was overwriting the yylloc->source value
in every action, (after that value had been carefully set by the handling
of the #line directive). Instead, we want to initialize it once in
YY_USER_INIT and then not touch it at all in YY_USER_ACTION.
2010-08-23 10:48:10 -07:00
Carl Worth 2a9e791fde glcpp: Add new test for #line directive.
This test exposes two current bugs:

	1. The source number is not being correctly emitted in error
	   messages (instead, it's always 0).

	2. A directive of "#line 0" is resulting in the following
	   parse error:

		preprocessor error: Invalid tokens after #
2010-08-23 10:48:10 -07:00
Carl Worth c15f04b326 glcpp: Update README file (new specifications and fewer limitations).
The README file had grown a little bit stale. We've been using newer
versions of both the GLSL and C99 specifications, so list those. Also,
several of the documented known limitations have since been fixed, so
remove those.
2010-08-23 10:48:10 -07:00
Carl Worth 0acd68c405 glcpp: Add test for the #error directive.
This directive is already implemented nicely, but wasn't previously tested.
It will be convenient to use this directive in further tests that rely
on error messages, (such as ensuring that #line correctly sets the line
number in the error message).
2010-08-23 10:48:10 -07:00
Eric Anholt a721abfbd1 glsl: Trim the size of uniform arrays to the maximum element used.
Fixes glsl-getactiveuniform-array-size.
2010-08-23 10:34:31 -07:00
Eric Anholt 001a7bfdfc mesa: Don't add 1 to GL_ACTIVE_UNIFORM_MAX_LENGTH.
Fixes: glsl-getactiveuniform-length.
2010-08-23 10:34:31 -07:00
Roland Scheidegger c2f074d8a4 util: fix util_fill_rect to take util_color instead of u32 param
util_fill_rect could not handle formats with more than 32 bits,
since the fill color was a uint32_t value. Fix this by using
a util_color union instead, and also expand the union so it
works with formats which have up to 256 bits (the max of any
format currently defined).
2010-08-23 17:55:16 +02:00
Luca Barbieri c907b94713 nvfx: emit bo relocations only when needed
Should improve performance, possibly significantly.
2010-08-23 17:12:31 +02:00
Eric Anholt ea70969618 glsl2: Add missing sig_iter.next() to the no-constant-folding-to-outvals fix. 2010-08-23 07:22:16 -07:00
Luca Barbieri 2e215bc28f nvfx: match Gallium's gl_PointCoord brokenness
Gallium always puts gl_PointCoord in GENERIC[0] if
point_quad_rasterization is enabled.

This is silly, but for now it makes mesa-demos/glsl/pointcoord work.
2010-08-23 15:20:31 +02:00
Luca Barbieri bfaa2577c6 nvfx: support clip planes sensibly and fix them on nv30
Before, we were discarding the compiled vertex program on each
vertex program change.

Now we compile the program as if there were 6 clip planes and
dynamically patch in an "end program" bit at the right place.

Also, nv30 should now work.
2010-08-23 15:09:22 +02:00
Dave Airlie eb430b0e94 r300g: avoid stall in no-tcl drawing when mapping vbo
the current code reuses the same vbo over and over, however after a flush
we'd stall and wait for mapping on the vbo when we should just fire and forget.

On a gears test this brings me from ~620 to ~750 on my rv530 in swtcl mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-23 20:31:21 +10:00
Chia-I Wu e607b67ebc glapi: Clean up header inclusions.
Do not rely on PUBLIC being defined in glapi.h.  Do not include core
mesa headers.
2010-08-23 18:28:14 +08:00
Chia-I Wu 0c87828050 mesa: Assorted fixes for es_generator.py on win32.
Fix mixed use of GL_APIENTRY and GLAPIENTRY.  Parameter list of a function
prototype should never be empty.
2010-08-23 18:28:14 +08:00
Zhenyu Wang 8a537b2fb8 i965: Add sandybridge D0 pci ids
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2010-08-23 10:16:45 +08:00
Eric Anholt 27e931f679 mesa: Fix typo in autoconf.in that made talloc cflags still detect at runtime. 2010-08-22 18:54:30 -07:00
Marek Olšák cfc4d86656 st/mesa: implement depth-only blit for BlitFramebuffer
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák 7945e143e0 util: implement depth blitting in u_blit
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Marek Olšák 36e523f4a3 st/mesa: fix BlitFramebuffer for D24S8 textures
This is the same issue as in the previous patch, but here the Blit is not
implemented for separate depth and stencil buffers at all (such
a configuration is not supported in Gallium) and the code incorrectly treated
a D24S8 texture as two separate buffers, making this Blit a no-op.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-22 19:40:26 -06:00
Brian Paul 24bd9780bc st/mesa: added st_is_depth_stencil_combined() function
This code is part of a patch by Marek Olšák.
2010-08-22 19:40:26 -06:00
Eric Anholt 428a3cd2d5 glsl: Don't constant-fold in a constant in place of a function outval. 2010-08-22 18:34:46 -07:00
Eric Anholt 6606fde3ec glsl: Convert constant folding to the rvalue visitor.
This should be mostly a noop, except that a plain dereference of a
variable that is not part of a constant expression could now get
"constant folded".  I expect that for all current backends this will
be either a noop, or possibly a win when it provokes more
ir_algebraic.  It'll also ensure that when new features are added,
tree walking will work normally.  Before this, constants weren't
getting folded inside of loops.
2010-08-22 18:34:46 -07:00
Eric Anholt 137b8397fa glsl: Don't tree-graft in an expression in place of a function outval.
Fixes: glsl-constant-folding-call-1 (bug #29737)
2010-08-22 18:34:45 -07:00
Brian Paul 6b90d1b1ac st/mesa: fix ReadPixels crashes when reading depth/stencil from a FBO
This is based on a patch from Marek Olšák.

NOTE: This is a candidate for the Mesa 7.8 branch.
2010-08-22 19:04:49 -06:00
Brian Paul c94256e83b mesa: use driver hook for creating new renderbuffers 2010-08-22 18:54:55 -06:00
Brian Paul ed57286b75 st/mesa: clean-up pipe_get_transfer() calls 2010-08-22 18:54:55 -06:00
Eric Anholt 639cdd3782 mesa: AC_SUBST the talloc libs/cflags so the ./configure results are saved.
I had used pkg-config from the Makefile because I didn't want to screw
around with the non-autoconf build, but that doesn't work because the
PKG_CONFIG_PATH or TALLOC_LIBS/TALLOC_CFLAGS that people set at
configure time needs to be respected and may not be present at build
time.

Bug #29585
2010-08-22 17:36:51 -07:00
Luca Barbieri 8ffc357228 nvfx: fix minor memory leak 2010-08-23 00:16:59 +02:00
Luca Barbieri d507c0812d nvfx: support both sprite coord origins
Now we lie less when claiming OpenGL 2 support.

Also, first piglit result group is now all green, except for
fdo25614-genmipmap, which seems mesa/st's fault.
2010-08-23 00:15:03 +02:00
Luca Barbieri d21be6ee2c nvfx: use 64-bit bitmasks for temps 2010-08-23 00:15:03 +02:00