mesa.git
13 years agor600g: Implemented the Z and W component write for the SCS opcode.
Tilman Sauerbeck [Mon, 20 Sep 2010 19:27:59 +0000 (21:27 +0200)]
r600g: Implemented the Z and W component write for the SCS opcode.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agor600g: Honour destination operand's writemask in the SCS implementation.
Tilman Sauerbeck [Sun, 19 Sep 2010 08:06:34 +0000 (10:06 +0200)]
r600g: Honour destination operand's writemask in the SCS implementation.

If we are not going to write to the X or Y components of the destination
vector we also don't need to prepare to compute SIN or COS.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agosoftpipe: fix whitespace
Luca Barbieri [Mon, 20 Sep 2010 18:49:03 +0000 (20:49 +0200)]
softpipe: fix whitespace

13 years agotgsi: add switch/case opcodes to tgsi_opcode_tmp.h
Luca Barbieri [Mon, 20 Sep 2010 17:19:50 +0000 (19:19 +0200)]
tgsi: add switch/case opcodes to tgsi_opcode_tmp.h

13 years agosoftpipe: make z/s test always pass if no zsbuf, instead of crashing
Luca Barbieri [Mon, 20 Sep 2010 17:22:44 +0000 (19:22 +0200)]
softpipe: make z/s test always pass if no zsbuf, instead of crashing

D3D10 specifies this.

13 years agogallium: avoid the C++ keyword "template" in sw_winsys.h
Luca Barbieri [Mon, 20 Sep 2010 18:13:30 +0000 (20:13 +0200)]
gallium: avoid the C++ keyword "template" in sw_winsys.h

13 years agogallivm: remove debug code
Brian Paul [Mon, 20 Sep 2010 17:21:44 +0000 (11:21 -0600)]
gallivm: remove debug code

13 years agollvmpipe: fix query bug when no there's no scene
Brian Paul [Mon, 20 Sep 2010 16:50:15 +0000 (10:50 -0600)]
llvmpipe: fix query bug when no there's no scene

13 years agost/mesa: fix assertion failure in GetTexImage for cubemaps
Marek Olšák [Fri, 17 Sep 2010 00:43:38 +0000 (02:43 +0200)]
st/mesa: fix assertion failure in GetTexImage for cubemaps

Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.

13 years agor600g: move chip class to radeon common structure
Jerome Glisse [Mon, 20 Sep 2010 15:58:00 +0000 (11:58 -0400)]
r600g: move chip class to radeon common structure

So texture code can be shared btw new state design
& old one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agoglsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
Kenneth Graunke [Sun, 19 Sep 2010 02:51:07 +0000 (04:51 +0200)]
glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.

When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.

13 years agoglsl: Add comments to clarify the types of comparison binops.
Kenneth Graunke [Sun, 19 Sep 2010 02:50:28 +0000 (04:50 +0200)]
glsl: Add comments to clarify the types of comparison binops.

13 years agodocs: mark as obsolete, remove dead links
Brian Paul [Mon, 20 Sep 2010 14:57:53 +0000 (08:57 -0600)]
docs: mark as obsolete, remove dead links

13 years agodocs: remove old broken link
Brian Paul [Mon, 20 Sep 2010 14:54:04 +0000 (08:54 -0600)]
docs: remove old broken link

13 years agoglsl2: silence compiler warnings in printf() calls
Brian Paul [Mon, 20 Sep 2010 14:22:51 +0000 (08:22 -0600)]
glsl2: silence compiler warnings in printf() calls

Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"

13 years agomesa: don't call valid_texture_object() in non-debug builds
Brian Paul [Mon, 20 Sep 2010 14:19:08 +0000 (08:19 -0600)]
mesa: don't call valid_texture_object() in non-debug builds

This reverts commit c32bac57ed445e48856d74113364287ed6e5cdd4
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.

13 years agoglsl: Add doxygen comments
Ian Romanick [Sat, 18 Sep 2010 14:08:38 +0000 (16:08 +0200)]
glsl: Add doxygen comments

