mesa.git
13 years agor600g: take constantly interpolated values into a/c
Dave Airlie [Thu, 15 Sep 2011 11:39:26 +0000 (12:39 +0100)]
r600g: take constantly interpolated values into a/c

We could constant interpolated values now and set have_perspective
if nothing else is set to avoid a GPU hang.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: add flat non-interpolation support.
Dave Airlie [Thu, 15 Sep 2011 11:38:10 +0000 (12:38 +0100)]
r600g: add flat non-interpolation support.

TGSI CONSTANT interpolation is just flat, and we just read the values
direct from the LDS into the GPR without doing any interpolation on them.

This is needed to pass integer types into the fragment shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: set number type correctly for color buffers.
Dave Airlie [Thu, 15 Sep 2011 11:34:43 +0000 (12:34 +0100)]
r600g: set number type correctly for color buffers.

If we get a scaled type assume its a real integer type (as textures are).

Also fixup the blend bypass and blend clamp flags on evergreen as per the
docs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: add missing formats to color buffer setup.
Dave Airlie [Sat, 10 Sep 2011 16:53:34 +0000 (17:53 +0100)]
r600g: add missing formats to color buffer setup.

just playing with EXT_texture_integer, and this was first bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agosoftpipe: use consistent indentation in sp_quad_blend.c
Brian Paul [Wed, 14 Sep 2011 14:30:52 +0000 (08:30 -0600)]
softpipe: use consistent indentation in sp_quad_blend.c

13 years agogallivm: fix build with LLVM 3.0svn
Tobias Droste [Thu, 15 Sep 2011 00:39:26 +0000 (02:39 +0200)]
gallivm: fix build with LLVM 3.0svn

LLVM 3.0svn added SubtargetInfo as additional parameter to
createMCDisassembler() and createMCInstPrinter().
See revision 139237 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoChange strerror(ret) to strerror(-ret).
Eugeni Dodonov [Thu, 15 Sep 2011 18:12:02 +0000 (15:12 -0300)]
Change strerror(ret) to strerror(-ret).

13 years agosoftpipe: fix blending for luminance/intensity surfaces
Brian Paul [Thu, 15 Sep 2011 17:31:55 +0000 (11:31 -0600)]
softpipe: fix blending for luminance/intensity surfaces

If we're drawing to a luminance, luminance/alpha or intensity surface
we have to adjust (rebase) the fragment/quad colors before writing them
to the tile cache.  The tile cache always stores RGBA colors but if
we're caching a L/A surface (for example) we need to be sure that R=G=B
so that subsequent reads from the surface cache appear to return L/A

We previously had a special case for RGB (no alpha) surfaces.  This
change generalizes that for the other base formats.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40408, but sRGB
formats are still failing.  That'll be addressed in a later patch.

13 years agoutil: add util_format_is_luminance/intensity/rgb(), etc
Brian Paul [Thu, 15 Sep 2011 17:31:55 +0000 (11:31 -0600)]
util: add util_format_is_luminance/intensity/rgb(), etc

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agowayland: Flush before blocking in swapbuffers.
Jørgen Lind [Thu, 15 Sep 2011 15:36:46 +0000 (17:36 +0200)]
wayland: Flush before blocking in swapbuffers.

Make sure that we've sent the frame request that we're going to block on.

13 years agomesa: fix error handling for dlist image unpacking
Brian Paul [Thu, 15 Sep 2011 15:06:19 +0000 (09:06 -0600)]
mesa: fix error handling for dlist image unpacking

When compiling glDrawPixels, glTexImage(), etc. and we're copying
the user's image we need to be careful about GL error checking.
Previously, we were incorrectly generating GL_OUT_OF_MEMORY in
unpack_image() if width <= 0 or height <= 0 or for invalid format/type
values.  We now check those arguments in unpack_image() and return NULL
if there's a bad value.  The command will get compiled with the
arguments as-is and image=NULL.  Later, when the command is executed the
correct errors will be generated.

This issue was reported by Yuanhan Liu <yuanhan.liu@linux.intel.com>

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
13 years agost/mesa: rewrap a long line
Brian Paul [Thu, 15 Sep 2011 14:58:31 +0000 (08:58 -0600)]
st/mesa: rewrap a long line

