mesa.git
12 years agoglsl: Add an origin pointer in the function signature object.
Olivier Galibert [Wed, 2 May 2012 21:11:41 +0000 (23:11 +0200)]
glsl: Add an origin pointer in the function signature object.

This points to the object with the function body, allowing us to map
from a built-in prototype to the actual body with IR code to execute.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add methods to copy parts of one ir_constant into another.
Olivier Galibert [Wed, 2 May 2012 21:11:40 +0000 (23:11 +0200)]
glsl: Add methods to copy parts of one ir_constant into another.

- copy_masked_offset copies part of a constant into another,
  assign-like.

- copy_offset copies a constant into (a subset of) another,
  funcall-return like.

These methods are to be used to trace through assignments and function
calls when computing a constant expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
12 years agoglsl: Add a constant_referenced method to ir_dereference*
Olivier Galibert [Wed, 2 May 2012 21:11:39 +0000 (23:11 +0200)]
glsl: Add a constant_referenced method to ir_dereference*

The method is used to get a reference to an ir_constant * within the
context of evaluating an assignment when calculating a
constant_expression_value.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
12 years agoglsl: Add a variable context to constant_expression_value().
Olivier Galibert [Wed, 2 May 2012 21:11:38 +0000 (23:11 +0200)]
glsl: Add a variable context to constant_expression_value().

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
12 years agoglsl: Extend ir_constant::zero to handle more types.
Olivier Galibert [Wed, 2 May 2012 21:11:37 +0000 (23:11 +0200)]
glsl: Extend ir_constant::zero to handle more types.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
12 years agoglsl: Fix broken constant expression handling for <, <=, >, and >=.
Kenneth Graunke [Tue, 8 May 2012 19:04:45 +0000 (12:04 -0700)]
glsl: Fix broken constant expression handling for <, <=, >, and >=.

We were looping over all the vector components, but only dealing with
the first one.  This was masked by the fact that constant expression
handling on built-ins went through custom code for the lessThan()
/function/ rather than the ir_binop_less expression operator.

NOTE: This is a candidate for all release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agovbo: add some comments
Brian Paul [Tue, 8 May 2012 17:40:28 +0000 (11:40 -0600)]
vbo: add some comments

12 years agomesa: remove needless casts in save_EdgeFlag()
Brian Paul [Tue, 8 May 2012 15:32:43 +0000 (09:32 -0600)]
mesa: remove needless casts in save_EdgeFlag()

12 years agomesa: minor clean-ups in dlist material code
Brian Paul [Tue, 8 May 2012 15:12:35 +0000 (09:12 -0600)]
mesa: minor clean-ups in dlist material code

12 years agomesa: fix error strings in dlist code
Brian Paul [Tue, 8 May 2012 15:11:04 +0000 (09:11 -0600)]
mesa: fix error strings in dlist code

12 years agomesa: add gl_context::NewDriverState and use it for vertex arrays
Marek Olšák [Mon, 16 Apr 2012 02:56:12 +0000 (04:56 +0200)]
mesa: add gl_context::NewDriverState and use it for vertex arrays

The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use
the same flag to notify the driver. Since we've run out of bits in NewState
and NewState is for core Mesa anyway, we need to find another way.

This patch is the first to start decoupling the state flags meant only
for core Mesa and those only for drivers.

The idea is to have two flag sets:
- gl_context::NewState - used by core Mesa only
- gl_context::NewDriverState - used by drivers only (the flags are defined
                               by the driver and opaque to core Mesa)

It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module
that the user changed vertex arrays, and the vbo module in turn sets
a driver-specific flag to notify the driver that it should update its vertex
array bindings.

The driver decides which bits of NewDriverState should be set and stores them
in gl_context::DriverFlags. Then, Core Mesa can do this:
ctx->NewDriverState |= ctx->DriverFlags.NewArray;

This patch implements this behavior and adapts st/mesa.
DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS.

Core Mesa only sets NewDriverState. It's the driver's responsibility to read
it whenever it wants and reset it to 0.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: move gl_client_array*[] from vbo_draw_func into gl_context
Marek Olšák [Mon, 23 Apr 2012 16:20:56 +0000 (18:20 +0200)]
mesa: move gl_client_array*[] from vbo_draw_func into gl_context