13 years agoi915g: Link with wrapper sw winsys with scons
Jakob Bornecrantz [Mon, 20 Sep 2010 13:25:18 +0000 (15:25 +0200)]
i915g: Link with wrapper sw winsys with scons

13 years agosvga: Integer constant register file has a separate namespace.
Michal Krol [Thu, 16 Sep 2010 16:51:03 +0000 (16:51 +0000)]
svga: Integer constant register file has a separate namespace.

Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.

13 years agosvga: Fix relative addressing translation for pixel shaders.
Michal Krol [Thu, 16 Sep 2010 16:48:00 +0000 (16:48 +0000)]
svga: Fix relative addressing translation for pixel shaders.

Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.

13 years agor600g: Cleanup viewport floats.
Corbin Simpson [Mon, 20 Sep 2010 06:02:19 +0000 (23:02 -0700)]
r600g: Cleanup viewport floats.

13 years agor600g: Clean up PS setup.
Corbin Simpson [Mon, 20 Sep 2010 05:54:18 +0000 (22:54 -0700)]
r600g: Clean up PS setup.

I didn't do r600d according to the docs; I split EXPORT_MODE to be a bit more
useful and obvious. Hope this is okay.

13 years agor600g: only flush for the correct colorbuffer, not all of them.
Dave Airlie [Mon, 20 Sep 2010 05:39:03 +0000 (15:39 +1000)]
r600g: only flush for the correct colorbuffer, not all of them.

13 years agor600g: add missing BC_INST wrapper for evergreen
Dave Airlie [Mon, 20 Sep 2010 05:38:40 +0000 (15:38 +1000)]
r600g: add missing BC_INST wrapper for evergreen

13 years agor600g: fixup r700 CB_SHADER_CONTROL register.
Dave Airlie [Mon, 20 Sep 2010 05:36:52 +0000 (15:36 +1000)]
r600g: fixup r700 CB_SHADER_CONTROL register.

r600c emits this with a mask of each written output.

13 years agor600g: fix r700 cube map sizing.
Dave Airlie [Mon, 20 Sep 2010 05:30:52 +0000 (15:30 +1000)]
r600g: fix r700 cube map sizing.

this fixes fbo-cubemap on r700.

13 years agor600g: add color/texture support for more depth formats.
Dave Airlie [Mon, 20 Sep 2010 02:21:35 +0000 (12:21 +1000)]
r600g: add color/texture support for more depth formats.

13 years agor600g: add z16 to color setup
Dave Airlie [Mon, 20 Sep 2010 02:04:52 +0000 (12:04 +1000)]
r600g: add z16 to color setup

13 years agor600g: fix tiling support for ddx supplied buffers
Dave Airlie [Mon, 20 Sep 2010 01:39:14 +0000 (11:39 +1000)]
r600g: fix tiling support for ddx supplied buffers

needed to emit some more relocs to the kernel.

13 years agor600g: "tmp" is such a bad name for a texture.
Corbin Simpson [Mon, 20 Sep 2010 01:20:05 +0000 (18:20 -0700)]
r600g: "tmp" is such a bad name for a texture.

13 years agor600g: Fix false and true.
Corbin Simpson [Mon, 20 Sep 2010 01:14:41 +0000 (18:14 -0700)]
r600g: Fix false and true.

13 years agor600g: Clean up some indentation and |= vs. | usage.
Corbin Simpson [Mon, 20 Sep 2010 01:13:41 +0000 (18:13 -0700)]
r600g: Clean up some indentation and |= vs. | usage.

13 years agor600g: Deobfuscate and comment a few more functions in r600_hw_states.
Corbin Simpson [Mon, 20 Sep 2010 01:04:41 +0000 (18:04 -0700)]
r600g: Deobfuscate and comment a few more functions in r600_hw_states.

13 years agor600g: Trivially deobfuscate r600_hw_states.
Corbin Simpson [Mon, 20 Sep 2010 00:12:26 +0000 (17:12 -0700)]
r600g: Trivially deobfuscate r600_hw_states.

