Commit Graph

50545 Commits

Author SHA1 Message Date
Tom Stellard a8d82c44f7 radeon/llvm: Remove the EXPORT_REG instruction 2012-05-08 15:47:46 -04:00
Tom Stellard 8a4c25dd7e radeon/llvm: Use a custom inserter to lower RESERVE_REG 2012-05-08 15:47:46 -04:00
Tom Stellard 94e797d0fa radeon/llvm: Use a custom inserter to lower STORE_OUTPUT 2012-05-08 15:47:46 -04:00
Tom Stellard 4226433625 radeon/llvm: Remove AMDGPULowerShaderInstructions class
It is no longer used.
2012-05-08 15:47:46 -04:00
Tom Stellard ad385c402e radeon/llvm: Use a custom inserter to lower LOAD_INPUT 2012-05-08 15:47:45 -04:00
Tom Stellard 52a7f212d3 radeon/llvm: Remove the ReorderPreloadInstructions pass 2012-05-08 15:47:45 -04:00
Tom Stellard e042b3aeed radeon/llvm: Remove old comment from AMDIL.h 2012-05-08 15:47:45 -04:00
Paul Berry e19741c4d8 Add bin/compile to .gitignore
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 13:10:00 -07:00
Olivier Galibert 363c14ae0c glsl: Change built-in constant expression evaluation to run the IR.
This removes code duplication with
ir_expression::constant_expression_value and builtins/ir/*.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert 2ff7b121ca 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>
2012-05-08 12:55:52 -07:00
Olivier Galibert 8ec01ba2ff 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]
2012-05-08 12:55:50 -07:00
Olivier Galibert a270e86d38 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]
2012-05-08 12:55:47 -07:00
Olivier Galibert 6e4852a3a5 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]
2012-05-08 12:55:46 -07:00
Olivier Galibert 27a198388e 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]
2012-05-08 12:55:38 -07:00
Kenneth Graunke f72e9b2041 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>
2012-05-08 12:28:44 -07:00
Brian Paul c55ebc3e3e vbo: add some comments 2012-05-08 12:12:03 -06:00
Brian Paul ad5e3609d4 mesa: remove needless casts in save_EdgeFlag() 2012-05-08 12:12:03 -06:00
Brian Paul 2428de1c50 mesa: minor clean-ups in dlist material code 2012-05-08 12:12:03 -06:00
Brian Paul b13ecbadea mesa: fix error strings in dlist code 2012-05-08 12:12:03 -06:00
Marek Olšák c5e473fbe2 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>
2012-05-08 15:57:51 +02:00
Marek Olšák 50f7e75f9e 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>
2012-05-08 15:57:51 +02:00
Marek Olšák a7ac9c9c7d 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>
2012-05-08 15:57:51 +02:00
Vadim Girlin d6aa7cd7f8 radeon/llvm: add suport for cube textures
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin e98e209528 radeon/llvm: add support for CUBE ALU instruction
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin 996fa375ec 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>
2012-05-08 01:18:23 +04:00
Vadim Girlin e9be193430 radeon/llvm: add missing cases for BREAK/CONTINUE
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin e740b60845 radeon/llvm: add support for AHSR/LSHR/LSHL instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin 95ed0e9b6b radeon/llvm: add support for TXQ/TXF/DDX/DDY instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin d8a1204854 radeon/llvm: add support for VertexID, InstanceID
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin e3e7ae732c 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>
2012-05-08 01:18:22 +04:00
Vadim Girlin 757f471ba9 radeon/llvm: add support for v4i32
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin 06db74a753 radeon/llvm: fix ABS_i32 instruction lowering
Swap source operands.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin 3a6a1cd75f 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>
2012-05-08 01:18:22 +04:00
Vadim Girlin 2a88dfc521 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>
2012-05-08 01:18:21 +04:00
Tom Stellard 3f8c37967a r600g: Fix out of tree builds that use the LLVM backend
https://bugs.freedesktop.org/show_bug.cgi?id=49567
2012-05-07 15:05:25 -04:00
Tom Stellard c425c3823f 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
2012-05-07 14:01:53 -04:00
Paul Berry 714b4f6184 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>
2012-05-07 10:50:33 -07:00
Paul Berry a683012a80 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>
2012-05-07 10:50:04 -07:00
Paul Berry b9819a027d 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>
2012-05-07 10:48:53 -07:00
Paul Berry 3ec0e55b63 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>
2012-05-07 10:47:49 -07:00
Chad Versace 1c0f5d8324 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>
2012-05-07 08:38:12 -07:00
Brian Paul 64c510bb72 mesa: bump version to 8.1.0 in configs/default 2012-05-07 07:30:04 -06:00
Marcin Slusarz ecc7e5e85b nv50: handle VP without inputs 2012-05-07 14:05:35 +02:00
Christoph Bumiller c19672f90a nvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc 2012-05-06 22:03:06 +02:00
Christoph Bumiller 28d6a268af nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs 2012-05-06 22:03:06 +02:00
Christoph Bumiller 38a20281fc nvc0/ir: fix lowering of textureGrad 2012-05-06 22:03:06 +02:00
Christoph Bumiller 9dfac63ae0 nouveau: fix nouveau_scratch_runout_release bo count underflow 2012-05-06 22:03:06 +02:00
Jordan Justen 5795d3b5ae 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>
2012-05-05 20:35:08 -07:00
Baldo Davide 0ad0bc5af5 auxiliary/os: Add missing signal.h include.
The signal.h include was missed in the commit
bc16c73407 which leads to broken
compilations under Linux.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-05 04:51:32 +01:00
Kenneth Graunke 3cd7bee48f 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>
2012-05-04 17:19:43 -07:00