mesa.git
12 years agotrace: Match NULL context members.
José Fonseca [Sat, 12 May 2012 15:31:25 +0000 (16:31 +0100)]
trace: Match NULL context members.

12 years agogallium/docs: remove documentation of redefine_user_buffer
Marek Olšák [Sat, 12 May 2012 10:25:33 +0000 (12:25 +0200)]
gallium/docs: remove documentation of redefine_user_buffer

12 years agoradeonsi: Fixed point vertex formats aren't supported.
Michel Dänzer [Fri, 11 May 2012 14:19:19 +0000 (16:19 +0200)]
radeonsi: Fixed point vertex formats aren't supported.

12 years agoradeonsi: Fixups for recent build infrastructure changes.
Michel Dänzer [Sat, 12 May 2012 10:12:21 +0000 (12:12 +0200)]
radeonsi: Fixups for recent build infrastructure changes.

In particular for the pipe loader changes.

12 years agor600g: setup COLOR1 for possible dual-src in the framebuffer bind
Dave Airlie [Fri, 27 Apr 2012 08:38:46 +0000 (09:38 +0100)]
r600g: setup COLOR1 for possible dual-src in the framebuffer bind

As pointed out by Marek, if we have only one cb, we may as well add this
single register write here rather than adding it in the draw loop.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agonv30: Silence pipe_cap warnings
Roy Spliet [Sat, 12 May 2012 01:42:31 +0000 (03:42 +0200)]
nv30: Silence pipe_cap warnings

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agonv30/shader: SSG, LIT only requires one source register
Roy Spliet [Sat, 12 May 2012 01:42:30 +0000 (03:42 +0200)]
nv30/shader: SSG, LIT only requires one source register

Fixes crashing due to assertion error

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agonouveau/vieux: finish != flush, how about we do that..
Ben Skeggs [Thu, 10 May 2012 17:02:13 +0000 (03:02 +1000)]
nouveau/vieux: finish != flush, how about we do that..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agor300g/swtcl: move vertex buffer updates into set_vertex_buffers
Marek Olšák [Fri, 11 May 2012 21:33:50 +0000 (23:33 +0200)]
r300g/swtcl: move vertex buffer updates into set_vertex_buffers

12 years agor300g/swtcl: move index buffer updates from swtcl_draw_vbo into set_index_buffer
Marek Olšák [Fri, 11 May 2012 21:33:50 +0000 (23:33 +0200)]
r300g/swtcl: move index buffer updates from swtcl_draw_vbo into set_index_buffer