13 years agor600g: Use align() instead of handrolled code.
Corbin Simpson [Sun, 19 Sep 2010 23:42:29 +0000 (16:42 -0700)]
r600g: Use align() instead of handrolled code.

13 years agor600g: drop debugging that snuck in
Dave Airlie [Mon, 20 Sep 2010 00:45:18 +0000 (10:45 +1000)]
r600g: drop debugging that snuck in

13 years agor600g: clean up valgrind issues on maxtargets test.
Dave Airlie [Mon, 20 Sep 2010 00:44:44 +0000 (10:44 +1000)]
r600g: clean up valgrind issues on maxtargets test.

13 years agor600g: fix fbo-drawbuffers-maxtargets
Dave Airlie [Mon, 20 Sep 2010 00:34:42 +0000 (10:34 +1000)]
r600g: fix fbo-drawbuffers-maxtargets

we were leaking buffers since the flush code was added, it wasn't dropping references.
move setting up flush to the set_framebuffer_state.
clean up the flush state object.
make more space in the BOs array for flushing.

13 years agor600g: send correct surface base update for multi-cbufs
Dave Airlie [Mon, 20 Sep 2010 00:15:26 +0000 (10:15 +1000)]
r600g: send correct surface base update for multi-cbufs

13 years agor600g: modify index buffers for sizes the hw can't deal with.
Dave Airlie [Sun, 19 Sep 2010 23:57:47 +0000 (09:57 +1000)]
r600g: modify index buffers for sizes the hw can't deal with.

this just uses the common code from r300g now in util to do translations on r600g.

13 years agoutil/r300g: split the r300 index buffer modifier functions out to util
Dave Airlie [Thu, 12 Aug 2010 10:20:23 +0000 (20:20 +1000)]
util/r300g: split the r300 index buffer modifier functions out to util

These can be used by other drivers, like r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: fix exports_ps to export a number not a mask.
Henri Verbeet [Sun, 19 Sep 2010 23:29:43 +0000 (09:29 +1000)]
r600g: fix exports_ps to export a number not a mask.

13 years agoscons: Link against talloc in the Gallium DRI drivers
Jakob Bornecrantz [Sun, 19 Sep 2010 20:08:47 +0000 (22:08 +0200)]
scons: Link against talloc in the Gallium DRI drivers

13 years agorbug: Add function to get opcode name string
Jakob Bornecrantz [Fri, 10 Sep 2010 02:39:26 +0000 (04:39 +0200)]
rbug: Add function to get opcode name string

13 years agorbug: Cast opcode to corrent int size
Jakob Bornecrantz [Fri, 10 Sep 2010 00:15:11 +0000 (02:15 +0200)]
rbug: Cast opcode to corrent int size

13 years agoRevert "r600g: Flush upload buffers before draws instead of before flushes."
Henri Verbeet [Sun, 19 Sep 2010 20:59:14 +0000 (22:59 +0200)]
Revert "r600g: Flush upload buffers before draws instead of before flushes."

This reverts commit a1d9a58b825825723f1c5f7705f2ed3ef834038a.
Flushing the upload buffers on draw is wrong, uploads aren't supposed to
cause flushes in the first place. The real issue was
radeon_bo_pb_map_internal() not respecting PB_USAGE_UNSYNCHRONIZED.

13 years agor600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal().
Henri Verbeet [Sun, 19 Sep 2010 20:58:42 +0000 (22:58 +0200)]
r600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal().

13 years agogallium/docs: Fixed a typo in the SCS opcode description.
Tilman Sauerbeck [Sun, 19 Sep 2010 07:03:11 +0000 (09:03 +0200)]
gallium/docs: Fixed a typo in the SCS opcode description.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agoauxiliary: fix depth-only and stencil-only clears
Luca Barbieri [Sun, 19 Sep 2010 19:48:28 +0000 (21:48 +0200)]
auxiliary: fix depth-only and stencil-only clears

Depth-only and stencil-only clears should mask out depth/stencil from the
output, mask out stencil/input from input, and OR or ADD them together.

However, due to a typo they were being ANDed, resulting in zeroing the buffer.

