Commit Graph

53407 Commits

Author SHA1 Message Date
Alexander V. Nikolaev eaa8e56108 gallium/gallivm: code generation options for LLVM 3.1+
LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-10-28 10:34:26 +00:00
Eric Anholt 459b28aba7 i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:54 -07:00
Eric Anholt 99dc870613 i965: Rename misleading "active" field of brw->query.
"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:01 -07:00
Marek Olšák b78b62497f r600g: advertise 32 streamout vec4 outputs
to match the varying limit.
2012-10-26 19:01:16 +02:00
Brian Paul 80bc3206aa softpipe: remove extraneous whitespace 2012-10-26 10:59:29 -06:00
Brian Paul 369b5a311c gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59.
2012-10-26 10:59:29 -06:00
Marek Olšák 8b63512be0 r600g: advertise 32 fragment shaders inputs, not 34 2012-10-26 18:01:14 +02:00
José Fonseca 8eb2b331ef graw/fs-test: Use user constant buffers.
Much simpler. More interesting.
2012-10-26 16:02:59 +01:00
José Fonseca ce10624e9e trace: Flush before drawing. 2012-10-26 16:02:59 +01:00
José Fonseca 91332e455a graw: Ensure new members are zeroed.
Several new state members were added, and they were not being zeroed,
causing random crashes.
2012-10-26 16:02:59 +01:00
José Fonseca 2532f0d063 tests/graw: Update occlusion query example. 2012-10-26 16:02:58 +01:00
Michel Dänzer 97078b198d radeonsi: Handle TGSI_SEMANTIC_FACE.
Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:18 +02:00
Michel Dänzer 691f08dbea radeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer 44ef033c25 radeonsi: Don't snoop context state while building shaders.
Let's use the shader key describing the state.

Ported from r600g commit b652180107.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer f3257d80b0 radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Alex Deucher bd274eb8f4 r600g: split cayman common state out into a shared function
And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:32 -04:00
Alex Deucher 67c875117c r600g: emit some additional regs on cayman
These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:06 -04:00
Alex Deucher d781f0c73c r600g: there are 16 const buffer size regs for each shader stage
we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:55 -04:00
Alex Deucher 20d268b350 r600g: rework evergreen_init_common_regs()
Move gfx specific bits out as the code is shared with
compute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:40 -04:00
Alex Deucher 480e146305 r600g/compute: always CONTEXT_CONTROL packet at start of CS
It's required.  The CP uses this to properly allocate new
contexts.  Also do a CS partial flush since we are updating
CONFIG regs which are single state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:33 -04:00
José Fonseca 4a93414985 tools/trace: More helpful message when no args are provided. 2012-10-26 10:50:48 +01:00
José Fonseca 54536686b2 scons: Build xlib swrast too.
Helpful for debugging.
2012-10-26 10:50:48 +01:00
Christian König 59d4bc8c48 vl: fix the dri winsys helper screen init
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-26 09:53:04 +02:00
Vinson Lee 8cb2a4a7f5 tests: Use printf instead of debug_printf in u_format_compatible_test.
Use printf instead of debug_printf to be consistent with print
statements in rest of unit tests.

This also fixes the lack of print output with the MinGW build of
u_format_compatible_test.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 23:09:59 -07:00
Marek Olšák 8fb4b1dce1 r300g: fix texture border color for sRGB formats
NOTE: This is a candidate for the stable branches.
2012-10-26 01:27:05 +02:00
Kenneth Graunke b45a68eebf glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:53:39 -07:00
Kenneth Graunke 03ea156f1b i965/vs: Preserve the type when copy propagating into an instruction.
Consider the following code, which reinterprets a register as a
different type:

mov(8)          g6<1>F          g1.4<0,4,1>.xF
and(8)          g5<1>.xUD       g6<4,4,1>.xUD   0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV.  Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8)          g5<1>.xUD       g6<4,4,1>.xF    0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke 10ff6772c8 i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.
Consider the following code sequence:

   mul(8)          g4<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mov.sat(8)      m1<1>.xyF       g4<4,4,1>F
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions.  Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination.  While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          m1<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source.  It ensures that all
necessary channels are available (possibly written by several
instructions).  In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code.  However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke 9142ade154 glcpp: Don't use infinite lookhead for #define differentiation.
Previously, we used lookahead patterns to differentiate:

   #define FOO(x)  function macro
   #define FOO (x) object macro