13 years agomesa: add missing ')' in error message
Brian Paul [Thu, 15 Sep 2011 14:02:52 +0000 (08:02 -0600)]
mesa: add missing ')' in error message

13 years agouniforms: accept all int/unsigned int sampler types in uniform checks.
Dave Airlie [Wed, 14 Sep 2011 11:07:47 +0000 (12:07 +0100)]
uniforms: accept all int/unsigned int sampler types in uniform checks.

I'm not 100% sure about this, it may need a version check or it might
be completely wrong.

added multisample ones as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoglsl: Remove field array_lvalue from ir_variable.
Paul Berry [Sat, 10 Sep 2011 14:48:46 +0000 (07:48 -0700)]
glsl: Remove field array_lvalue from ir_variable.

The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.

However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).

This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).

This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation.  Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.

Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: Initialize multi VGT related register on Cayman.
Michel Dänzer [Wed, 14 Sep 2011 16:37:48 +0000 (18:37 +0200)]
r600g: Initialize multi VGT related register on Cayman.

Prevents lockups with piglit tests draw-elements and draw-vertices using large
numbers of vertices.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alex.deucher@amd.com>
13 years agoglx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
Michel Dänzer [Wed, 14 Sep 2011 16:37:48 +0000 (18:37 +0200)]
glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.

As already done in dri2CopySubBuffer().

Should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=36371
https://bugs.freedesktop.org/show_bug.cgi?id=40533

Might fix:

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
13 years agoDRI: Log something if we don't support legacy DRI
Andrew Deason [Wed, 14 Sep 2011 16:37:48 +0000 (18:37 +0200)]
DRI: Log something if we don't support legacy DRI

If we are called via the legacy DRI interface, and we don't support
legacy DRI (InitScreen is NULL), print a debug message, so it is easy
to see why the driver fails to initialize.

See https://bugs.freedesktop.org/show_bug.cgi?id=40437

13 years agoGLX: Say something if we cannot connect via DRI2
Andrew Deason [Wed, 14 Sep 2011 16:37:48 +0000 (18:37 +0200)]
GLX: Say something if we cannot connect via DRI2

See https://bugs.freedesktop.org/show_bug.cgi?id=40437

13 years agonvc0: implement resource_resolve
Christoph Bumiller [Wed, 14 Sep 2011 16:30:37 +0000 (18:30 +0200)]
nvc0: implement resource_resolve

13 years agollvmpipe: Remove dead lp_tile_shuffle_mask.py script.
José Fonseca [Wed, 14 Sep 2011 15:48:17 +0000 (16:48 +0100)]
llvmpipe: Remove dead lp_tile_shuffle_mask.py script.

Broken, and we now shuffle tiles with pack/unpack instructions, instead
of shuffle masks.

13 years agoscons: Remove dead MSVC SDK/DDK/WINCE tools.
José Fonseca [Wed, 14 Sep 2011 15:36:35 +0000 (16:36 +0100)]
scons: Remove dead MSVC SDK/DDK/WINCE tools.

Not really used anymore.

13 years agonv50/ir: add missing license headers
Christoph Bumiller [Wed, 14 Sep 2011 14:47:44 +0000 (16:47 +0200)]
nv50/ir: add missing license headers

13 years agost/mesa: fix/update comment on st_translate_color()
Brian Paul [Wed, 14 Sep 2011 14:31:47 +0000 (08:31 -0600)]
st/mesa: fix/update comment on st_translate_color()

13 years agonvc0: emit tessellation mode and patch size in TCP/TEP validation
Christoph Bumiller [Thu, 25 Aug 2011 11:02:18 +0000 (13:02 +0200)]
nvc0: emit tessellation mode and patch size in TCP/TEP validation

13 years agonv50,nvc0: handle PIPE_CAP_MIN/MAX_TEXEL_OFFSET
Christoph Bumiller [Mon, 5 Sep 2011 13:31:28 +0000 (15:31 +0200)]
nv50,nvc0: handle PIPE_CAP_MIN/MAX_TEXEL_OFFSET