13 years agor600g: Buffer object maps imply a wait.
Henri Verbeet [Sun, 19 Sep 2010 17:27:30 +0000 (19:27 +0200)]
r600g: Buffer object maps imply a wait.

Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.

13 years agor600g: Remove a redundant flush in r600_texture_transfer_map().
Henri Verbeet [Sun, 19 Sep 2010 17:27:30 +0000 (19:27 +0200)]
r600g: Remove a redundant flush in r600_texture_transfer_map().

radeon_ws_bo_map() will already take care of that if needed.

13 years agor600g: Check for other references before checking for existing mappings in radeon_bo_...
Henri Verbeet [Sun, 19 Sep 2010 17:27:30 +0000 (19:27 +0200)]
r600g: Check for other references before checking for existing mappings in radeon_bo_pb_map_internal().

Having a non-NULL data pointer doesn't imply it's safe to reuse that mapping,
it may have been unmapped but not flushed yet.

13 years agor600g: Flush upload buffers before draws instead of before flushes.
Henri Verbeet [Sun, 19 Sep 2010 17:27:30 +0000 (19:27 +0200)]
r600g: Flush upload buffers before draws instead of before flushes.

If a upload buffer is used by a previous draw that's still in the CS,
accessing it would need a context flush. However, doing a context flush when
mapping the upload buffer would then flush/destroy the same buffer we're trying
to map there. Flushing the upload buffers before a draw avoids both the CS
flush and the upload buffer going away while it's being used. Note that
u_upload_data() could e.g. use a pool of buffers instead of allocating new
ones all the time if that turns out to be a significant issue.

13 years agoegl: Enable drm platform by default.
Chia-I Wu [Sun, 19 Sep 2010 09:31:34 +0000 (17:31 +0800)]
egl: Enable drm platform by default.

This enables EGL_MESA_drm_display for st/egl in the default setup.

13 years agost/egl: s/kms/drm/ on the drm backend.
Chia-I Wu [Sun, 19 Sep 2010 09:11:07 +0000 (17:11 +0800)]
st/egl: s/kms/drm/ on the drm backend.

s/kms/drm/, s/kdpy/drmdpy/, and so forth.

13 years agost/egl: Rename kms backend to drm.
Chia-I Wu [Sun, 19 Sep 2010 08:54:39 +0000 (16:54 +0800)]
st/egl: Rename kms backend to drm.

The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.

13 years agost/egl: Split modeset code support to modeset.c.
Chia-I Wu [Sun, 19 Sep 2010 08:32:06 +0000 (16:32 +0800)]
st/egl: Split modeset code support to modeset.c.

The modeset code supports now obsolete EGL_MESA_screen_surface.  Move it
to a file of its own.

13 years agor600g: only emit uses waterfall on r6xx hw.
Dave Airlie [Sun, 19 Sep 2010 07:25:50 +0000 (17:25 +1000)]
r600g: only emit uses waterfall on r6xx hw.

13 years agor600g; add uses waterfall to asm cf for r6xx.
Dave Airlie [Sun, 19 Sep 2010 07:14:57 +0000 (17:14 +1000)]
r600g; add uses waterfall to asm cf for r6xx.

On r6xx if an MOVA instruction is emitted we should set this bit.

13 years agor600g: Added support for TGSI_SEMANTIC_FACE.
Tilman Sauerbeck [Sat, 18 Sep 2010 14:42:22 +0000 (16:42 +0200)]
r600g: Added support for TGSI_SEMANTIC_FACE.

This makes the 'glsl1-gl_FrontFacing var (1)' piglit test pass.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agonv50: Remove dead initialization.
Vinson Lee [Sun, 19 Sep 2010 06:07:41 +0000 (23:07 -0700)]
nv50: Remove dead initialization.

13 years agonv50: Remove dead initialization.
Vinson Lee [Sun, 19 Sep 2010 06:06:29 +0000 (23:06 -0700)]
nv50: Remove dead initialization.