In the future we'd like to treat vertex arrays as a state and
not as a parameter to the draw function. This is the first step
towards that goal. Part of the goal is to avoid array re-validation
for every draw call.

This commit adds:
const struct gl_client_array **gl_context::Array::_DrawArrays.

The pointer is changed in:
* vbo_draw_method
* vbo_rebase_prims - unused by gallium
* vbo_split_prims - unused by gallium
* st_RasterPos

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agovbo: move vbo_draw_method into vbo_context.h
Marek Olšák [Mon, 23 Apr 2012 16:11:38 +0000 (18:11 +0200)]
vbo: move vbo_draw_method into vbo_context.h

I'll need vbo_context in that function soon.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoradeon/llvm: add suport for cube textures
Vadim Girlin [Mon, 7 May 2012 09:25:08 +0000 (13:25 +0400)]
radeon/llvm: add suport for cube textures

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for CUBE ALU instruction
Vadim Girlin [Mon, 7 May 2012 09:10:09 +0000 (13:10 +0400)]
radeon/llvm: add support for CUBE ALU instruction

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for some ALU instructions
Vadim Girlin [Mon, 7 May 2012 09:06:22 +0000 (13:06 +0400)]
radeon/llvm: add support for some ALU instructions

Add support for IABS, NOT, AND, XOR, OR, UADD, UDIV, IDIV, MOD, UMOD, INEG,
I2F, U2F, F2U, F2I, USEQ, USGE, USLT, USNE, ISGE, ISLT, ROUND, MIN, MAX,
IMIN, IMAX, UMIN, UMAX

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add missing cases for BREAK/CONTINUE
Vadim Girlin [Mon, 7 May 2012 09:02:46 +0000 (13:02 +0400)]
radeon/llvm: add missing cases for BREAK/CONTINUE

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for AHSR/LSHR/LSHL instructions
Vadim Girlin [Mon, 7 May 2012 08:50:25 +0000 (12:50 +0400)]
radeon/llvm: add support for AHSR/LSHR/LSHL instructions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for TXQ/TXF/DDX/DDY instructions
Vadim Girlin [Mon, 7 May 2012 08:47:47 +0000 (12:47 +0400)]
radeon/llvm: add support for TXQ/TXF/DDX/DDY instructions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for VertexID, InstanceID
Vadim Girlin [Mon, 7 May 2012 16:26:32 +0000 (20:26 +0400)]
radeon/llvm: add support for VertexID, InstanceID

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: fix live-in handling for inputs
Vadim Girlin [Mon, 7 May 2012 13:38:01 +0000 (17:38 +0400)]
radeon/llvm: fix live-in handling for inputs

Set the input registers as live-in for entry basic block.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: add support for v4i32
Vadim Girlin [Mon, 7 May 2012 16:24:13 +0000 (20:24 +0400)]
radeon/llvm: add support for v4i32

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: fix ABS_i32 instruction lowering
Vadim Girlin [Mon, 7 May 2012 09:17:00 +0000 (13:17 +0400)]
radeon/llvm: fix ABS_i32 instruction lowering

Swap source operands.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: use integer comparison for IF
Vadim Girlin [Mon, 7 May 2012 09:14:58 +0000 (13:14 +0400)]
radeon/llvm: use integer comparison for IF

Replacing "float equal to 1.0f" with "int not equal to 0".
This should help for further optimization of boolean computations.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoradeon/llvm: use bitcasts for integers
Vadim Girlin [Mon, 7 May 2012 16:22:29 +0000 (20:22 +0400)]
radeon/llvm: use bitcasts for integers

We're using float as default type, so basically for every instruction that
wants other types for dst/src operands we need to perform the bitcast
to/from default float. Currently bitcast produces no-op MOV instruction,
will be eliminated later.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agor600g: Fix out of tree builds that use the LLVM backend
Tom Stellard [Mon, 7 May 2012 19:04:08 +0000 (15:04 -0400)]
r600g: Fix out of tree builds that use the LLVM backend

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

12 years agoradeon/llvm: Remove references to DebugFlag and isCurrentDebugType()
Tom Stellard [Mon, 7 May 2012 17:53:40 +0000 (13:53 -0400)]
radeon/llvm: Remove references to DebugFlag and isCurrentDebugType()