13 years agonvc0: remove old shader backend files
Christoph Bumiller [Tue, 13 Sep 2011 21:12:23 +0000 (23:12 +0200)]
nvc0: remove old shader backend files

13 years agonvc0: hook up to new shader code generator
Christoph Bumiller [Tue, 13 Sep 2011 21:10:35 +0000 (23:10 +0200)]
nvc0: hook up to new shader code generator

Also includes loading of shared shader library code (used for f64
and integer division) and setting up the immediate array buffer
which is appended to the code.

13 years agonv50/ir: import new shader backend code
Christoph Bumiller [Wed, 14 Sep 2011 14:18:23 +0000 (16:18 +0200)]
nv50/ir: import new shader backend code

13 years agonvc0: prevent interruption of m2mf push
Christoph Bumiller [Tue, 13 Sep 2011 21:02:23 +0000 (23:02 +0200)]
nvc0: prevent interruption of m2mf push

M2MF will trap if the data stream is interrupted by a QUERY fence
and report too much or not enough data.

13 years agonouveau: make data argument of nouveau_context::push_data const
Christoph Bumiller [Fri, 26 Aug 2011 20:59:19 +0000 (22:59 +0200)]
nouveau: make data argument of nouveau_context::push_data const

13 years agosoftpipe: implement blend color clamping
Brian Paul [Wed, 14 Sep 2011 14:15:14 +0000 (08:15 -0600)]
softpipe: implement blend color clamping

Per the GL spec, clamp incoming colors prior to blending depending on
whether the destination buffer stores normalized (non-float) values.
Note that the constant blend color needs to be clamped too (we always
get the unclamped color from Mesa).

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412

13 years agomesa: minor clean-up on _mesa_unclamped_float_rgba_to_ubyte()
Brian Paul [Wed, 14 Sep 2011 14:09:05 +0000 (08:09 -0600)]
mesa: minor clean-up on _mesa_unclamped_float_rgba_to_ubyte()

Add a comment and reformat to be under 80 columns.

13 years agomesa: white space, comment fixes in mtypes.h
Brian Paul [Wed, 14 Sep 2011 14:06:38 +0000 (08:06 -0600)]
mesa: white space, comment fixes in mtypes.h

"vale" was a typo.  Fix that and do some other minor clean-ups.

13 years agost/vdpau: Preliminary support for timestamped output surface into the presentation...
Emeric Grange [Mon, 12 Sep 2011 21:39:33 +0000 (23:39 +0200)]
st/vdpau: Preliminary support for timestamped output surface into the presentation queue

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
13 years agost/vdpau: Output surfaces that are too large to fit into the display target will...
Emeric Grange [Mon, 12 Sep 2011 21:39:32 +0000 (23:39 +0200)]
st/vdpau: Output surfaces that are too large to fit into the display target will be clipped

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
13 years agost/vdpau: Add get_clear_color capability
Emeric Grange [Mon, 12 Sep 2011 21:39:31 +0000 (23:39 +0200)]
st/vdpau: Add get_clear_color capability

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
13 years agost/vdpau: Add documentation from the VDPAU API and update some traces
Emeric Grange [Mon, 12 Sep 2011 21:39:30 +0000 (23:39 +0200)]
st/vdpau: Add documentation from the VDPAU API and update some traces

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
13 years agost/vdpau: Various whitespace cleanups found while reading some code
Emeric Grange [Mon, 12 Sep 2011 21:39:29 +0000 (23:39 +0200)]
st/vdpau: Various whitespace cleanups found while reading some code

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
13 years agonouveau: Add max_references parameter to vl_create_decoder()
Emeric Grange [Mon, 12 Sep 2011 21:39:28 +0000 (23:39 +0200)]
nouveau: Add max_references parameter to vl_create_decoder()

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
13 years agog3dvl: Add max_references parameter to vl_create_decoder()
Emeric Grange [Mon, 12 Sep 2011 21:39:27 +0000 (23:39 +0200)]
g3dvl: Add max_references parameter to vl_create_decoder()

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
13 years agog3dvl: Add get_clear_color capability
Emeric Grange [Mon, 12 Sep 2011 21:39:26 +0000 (23:39 +0200)]
g3dvl: Add get_clear_color capability

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
13 years agog3dvl: Various whitespace cleanups found while reading some code
Emeric Grange [Mon, 12 Sep 2011 21:39:25 +0000 (23:39 +0200)]
g3dvl: Various whitespace cleanups found while reading some code

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
13 years agomesa/colormac: introduce inline helper for 4 unclamped float to ubyte.
Dave Airlie [Wed, 14 Sep 2011 10:08:57 +0000 (11:08 +0100)]
mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.