13 years agonv50: Silence missing initializer warning.
Vinson Lee [Sat, 18 Sep 2010 22:59:00 +0000 (15:59 -0700)]
nv50: Silence missing initializer warning.

Fixes this GCC warning.
nv50_state_validate.c:336: warning: missing initializer
nv50_state_validate.c:336: error: (near initialization for 'validate_list[20].func')

13 years agonv50: fix typo in fifo packet length limit
Christoph Bumiller [Sat, 18 Sep 2010 18:52:44 +0000 (20:52 +0200)]
nv50: fix typo in fifo packet length limit

13 years agoglsl/builtins: Switch comparison functions to just return an expression.
Kenneth Graunke [Sat, 18 Sep 2010 13:56:28 +0000 (15:56 +0200)]
glsl/builtins: Switch comparison functions to just return an expression.

13 years agoglsl/builtins: Fix equal and notEqual builtins.
Kenneth Graunke [Sat, 18 Sep 2010 12:44:18 +0000 (14:44 +0200)]
glsl/builtins: Fix equal and notEqual builtins.

Commit 309cd4115b7cba669a0bf858e7809cb6dae90ddf incorrectly converted
these to all_equal and any_nequal, which is the wrong operation.

13 years agonv50: emit constbuf relocs before uploading constants
Christoph Bumiller [Sat, 18 Sep 2010 13:19:34 +0000 (15:19 +0200)]
nv50: emit constbuf relocs before uploading constants

13 years agonv50: add relocs for stack and local mem buffers
Christoph Bumiller [Sat, 18 Sep 2010 11:40:10 +0000 (13:40 +0200)]
nv50: add relocs for stack and local mem buffers

13 years agoglsl: Properly handle nested structure types.
Kenneth Graunke [Sat, 18 Sep 2010 09:11:09 +0000 (11:11 +0200)]
glsl: Properly handle nested structure types.

Fixes piglit test CorrectFull.frag.

13 years agor600g: Remove unused variable.
Vinson Lee [Sat, 18 Sep 2010 07:59:16 +0000 (00:59 -0700)]
r600g: Remove unused variable.

13 years agonvfx: Silence uninitialized variable warnings.
Vinson Lee [Sat, 18 Sep 2010 07:51:07 +0000 (00:51 -0700)]
nvfx: Silence uninitialized variable warnings.

13 years agonvfx: Remove const qualifer from nvfx_vertprog_translate.
Vinson Lee [Sat, 18 Sep 2010 07:47:36 +0000 (00:47 -0700)]
nvfx: Remove const qualifer from nvfx_vertprog_translate.

Silences this GCC warning.
nvfx_vertprog.c: In function 'nvfx_vertprog_translate':
nvfx_vertprog.c:998: warning: assignment discards qualifiers from pointer target type

13 years agoglsl2: Fixed cloning of ir_call error instructions.
Tilman Sauerbeck [Fri, 17 Sep 2010 23:56:34 +0000 (01:56 +0200)]
glsl2: Fixed cloning of ir_call error instructions.

Those have the callee field set to the null pointer, so
calling the public constructor will segfault.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agoglsl: Fix 'control reaches end of non-void function' warning.
Vinson Lee [Sat, 18 Sep 2010 07:14:20 +0000 (00:14 -0700)]
glsl: Fix 'control reaches end of non-void function' warning.

Fixes this GCC warning.

lower_variable_index_to_cond_assign.cpp:
In member function
'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const':

lower_variable_index_to_cond_assign.cpp:261:
warning: control reaches end of non-void function

13 years agox86: Silence unused variable warning on Mac OS X.
Vinson Lee [Sat, 18 Sep 2010 06:59:23 +0000 (23:59 -0700)]
x86: Silence unused variable warning on Mac OS X.

Silences the following GCC warning on Mac OS X.
x86/common_x86.c:58: warning: 'detection_debug' defined but not used

13 years agomesa: Silence "'valid_texture_object' defined but not used" warning.
Vinson Lee [Sat, 18 Sep 2010 06:43:38 +0000 (23:43 -0700)]
mesa: Silence "'valid_texture_object' defined but not used" warning.