These weren't being used at all and they were causing build failures
when LLVM was built with NDEBUG defined and mesa was not.

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

12 years agoi965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.
Paul Berry [Thu, 26 Apr 2012 13:35:56 +0000 (06:35 -0700)]
i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.

In i965 Gen7, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
12 years agoi965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.
Paul Berry [Thu, 26 Apr 2012 13:35:56 +0000 (06:35 -0700)]
i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.

In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
12 years agofbo: Only reuse depth/stencil attachments if the parameters match.
Paul Berry [Sat, 14 Apr 2012 04:50:08 +0000 (21:50 -0700)]
fbo: Only reuse depth/stencil attachments if the parameters match.

When the user attaches a texture to one of the depth/stencil
attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we
check to see if the same texture is also attached to the other
attachment point, and if so, we re-use the existing texture
attachment.  This is necessary to ensure that if the user later
queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not
receive an error.

If, however, the user attaches buffers to the two different attachment
points using different parameters (e.g. a different miplevel), then we
can't re-use the existing texture attachment, because it is pointing
to the wrong part of the texture.  This might occur as a transitory
condition if, for example, if the user attached miplevel zero of a
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to
it, and then later attempted to attach miplevel one of the same
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT.

This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and
GL_DEPTH_ATTACHMENT use the same attachment parameters before
attempting to share the texture attachment.

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 depth_stencil_shared"
and "texturing/depthstencil-render-miplevels 1024
stencil_depth_shared".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965: Fix mipmap offsets for HiZ and separate stencil buffers.
Paul Berry [Sun, 15 Apr 2012 17:35:01 +0000 (10:35 -0700)]
i965: Fix mipmap offsets for HiZ and separate stencil buffers.

When rendering to a miplevel other than 0 within a color, depth,
stencil, or HiZ buffer, we need to tell the GPU to render to an offset
within the buffer, so that the data is written into the correct
miplevel.  We do this using a coarse offset (in pages), and a fine
adjustment (the so-called "tile_x" and "tile_y" values, which are
measured in pixels).

We have always computed the coarse offset and fine adjustment using
intel_renderbuffer_tile_offsets() function.  This worked fine for
color and combined depth/stencil buffers, but failed to work properly
when HiZ and separate stencil were in use.  It failed to work because
there is only one set of fine adjustment controls shared by the HiZ,
depth, and stencil buffers, so we need to choose tile_x and tile_y
values that are compatible with the tiling of all three buffers, and
then compute separate coarse offsets for each buffer.

This patch fixes the HiZ and separate stencil case by replacing the
call to intel_renderbuffer_tile_offsets() with calls to two functions:
intel_region_get_tile_masks(), which determines how much of the
adjustment can be performed using offsets and how much can be
performed using tile_x and tile_y, and
intel_region_get_aligned_offset(), which computes the coarse offset.

intel_region_get_tile_offsets() is still used for color renderbuffers,
so to avoid code duplication, I've re-worked it to use
intel_region_get_tile_masks() and intel_region_get_aligned_offset().

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 X" where X is one of
(depth, depth_and_stencil, depth_stencil_single_binding, depth_x,
depth_x_and_stencil, stencil, stencil_and_depth, stencil_and_depth_x).

On i965 Gen7, the variants of
"texturing/depthstencil-render-miplevels" that contain a stencil
buffer still fail, due to another problem: Gen7 seems to ignore the 3
LSB's of the tile_y adjustment (and possibly also tile_x).

v2: Removed spurious comments.  Added assertions to check
preconditions of intel_region_get_aligned_offset().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Disable ARB_framebuffer_object in ES contexts
Chad Versace [Thu, 3 May 2012 23:02:50 +0000 (16:02 -0700)]
intel: Disable ARB_framebuffer_object in ES contexts

This patch removes ARB_framebuffer_object from the GLES1 and GLES2
extension lists in intel_extensions_es.c.

Fixes a crash in the Android browser on Ice Cream Sandwich.

The Android browser crashed because it did the following, which is legal
in GLES2 but not in ARB_framebuffer_object.
    glGenFramebuffers(1, &fb);
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // render render render...
    glDeleteFramebuffers(1, &fb);
    // go do other stuff...
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // This bind unexpectedly failed, and the app panics.