12 years agor300g/swtcl: malloc vertex and index buffers (don't use radeon DRM to get them)
Marek Olšák [Fri, 11 May 2012 21:22:21 +0000 (23:22 +0200)]
r300g/swtcl: malloc vertex and index buffers (don't use radeon DRM to get them)

Vertex and index buffers are never used by hardware, only by Draw.
SWTCL chipsets usually have very little memory, so this might help
with stability and reliability.

12 years agor300g/swtcl: don't do stuff which is only for HWTCL
Marek Olšák [Fri, 11 May 2012 21:09:05 +0000 (23:09 +0200)]
r300g/swtcl: don't do stuff which is only for HWTCL

12 years agor300g: remove slab allocator for pipe_resource (used mainly for user buffers)
Marek Olšák [Fri, 11 May 2012 20:56:08 +0000 (22:56 +0200)]
r300g: remove slab allocator for pipe_resource (used mainly for user buffers)

12 years agor300g: remove user_buffer_create
Marek Olšák [Fri, 11 May 2012 20:34:34 +0000 (22:34 +0200)]
r300g: remove user_buffer_create

12 years agor300g: fix breakage after gallium-userbuf merge
Marek Olšák [Fri, 11 May 2012 20:25:03 +0000 (22:25 +0200)]
r300g: fix breakage after gallium-userbuf merge

12 years agollvmpipe: add cast to silence warning
Brian Paul [Fri, 11 May 2012 22:16:11 +0000 (16:16 -0600)]
llvmpipe: add cast to silence warning

12 years agovega: fix 565 color unpacking bug
Andreas Betz [Fri, 11 May 2012 13:29:06 +0000 (07:29 -0600)]
vega: fix 565 color unpacking bug

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags
Brian Paul [Wed, 9 May 2012 18:09:21 +0000 (12:09 -0600)]
mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags

Instead of having to hack the code to enable these debugging options,
set them through the MESA_DEBUG env var.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: implement DEBUG_ALWAYS_FLUSH debug option
Brian Paul [Wed, 9 May 2012 18:08:47 +0000 (12:08 -0600)]
mesa: implement DEBUG_ALWAYS_FLUSH debug option

This flag has been around for a while but it wasn't actually used anywhere.

Now, setting this flag causes a glFlush() to be issued after each
drawing call (including glBegin/End, glDrawElements, glDrawArrays,
glDrawPixels, glCopyPixels and glBitmap).

12 years agomesa: define DEBUG_SILENT flag, use in output_if_debug()
Brian Paul [Wed, 9 May 2012 19:25:00 +0000 (13:25 -0600)]
mesa: define DEBUG_SILENT flag, use in output_if_debug()

12 years agomesa: clean-up the debug/verbose flag setup code
Brian Paul [Wed, 9 May 2012 18:07:28 +0000 (12:07 -0600)]
mesa: clean-up the debug/verbose flag setup code

Split the verbose and debug flag setup code into separate functions.

12 years agomesa: do FLUSH_VERTICES() in _mesa_flush/finish()
Brian Paul [Wed, 9 May 2012 17:56:10 +0000 (11:56 -0600)]
mesa: do FLUSH_VERTICES() in _mesa_flush/finish()

This was being done in the _mesa_Flush/Finish() calls but if there
was an internal call to _mesa_flush/finish() the FLUSH_VERTICES()
wouldn't happen.  Looks like only the intel and radeon drivers made
such calls in MakeCurrent().

12 years agomesa: fix glMaterial / dlist bug
Brian Paul [Tue, 8 May 2012 17:41:03 +0000 (11:41 -0600)]
mesa: fix glMaterial / dlist bug

When glColorMaterial() is used to latch glColor commands to a material
attribute, glMaterial calls to change that material should become no-ops.
This failed to work properly when the glMaterial call was inside a
display list.

This removes the Material function from the vbo_attrib_tmp.h template
file.  We have separate/different implementations for the "save" and
"exec" cases now.

NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: fix/add error check in _mesa_ColorMaterial()
Brian Paul [Tue, 8 May 2012 16:22:20 +0000 (10:22 -0600)]
mesa: fix/add error check in _mesa_ColorMaterial()

_mesa_material_bitmask() will record a GL error and return 0 if
face or mode are illegal.  Return early in that case.

NOTE: This is a candidate for the 8.0 branch.

12 years agoradeon/llvm: More comments and cleanups
Tom Stellard [Fri, 11 May 2012 17:44:24 +0000 (13:44 -0400)]
radeon/llvm: More comments and cleanups

12 years agogallivm: Fix copy'n'paste typo bug translating CEIL opcode.
José Fonseca [Fri, 11 May 2012 15:43:28 +0000 (16:43 +0100)]
gallivm: Fix copy'n'paste typo bug translating CEIL opcode.

Trivial.

12 years agor600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE
Marek Olšák [Fri, 11 May 2012 15:34:26 +0000 (17:34 +0200)]
r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE

12 years agoMerge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa
Marek Olšák [Fri, 11 May 2012 14:42:20 +0000 (16:42 +0200)]
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa

12 years agoMerge branch 'gallium-userbuf'
Marek Olšák [Fri, 11 May 2012 14:38:13 +0000 (16:38 +0200)]
Merge branch 'gallium-userbuf'

Conflicts:
src/gallium/docs/source/screen.rst
src/gallium/drivers/nv50/nv50_state.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_draw.c

12 years agoradeon/llvm: Fix Evergreen/Cayman tablegen predicates
Tom Stellard [Fri, 11 May 2012 13:31:00 +0000 (09:31 -0400)]
radeon/llvm: Fix Evergreen/Cayman tablegen predicates

Some Evergreen/Cayman instructions were being enabled for SI.

12 years agogallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/
José Fonseca [Fri, 11 May 2012 12:41:56 +0000 (13:41 +0100)]
gallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/

For consistency.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.
José Fonseca [Fri, 11 May 2012 12:36:46 +0000 (13:36 +0100)]
gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.

Some code relies on the existing of an invalid texture target. It seems
safer to bring it back than to deal with unintended consequences.

This partially reverts commit a4ebb04214bab1cd9bd41967232ec89441e31744.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agollvmpipe: Fix triangle bounding box calculation to be correctly inclusive or exclusive
James Benton [Thu, 10 May 2012 16:15:28 +0000 (17:15 +0100)]
llvmpipe: Fix triangle bounding box calculation to be correctly inclusive or exclusive

Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agollvmpipe: Change triangle rasterization comparison from < 0 to <= 0
James Benton [Thu, 10 May 2012 16:15:27 +0000 (17:15 +0100)]
llvmpipe: Change triangle rasterization comparison from < 0 to <= 0

Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agoclover: Implement CL_MEM_COPY_HOST_PTR.
Francisco Jerez [Fri, 4 May 2012 13:02:21 +0000 (15:02 +0200)]
clover: Implement CL_MEM_COPY_HOST_PTR.

12 years agogallium/targets/pipe-loader: Prepend DESTDIR to the installation directory.
Alexey Shvetsov [Tue, 10 Apr 2012 22:11:56 +0000 (01:11 +0300)]
gallium/targets/pipe-loader: Prepend DESTDIR to the installation directory.

Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
12 years agoclover: Assorted build fixes.
Tom Stellard [Fri, 20 Apr 2012 14:56:46 +0000 (16:56 +0200)]
clover: Assorted build fixes.

Contains the following patches squashed in:

commit 9fff1dc0875f7c9591550fa3ebbe1ba7a18483fa
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:20:03 2012 +0100

    configure.ac: Build gallium loader when OpenCL is enabled

commit 542111cb02957418c6a285cb6ef2924e49adc66e
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:30:29 2012 +0100

    configure.ac: Add sw/null to GALLIUM_WINSYS_DIRS for gallium loader

commit 876f8de46062dde76b6075be3b6628f969b16648
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Thu Feb 9 11:26:05 2012 -0500

    configure.ac: Require gcc > 4.6.0 for clover

commit 99049d50fa3d9a23297ae658189c19c89dca1766
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:32:06 2012 +0100

    configure.ac: Require Gallium drm loader when gallium loader is enabled

    No longer silently exclude this when building OpenCL drivers
    for nouveau and r600.

12 years agoclover: Import OpenCL state tracker.
Francisco Jerez [Fri, 20 Apr 2012 14:56:19 +0000 (16:56 +0200)]
clover: Import OpenCL state tracker.

12 years agogallium/tests/trivial: Import compute unit tests.
Francisco Jerez [Tue, 20 Mar 2012 22:41:09 +0000 (23:41 +0100)]
gallium/tests/trivial: Import compute unit tests.

Add a test program that tries to exercise some of the language
features commonly used by compute programs at the Gallium API level:

   - Correctness of the values returned by the grid parameters.
   - Proper functioning of resource LOADs and STOREs.
   - Subroutine calls.
   - Argument passing to the compute parameter through the INPUT
     memory space.
   - Mapping of buffer objects to the GLOBAL memory space.
   - Proper functioning of the PRIVATE and LOCAL memory spaces.
   - Texture sampling and constant buffers.
   - Support for multiple kernels in the same program.
   - Indirect resource indexing.
   - Formatted resource loads and stores (i.e. with channel conversion
     and scaling) using several different formats.
   - Proper functioning of work-group barriers.
   - Atomicity and semantics of the atomic opcodes.

As of now all of them seem to pass on my nvA8.

12 years agogallium/gbm: Switch to auxiliary/pipe-loader.
Francisco Jerez [Fri, 20 Apr 2012 14:31:23 +0000 (16:31 +0200)]
gallium/gbm: Switch to auxiliary/pipe-loader.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agogallium/tests/trivial: Switch to the pipe loader.
Francisco Jerez [Wed, 25 Apr 2012 20:16:26 +0000 (22:16 +0200)]
gallium/tests/trivial: Switch to the pipe loader.

It simplifies things slightly, and besides, it makes possible to
execute the trivial tests on a hardware device instead of being
limited to software rendering.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agogallium: Add "pipe-loader" target.
Francisco Jerez [Fri, 25 Nov 2011 13:26:00 +0000 (14:26 +0100)]
gallium: Add "pipe-loader" target.

This target generates pipe driver modules intended to be consumed by
auxiliary/pipe-loader.  Most of it was taken from the "gbm" target --
the duplicated code will be replaced with references to this target in
a future commit.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agogallium: Add pipe loader for device enumeration and driver multiplexing.
Francisco Jerez [Wed, 25 Apr 2012 20:16:00 +0000 (22:16 +0200)]
gallium: Add pipe loader for device enumeration and driver multiplexing.

The goal is to have a uniform interface to create winsys and
pipe_screen instances for any driver, exposing the device enumeration
capabilities that might be supported by the operating system (for now
there's a "drm" back-end using udev and a "sw" back-end that always
returns the same built-in devices).

The typical use case of this library will be:
>
> struct pipe_loader_device devs[n];
> struct pipe_screen *screen;
>
> pipe_loader_probe(&devs, n);
>[pick some device from the array...]
>
> screen = pipe_loader_create_screen(dev, library_search_path);
>[do something with screen...]
>
> screen->destroy(screen);
> pipe_loader_release(&devs, N);
>

A part of the code was taken from targets/gbm/pipe_loader.c, which
will be removed and replaced with calls into this library by a future
commit.

12 years agogallium/tgsi/text: Replace open-coded integer parsing with parse_int().
Francisco Jerez [Tue, 20 Mar 2012 21:46:11 +0000 (22:46 +0100)]
gallium/tgsi/text: Replace open-coded integer parsing with parse_int().

12 years agogallium/tgsi/text: Parse immediates of non-float data types.
Francisco Jerez [Tue, 20 Mar 2012 21:39:29 +0000 (22:39 +0100)]
gallium/tgsi/text: Parse immediates of non-float data types.

12 years agogallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types.
Francisco Jerez [Tue, 20 Mar 2012 20:29:36 +0000 (21:29 +0100)]
gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types.

12 years agogallium/tgsi/text: Make label parsing optional for branch instructions.
Francisco Jerez [Mon, 26 Mar 2012 15:56:29 +0000 (17:56 +0200)]
gallium/tgsi/text: Make label parsing optional for branch instructions.

Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no
longer require a label argument, make it optional for them.

12 years agost/mesa: Use local temporary registers.
Francisco Jerez [Thu, 8 Dec 2011 17:05:25 +0000 (18:05 +0100)]
st/mesa: Use local temporary registers.

Local makes more sense in most places because non-inline function
calls are unimplemented anyway.

12 years agogallium/tgsi/ureg: Support local temporary emission.
Francisco Jerez [Mon, 26 Mar 2012 15:55:30 +0000 (17:55 +0200)]
gallium/tgsi/ureg: Support local temporary emission.

12 years agogallium/tgsi/ureg: Lift the restriction on releasing temporaries over UREG_MAX_TEMP.
Francisco Jerez [Thu, 8 Dec 2011 17:00:17 +0000 (18:00 +0100)]
gallium/tgsi/ureg: Lift the restriction on releasing temporaries over UREG_MAX_TEMP.

12 years agogallium/util: Define util_strchrnul.
Francisco Jerez [Fri, 25 Nov 2011 13:37:07 +0000 (14:37 +0100)]
gallium/util: Define util_strchrnul.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agogallium/compute: Drop TGSI dependency.
Francisco Jerez [Sun, 18 Mar 2012 22:59:33 +0000 (23:59 +0100)]
gallium/compute: Drop TGSI dependency.

Add a shader cap for specifying the preferred shader representation.
Right now the only supported value is TGSI, other enum values will be
added as they are needed.

This is mainly to accommodate AMD's LLVM compiler back-end by letting
it bypass the TGSI representation for compute programs.  Other drivers
will keep using the common TGSI instruction set.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agogallium/tgsi: Introduce the "LOCAL" register declaration modifier.
Francisco Jerez [Sun, 18 Mar 2012 18:21:36 +0000 (19:21 +0100)]
gallium/tgsi: Introduce the "LOCAL" register declaration modifier.

This change will be useful to implement function parameter passing on
top of TGSI.  As we don't have a proper stack, a register-based
calling convention will be used instead, which isn't necessarily a bad
thing given that GPUs often have plenty of registers to spare.

Using the same register space for local temporaries and
inter-procedural communication caused some inefficiencies, because in
some cases the register allocator would lose the freedom to merge
temporary values together into the same physical register, leading to
suboptimal register (and sometimes, as a side effect, instruction)
usage.

The LOCAL declaration modifier specifies that the value isn't intended
for parameter passing and as a result the compiler doesn't have to
give any guarantees of it being preserved across function boundaries.

Ignoring the LOCAL flag doesn't change the semantics of a valid
program in any way, because local variables are just supposed to get a
more relaxed treatment.  IOW, this should be a backwards-compatible
change.

12 years agogallium/tgsi: Add support for atomic opcodes.
Francisco Jerez [Mon, 30 Apr 2012 18:22:23 +0000 (20:22 +0200)]
gallium/tgsi: Add support for atomic opcodes.

12 years agogallium/tgsi: Add support for barriers.
Francisco Jerez [Mon, 30 Apr 2012 18:21:38 +0000 (20:21 +0200)]
gallium/tgsi: Add support for barriers.

12 years agogallium/tgsi: Define system values used to query the compute grid parameters.
Francisco Jerez [Sun, 18 Mar 2012 17:13:29 +0000 (18:13 +0100)]
gallium/tgsi: Define system values used to query the compute grid parameters.

12 years agogallium/tgsi: Add resource write-back support.
Francisco Jerez [Mon, 30 Apr 2012 18:20:29 +0000 (20:20 +0200)]
gallium/tgsi: Add resource write-back support.

Define a new STORE opcode with a role dual to the LOAD opcode, and add
flags to specify that a shader resource is intended for writing.

12 years agogallium/tgsi: Add support for raw resources.
Francisco Jerez [Mon, 30 Apr 2012 17:08:55 +0000 (19:08 +0200)]
gallium/tgsi: Add support for raw resources.

Normal resource access (e.g. the LOAD TGSI opcode) is supposed to
perform a series of conversions to turn the texture data as it's found
in memory into the target data type.

In compute programs it's often the case that we only want to access
the raw bits as they're stored in some buffer object, and any kind of
channel conversion and scaling is harmful or inefficient, especially
in implementations that lack proper hardware support to take care of
it -- in those cases the conversion has to be implemented in software
and it's likely to result in a performance hit even if the pipe_buffer
and declaration data types are set up in a way that would just pass
the data through.

Add a declaration flag that marks a resource as typeless.  No channel
conversion will be performed in that case, and the X coordinate of the
address vector will be interpreted in byte units instead of elements
for obvious reasons.

This is similar to D3D11's ByteAddressBuffer, and will be used to
implement OpenCL's constant arguments.  The remaining four compute
memory spaces can also be understood as raw resources.

12 years agogallium/tgsi: Define the TGSI_BUFFER texture target.
Francisco Jerez [Mon, 30 Apr 2012 16:28:36 +0000 (18:28 +0200)]
gallium/tgsi: Define the TGSI_BUFFER texture target.

This texture type was already referred to by the documentation but it
was never defined.  Define it as 0 to match the pipe_texture_target
enumeration values.

12 years agogallium/tgsi: Introduce the compute processor.
Francisco Jerez [Sun, 18 Mar 2012 18:09:18 +0000 (19:09 +0100)]
gallium/tgsi: Introduce the compute processor.

12 years agogallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.
Francisco Jerez [Mon, 30 Apr 2012 16:27:52 +0000 (18:27 +0200)]
gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.

Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration
to a separate token -- they only make sense for FS inputs and we need
room for other flags in the top-level declaration token.

12 years agogallium: Add context hooks for binding shader resources.
Francisco Jerez [Tue, 1 May 2012 00:47:03 +0000 (02:47 +0200)]
gallium: Add context hooks for binding shader resources.

12 years agogallium/tgsi: Split sampler views from shader resources.
Francisco Jerez [Tue, 1 May 2012 00:38:51 +0000 (02:38 +0200)]
gallium/tgsi: Split sampler views from shader resources.

This commit splits the current concept of resource into "sampler
views" and "shader resources":

"Sampler views" are textures or buffers that are bound to a given
shader stage and can be read from in conjunction with a sampler
object.  They are analogous to OpenGL texture objects or Direct3D
SRVs.

"Shader resources" are textures or buffers that can be read and
written from a shader.  There's no support for floating point
coordinates, address wrap modes or filtering, and, unlike sampler
views, shader resources are global for the whole graphics pipeline.
They are analogous to OpenGL image objects (as in
ARB_shader_image_load_store) or Direct3D UAVs.

Most hardware is likely to implement shader resources and sampler
views as separate objects, so, having the distinction at the API level
simplifies things slightly for the driver.

This patch introduces the SVIEW register file with a declaration token
and syntax analogous to the already existing RES register file.  After
this change, the SAMPLE_* opcodes no longer accept a resource as
input, but rather a SVIEW object.  To preserve the functionality of
reading from a sampler view with integer coordinates, the
SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS)
but take a SVIEW register instead of a RES register as argument.

12 years agogallium: Basic compute interface.
Francisco Jerez [Wed, 25 Apr 2012 20:15:16 +0000 (22:15 +0200)]
gallium: Basic compute interface.

Define an interface that exposes the minimal functionality required to
implement some of the popular compute APIs.  This commit adds entry
points to set the grid layout and other state required to keep track
of the usual address spaces employed in compute APIs, to bind a
compute program, and execute it on the device.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
12 years agoradeonsi: Properly translate vertex format swizzle.
Michel Dänzer [Fri, 11 May 2012 09:52:16 +0000 (11:52 +0200)]
radeonsi: Properly translate vertex format swizzle.

egltri_screen works correctly!

12 years agoradeon/llvm: Remove AMDILMCCodeEmitter.cpp
Tom Stellard [Thu, 10 May 2012 19:54:43 +0000 (15:54 -0400)]
radeon/llvm: Remove AMDILMCCodeEmitter.cpp

12 years agoradeon/llvm: Remove SILowerShaderInstructions.cpp
Tom Stellard [Thu, 10 May 2012 19:31:42 +0000 (15:31 -0400)]
radeon/llvm: Remove SILowerShaderInstructions.cpp

12 years agoradeonsi/llvm: Move lowering of RETURN to ConvertToISA pass
Tom Stellard [Thu, 10 May 2012 19:29:00 +0000 (15:29 -0400)]
radeonsi/llvm: Move lowering of RETURN to ConvertToISA pass

12 years agoradeon/llvm: Add some comments
Tom Stellard [Wed, 9 May 2012 15:06:48 +0000 (11:06 -0400)]
radeon/llvm: Add some comments

12 years agoradeon/llvm: Move util functions into AMDGPU namespace
Tom Stellard [Thu, 10 May 2012 16:49:41 +0000 (12:49 -0400)]
radeon/llvm: Move util functions into AMDGPU namespace

12 years agoi965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h
Paul Berry [Mon, 30 Apr 2012 05:05:28 +0000 (22:05 -0700)]
i965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h

This patch renames the gen6_hiz.h and gen7_hiz.h files to correspond
to the renames of the corresponding .cpp files (see previous commit).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/hiz: Convert gen{6,7}_hiz.c to C++
Paul Berry [Mon, 30 Apr 2012 04:50:22 +0000 (21:50 -0700)]
i965/hiz: Convert gen{6,7}_hiz.c to C++

This patch converts the files gen6_hiz.c and gen7_hiz.c to C++, in
preparation for expanding the HiZ code to support arbitrary blits.

The new files are called gen6_blorp.cpp and gen7_blorp.cpp to reflect
the expanded role that this code will serve--"blorp" stands for "BLit
Or Resolve Pass".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/hiz: Make void pointer type casts explicit
Paul Berry [Thu, 26 Apr 2012 16:29:19 +0000 (09:29 -0700)]
i965/hiz: Make void pointer type casts explicit

Previous to this patch, gen6_hiz.c contained two implicit type casts
from void * to a a non-void pointer type.  This is allowed in C but
not in C++.  This patch makes the type casts explicit, so that
gen6_hiz.c can be converted into a C++ file.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agointel: Work around differences between C and C++ scoping rules.
Paul Berry [Mon, 30 Apr 2012 04:46:47 +0000 (21:46 -0700)]
intel: Work around differences between C and C++ scoping rules.

In C++, if a struct is defined inside another struct, or its name is
first seen inside a struct or function, the struct is nested inside
the namespace of the struct or function it appears in.  In C, all
structs are visible from toplevel.

This patch explicitly moves the decalartions of intel_batchbuffer to
toplevel, so that it does not get nested inside a namespace when
header files are included from C++.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agointel: Add extern "C" declarations to headers
Paul Berry [Fri, 27 Apr 2012 14:40:34 +0000 (07:40 -0700)]
intel: Add extern "C" declarations to headers

These declarations are necessary to allow C++ code to call C code
without causing unresolved symbols (which would make the driver fail
to load).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoradeon/llvm: Auto-encode RAT_WRITE_CACHELESS_eg
Tom Stellard [Thu, 10 May 2012 15:52:00 +0000 (11:52 -0400)]
radeon/llvm: Auto-encode RAT_WRITE_CACHELESS_eg

12 years agoradeon/llvm: Delete all instructions that have been custom lowered
Tom Stellard [Thu, 10 May 2012 15:31:52 +0000 (11:31 -0400)]
radeon/llvm: Delete all instructions that have been custom lowered

12 years agoradeonsi: Set NONE format for unused vertex shader position export slots.
Michel Dänzer [Thu, 10 May 2012 11:54:39 +0000 (13:54 +0200)]
radeonsi: Set NONE format for unused vertex shader position export slots.

12 years agoradeonsi: Eliminate one more magic number for texture image resources.
Michel Dänzer [Thu, 10 May 2012 11:54:27 +0000 (13:54 +0200)]
radeonsi: Eliminate one more magic number for texture image resources.

12 years agoradeonsi: Fix vertex buffer resource for stride 0.
Michel Dänzer [Thu, 10 May 2012 11:54:27 +0000 (13:54 +0200)]
radeonsi: Fix vertex buffer resource for stride 0.

12 years agoradeon/llvm: Remove AMDGPUConstants.pm
Tom Stellard [Wed, 9 May 2012 15:50:02 +0000 (11:50 -0400)]
radeon/llvm: Remove AMDGPUConstants.pm

12 years agoradeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const
Tom Stellard [Wed, 9 May 2012 15:44:27 +0000 (11:44 -0400)]
radeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const

12 years agoradeon/llvm: Make sure the LOAD_CONST def uses the isSI predicate
Tom Stellard [Wed, 9 May 2012 15:43:17 +0000 (11:43 -0400)]
radeon/llvm: Make sure the LOAD_CONST def uses the isSI predicate

12 years agosvga: implement CEIL opcode translation
Brian Paul [Wed, 9 May 2012 16:31:07 +0000 (10:31 -0600)]
svga: implement CEIL opcode translation

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoglsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
Christoph Bumiller [Sat, 5 May 2012 12:38:09 +0000 (14:38 +0200)]
glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil

The implementation using FLR was buggy, the second negation could
get lost.

12 years agogallium/drivers: handle TGSI_OPCODE_CEIL
Christoph Bumiller [Sat, 5 May 2012 12:36:40 +0000 (14:36 +0200)]
gallium/drivers: handle TGSI_OPCODE_CEIL

12 years agor600g: Handle TGSI_OPCODE_CEIL (v2)
Kai Wasserbäch [Mon, 7 May 2012 15:59:35 +0000 (17:59 +0200)]
r600g: Handle TGSI_OPCODE_CEIL (v2)

v2: Enabled CEIL on Cayman too.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agogallivm: implement iabs/issg opcode.
Dave Airlie [Mon, 6 Feb 2012 18:33:21 +0000 (18:33 +0000)]
gallivm: implement iabs/issg opcode.

Reimplemented by Olivier Galibert <galibert@pobox.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoi965: fix wrong cube/3D texture layout
Yuanhan Liu [Wed, 2 May 2012 09:29:11 +0000 (17:29 +0800)]
i965: fix wrong cube/3D texture layout

Fix wrong cube/3D texture layout for the tailing levels whose width or
height is smaller than the align unit.

From 965 B-spec http://intellinuxgraphics.org/VOL_1_graphics_core.pdf at
page 135:
   All of the LOD=0 q-planes are stacked vertically, then below that,
   the LOD=1 qplanes are stacked two-wide, then the LOD=2 qplanes are
   stacked four-wide below that, and so on.

Thus we should always inrease pack_x_nr, which results to the pitch of LODn
may greater than the pitch of LOD0. So we should refactor mt->total_width
when needed.

This would fix the following webgl test case on all gen4 platforms:
  conformance/textures/texture-size-cube-maps.html

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agoradeon/llvm: Remove AMDILUtilityFunctions.cpp
Tom Stellard [Tue, 8 May 2012 19:37:59 +0000 (15:37 -0400)]
radeon/llvm: Remove AMDILUtilityFunctions.cpp

12 years agoradeon/llvm: Remove some unused functions from AMDILInstrInfo
Tom Stellard [Tue, 8 May 2012 17:59:27 +0000 (13:59 -0400)]
radeon/llvm: Remove some unused functions from AMDILInstrInfo

12 years agoradeon/llvm: Add some comments and fix coding style
Tom Stellard [Mon, 7 May 2012 18:52:11 +0000 (14:52 -0400)]
radeon/llvm: Add some comments and fix coding style

12 years agoradeon/llvm: Remove the EXPORT_REG instruction
Tom Stellard [Tue, 8 May 2012 17:08:29 +0000 (13:08 -0400)]
radeon/llvm: Remove the EXPORT_REG instruction

12 years agoradeon/llvm: Use a custom inserter to lower RESERVE_REG
Tom Stellard [Tue, 8 May 2012 15:33:05 +0000 (11:33 -0400)]
radeon/llvm: Use a custom inserter to lower RESERVE_REG

12 years agoradeon/llvm: Use a custom inserter to lower STORE_OUTPUT
Tom Stellard [Tue, 8 May 2012 14:27:30 +0000 (10:27 -0400)]
radeon/llvm: Use a custom inserter to lower STORE_OUTPUT

12 years agoradeon/llvm: Remove AMDGPULowerShaderInstructions class
Tom Stellard [Tue, 8 May 2012 14:04:44 +0000 (10:04 -0400)]
radeon/llvm: Remove AMDGPULowerShaderInstructions class

It is no longer used.

12 years agoradeon/llvm: Use a custom inserter to lower LOAD_INPUT
Tom Stellard [Tue, 8 May 2012 14:01:58 +0000 (10:01 -0400)]
radeon/llvm: Use a custom inserter to lower LOAD_INPUT

12 years agoradeon/llvm: Remove the ReorderPreloadInstructions pass
Tom Stellard [Mon, 7 May 2012 19:20:26 +0000 (15:20 -0400)]
radeon/llvm: Remove the ReorderPreloadInstructions pass

12 years agoradeon/llvm: Remove old comment from AMDIL.h
Tom Stellard [Mon, 7 May 2012 18:51:27 +0000 (14:51 -0400)]
radeon/llvm: Remove old comment from AMDIL.h

12 years agoAdd bin/compile to .gitignore
Paul Berry [Tue, 8 May 2012 18:03:55 +0000 (11:03 -0700)]
Add bin/compile to .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>