Unfortunately, our rule for function macros:

   {HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead.  We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-10-25 14:52:53 -07:00
Kenneth Graunke eeb2fb72eb i965/vs: Fix debug dumping of VS push constants.
While copying the values into the batch space, we advance the param
pointer.  The debug code then tries to iterate over all the uploaded
values, starting at param...which is now the end of the uploaded data,
rather than the start.

This patch saves a pointer to the start of push constant space before
it gets altered and switches the debug code to use that.

Tested by uncommenting the code and examining the output of
glsl-vs-clamp-1.shader_test.  Previously all values appeared to be zero.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:53 -07:00
Matt Turner df924d82e2 mesa/tests: Add ES3.0 dispatch table sanity test
Since ES3.0 is backward compatible with 2.0, we check that all the 2.0
functions and additional 3.0 functions exist.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Matt Turner 355f507f2a Split dispatch sanity's validate_function test into two
Will be useful for the next patch, adding GLES 3 testing.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Paul Berry 1cf6360f89 dispatch_sanity: print names of functions that shouldnt be in dispatch table.
Previously we just printed the dispatch table index and the user had
to convert it to a function name.  That was a pain because when
FEATURE_remap_table is defined, the assignment of functions to
dispatch table entries is done at run time.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Paul Berry 03984b26c4 shared-glapi: implement _glapi_get_proc_name().
Previously this function was only implemented for non-shared-glapi
builds.  Since the function is only intended for debugging purposes we
use a simple O(n) algorithm.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Matt Turner 67f1e7bf5f src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS
When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC       ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-10-25 13:31:24 -07:00
Matt Turner d654afd892 egl: Import eglext.h revision 19332
The version number (14) wasn't updated.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 10:49:09 -07:00
Matt Turner 41b14d1251 ralloc: Annotate printf functions with PRINTFLIKE(...)
Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
	'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-25 10:47:43 -07:00
Matt Turner ec57fbbc72 build: Ship install-sh in the tarball
Fixes the problem where configure from the tarball would report missing
files:

$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in bin

NOTE: This is a candidate for the 9.0 branch.
2012-10-25 10:47:43 -07:00
José Fonseca 0cb0c38cce mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)
4bits and 3bits quantitization values differ significantly for
values other than 0 and 1.

Fixes piglit draw-pixels for softpipe/llvmpipe.

NOTE: Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-25 17:57:57 +01:00
José Fonseca 4efcdd1e7a trace: Fix dumping of set_constant_buffer method. 2012-10-25 15:30:19 +01:00
Andreas Boll 86cd77d0a9 docs: add another fixed bug to mesa 8.0.5 release notes
Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:59:51 +02:00
Andreas Boll 2574d10398 docs: Add 8.0.5 release notes
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:51:09 +02:00
Bryan Cain ebd8df7a31 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.
2012-10-24 23:51:08 +02:00
Vincent Lejeune 0f35702d79 r600g: force bank_swizzle if already set
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:37:02 +02:00
Vincent Lejeune d1eaa9ea70 r600g: rewrite tgsi-to-llvm load-input to handle fragcoord
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:31:41 +02:00
Christoph Bumiller d310e29302 nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D 2012-10-24 20:47:38 +02:00
Ian Romanick be1c5f4498 mesa: Use MIN instead of CLAMP for unsigned source data
This silences a zillion GCC warnings like:

../../../src/mesa/main/pack.c: In function '_mesa_pack_rgba_span_from_uints':
../../../src/mesa/main/pack.c:560:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 11:03:16 -07:00
Michel Dänzer eee1ff423c st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 17:54:25 +02:00
Andreas Boll ecb02c27fc gallium/docs: fix sphinx warning
src/gallium/docs/source/context.rst:495: WARNING:
malformed hyperlink target.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 14:14:03 +02:00
Vinson Lee 016897cc66 scons: Do not use -fvisibilty=hidden on Cygwin.
This is a follow-up to commit db78643182.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-23 23:22:45 -07:00