The semantics of glBindFramebuffer specified by ARB_framebuffer_object (a
desktop GL extension) and GLES2 specs are incompatible. The ideal solution
to fix this is to create separate API entry points for glBindFramebuffer,
one for GL and the other for GLES2. But, until that work is complete,
disabling ARB_framebuffer_object in GLES2 contexts safely fixes the problem.

Likewise, the semantics of glBindFramebuffer in ARB_framebuffer_object and
of glBindFramebufferOES in OES_framebuffer_object (a GLES1 extension) are
incompatible. Even though the functions have different names, the semantic
difference still results in a bug because both API calls are implemented
by a single function, _mesa_BindFramebufferEXT, which handles the semantic
difference incorrectly. Again, disabling ARB_framebuffer_object in GLES1
contexts safely fixes this problem.

According to the ARB_framebuffer_object spec, the extension is an
amalgamation of
    EXT_framebuffer_object
    EXT_framebuffer_blit
    EXT_packed_depth_stencil
    EXT_framebuffer_multisample
By disabling this extension, however, no functionality is removed from
GLES1 and GLES2 contexts because 1) the first three extensions are
explicitly enabled in Intel's ES extension lists and 2) no functionality
of the last extension is exposed in an ES context.

Note: This is a candidate for the 8.0 branch.
See-also: http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg21006.html
CC: Charles Johnson <charles.f.johnson@intel.com>
CC: Sean Kelley <sean.v.kelley@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agomesa: bump version to 8.1.0 in configs/default
Brian Paul [Mon, 7 May 2012 13:30:04 +0000 (07:30 -0600)]
mesa: bump version to 8.1.0 in configs/default

12 years agonv50: handle VP without inputs
Marcin Slusarz [Mon, 7 May 2012 12:05:35 +0000 (14:05 +0200)]
nv50: handle VP without inputs

12 years agonvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc
Christoph Bumiller [Sat, 5 May 2012 15:57:50 +0000 (17:57 +0200)]
nvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc

12 years agonv50/ir/opt: don't lose saturation in tryCollapseChainedMULs
Christoph Bumiller [Sat, 5 May 2012 14:35:49 +0000 (16:35 +0200)]
nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs

12 years agonvc0/ir: fix lowering of textureGrad
Christoph Bumiller [Sat, 5 May 2012 11:30:03 +0000 (13:30 +0200)]
nvc0/ir: fix lowering of textureGrad

12 years agonouveau: fix nouveau_scratch_runout_release bo count underflow
Christoph Bumiller [Sat, 5 May 2012 11:28:19 +0000 (13:28 +0200)]
nouveau: fix nouveau_scratch_runout_release bo count underflow

12 years agomesa: Add primitive restart support to glArrayElement
Jordan Justen [Tue, 1 May 2012 07:01:08 +0000 (00:01 -0700)]
mesa: Add primitive restart support to glArrayElement

When primitive restart is enabled, and glArrayElement is called
with the restart index value, then call glPrimitiveRestartNV.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul<brianp@vmware.com>
12 years agoauxiliary/os: Add missing signal.h include.
Baldo Davide [Sat, 5 May 2012 03:50:19 +0000 (04:50 +0100)]
auxiliary/os: Add missing signal.h include.

The signal.h include was missed in the commit
bc16c73407d11bb6702cf7de9925bfaeb80a5272 which leads to broken
compilations under Linux.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
12 years agointel: Remove pointless software fallback for glBitmap on Gen6.
Kenneth Graunke [Mon, 5 Mar 2012 21:54:29 +0000 (13:54 -0800)]
intel: Remove pointless software fallback for glBitmap on Gen6.

We already have a meta path below that works just fine; no apparent
regressions in oglconform.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46834
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoglsl: Fix regression in function out-parameter lvalue detection.
Eric Anholt [Tue, 24 Apr 2012 00:24:13 +0000 (17:24 -0700)]
glsl: Fix regression in function out-parameter lvalue detection.

When doing the var->assigned change in
f2475ca424f7e001be50f64dafa5700f6603d684, I overzealously indented the
second block of code into the "if (var)" test.  Revert these blocks to
the way they were before, just taking advantage of "var" to avoid
re-calling variable_referenced().

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