This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as
suggested by Brian. It uses it in a few places I noticed from previous
color changes, and also some core mesa places. I haven't updated other places
yet.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agomesa: introduce a clear color union to be used for int/unsigned buffers
Dave Airlie [Mon, 12 Sep 2011 09:57:40 +0000 (10:57 +0100)]
mesa: introduce a clear color union to be used for int/unsigned buffers

This introduces a new gl_color_union union and moves the current
ClearColorUnclamped to use it, it removes current ClearColor completely and
renames CCU to CC, then all drivers are modified to expected unclamped floats instead.

also fixes st to use translated color in one place it wasn't.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agost/mesa: fix incorrect debug output
Brian Paul [Tue, 13 Sep 2011 15:30:31 +0000 (09:30 -0600)]
st/mesa: fix incorrect debug output

format and type are not GL enums here.

13 years agogallivm: remove unused vars
Brian Paul [Tue, 13 Sep 2011 14:16:01 +0000 (08:16 -0600)]
gallivm: remove unused vars

13 years agogallium: minor comments for util_format_channel_description fields
Brian Paul [Mon, 12 Sep 2011 23:04:11 +0000 (17:04 -0600)]
gallium: minor comments for util_format_channel_description fields

13 years agonv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats
Marcin Slusarz [Tue, 13 Sep 2011 13:14:19 +0000 (15:14 +0200)]
nv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats

R4A4 is needed by OSD in mplayer's xvmc output

13 years agor600g: fix typo in "r600g: simplify deducing chip family"
Marek Olšák [Tue, 13 Sep 2011 11:07:46 +0000 (13:07 +0200)]
r600g: fix typo in "r600g: simplify deducing chip family"

13 years agomesa/pack: don't apply transfer operations to integer format buffers. (v3)
Dave Airlie [Mon, 12 Sep 2011 13:44:25 +0000 (14:44 +0100)]
mesa/pack: don't apply transfer operations to integer format buffers. (v3)

The EXT_texture_integer issues says:

Should pixel transfer operations be defined for the integer pixel
path?

RESOLVED: No.  Fragment shaders can achieve similar results
with more flexibility.  There is no need to aggrandize this
legacy mechanism.

v2: fix comments, fix unpack paths, use same comment/code
v3: fix last comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor600g: remove unused function r600_buffer_from_handle
Marek Olšák [Sun, 11 Sep 2011 19:05:46 +0000 (21:05 +0200)]
r600g: remove unused function r600_buffer_from_handle

13 years agor600g: remove an irrelevant XXX comment
Marek Olšák [Sun, 11 Sep 2011 17:31:40 +0000 (19:31 +0200)]
r600g: remove an irrelevant XXX comment

13 years agor600g: remove r600_resource_buffer struct
Marek Olšák [Sun, 11 Sep 2011 16:46:54 +0000 (18:46 +0200)]
r600g: remove r600_resource_buffer struct

This subclass of r600_resource doesn't contain any useful members,
so let's just use r600_resource.

13 years agor600g: set the return type of radeon_destroy to void
Marek Olšák [Sun, 11 Sep 2011 16:01:25 +0000 (18:01 +0200)]
r600g: set the return type of radeon_destroy to void

13 years agor600g: remove r600_drm_public.h
Marek Olšák [Sun, 11 Sep 2011 15:38:43 +0000 (17:38 +0200)]
r600g: remove r600_drm_public.h