13 years agoir_to_mesa: Remove unused member array_indexed from struct statevar_element.
Vinson Lee [Sat, 18 Sep 2010 06:35:09 +0000 (23:35 -0700)]
ir_to_mesa: Remove unused member array_indexed from struct statevar_element.

Fixes this GCC warning.
warning: missing initializer for member 'statevar_element::array_indexed'

13 years agomesa: bump version to 7.10
Vinson Lee [Sat, 18 Sep 2010 00:52:13 +0000 (17:52 -0700)]
mesa: bump version to 7.10

13 years agoglsl2: Empty functions can be inlined.
Tilman Sauerbeck [Fri, 17 Sep 2010 16:50:07 +0000 (18:50 +0200)]
glsl2: Empty functions can be inlined.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: Silence unused variable warnings.
Vinson Lee [Fri, 17 Sep 2010 21:27:39 +0000 (14:27 -0700)]
r600g: Silence unused variable warnings.

The variables are used in code that is currently ifdef'ed out.

13 years agor600g: Silence uninitialized variable warning.
Vinson Lee [Fri, 17 Sep 2010 21:21:32 +0000 (14:21 -0700)]
r600g: Silence uninitialized variable warning.

13 years agor600g: Fix memory leak on error path.
Vinson Lee [Fri, 17 Sep 2010 21:17:26 +0000 (14:17 -0700)]
r600g: Fix memory leak on error path.

13 years agor600g: Fix implicit declaration warning.
Vinson Lee [Fri, 17 Sep 2010 21:06:23 +0000 (14:06 -0700)]
r600g: Fix implicit declaration warning.

Fixes this GCC warning.
r600_state2.c: In function 'r600_context_flush':
r600_state2.c:946: error: implicit declaration of function 'drmCommandWriteRead'

13 years agor600g: Remove unnecessary headers.
Vinson Lee [Fri, 17 Sep 2010 19:40:54 +0000 (12:40 -0700)]
r600g: Remove unnecessary headers.

13 years agor600g: Remove unnecessary header.
Vinson Lee [Fri, 17 Sep 2010 19:38:29 +0000 (12:38 -0700)]
r600g: Remove unnecessary header.

13 years agollvmpipe: Default to no threading on single processor systems.
José Fonseca [Thu, 16 Sep 2010 19:27:13 +0000 (20:27 +0100)]
llvmpipe: Default to no threading on single processor systems.

13 years agoutil: linearized sRGB values don't fit into 8bits
José Fonseca [Fri, 17 Sep 2010 10:13:37 +0000 (11:13 +0100)]
util: linearized sRGB values don't fit into 8bits

Fixes glean texture_srgb test.

13 years agogallivm: added missing case for PIPE_TEXTURE_RECT
Brian Paul [Fri, 17 Sep 2010 18:16:02 +0000 (12:16 -0600)]
gallivm: added missing case for PIPE_TEXTURE_RECT

Fixes fd.o bug 30245

13 years agor600g: alternative command stream building from context
Jerome Glisse [Fri, 17 Sep 2010 14:41:50 +0000 (10:41 -0400)]
r600g: alternative command stream building from context

Winsys context build a list of register block a register block is
a set of consecutive register that will be emited together in the
same pm4 packet (the various r600_block* are there to provide basic
grouping that try to take advantage of states that are linked together)
Some consecutive register are emited each in a different block,
for instance the various cb[0-7]_base. At winsys context creation,
the list of block is created & an index into the list of block. So
to find into which block a register is in you simply use the register
offset and lookup the block index. Block are grouped together into
group which are the various pkt3 group of config, context, resource,

Pipe state build a list of register each state want to modify,
beside register value it also give a register mask so only subpart
of a register can be updated by a given pipe state (the oring is
in the winsys) There is no prebuild register list or define for
each pipe state. Once pipe state are built they are bound to
the winsys context.

Each of this functions will go through the list of register and
will find into which block each reg falls and will update the
value of the block with proper masking (vs/ps resource/constant
are specialized variant with somewhat limited capabilities).