12 years agomesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE.
Eric Anholt [Tue, 24 Apr 2012 00:12:04 +0000 (17:12 -0700)]
mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE.

12 years agoi965/fs: Fix regression in comparison handling from ANDs change.
Eric Anholt [Mon, 23 Apr 2012 23:48:09 +0000 (16:48 -0700)]
i965/fs: Fix regression in comparison handling from ANDs change.

I had fixed up the logic ops for delayed ANDing, but not equality
comparisons on bools.  Fixes new piglit fs-bool-less-compare-true.

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

12 years agoglsl: Don't consider unused FS out variables as being statically assigned.
Eric Anholt [Mon, 23 Apr 2012 23:10:12 +0000 (16:10 -0700)]
glsl: Don't consider unused FS out variables as being statically assigned.

I only considered var->assigned for FragColor and FragData, but
ignored when it was false for out vars.  Fixes piglit
write-gl_FragColor-and-not-user-output.frag

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

12 years agoi965: Add a comment about the state flag for sRGBEnabled.
Eric Anholt [Mon, 23 Apr 2012 16:46:15 +0000 (09:46 -0700)]
i965: Add a comment about the state flag for sRGBEnabled.

I thought this might be _NEW_COLOR, but it isn't.

12 years agointel: Return success when asked to allocate a 0-width/height renderbuffer.
Eric Anholt [Mon, 23 Apr 2012 21:14:11 +0000 (14:14 -0700)]
intel: Return success when asked to allocate a 0-width/height renderbuffer.

It seems silly that GL lets you allocate these given that they're
framebuffer attachment incomplete, but the webgl conformance tests
actually go looking to see if the getters on 0-width/height
depth/stencil renderbuffers return good values.  By failing out here,
they all got smashed to 0, which turned out to be correct for all the
getters they tested except for GL_RENDERBUFFER_INTERNAL_FORMAT.  Now,
by succeeding but not making a miptree, that one also returns the
expected value.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Always copy the index when cloning a variable.
Eric Anholt [Wed, 25 Apr 2012 21:59:25 +0000 (14:59 -0700)]
glsl: Always copy the index when cloning a variable.

The index is also used for GL_ARB_blend_func_extended.  Cloning in
i965 was dropping a non-ARB_explicit_attrib_location index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
12 years agoi965: Add support for GL_ARB_draw_buffers_blend.
Eric Anholt [Wed, 25 Apr 2012 20:19:28 +0000 (13:19 -0700)]
i965: Add support for GL_ARB_draw_buffers_blend.

Tested with piglit fbo-draw-buffers-blend and intel oglconform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agonv50: fix typo causing NULL-deref in nv50_resource_resolve
Christoph Bumiller [Fri, 4 May 2012 15:40:33 +0000 (17:40 +0200)]
nv50: fix typo causing NULL-deref in nv50_resource_resolve

Introduced in b328949a37fee7b0f68ed3e068ffc4426c083042.

12 years agonv50/ir: move expansion of IMUL to later stage and handle memory operands
Christoph Bumiller [Fri, 4 May 2012 16:00:40 +0000 (18:00 +0200)]
nv50/ir: move expansion of IMUL to later stage and handle memory operands

12 years agonv50: implement stream output
Christoph Bumiller [Thu, 3 May 2012 10:50:08 +0000 (12:50 +0200)]
nv50: implement stream output

12 years agonv50: enable array textures
Christoph Bumiller [Tue, 24 Apr 2012 21:21:41 +0000 (23:21 +0200)]
nv50: enable array textures

12 years agosvga: specify 4-byte aligned vertex elements
Brian Paul [Mon, 30 Apr 2012 22:01:08 +0000 (16:01 -0600)]
svga: specify 4-byte aligned vertex elements

We haven't found a case where this is needed, but it would be prudent
for some hosts, per Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agogallivm: fix comment typo
Brian Paul [Thu, 3 May 2012 23:00:37 +0000 (17:00 -0600)]
gallivm: fix comment typo

12 years agodocs: another viewperf bug
Brian Paul [Tue, 1 May 2012 21:49:31 +0000 (15:49 -0600)]
docs: another viewperf bug