13 years agor600g: inline some of the winsys r600_get functions
Marek Olšák [Sun, 11 Sep 2011 14:35:10 +0000 (16:35 +0200)]
r600g: inline some of the winsys r600_get functions

13 years agor600g: simplify deducing chip family
Marek Olšák [Sun, 11 Sep 2011 12:57:55 +0000 (14:57 +0200)]
r600g: simplify deducing chip family

13 years agor600g: compute tiling info in the pipe, not in the winsys
Marek Olšák [Sun, 11 Sep 2011 12:53:07 +0000 (14:53 +0200)]
r600g: compute tiling info in the pipe, not in the winsys

The winsys doesn't need it.

13 years agor600g: remove unused ioctl definitions
Marek Olšák [Sun, 11 Sep 2011 12:07:17 +0000 (14:07 +0200)]
r600g: remove unused ioctl definitions

13 years agor600g: do not loop in radeon_family_from_device
Marek Olšák [Sun, 11 Sep 2011 11:47:20 +0000 (13:47 +0200)]
r600g: do not loop in radeon_family_from_device

Also move that function to r600_drm.c

13 years agor600g: cleanup build include dirs and dependencies
Marek Olšák [Sun, 11 Sep 2011 11:28:12 +0000 (13:28 +0200)]
r600g: cleanup build include dirs and dependencies

The scons build still depended on libdrm_radeon.

13 years agoscons: Don't use gstabs on mingw-64.
José Fonseca [Mon, 12 Sep 2011 16:23:47 +0000 (17:23 +0100)]
scons: Don't use gstabs on mingw-64.

13 years agost/mesa: clamp Max program param limits
Marek Olšák [Mon, 12 Sep 2011 10:46:45 +0000 (12:46 +0200)]
st/mesa: clamp Max program param limits

Setting just MAX_PROGRAM_ENV_PARAMS to 4096 breaks everything,
so let's do this instead.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=40767

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agopb_buffer: inline 'base' sub-struct
Marek Olšák [Sun, 11 Sep 2011 15:24:24 +0000 (17:24 +0200)]
pb_buffer: inline 'base' sub-struct

13 years agor300g: handle the new CAPs
Marek Olšák [Sun, 11 Sep 2011 13:46:47 +0000 (15:46 +0200)]
r300g: handle the new CAPs

13 years agotgsi: fix typo in commit 324ac982d8e7
Emil Velikov [Sat, 10 Sep 2011 19:07:07 +0000 (14:07 -0500)]
tgsi: fix typo in commit 324ac982d8e7

Reviewed-by: Bryan Cain <bryancain3@gmail.com>
13 years agonouveau: Add support for XvMC acceleration
Maarten Lankhorst [Sat, 10 Sep 2011 07:55:55 +0000 (09:55 +0200)]
nouveau: Add support for XvMC acceleration

Try to use the PMPEG where available

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
13 years agoglsl_to_tgsi: use UARL instead of I2F and ARL
Bryan Cain [Fri, 2 Sep 2011 05:10:50 +0000 (00:10 -0500)]
glsl_to_tgsi: use UARL instead of I2F and ARL

Since TGSI now has a UARL opcode that takes an integer as the source, it is
no longer necessary to hack around the lack of an integer ARL opcode using I2F.
UARL is only emitted when native integers are enabled; ARL is still used
otherwise.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agogallium: add TGSI opcodes UARL and UCMP
Bryan Cain [Sat, 10 Sep 2011 17:31:54 +0000 (12:31 -0500)]
gallium: add TGSI opcodes UARL and UCMP

They are needed by glsl_to_tgsi for an efficient implementation using native
integers.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: fix more valgrind warnings
Marek Olšák [Sat, 10 Sep 2011 16:42:49 +0000 (18:42 +0200)]
mesa: fix more valgrind warnings

==27540== Invalid read of size 4
==27540==    at 0x96277B7: _mesa_make_extension_string (string3.h:144)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???
==27540==  Address 0xad35b30 is 3,688 bytes inside a block of size 3,691 alloc'd
==27540==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==27540==    by 0x9627641: _mesa_make_extension_string (extensions.c:910)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???

And:

