Rob Clark [Thu, 25 Apr 2013 19:00:58 +0000 (15:00 -0400)]
freedreno: use writecombine buffers
Better than uncached for writes, which are common for vertex buffer
upload, etc.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Thu, 25 Apr 2013 15:17:02 +0000 (11:17 -0400)]
freedreno: don't patch and re-emit same shader as much
New textures or vertex buffers don't always require patching and
re-emitting the shaders. So do a better job of figuring out when we
actually have to patch the shader.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Eric Anholt [Mon, 15 Apr 2013 23:44:55 +0000 (16:44 -0700)]
i965: Avoid recompiles for fragment clamping on non-clamping APIs.
Removes 75/78 state-dependent recompiles in GLB2.7 (the remaining 3 are
due to FBO-rendering size predictions). We currently expose
GL_ARB_color_buffer_float on GL core, so we may mis-predict there, but I'm
about to send a patch for removing that silly extension in that case.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Alex Deucher [Thu, 25 Apr 2013 18:22:46 +0000 (14:22 -0400)]
radeonsi: add new SI pci ids
Note: this is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher [Thu, 25 Apr 2013 18:21:15 +0000 (14:21 -0400)]
r600g: add new richland pci ids
Note: this is a candidate for the stable branches.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
José Fonseca [Thu, 25 Apr 2013 15:16:21 +0000 (16:16 +0100)]
draw: Yield zeros for LLVM fetches of non-existing vertex elements.
If a bug in an app/stater-tacker causes vertex buffer to fetch vertex
elements that are not bound, simply return zeros instead of crashing.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 25 Apr 2013 13:18:33 +0000 (14:18 +0100)]
trace: Only close trace files on exit.
Many applications don't exit cleanly, others may create and destroy a
screen multiple times, so we only write </trace> tag and close at exit
time.
José Fonseca [Thu, 25 Apr 2013 13:06:50 +0000 (14:06 +0100)]
graw: Set the vertex shader constant buffer.
We were setting the fragment shader, which wasn't needed.
José Fonseca [Wed, 24 Apr 2013 12:08:46 +0000 (13:08 +0100)]
graw: Simple utilities to dump and disassemble TGSI tokens.
Useful for core dumps, where calling tgsi_dump() from gdb is not an
alternative.
José Fonseca [Wed, 24 Apr 2013 21:02:18 +0000 (22:02 +0100)]
scons: Support clang.
clang is supports most gcc options / extensions, with a some exceptions.
The biggest advantage of using clang is that compilation times are much
short.
One can tell scons to use clang when building by invoking it as
CC=clang CXX=clang++ scons libgl-xlib
José Fonseca [Wed, 24 Apr 2013 20:58:20 +0000 (21:58 +0100)]
util/u_sse: Fix _mm_shuffle_epi8 prototype for clang.
Clang does not support __artificial__. Instead match precisely what's
in the clang headers.
José Fonseca [Wed, 24 Apr 2013 21:00:32 +0000 (22:00 +0100)]
scons: Remove redundant code.
-fvisibility=hidden is already elsewhere for the whole tree.
Chris Forbes [Mon, 22 Apr 2013 05:07:57 +0000 (17:07 +1200)]
mesa: fix bogus comment about PrimitiveRestart fields
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Chris Forbes [Tue, 23 Apr 2013 18:44:02 +0000 (06:44 +1200)]
i965: report correct sample positions
From low to high bits, the sample positions are packed y0,x0,y1,x1...
Fixes arb_texture_multisample-sample-position piglit.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Rob Clark [Wed, 24 Apr 2013 21:45:00 +0000 (17:45 -0400)]
freedreno: fix bogus IMM const reg index
We were assigning incorrect const register for immediates, and
potentially writing immediate const to the wrong location. This fixes
an incorrect-rendering bug with xonotic.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Wed, 24 Apr 2013 14:50:51 +0000 (10:50 -0400)]
freedreno: clear fixes and debugging
Set a few extra registers to make sure we are in proper state for
clearing. And also add some debug options to mark all state dirty in
clear and gmem operations to aid in debugging.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Wed, 24 Apr 2013 14:48:59 +0000 (10:48 -0400)]
freedreno: fix texture fetch type
There is a bit we need to set for 2D vs 3D fetch, to tell the hw whether
there are two or there valid input components.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Wed, 24 Apr 2013 14:44:56 +0000 (10:44 -0400)]
freedreno: fix temp register usage
The previous approach of using the dst register as an intermediate
temporary doesn't work in a lot of cases. For example, if the dst
register is the same as one of the src registers.
For now, just simplify it and always allocate a new register to use as
an intermediate. In some cases this will result in more registers used
than required. I think the best solution would be to implement an
optimization pass to reduce the number of registers used, which would
also solve the problem we have now of not being able to use GPRs that
are assigned for TGSI_FILE_INPUT.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 23 Apr 2013 15:20:25 +0000 (11:20 -0400)]
freedreno: add noop driver
It is useful for debugging.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 22 Apr 2013 17:55:14 +0000 (13:55 -0400)]
freedreno: use u_math macros/helpers more
Get rid of a few self-defined macros:
ALIGN() -> align()
min() -> MIN2()
max() -> MAX2()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 22 Apr 2013 17:42:55 +0000 (13:42 -0400)]
freedreno: implement fd_screen_destroy()
Opps, didn't notice that I had left it stubbed out.
Also, make things fail a bit more gracefully when things go wrong.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 22 Apr 2013 17:21:21 +0000 (13:21 -0400)]
freedreno: set SWAP bit based on format
Really this should be set based on buffer format, not on color vs
depth/stencil. Probably there should be more formats that set the bit
as we add support for more render target formats.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Tom Stellard [Tue, 23 Apr 2013 15:08:30 +0000 (08:08 -0700)]
radeon/llvm: Fix segfault with a specifc libelf implementation
The libelf implementation that is distributed here:
http://www.mr511.de/software/english.html
requires calling elf_version() prior to calling elf_memory()
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Alex Deucher [Wed, 24 Apr 2013 16:26:52 +0000 (12:26 -0400)]
r600g: use CP DMA for buffer clears on evergreen+
Lighter weight then using streamout. Only evergreen
and newer asics support embedded data as src with
CP DMA.
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Chia-I Wu [Wed, 10 Apr 2013 13:32:30 +0000 (21:32 +0800)]
i965/gen7: fix encoding of (huge) surface size for BRW_SURFACE_BUFFER
Unlike GEN6, the bits of entry count are distributed like this
width = (entry_count & 0x0000007f); /* bits [6:0] */
height = (entry_count & 0x001fff80) >> 7; /* bits [20:7] */
depth = (entry_count & 0x7fe00000) >> 21; /* bits [30:21] */
The maximum entry count is still limited to 2^27.
This was noted while going over the PRM. No test is impacted, because
1<<20 (the bit that moved) is much larger than GL_UNIFORM_BLOCK_MAX_SIZE,
GL_MAX_TEXTURE_BUFFER_SIZE, or MAX_*_UNIFORM_COMPONENTS.
v2: Explain more in the commit message (by anholt)
Reviewed-by: Eric Anholt <eric@anholt.net>
Chia-I Wu [Wed, 10 Apr 2013 13:32:13 +0000 (21:32 +0800)]
i965/gen7: fix 3DSTATE_LINE_STIPPLE_PATTERN
The inverse repeat count should taks up bits 31:15 and is in U1.16. Fixes
the "Restarting lines within a single Begin/End block" subtest of piglit
linestipple, and gets the other failing subtests much closer to passing.
v2: Rewrite commit message with more detailed piglit info (by anholt)
Reviewed-by: Eric Anholt <eric@anholt.net>
Chia-I Wu [Wed, 10 Apr 2013 13:31:56 +0000 (21:31 +0800)]
i965: fix SURFACE_STATE dumping
Wrong fields were used when dumping width and height.
Reviewed-by: Eric Anholt <eric@anholt.net>
Matt Turner [Tue, 23 Apr 2013 04:43:34 +0000 (21:43 -0700)]
i965: Remove strange comments about math functions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 23 Apr 2013 04:33:38 +0000 (21:33 -0700)]
i965: Remove traces of nonexistent TAN math function.
Never existed? At least never supported. Doesn't appear in 965, G45,
or ILK documentation.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Mon, 22 Apr 2013 21:02:00 +0000 (14:02 -0700)]
glsl: Teach basic block analysis about break/continue/discard.
Previously, the only kind of ir_jump that would terminate a basic
block was "return". However, the other possible types of ir_jump
("break", "continue", and "discard") should terminate a basic block
too. This patch modifies basic block analysis so that it terminates a
basic block on any type of ir_jump, not just ir_return.
Fixes piglit test dead-code-break-interaction.shader_test.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Mon, 22 Apr 2013 20:59:17 +0000 (13:59 -0700)]
glsl: Add virtual function ir_instruction::as_jump()
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tom Stellard [Wed, 24 Apr 2013 03:08:57 +0000 (20:08 -0700)]
r600g/llvm: Pass struct r600_bytecode to r600_llvm_compile
This way we don't need to update the function signature everytime we
emit a new config value. This also fixes the build with
--enable-opencl.
José Fonseca [Wed, 24 Apr 2013 09:49:57 +0000 (10:49 +0100)]
winsys/sw/xlib: Prevent shared memory segment leakage.
Running piglit with this was causing all sort of weird stuff happening
to my desktop (Chromium webpages become blank, Qt Creator flickered,
etc). I tracked this down to shared memory segment leakage when GL is
not shutdown properly. The segments can be seen running `ipcs` and
looking for nattch==0.
This changes fixes this by calling shmctl(IPC_RMID) soon after creation
(which does not remove the segment immediately, but simply marks it for
removal when no more processes are attached).
This matches src/mesa/drivers/x11/xm_buffer.c behaviour.
v2:
- move shmctl(IPC_RMID) after XShmAttach() for *BSD, per Chris Wilson
- remove stray debug printfs, spotted by Ian Romanick
NOTE: This is a candidate for stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Zack Rusin [Tue, 23 Apr 2013 00:44:21 +0000 (20:44 -0400)]
draw/gs: preserve leading vertex info for gs
We need to handle the leading vertex information when
assembling primitives for the geometry shader otherwise
the resulting triangles will have vertices at incorrect
input locations.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Laurent Carlier [Wed, 24 Apr 2013 10:47:18 +0000 (12:47 +0200)]
r200: fix build regression introduced with
9a32203e1618486e87c7baf494134e05f0e38cf3
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Christian König [Sat, 20 Apr 2013 11:19:33 +0000 (13:19 +0200)]
radeonsi: cleanup disabling tiling for UVD v3
Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=63702
v2: add a comment that this is just a workaround
v3: fix typo in comment
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Chad Versace [Tue, 23 Apr 2013 02:17:48 +0000 (04:17 +0200)]
egl/dri2: Fix min/max swap interval of configs
The commit below exposed a bug in dri2_add_config.
commit
3998f8c6b5da1a223926249755e54d8f701f81ab
Author: Ralf Jung <post@ralfj.de>
Date: Tue Apr 9 14:09:50 2013 +0200
egl/x11: Fix initialisation of swap_interval
This little code snippet near the bottom of dri2_add_config,
if (double_buffer) {
...
conf->base.MinSwapInterval = dri2_dpy->min_swap_interval;
conf->base.MaxSwapInterval = dri2_dpy->max_swap_interval;
}
it never did what it claimed to do. The assignment never changed the value
of conf->base.MaxSwapInterval, because dri2_dpy->max_swap_interval was,
until the above exposing commit, unitialized here. That is,
conf->base.MaxSwapInterval was 0 before and after assignment. Ditto for
the min swap interval.
Above the troublesome code snippet, the call to _eglFilterArray rejects
the config as unmatching if its swap interval bounds differ from the base
config's. Before the exposing commit, at the call to _eglFilterArray, the
swap interval bounds were always [0,0], and hence no config was rejected
due to swap interval.
After the exposing commit, _eglFilterArray incorrectly rejected some
configs, which prevented dri2_egl_config::dri_double_config from getting
set for the rejected config, which resulted in a NULL pointer getting
passed into dri2CreateNewDrawable, and then segfault.
The solution: set the swap interval bounds before _eglFilterArray.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63447
Tested-by: Lu Hua <huax.lu@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Kenneth Graunke [Tue, 23 Apr 2013 06:52:22 +0000 (23:52 -0700)]
mesa: Add unpack functions for A/I/L/LA [U]INT8/16/32 formats.
NOTE: This is a candidate for stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Tue, 23 Apr 2013 06:37:06 +0000 (23:37 -0700)]
mesa: Add unpack functions for R/RG/RGB [U]INT8/16/32 formats.
NOTE: This is a candidate for stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Tue, 23 Apr 2013 06:13:47 +0000 (23:13 -0700)]
mesa: Add an unpack function for ARGB2101010_UINT.
v2: Remove extra parenthesis (suggested by Brian).
NOTE: This is a candidate for stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Tue, 23 Apr 2013 05:58:49 +0000 (22:58 -0700)]
mesa: Fix unpack function for ETC2_SRGB8_PUNCHTHROUGH_ALPHA1.
We accidentally set MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1 twice,
rather than setting the RGB8 and SRGB8 formats.
NOTE: This is a candidate for stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 20:55:37 +0000 (13:55 -0700)]
mesa: Fix up some final license word wrapping issues by hand.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 20:52:08 +0000 (13:52 -0700)]
mesa: Restore 78-column wrapping of license text in C++-style comments.
The previous commit introduced extra words, breaking the formatting.
This text transformation was done automatically via the following shell
command:
$ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript2
where 'vimscript2' is a file containing:
/THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/^ *$/ !fmt -w 78 -p '// '
:wq
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 20:46:48 +0000 (13:46 -0700)]
mesa: Restore 78-column wrapping of license text in C-style comments.
The previous commit introduced extra words, breaking the formatting.
This text transformation was done automatically via the following shell
command:
$ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript
where 'vimscript' is a file containing:
/THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * '
:wq
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 20:09:39 +0000 (13:09 -0700)]
mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.
This brings the license text in line with the MIT License as published
on the Open Source Initiative website:
http://opensource.org/licenses/mit-license.php
Generated automatically be the following shell command:
$ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {}
This introduces some wrapping issues, to be fixed in the next commit.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 20:01:45 +0000 (13:01 -0700)]
mesa: Change "BRIAN PAUL OR IBM" to "THE AUTHORS" in license text.
See previous commit for the rationale. These weren't caught by the
automatic conversion due to the "OR IBM" addition.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Sun, 21 Apr 2013 19:56:09 +0000 (12:56 -0700)]
mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.
Generated automatically be the following shell command:
$ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
sed -i 's/BRIAN PAUL/THE AUTHORS/' {}
The intention here is to protect all authors, not just Brian Paul. I
believe that was already the sensible interpretation, but spelling it
out is probably better.
More practically, it also prevents people from accidentally copy &
pasting the license into a new file which says Brian is not liable when
he isn't even one of the authors.
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Tue, 23 Apr 2013 15:19:07 +0000 (09:19 -0600)]
mesa: make _mesa_save_vtxfmt_init() static
It's called from nowhere else.
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Tue, 23 Apr 2013 19:18:41 +0000 (13:18 -0600)]
docs: document issue with Viewperf proe-05 test 6
Brian Paul [Tue, 23 Apr 2013 16:57:45 +0000 (10:57 -0600)]
mesa: use new _mesa_inside_dlist_begin_end() function
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Tue, 23 Apr 2013 16:53:00 +0000 (10:53 -0600)]
mesa: use new _mesa_inside_begin_end() function
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Sun, 14 Apr 2013 17:59:06 +0000 (19:59 +0200)]
mesa: remove unused opcodes AND, DP2A, NOT, NRM3, NRM4, OR, PRINT, XOR
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 01:41:43 +0000 (03:41 +0200)]
mesa: don't flush vertices and don't flag _NEW_COLOR in ClearColor, ClearIndex
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 01:41:43 +0000 (03:41 +0200)]
mesa: don't flush vertices and don't flag _NEW_COLOR for GL_CLAMP_READ_COLOR
There used to be a derived state _ClampReadColor, so setting _NEW_COLOR
made sense. The state is gone now.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 01:41:43 +0000 (03:41 +0200)]
mesa: don't flag _NEW_DEPTH in Begin/EndQuery if driver implements the functions
We don't want to set the flag for Gallium.
I think only swrast needs the flag to be set for occlusion queries.
v2: fix stats_wm updates in i965
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 01:40:06 +0000 (03:40 +0200)]
mesa: don't flush vertices and don't flag _NEW_DEPTH in ClearDepth
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 00:54:58 +0000 (02:54 +0200)]
mesa: don't flush and don't flag _NEW_STENCIL in ClearStencil, ActiveStencilFace
The functions don't affect driver state. There is no code that would rely
on vertices being flushed prior to changing the states, and no code that
would check for _NEW_STENCIL before using the states.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sun, 14 Apr 2013 20:31:50 +0000 (22:31 +0200)]
mesa: don't set _NEW_BUFFERS in GenerateMipmap and BlitFramebuffer
both functions don't change the framebuffer in any way
(if mesa_meta is not used)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 00:23:37 +0000 (02:23 +0200)]
mesa: remove _NEW_PACKUNPACK
No driver checks the flag. Nobody uses it.
I also removed the FLUSH_VERTICES calls, because PixelStorei has no effect
on rendering.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Mon, 15 Apr 2013 11:00:54 +0000 (13:00 +0200)]
mesa: convert _NEW_RASTERIZER_DISCARD to a driver flag
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sun, 14 Apr 2013 22:50:20 +0000 (00:50 +0200)]
mesa,i965: use NewDriverState to communicate TFB state changes with the driver
_NEW_TRANSFORM_FEEDBACK is not used by core Mesa, so it can be removed.
Instead, an new private flag is added to i965 to serve the same purpose.
If you're new to this:
* When creating a context. you can set private dirty flags
in gl_context::DriverFlags, eg.:
ctx->DriverFlags.NewStateX = BRW_NEW_STATE_X;
* When StateX is changed, core Mesa does:
ctx->NewDriverState |= ctx->DriverFlags.NewStateX;
* When you have to draw, read and clear ctx->NewDriverState.
* Pros: not touching NewState, the driver decides the mapping between
GL states and hw state groups, unlimited number of flags in core Mesa
(still limited number of flags in the driver though)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sun, 14 Apr 2013 20:24:09 +0000 (22:24 +0200)]
mesa: remove redundant _NEW_BUFFERS setting in ReadBuffer
already set by _mesa_readbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sun, 14 Apr 2013 21:28:36 +0000 (23:28 +0200)]
st/mesa: add a simple path to BufferData if it only discards buffer contents
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Mon, 15 Apr 2013 12:39:58 +0000 (14:39 +0200)]
st/mesa: depth-stencil-alpha state also depends on _NEW_BUFFERS
because the code looks at the visual if there is a depth or stencil buffer
before enabling depth or stencil, respectively.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Tue, 23 Apr 2013 18:40:05 +0000 (19:40 +0100)]
gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center.
Squashed commit of the following:
commit
04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852
Author: José Fonseca <jfonseca@vmware.com>
Date: Tue Apr 23 17:37:18 2013 +0100
gallium: s/lower_left_origin/bottom_edge_rule/
commit
4dff4f64fa83b9737def136fffd161d55e4f1722
Author: José Fonseca <jfonseca@vmware.com>
Date: Tue Apr 23 17:35:04 2013 +0100
gallium: Move diagram to docs.
commit
442a63012c8c3c3797f45e03f2ca20ad5f399832
Author: James Benton <jbenton@vmware.com>
Date: Fri May 11 17:50:55 2012 +0100
gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center.
This change is necessary to achieve correct results when using OpenGL
FBOs.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Marek Olšák [Sun, 21 Apr 2013 21:26:52 +0000 (23:26 +0200)]
r600g: initialize CMASK and HTILE with the GPU using streamout
This fixes a crash when a resource cannot be mapped to the CPU's address space
because it's too big.
This puts a global pipe_context in r600_screen, which is guarded by a mutex,
so that we can use pipe_context when there isn't one around.
Hopefully our multi-context support is solid.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
NOTE: This is a candidate for the 9.1 branch.
Marek Olšák [Sun, 21 Apr 2013 17:39:03 +0000 (19:39 +0200)]
gallium/u_blitter: implement buffer clearing
Although this might be useful for ARB_clear_buffer_object,
I need it for initializating resources in r600g.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
v2: comment cleanups
NOTE: This is a candidate for the 9.1 branch.
Vincent Lejeune [Fri, 19 Apr 2013 18:10:44 +0000 (20:10 +0200)]
r600/llvm: Read stacksize from config header
Vincent Lejeune [Sat, 13 Apr 2013 14:35:39 +0000 (16:35 +0200)]
/bin/bash: q : commande introuvable
Tom Stellard [Tue, 23 Apr 2013 14:58:38 +0000 (10:58 -0400)]
radeon/llvm: Fix build with LLVM >= r180063
Tom Stellard [Tue, 23 Apr 2013 14:57:54 +0000 (10:57 -0400)]
gallivm: Fix build with LLVM >= r180063
Zack Rusin [Mon, 22 Apr 2013 23:07:14 +0000 (19:07 -0400)]
draw: use the prim count for ia primitives
Number of vertices to fetch doesn't always equal the number of input
vertices. To correctly compute the number if IA primitives we need
to use the total number of input vertices, not only those that
need to be fetched.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Sat, 20 Apr 2013 07:02:00 +0000 (00:02 -0700)]
tgsi/scan: set correct input limits for geometry shader
TGSI geometry shader input declerations are of the IN[][2] format
and the dimensions of the array have to be deduced from the input
primitive property.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Fri, 19 Apr 2013 23:51:27 +0000 (16:51 -0700)]
draw: add code to reset instance dependent data
We want to be able to reset certain parts of the pipeline,
in particular the input primitive index, but only either with
seperate invocations of the draw_vbo or new instances. In all
other cases (e.g. new invocations due to primitive restart)
that data needs to be preserved. Add a function through which
we can reset instance dependent data.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Fri, 19 Apr 2013 19:51:07 +0000 (12:51 -0700)]
softpipe: fix streamout with an emptry geometry shader
Same approach as in the llvmpipe, if the geometry shader is
null and we have stream output then attach it to the vertex
shader right before executing the draw pipeline.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Andreas Boll [Fri, 1 Feb 2013 12:39:42 +0000 (13:39 +0100)]
configure.ac: Allow OpenGL ES1 and ES2 only with enabled OpenGL
Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa
9.0.x
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Matt Turner [Wed, 10 Apr 2013 02:12:39 +0000 (19:12 -0700)]
i965/fs: Don't save value returned by emit() if it's not used.
Probably a copy-n-paste mistake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Mon, 22 Apr 2013 16:42:43 +0000 (10:42 -0600)]
mesa: Remove extra MapBufferRange in create_beginend_table()
Looks like a copy&paste typo.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
José Fonseca [Sat, 20 Apr 2013 11:24:44 +0000 (12:24 +0100)]
gallium: Add a new clip_halfz rasterizer state.
gl_rasterization_rules lumps too many different flags.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Thu, 28 Feb 2013 03:06:32 +0000 (19:06 -0800)]
i965: Fix a mistake in the comments for software counters.
The code doesn't set brw->query.obj to NULL, it sets query->bo to NULL.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
José Fonseca [Mon, 22 Apr 2013 14:28:32 +0000 (15:28 +0100)]
gallivm: Fix assignment of unsigned values to OUT register.
TEMP is not the only register file that accept unsigned. OUT too.
Actually, what determines the appropriate type of the destination value is
not the opcode, but rather the register.
Also cleanup/simplify code. Add a few more asserts, but also make
code more robust by handling graceful if assert fails.
This fixes segfault / assertion in the included vert-uadd.sh graw shader.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Matt Turner [Sun, 21 Apr 2013 07:18:11 +0000 (00:18 -0700)]
i965: Apply CMP NULL {Switch} work-around to other Gen7s.
Listed in the restrictions section of CMP, but not on the work-arounds
page.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Mon, 22 Apr 2013 16:08:06 +0000 (10:08 -0600)]
st/mesa: minor indentation fixes
Eric Anholt [Sat, 13 Apr 2013 08:46:09 +0000 (01:46 -0700)]
mesa: Introduce a globally-available minify() macro.
This matches u_minify()'s behavior, for consistency.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Sat, 13 Apr 2013 08:37:35 +0000 (01:37 -0700)]
mesa: Generalize TexStorage allocator between swrast and intel.
This should be reusable for other non-gallium drivers, so we can make the
extension always be available.
v2: Add a more detailed comment than the old function had (recommended
by Brian).
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Eric Anholt [Sat, 13 Apr 2013 03:16:41 +0000 (20:16 -0700)]
mesa: Add performance debug for meta code.
I noticed a fallback in regnum through sysprof, and wanted a nicer way to
get information about it.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Fri, 12 Apr 2013 00:58:09 +0000 (17:58 -0700)]
intel: Mention how much data we're trying to subdata in perf debug.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
José Fonseca [Sun, 21 Apr 2013 08:02:21 +0000 (09:02 +0100)]
Revert "gallivm: Emit vector selects."
It caused inumerous regressions (LLVM 3.1) in blending. In particular:
- lp_test_blend
type=u8nx16 rgb_func=sub rgb_src_factor=zero rgb_dst_factor=inv_src_color alpha_func=rev_sub alpha_src_factor=one alpha_dst_factor=const_color ... MISMATCH
Src: 0 0 0 b5 49 29 0 a2 0 21 de 0 c3 1b ec 0
Src1: 2d 85 14 0 f8 0 79 a1 99 0 d8 0 59 16 0 0
Dst: 0 a9 97 0 c0 0 78 0 0 8b aa f0 bd 0 78 f6
Con: 7d 0 c0 0 0 bb 77 0 0 0 50 0 40 51 0 0
Res: 0 0 0 0 0 29 0 0 0 0 c8 0 97 1b e3 0
Ref: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
type=u8nx16 rgb_func=max rgb_src_factor=one rgb_dst_factor=inv_const_color alpha_func=min alpha_src_factor=zero alpha_dst_factor=inv_src1_alpha ... MISMATCH
Src: d 0 0 e9 0 37 35 f0 62 0 0 b2 e9 f7 0 5c
Src1: 8f 0 bf 0 a8 5 0 0 c4 0 d7 7 92 a 0 17
Dst: cb 0 1e 0 0 0 19 8e 0 4d 0 0 0 0 3 46
Con: aa 5a 5f 8f 0 0 bc 92 0 88 0 0 b7 8a c0 88
Res: 44 0 13 0 0 0 7 8e 0 24 0 0 0 0 1 40
Ref: 44 0 13 0 0 37 35 0 62 24 0 0 e9 f7 1 0
This reverts commit
1e266c7ef01251ecf72347a2ba1d174b035cbe3b.
José Fonseca [Sun, 21 Apr 2013 07:53:31 +0000 (08:53 +0100)]
llvmpipe: verify function on blend test.
José Fonseca [Sat, 20 Apr 2013 09:42:09 +0000 (10:42 +0100)]
llvmpipe: Don't support Z32_FLOAT_S8X24_UINT texture sampling support either.
Because we don't support, and the u_format fallback doesn't work for
zs formats.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Sat, 20 Apr 2013 08:43:54 +0000 (09:43 +0100)]
llvmpipe: Ignore depth-stencil state if format has no depth/stencil.
Prevents assertion failures inside the driver for such state combinations.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Fri, 19 Apr 2013 21:34:47 +0000 (22:34 +0100)]
gallivm: Disable LLVM 2.7 workaround on other versions.
2.7 was a particularly trouble ridden release.
Furthermore, the bug no longer can be reproduced ever since the
first_level state was taken in account.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Fri, 19 Apr 2013 13:04:15 +0000 (14:04 +0100)]
gallivm: Emit vector selects.
They are supported on LLVM 3.1, at least on x86. (I haven't tested on PPC
though.)
Actually lp_build_linear_mip_levels() already has been emitting them for
some time.
This avoids intrinsics, which tend to be an obstacle for certain
optimization passes.
Reviewed-by: Brian Paul <brianp@vmware.com>
Rob Clark [Sat, 20 Apr 2013 21:59:41 +0000 (17:59 -0400)]
freedreno: move ir -> ir2
There will be a new IR for a3xx, which has a very different shader ISA
(more scalar oriented). So rename to avoid conflicts later when I start
adding a3xx support to the gallium driver.
Signed-off-by: Rob Clark <Rob Clark robdclark@freedesktop.org>
Rob Clark [Sat, 20 Apr 2013 21:31:47 +0000 (17:31 -0400)]
freedreno: cleanup some cruft left over from fdre
The standalone shader assembler needed some meta-data to know about
attributes/varyings/etc, to do the shader linkage. We don't need these
parts with gallium/tgsi, so just get rid of it.
Signed-off-by: Rob Clark <Rob Clark robdclark@freedesktop.org>
Roland Scheidegger [Fri, 19 Apr 2013 23:46:04 +0000 (01:46 +0200)]
gallivm: implement switch opcode
Should be able to handle all things which make this tricky to implement.
Fallthroughs, including most notably into/out of default, should be handled
correctly but are quite a mess.
If we see largely unoptimized switches in the wild should probably think
about some "real" switch optimization pass, e.g. things like this:
switch
case1
someinst
brk
case2
default
case3
someinst
brk
case4
someinst
endswitch
are legal, but the pointless case2/case3 statements not only cause condition
evaluation but will turn this into a "fake" fallthrough case (because
mask and defaultmask are already updated for case2 when default is
encountered) requiring executing code twice.
If default is at the end though, there's never any code re-execution, and
if that's not the case if there's no fallthrough in (not even a fake one)
and out of default there's no code re-execution neither.
v2: add comments, and use enum for break type instead of magic boolean.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Fri, 19 Apr 2013 01:38:50 +0000 (03:38 +0200)]
gallivm: use uint build context for mask instead of float
Unsurprisingly noone was using it except for grabbing builder.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Fri, 19 Apr 2013 01:26:20 +0000 (03:26 +0200)]
gallivm/tgsi: fix up breakc
It seems there was a typo in gallivm breakc handling (I am actually still
not sure it is really needed but otherwise that statement really should go
away). Also fix the wrong src argument type, even though they weren't really
used.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Fri, 19 Apr 2013 22:38:31 +0000 (00:38 +0200)]
svga: remove TGSI_OPCODE_BREAKC instruction translation
While initially that opcode probably was meant for something along the
lines of sm3 break_comp it has never worked that way (not even the
argument count was right) and now the opcode has quite different
semantics so just remove it. (Discovered by Jose Fonseca)
Roland Scheidegger [Fri, 19 Apr 2013 22:34:20 +0000 (00:34 +0200)]
gallium: document breakc and switch/case/default/endswitch
docs were missing, especially the opcode-from-hell switch however is anything
but obvious.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>