12 years agomesa: do more teximage error checking for generic compressed formats
Brian Paul [Tue, 1 May 2012 20:46:04 +0000 (14:46 -0600)]
mesa: do more teximage error checking for generic compressed formats

When glTexImage or glCopyTexImage is called with internalFormat being a
generic compressed format (like GL_COMPRESSED_RGB) we need to do the same
error checks as for specific compressed formats.  In particular, check if
the texture target is compatible with the format.  None of the texture
compression formats we support so far work with GL_TEXTURE_1D, for example.

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

NOTE: This is a candidate for the 8.0 branch.

12 years agoscons: Do not build EGL on Solaris.
Vinson Lee [Tue, 1 May 2012 01:57:38 +0000 (18:57 -0700)]
scons: Do not build EGL on Solaris.

The current EGL headers do not support Solaris.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agodarwin: Use ASL for logging
Jeremy Huddleston [Sun, 29 Apr 2012 06:19:42 +0000 (23:19 -0700)]
darwin: Use ASL for logging

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agodarwin: Make reported errors more user-friendly
Jeremy Huddleston [Sat, 28 Apr 2012 23:50:00 +0000 (16:50 -0700)]
darwin: Make reported errors more user-friendly

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agodarwin: Fix an error message
Jeremy Huddleston [Sun, 29 Apr 2012 07:27:03 +0000 (00:27 -0700)]
darwin: Fix an error message

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agoegl_dri2: Fix out of tree builds with the wayland backend enabled
Robert Hooker [Wed, 2 May 2012 23:04:57 +0000 (19:04 -0400)]
egl_dri2: Fix out of tree builds with the wayland backend enabled

Otherwise it fails like so:

  CC     egl_dri2.lo
In file included from egl_dri2.h:40:0,
                 from egl_dri2.c:42:
../../../../../../src/egl/wayland/wayland-drm/wayland-drm.h:8:41:
fatal error: wayland-drm-server-protocol.h: No such file or directory
compilation terminated.

12 years agogbm: Add gbm_bo_write entry point
Kristian Høgsberg [Wed, 2 May 2012 19:30:13 +0000 (15:30 -0400)]
gbm: Add gbm_bo_write entry point

This new gbm entry point allows writing data into a gbm bo.  The bo has
to be created with the GBM_BO_USE_WRITE flag, and it's only required to
work for GBM_BO_USE_CURSOR_64X64 bos.

The gbm API is designed to be the glue layer between EGL and KMS, but there
was never a mechanism initialize a buffer suitable for use with KMS
hw cursors.  The hw cursor bo is typically not compatible with anything EGL
can render to, and thus there's no way to get data into such a bo.

gbm_bo_write() fills that gap while staying out of the efficient
cpu->gpu pixel transfer business.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
12 years agor600g/llvm: Mask write of pred_inst in llvm_if()
Tom Stellard [Mon, 30 Apr 2012 14:18:41 +0000 (10:18 -0400)]
r600g/llvm: Mask write of pred_inst in llvm_if()

12 years agor600g/llvm: Lower ULT A, B, C to SETGT_UINT A, C, B
Tom Stellard [Fri, 27 Apr 2012 20:22:58 +0000 (16:22 -0400)]
r600g/llvm: Lower ULT A, B, C to SETGT_UINT A, C, B

12 years agor600g: Print integer values of literal constants in shader dumps
Tom Stellard [Fri, 27 Apr 2012 19:26:30 +0000 (15:26 -0400)]
r600g: Print integer values of literal constants in shader dumps

12 years agor600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream
Tom Stellard [Fri, 27 Apr 2012 19:15:19 +0000 (15:15 -0400)]
r600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream

12 years agor600g/llvm: Don't duplicate R600 intrinsics installed by LLVM
Tom Stellard [Tue, 24 Apr 2012 17:31:07 +0000 (13:31 -0400)]
r600g/llvm: Don't duplicate R600 intrinsics installed by LLVM

At this point, in order for OpenCL to work correctly with r600g, OpenCL
specific intrinsics need to be defined in the LLVM tree.  So, we need
to check for these intrinsics in the LLVM include directory to make sure
not to re-define them.