==28351== Invalid write of size 2
==28351==    at 0x4C087CC: _mesa_make_extension_string (string3.h:144)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f3 is 19 bytes inside a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==
==28351== Invalid read of size 4
==28351==    at 0x4C087EC: _mesa_make_extension_string (extensions.c:806)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f4 is 0 bytes after a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)

The first part adds 2, because ' ' and '\0' may be written at the end
of the buffer.

13 years agodraw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()
Brian Paul [Sat, 10 Sep 2011 16:20:52 +0000 (10:20 -0600)]
draw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()

These two functions were nearly the same with lots of duplicated code.
Now pass in a boolean 'elts' flag and use a few conditionals to implement
the linear vs. indexed cases.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agor300/compiler: Implement ROUND
Tom Stellard [Mon, 5 Sep 2011 13:57:36 +0000 (06:57 -0700)]
r300/compiler: Implement ROUND

According to the GLSL spec, the implementor can decide which way to round
when the fraction is .5.  The r300 compiler will round down.

13 years agomesa: fix a valgrind warning
Marek Olšák [Sat, 10 Sep 2011 13:12:54 +0000 (15:12 +0200)]
mesa: fix a valgrind warning

==5715== Invalid read of size 4
==5715==    at 0x4AA590B: _mesa_make_extension_string (extensions.c:908)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
==5715==  Address 0x4795730 is 0 bytes inside a block of size 1 alloc'd
==5715==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==5715==    by 0x4AA5B4C: _mesa_make_extension_string (extensions.c:772)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)

13 years agost/dri: remove the call to driInitExtensions
Marek Olšák [Sat, 10 Sep 2011 10:33:02 +0000 (12:33 +0200)]
st/dri: remove the call to driInitExtensions

The function no longer exists. This fixes Gallium build.

13 years agor600g: fix shadow rect samplers
Marek Olšák [Mon, 5 Sep 2011 06:01:24 +0000 (08:01 +0200)]
r600g: fix shadow rect samplers

13 years agor600g: use SAMPLE_LB for OPCODE_TXB
Marek Olšák [Mon, 5 Sep 2011 05:18:18 +0000 (07:18 +0200)]
r600g: use SAMPLE_LB for OPCODE_TXB

13 years agor600g: enable texture arrays
Marek Olšák [Sun, 4 Sep 2011 02:41:52 +0000 (04:41 +0200)]
r600g: enable texture arrays

13 years agor600g: add support for shadow array samplers
Marek Olšák [Mon, 5 Sep 2011 01:32:12 +0000 (03:32 +0200)]
r600g: add support for shadow array samplers

I had to guess & verify how some of the SAMPLE instructions work.

13 years agor600g: implement texture arrays for evergreen
Marek Olšák [Sun, 4 Sep 2011 02:23:02 +0000 (04:23 +0200)]
r600g: implement texture arrays for evergreen

13 years agor600g: always decompress all mipmaps and layers, slices, or faces of zbuffers
Marek Olšák [Sun, 4 Sep 2011 00:58:41 +0000 (02:58 +0200)]
r600g: always decompress all mipmaps and layers, slices, or faces of zbuffers

This fixes piglit/fbo-depth-array.

Reviewed-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: fix texture array filtering
Marek Olšák [Fri, 2 Sep 2011 05:35:48 +0000 (07:35 +0200)]
r600g: fix texture array filtering

This fixes piglit/fbo-generatemipmap-array.

It looks like SQ_TEX_SAMPLER_WORD0_0.TEX_ARRAY_OVERRIDE should be set
for array textures in order to disable filtering between slices,
which adds a dependency between sampler views and sampler states.

This patch reworks sampler state updates such that they are postponed until
draw time. TEX_ARRAY_OVERRIDE is updated according to bound sampler views.

This also consolidates setting the texture state between vertex and
pixel shaders.

13 years agoglsl_to_tgsi: fix shadow2DArray comparison
Marek Olšák [Mon, 5 Sep 2011 04:11:26 +0000 (06:11 +0200)]
glsl_to_tgsi: fix shadow2DArray comparison

v2: adjust the assertion, add a comment

