Eric Anholt [Thu, 10 May 2012 15:50:14 +0000 (08:50 -0700)]
intel: Fix signed/unsigned comparison warnings.
Eric Anholt [Thu, 10 May 2012 15:46:35 +0000 (08:46 -0700)]
Eric Anholt [Thu, 10 May 2012 15:45:25 +0000 (08:45 -0700)]
Kenneth Graunke [Thu, 10 May 2012 23:10:15 +0000 (16:10 -0700)]
i965/fs: Add a local common subexpression elimination pass.
Total instructions: 18210 -> 17836
49/163 programs affected (30.1%)
12888 -> 12514 instructions in affected programs (2.9% reduction)
This reduces Lightsmark's "Scale down filter" shader from 395
instructions to 283, a whopping 28%. It also reduces register pressure
significantly: the SIMD8 program now uses 29 registers instead of 101,
giving us more than enough room for a SIMD16 program.
v2: Add && !inst->conditional_mod to the "skip some instructions" check.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 10 May 2012 23:10:14 +0000 (16:10 -0700)]
i965/fs: Use a const reference in fs_reg::equals instead of a pointer.
This lets you omit some ampersands and is more idiomatic C++. Using
const also marks the function as not altering either register (which
was obvious, but nice to enforce).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Oliver McFadden [Mon, 7 May 2012 13:01:16 +0000 (16:01 +0300)]
mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Oliver McFadden [Mon, 7 May 2012 11:15:53 +0000 (14:15 +0300)]
mesa: GLES specifies restrictions on uniform matrix transpose.
GL_INVALID_VALUE is generated if transpose is not GL_FALSE.
http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Michel Dänzer [Mon, 14 May 2012 14:34:11 +0000 (16:34 +0200)]
radeonsi: Keep around copies of original sampler states.
Fixes crashes when restoring sampler states after blits.
Michel Dänzer [Mon, 14 May 2012 14:26:19 +0000 (16:26 +0200)]
radeonsi: Flesh out shader interpolation related code.
Handle perspective interpolation and ceontroid vs. center.
Michel Dänzer [Mon, 14 May 2012 13:39:17 +0000 (15:39 +0200)]
radeonsi: Add proper SI family names.
Michel Dänzer [Mon, 14 May 2012 13:32:02 +0000 (15:32 +0200)]
radeonsi: Separate states for samplers and sampler views.
And reset nregs on updates. Prevents eventual assertion failure.
Michel Dänzer [Fri, 11 May 2012 13:26:15 +0000 (15:26 +0200)]
radeonsi: Fixups for drawing with an index buffer.
Mostly using the DRAW_INDEX_2 type 3 packet instead of DRAW_INDEX, which is
no longer supported on SI.
Vinson Lee [Mon, 14 May 2012 06:40:57 +0000 (23:40 -0700)]
vl: Initialize pipe_vertex_buffer.user_buffer fields.
Fix uninitialized scalar variable defects reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
James Benton [Mon, 14 May 2012 15:00:06 +0000 (16:00 +0100)]
llvmpipe: Calculate fixed point coordinates for triangle setup earlier.
This allows us to calculate the triangle's area using fixed point,
previously it was cacluated in floating point space. It was possible
that a triangle which had negative area in floating point space had
a positive area in fixed point space.
Fixes fdo 40920.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tom Stellard [Mon, 14 May 2012 13:32:45 +0000 (09:32 -0400)]
radeon/llvm: Coding style fixes for R600CodeEmitter.cpp
Tom Stellard [Mon, 14 May 2012 14:40:12 +0000 (10:40 -0400)]
radeon/llvm: Lower bitcast instructions to copies
Marek Olšák [Fri, 11 May 2012 20:56:08 +0000 (22:56 +0200)]
radeonsi: 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)]
r600g: remove slab allocator for pipe_resource (used mainly for user buffers)
Marek Olšák [Sat, 12 May 2012 15:35:42 +0000 (17:35 +0200)]
r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap (EG)
Marek Olšák [Sat, 12 May 2012 11:08:02 +0000 (13:08 +0200)]
gallium: remove user_buffer_create from the interface
Nothing uses it now.
Marek Olšák [Sat, 12 May 2012 10:56:19 +0000 (12:56 +0200)]
gallium/graw: stop using user_buffer_create
This is compile-tested.
Marek Olšák [Thu, 29 Mar 2012 22:20:16 +0000 (00:20 +0200)]
gallium/util: remove unused parameter nr_vertex_buffers in util_draw_max_index
Francisco Jerez [Sat, 12 May 2012 17:33:33 +0000 (19:33 +0200)]
clover: Fix build on i386.
Francisco Jerez [Sat, 12 May 2012 17:24:09 +0000 (19:24 +0200)]
clover: Check the total work-group size provided to clEnqueueNDRangeKernel.
Christoph Bumiller [Sat, 12 May 2012 17:32:46 +0000 (19:32 +0200)]
clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK
This is not necessarily the product of MAX_BLOCK_SIZE[i].
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Francisco Jerez [Sat, 12 May 2012 17:08:43 +0000 (19:08 +0200)]
r600g: Handle compute caps.
Francisco Jerez [Sat, 12 May 2012 17:17:13 +0000 (19:17 +0200)]
r300g: Handle compute caps.
José Fonseca [Sat, 12 May 2012 16:23:52 +0000 (17:23 +0100)]
auxiliary/util: Ensure pipe_constant_buffer::user_buffer is initialized.
José Fonseca [Sat, 12 May 2012 16:08:30 +0000 (17:08 +0100)]
scons: Fix missing gbm symbols in st/egl.
José Fonseca [Sat, 12 May 2012 16:00:11 +0000 (17:00 +0100)]
targets/egl-static: Fix some missing symbols.
José Fonseca [Sat, 12 May 2012 15:59:41 +0000 (16:59 +0100)]
trace: Fix pipe_context::clear dumping.
José Fonseca [Sat, 12 May 2012 15:59:22 +0000 (16:59 +0100)]
trace: Fix pipe_shader_state dumping.
José Fonseca [Fri, 23 Mar 2012 10:52:47 +0000 (10:52 +0000)]
scons: Link r600_drm.so against libdrm-radeon
José Fonseca [Sat, 12 May 2012 15:31:25 +0000 (16:31 +0100)]
trace: Match NULL context members.
Marek Olšák [Sat, 12 May 2012 10:25:33 +0000 (12:25 +0200)]
gallium/docs: remove documentation of redefine_user_buffer
Michel Dänzer [Fri, 11 May 2012 14:19:19 +0000 (16:19 +0200)]
radeonsi: Fixed point vertex formats aren't supported.
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.
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>
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>
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>
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>
Marek Olšák [Fri, 11 May 2012 21:33:50 +0000 (23:33 +0200)]
r300g/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 index buffer updates from swtcl_draw_vbo into set_index_buffer
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.
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
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)
Marek Olšák [Fri, 11 May 2012 20:34:34 +0000 (22:34 +0200)]
r300g: remove user_buffer_create
Marek Olšák [Fri, 11 May 2012 20:25:03 +0000 (22:25 +0200)]
r300g: fix breakage after gallium-userbuf merge
Brian Paul [Fri, 11 May 2012 22:16:11 +0000 (16:16 -0600)]
llvmpipe: add cast to silence warning
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>
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>
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).
Brian Paul [Wed, 9 May 2012 19:25:00 +0000 (13:25 -0600)]
mesa: define DEBUG_SILENT flag, use in output_if_debug()
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.
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().
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.
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.
Tom Stellard [Fri, 11 May 2012 17:44:24 +0000 (13:44 -0400)]
radeon/llvm: More comments and cleanups
José Fonseca [Fri, 11 May 2012 15:43:28 +0000 (16:43 +0100)]
gallivm: Fix copy'n'paste typo bug translating CEIL opcode.
Trivial.
Marek Olšák [Fri, 11 May 2012 15:34:26 +0000 (17:34 +0200)]
r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE
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
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
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.
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>
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>
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>
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>
Francisco Jerez [Fri, 4 May 2012 13:02:21 +0000 (15:02 +0200)]
clover: Implement CL_MEM_COPY_HOST_PTR.
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>
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.
Francisco Jerez [Fri, 20 Apr 2012 14:56:19 +0000 (16:56 +0200)]
clover: Import OpenCL state tracker.
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.
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>
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>
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>
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.
Francisco Jerez [Tue, 20 Mar 2012 21:46:11 +0000 (22:46 +0100)]
gallium/tgsi/text: Replace open-coded integer parsing with parse_int().
Francisco Jerez [Tue, 20 Mar 2012 21:39:29 +0000 (22:39 +0100)]
gallium/tgsi/text: Parse immediates of 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.
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.
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.
Francisco Jerez [Mon, 26 Mar 2012 15:55:30 +0000 (17:55 +0200)]
gallium/tgsi/ureg: Support local temporary emission.
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.
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>
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>
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.
Francisco Jerez [Mon, 30 Apr 2012 18:22:23 +0000 (20:22 +0200)]
gallium/tgsi: Add support for atomic opcodes.
Francisco Jerez [Mon, 30 Apr 2012 18:21:38 +0000 (20:21 +0200)]
gallium/tgsi: Add support for barriers.
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.
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.
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.
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.
Francisco Jerez [Sun, 18 Mar 2012 18:09:18 +0000 (19:09 +0100)]
gallium/tgsi: Introduce the compute processor.
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.
Francisco Jerez [Tue, 1 May 2012 00:47:03 +0000 (02:47 +0200)]
gallium: Add context hooks for binding 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.
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>
Michel Dänzer [Fri, 11 May 2012 09:52:16 +0000 (11:52 +0200)]
radeonsi: Properly translate vertex format swizzle.
egltri_screen works correctly!
Tom Stellard [Thu, 10 May 2012 19:54:43 +0000 (15:54 -0400)]
radeon/llvm: Remove AMDILMCCodeEmitter.cpp
Tom Stellard [Thu, 10 May 2012 19:31:42 +0000 (15:31 -0400)]
radeon/llvm: Remove SILowerShaderInstructions.cpp