12 years agor600g: Fix the evergreen offset/end register definitions
Tom Stellard [Wed, 2 May 2012 18:51:04 +0000 (14:51 -0400)]
r600g: Fix the evergreen offset/end register definitions

12 years agoglsl: report errors via GL_ARB_debug_output
Dylan Noblesmith [Mon, 2 Apr 2012 16:26:05 +0000 (16:26 +0000)]
glsl: report errors via GL_ARB_debug_output

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: add gl_context member
Dylan Noblesmith [Mon, 2 Apr 2012 16:14:31 +0000 (16:14 +0000)]
glsl: add gl_context member

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: add _mesa_shader_debug()
Dylan Noblesmith [Mon, 2 Apr 2012 16:11:11 +0000 (16:11 +0000)]
mesa: add _mesa_shader_debug()

This should be the one entrypoint libglsl needs
for GL_ARB_debug_output.

v2: added comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: consolidate error/warning code
Dylan Noblesmith [Mon, 2 Apr 2012 15:39:38 +0000 (15:39 +0000)]
glsl: consolidate error/warning code

And lay the groundwork for GL_ARB_debug_output.

v2: Add descriptive comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoradeon/llvm: Fix MachineInstr dump
Tom Stellard [Wed, 2 May 2012 15:53:13 +0000 (11:53 -0400)]
radeon/llvm: Fix MachineInstr dump

12 years agor600g: fixed the bug with VTX fetches in TEX clauses for evergreen
Adam Rak [Tue, 17 Apr 2012 19:56:02 +0000 (15:56 -0400)]
r600g: fixed the bug with VTX fetches in TEX clauses for evergreen

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agowinsys/radeon: Get max_pipes from the kernel
Tom Stellard [Tue, 20 Mar 2012 17:33:37 +0000 (13:33 -0400)]
winsys/radeon: Get max_pipes from the kernel

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: Add support for reading vertex fetches from bytestream
Tom Stellard [Wed, 29 Feb 2012 21:37:53 +0000 (16:37 -0500)]
r600g: Add support for reading vertex fetches from bytestream

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: Add support for reading native instructions from the LLVM bytestream
Tom Stellard [Mon, 27 Feb 2012 20:47:34 +0000 (15:47 -0500)]
r600g: Add support for reading native instructions from the LLVM bytestream

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: Add FC_NATIVE instruction
Tom Stellard [Mon, 27 Feb 2012 20:42:48 +0000 (15:42 -0500)]
r600g: Add FC_NATIVE instruction

This is a pseudo instruction that enables the LLVM backend to encode
instructions and pass it through r600_bytecode_build()

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: bypass alpha for integer types (v2)
Dave Airlie [Sun, 22 Apr 2012 19:51:43 +0000 (20:51 +0100)]
r600g: bypass alpha for integer types (v2)

This moves the alpha test control to derived state and disables alpha
testing for integer fbs.

fbo-blending test in piglit gets further when we do this (not a pass
but less fail).

v2: drop the fb_sx_alpha_test_control

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: Use debug_printf in lp_build_printf.
José Fonseca [Wed, 25 Apr 2012 15:35:05 +0000 (16:35 +0100)]
gallivm: Use debug_printf in lp_build_printf.

So that its output can be seen on GUI window apps.

Tested-by: James Benton <jbenton@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
12 years agogallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().
José Fonseca [Thu, 23 Feb 2012 09:48:08 +0000 (09:48 +0000)]
gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().

Brittle, complex, and unecesary. Just use function pointer constant.

12 years agogallivm: Add a lp_build_const_func_pointer() helper.
José Fonseca [Thu, 23 Feb 2012 09:21:26 +0000 (09:21 +0000)]
gallivm: Add a lp_build_const_func_pointer() helper.

To be reused in all places where we want to call C code.

12 years agogallivm: Cleanup/simplify lp_build_const_string_variable.
José Fonseca [Thu, 23 Feb 2012 09:44:41 +0000 (09:44 +0000)]
gallivm: Cleanup/simplify lp_build_const_string_variable.