13 years agoir_to_mesa: fix shadow2DArray comparison
Marek Olšák [Mon, 5 Sep 2011 04:09:37 +0000 (06:09 +0200)]
ir_to_mesa: fix shadow2DArray comparison

The depth should be in W.

v2: adjust the assertion, add a comment

13 years agou_blitter: add texture array support
Marek Olšák [Mon, 5 Sep 2011 01:30:02 +0000 (03:30 +0200)]
u_blitter: add texture array support

Reviewed-by: Dave Airlie <airlied@redhat.com>
13 years agost/mesa: convert shadow array samplers to TGSI
Marek Olšák [Mon, 5 Sep 2011 01:25:34 +0000 (03:25 +0200)]
st/mesa: convert shadow array samplers to TGSI

13 years agogallium: add shadow 1D and 2D array samplers to TGSI
Marek Olšák [Mon, 5 Sep 2011 01:23:05 +0000 (03:23 +0200)]
gallium: add shadow 1D and 2D array samplers to TGSI

And filling in all the switch statements in auxiliary. Mostly untested.

13 years agogallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
Marek Olšák [Mon, 5 Sep 2011 20:52:21 +0000 (22:52 +0200)]
gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS

v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.

13 years agodri: Remove all extension enabling utility functions
Ian Romanick [Mon, 22 Aug 2011 23:00:03 +0000 (16:00 -0700)]
dri: Remove all extension enabling utility functions

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoswrast-dri: Remove call to driInitExtensions
Ian Romanick [Tue, 30 Aug 2011 22:22:03 +0000 (15:22 -0700)]
swrast-dri: Remove call to driInitExtensions

The only purpose this call served in the DRI swrast driver was to
initialize the remap table.  Core Mesa already does the dispatch
offset remapping for every function that could possibly ever be
supported.  There's no need to continue using that cruft in the
driver.

13 years agoradeon: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 20:39:47 +0000 (13:39 -0700)]
radeon: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_logic_op,
and EXT_blend_minmax are no longer advertised.  These all resulted in
software fallbacks, so their loss will not be mourned.
EXT_blend_subtract is, however, explicitly added to the list.
GL_FUNC_SUBTRACT is fully accelerated, but GL_FUNC_REVERSE_SUBTRACT
(still) results in a software fallback.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
13 years agor600: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 22:05:11 +0000 (15:05 -0700)]
r600: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
13 years agor300: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 21:59:33 +0000 (14:59 -0700)]
r300: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
13 years agor200: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 22:58:24 +0000 (15:58 -0700)]
r200: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added
with a dependency on the drmSupportsBlendColor flag.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
13 years agonouveau: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 22:58:01 +0000 (15:58 -0700)]
nouveau: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and
EXT_blend_subtract are explicitly added to the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: Viktor Novotný <noviktor@seznam.cz>
13 years agointel: Move S3TC extension enable bits to intel_extensions.c
Ian Romanick [Mon, 22 Aug 2011 20:18:06 +0000 (13:18 -0700)]
intel: Move S3TC extension enable bits to intel_extensions.c

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agointel: Enable extensions by just setting the flags
Ian Romanick [Mon, 22 Aug 2011 20:15:42 +0000 (13:15 -0700)]
intel: Enable extensions by just setting the flags

Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agollvmpipe: add some null pointer checks
Brian Paul [Fri, 9 Sep 2011 19:59:20 +0000 (13:59 -0600)]
llvmpipe: add some null pointer checks

It's not clear if these are acceptable cases so issue a one-time warning
in debug builds when we hit them.

Fixes segfault in piglit fbo-mipmap-copypix test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agonvprogram: Silence "warning: unused parameter ‘ctx’"
Ian Romanick [Fri, 26 Aug 2011 00:42:16 +0000 (17:42 -0700)]
nvprogram: Silence "warning: unused parameter ‘ctx’"

13 years agoswrast: Silence many "warning: unused parameter ‘ctx’"
Ian Romanick [Thu, 25 Aug 2011 23:59:02 +0000 (16:59 -0700)]
swrast: Silence many "warning: unused parameter ‘ctx’"

Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.