Each block modified by r600_context_pipe_state_set* is marked as
dirty and we update a count of dwords needed to emit all dirty
state so far.

r600_context_pipe_state_set* should be call only when pipe context
change some of the state (thus when pipe bind state or set state)

Then to draw primitive you make a call to r600_context_draw
void r600_context_draw(struct r600_context *ctx, struct r600_draw *draw)
It will check if there is enough dwords in current cs buffer and
if not will flush. Once there is enough room it will copy packet
from dirty block and then add the draw packet3 to initiate the draw.

The flush will send the current cs, reset the count of dwords to
0 and remark all states that are enabled as dirty and recompute
the number of dwords needed to send the current context.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agor600g: Fixed the shift in S_02880C_KILL_ENABLE.
Tilman Sauerbeck [Fri, 17 Sep 2010 12:08:23 +0000 (14:08 +0200)]
r600g: Fixed the shift in S_02880C_KILL_ENABLE.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agor600g: Enable PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED.
Tilman Sauerbeck [Fri, 17 Sep 2010 10:49:51 +0000 (12:49 +0200)]
r600g: Enable PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agor600g: Only set PA_SC_EDGERULE on rv770 and greater.
Tilman Sauerbeck [Fri, 17 Sep 2010 10:17:48 +0000 (12:17 +0200)]
r600g: Only set PA_SC_EDGERULE on rv770 and greater.

This is what xf86-video-ati and r600c do.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agor600g: Added DB_SHADER_CONTROL defines.
Tilman Sauerbeck [Fri, 17 Sep 2010 10:05:26 +0000 (12:05 +0200)]
r600g: Added DB_SHADER_CONTROL defines.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agor600g: Formatting fixes.
Tilman Sauerbeck [Thu, 16 Sep 2010 13:09:01 +0000 (15:09 +0200)]
r600g: Formatting fixes.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
13 years agoglsl2: Add flags to enable variable index lowering
Ian Romanick [Thu, 16 Sep 2010 12:40:26 +0000 (14:40 +0200)]
glsl2: Add flags to enable variable index lowering

13 years agoglsl2: Refactor testing for whether a deref is of a matrix or array
Ian Romanick [Thu, 16 Sep 2010 10:12:22 +0000 (12:12 +0200)]
glsl2: Refactor testing for whether a deref is of a matrix or array

13 years agoglsl: add pass to lower variable array indexing to conditional assignments
Luca Barbieri [Tue, 7 Sep 2010 23:35:44 +0000 (01:35 +0200)]
glsl: add pass to lower variable array indexing to conditional assignments

Currenly GLSL happily generates indirect addressing of any kind of
arrays.

Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in
general.

This pass fixes that by lowering such constructs to a binary search on the
values, followed at the end by vectorized generation of equality masks, and
4 conditional assignments for each mask generation.

Note that this requires the ir_binop_equal change so that we can emit SEQ
to generate the boolean masks.

Unfortunately, ir_structure_splitting is too dumb to turn the resulting
constant array references to individual variables, so this will need to
be added too before this pass can actually be effective for temps.

Several patches in the glsl2-lower-variable-indexing were squashed
into this commit.  These patches fix bugs in Luca's original
implementation, and the individual patches can be seen in that branch.
This was done to aid bisecting in the future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agor600g: oops got the use_mem_constant the wrong way around.
Dave Airlie [Fri, 17 Sep 2010 14:28:06 +0000 (00:28 +1000)]
r600g: oops got the use_mem_constant the wrong way around.

this fixes evergreen gears again.

13 years agor600g: use calloc for ctx bo allocations
Dave Airlie [Fri, 17 Sep 2010 05:27:58 +0000 (15:27 +1000)]
r600g: use calloc for ctx bo allocations

since the reference code relies on these being NULL.

13 years agor600g: fixup map flushing.
Dave Airlie [Fri, 17 Sep 2010 04:36:18 +0000 (14:36 +1000)]
r600g: fixup map flushing.

long lived maps were getting removed when they shouldn't this
tries to avoid that problem by only adding to the flush list
on unmap.