- Move to lp_bld_const where it belongs
- Rename to lp_build_const_string
- take the length from the argument (and don't count the zero terminator twice)
- bitcast the constant to generic i8 *

12 years agogallivm: Added lp_build_const_mask_aos_swizzled
James Benton [Wed, 25 Apr 2012 10:19:07 +0000 (11:19 +0100)]
gallivm: Added lp_build_const_mask_aos_swizzled

Allows the creation of const aos masks which have the mask swizzled
to match the correct format.

Updated existing mask creation code to use the swizzled version where
necessary (tgsi register masks and llvmpipe aos blending).

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agogallivm: Move loop var declaration to beginning of scope.
José Fonseca [Wed, 25 Apr 2012 14:49:45 +0000 (15:49 +0100)]
gallivm: Move loop var declaration to beginning of scope.

12 years agogallivm: added a debug function which allows llvm to print vectors of 16 unsigned...
James Benton [Thu, 19 Apr 2012 17:13:14 +0000 (18:13 +0100)]
gallivm: added a debug function which allows llvm to print vectors of 16 unsigned ints

This is useful for debugging the linear llvm path as it handles pixels in this format

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agollvmpipe: add masking support to aos blend
James Benton [Thu, 19 Apr 2012 17:13:13 +0000 (18:13 +0100)]
llvmpipe: add masking support to aos blend

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agollvmpipe: Check when a shader does not satisfy 0 < imm < 1.
James Benton [Wed, 25 Apr 2012 10:19:06 +0000 (11:19 +0100)]
llvmpipe: Check when a shader does not satisfy 0 < imm < 1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agogallivm: fixed memory leak in lp_build_tgsi_aos
James Benton [Tue, 1 May 2012 15:56:30 +0000 (16:56 +0100)]
gallivm: fixed memory leak in lp_build_tgsi_aos

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agollvmpipe: Added support for color masks in AoS blending.
James Benton [Wed, 18 Apr 2012 14:25:34 +0000 (15:25 +0100)]
llvmpipe: Added support for color masks in AoS blending.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agogallivm: added aligned pointer get/set
James Benton [Thu, 19 Apr 2012 12:13:17 +0000 (13:13 +0100)]
gallivm: added aligned pointer get/set

12 years agogallivm: llvm c-style for loops, allows us to create loops with conditions on entry...
James Benton [Thu, 19 Apr 2012 12:02:57 +0000 (13:02 +0100)]
gallivm: llvm c-style for loops, allows us to create loops with conditions on entry, rather than condition check on loop

12 years agodri/nv10-nv20: Add support for S3TC
Viktor Novotný [Tue, 1 May 2012 13:23:51 +0000 (15:23 +0200)]
dri/nv10-nv20: Add support for S3TC

Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
12 years agodri/nouveau: Add general support for compressed formats.
Viktor Novotný [Tue, 1 May 2012 13:23:50 +0000 (15:23 +0200)]
dri/nouveau: Add general support for compressed formats.

Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
12 years agoglsl: Remove some completed tasks from the old "TODO" file.
Kenneth Graunke [Tue, 1 May 2012 21:46:12 +0000 (14:46 -0700)]
glsl: Remove some completed tasks from the old "TODO" file.

12 years agoradeon/llvm: Fix build for updated LLVM 3.1 release branch
Tom Stellard [Tue, 1 May 2012 20:40:53 +0000 (16:40 -0400)]
radeon/llvm: Fix build for updated LLVM 3.1 release branch

12 years agosoftpipe: use any_swizzle() helper in sp_tex_sample.c
Brian Paul [Wed, 25 Apr 2012 16:50:06 +0000 (10:50 -0600)]
softpipe: use any_swizzle() helper in sp_tex_sample.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agosoftpipe: whitespace, comment clean-ups in sp_tex_sample.c
Brian Paul [Wed, 25 Apr 2012 16:46:09 +0000 (10:46 -0600)]
softpipe: whitespace, comment clean-ups in sp_tex_sample.c

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agosoftpipe: implement coord clamping for texel fetches (TXF)
Brian Paul [Wed, 25 Apr 2012 16:42:42 +0000 (10:42 -0600)]
softpipe: implement coord clamping for texel fetches (TXF)

The GL spec says out of bounds fetches produce undefined results.
Use clamping to avoid failed assertions or crashes.

Fixes failed assertion in https://bugs.freedesktop.org/show_bug.cgi?id=49125
but the test still fails.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>