mesa.git
12 years agoglsl: fix deref_hash memory leak in constant_expression_value
Marcin Slusarz [Tue, 5 Jun 2012 19:10:33 +0000 (21:10 +0200)]
glsl: fix deref_hash memory leak in constant_expression_value

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglcpp: .gitignore cleanup
Andreas Boll [Fri, 8 Jun 2012 17:55:51 +0000 (19:55 +0200)]
glcpp: .gitignore cleanup

*.o, *.lo and *~ are already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: .gitignore cleanup
Andreas Boll [Fri, 8 Jun 2012 17:55:50 +0000 (19:55 +0200)]
glapi: .gitignore cleanup

remove archaic .cvsignore
*.pyo is already in toplevel .gitignore
*.pyc is already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogallivm: Fix calculating rho for 3d textures for the single-quad case
Roland Scheidegger [Thu, 24 May 2012 19:05:13 +0000 (21:05 +0200)]
gallivm: Fix calculating rho for 3d textures for the single-quad case

Discovered by accident, this looks like a very old typo bug.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agoi965: Add forgotten bitcast operations in brw_fs_channel_expressions.
Kenneth Graunke [Thu, 7 Jun 2012 18:20:18 +0000 (11:20 -0700)]
i965: Add forgotten bitcast operations in brw_fs_channel_expressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: allow all buffer formats provided src and dst match.
Paul Berry [Wed, 6 Jun 2012 18:17:32 +0000 (11:17 -0700)]
i965/blorp: allow all buffer formats provided src and dst match.

Previously, blits using the "blorp" mechanism only worked for 8-bit
RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers.
This was not enough, because the blorp mechanism must be used for
blitting whenever MSAA is in use.  This patch allows all formats to be
used, provided the source and destination formats match.

So far I have confirmed that the following formats work properly with
MSAA:
- GL_RGB
- GL_RGBA
- GL_ALPHA
- GL_ALPHA4
- GL_ALPHA8
- GL_R3_G3_B2
- GL_RGB4
- GL_RGB5
- GL_RGB8
- GL_RGB10
- GL_RGB12
- GL_RGB16
- GL_RGBA2
- GL_RGBA4
- GL_RGB5_A1
- GL_RGBA8
- GL_RGB10_A2
- GL_RGBA12
- GL_RGBA16

Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on
Sandy Bridge and Ivy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: Implement logic for additional buffer formats.
Paul Berry [Wed, 6 Jun 2012 18:05:02 +0000 (11:05 -0700)]
i965/blorp: Implement logic for additional buffer formats.

Previously the blorp engine only supported RGBA8 color buffers and
24-bit depth buffers.  This patch adds support for any color buffer
format that is supported as a render target, and for 16-bit and 32-bit
depth buffers.

This required threading the brw_context struct through into
brw_blorp_surface_info::set() so that it can consult the
brw->render_target_format array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.
Paul Berry [Wed, 6 Jun 2012 17:59:56 +0000 (10:59 -0700)]
i965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.

Even though brw_blorp_surface_info is derived from brw_blorp_mip_info,
this function doesn't need to be virtual, because it is never accessed
through a base class pointer.  Making the function non-virtual will
allow it to take additional parameters in the brw_blorp_surface_info
case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: Refactor surface format determination.
Paul Berry [Wed, 6 Jun 2012 17:34:12 +0000 (10:34 -0700)]
i965/blorp: Refactor surface format determination.

This patch moves the responsibility for deciding on the format of the
source and destination surfaces from the
gen{6,7}_blorp_emit_surface_state() functions to
brw_blorp_surface_info::set(), which is shared between Gen6 and Gen7.
This will make it possible to add support for more surface formats
without code duplication.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Enable the GL_ARB_shader_bit_encode extension.
Kenneth Graunke [Thu, 7 Jun 2012 07:11:28 +0000 (00:11 -0700)]
i965: Enable the GL_ARB_shader_bit_encode extension.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agost/mesa: Finally activate the ARB_shader_bit_encoding extension.
Olivier Galibert [Tue, 8 May 2012 18:40:37 +0000 (20:40 +0200)]
st/mesa: Finally activate the ARB_shader_bit_encoding extension.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in the software renderers.
Olivier Galibert [Tue, 8 May 2012 18:40:36 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in the software renderers.

TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene).  Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_constant_expression.
Olivier Galibert [Tue, 8 May 2012 18:40:35 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_constant_expression.

A "test_out = floatBitsToUint(-1.0);" fired through the GLSL compiler
gives a correct "(assign (x) (var_ref test_out)
(constant uint (3212836864)))"

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_validate.
Olivier Galibert [Tue, 8 May 2012 18:40:34 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_validate.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_expression.
Olivier Galibert [Tue, 8 May 2012 18:40:33 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: New unary opcodes for ARB_shader_bit_encoding support.
Olivier Galibert [Tue, 8 May 2012 18:40:32 +0000 (20:40 +0200)]
glsl: New unary opcodes for ARB_shader_bit_encoding support.

The opcodes are bitcast_f2u, bitcast_f2i, bitcast_i2f and bitcast_u2f.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Scaffolding for ARB_shader_bit_encoding.
Olivier Galibert [Mon, 30 Apr 2012 11:19:01 +0000 (13:19 +0200)]
glsl: Scaffolding for ARB_shader_bit_encoding.

That adds support for activating the extension.  It doesn't actually
*do* anything yet, of course.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.
Kenneth Graunke [Wed, 6 Jun 2012 06:51:04 +0000 (23:51 -0700)]
mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.

From the issues section of the GL_ARB_texture_compression_rgtc extension:

15) What should glGetTexLevelParameter return for
    GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1
    formats?  What should glGetTexLevelParameter return for
    GL_TEXTURE_BLUE_SIZE for the RGTC2 formats?

    RESOLVED:  Zero bits.

    These formats always return 0.0 for these respective components
    and have no bits devoted to these components.

    Returning 8 bits for red size of RGTC1 and the red and green
    sizes of RGTC2 makes sense because that's the maximum potential
    precision for the uncompressed texels.

Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats
and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats.  BLUE should be 0.

Fixes oglconform/rgtc/advanced.texture_fetch.tex_param.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: Hook up loop_variable_state destructor to plug a memory leak.
Kenneth Graunke [Tue, 5 Jun 2012 22:58:41 +0000 (15:58 -0700)]
glsl: Hook up loop_variable_state destructor to plug a memory leak.

While ~loop_state() is already freeing the loop_variable_state objects
via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor
was never getting called, so the hash table inside loop_variable_state
was never getting destroyed.

Fixes a memory leak in any shader with loops.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoradeon/llvm: Emulate RECIP_UINT instruction on Cayman
Tom Stellard [Wed, 6 Jun 2012 17:24:48 +0000 (13:24 -0400)]
radeon/llvm: Emulate RECIP_UINT instruction on Cayman

12 years agoradeon/llvm: Remove some duplicate code in the R600 CodeEmitter
Tom Stellard [Wed, 6 Jun 2012 15:40:34 +0000 (11:40 -0400)]
radeon/llvm: Remove some duplicate code in the R600 CodeEmitter

12 years agoradeon/llvm: Fix MULLO* instructions on Cayman
Tom Stellard [Wed, 6 Jun 2012 15:35:48 +0000 (11:35 -0400)]
radeon/llvm: Fix MULLO* instructions on Cayman

On Cayman, the MULLO* instructions must fill all slots in an
instruction group.

12 years agor600g: Compute support for Cayman
Tom Stellard [Tue, 5 Jun 2012 17:11:11 +0000 (13:11 -0400)]
r600g: Compute support for Cayman

12 years agoxorg: port to new compat API.
Dave Airlie [Wed, 6 Jun 2012 14:20:24 +0000 (15:20 +0100)]
xorg: port to new compat API.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: consolidate internal glCompressedTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCompressedTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glCompressedTexImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCompressedTexImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glCopyTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCopyTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glTexImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glTexImage1/2/3D code

The functions for handling 1D, 2D and 3D texture images were nearly
identical.  This folds them all together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agotranslate_test: add support for half floats
Brian Paul [Tue, 5 Jun 2012 15:03:45 +0000 (09:03 -0600)]
translate_test: add support for half floats

Fixes assertion reported in
https://bugs.freedesktop.org/show_bug.cgi?id=44519
but there's still failing cases.

12 years agodocs: remove documentation of old Makefile system
Brian Paul [Fri, 1 Jun 2012 15:19:36 +0000 (09:19 -0600)]
docs: remove documentation of old Makefile system

It's going away in the near future.

12 years agoradeon/llvm: Remove obselete hooks for the ConvertToISA pass
Tom Stellard [Wed, 6 Jun 2012 00:10:31 +0000 (20:10 -0400)]
radeon/llvm: Remove obselete hooks for the ConvertToISA pass

We can't remove this pass yet, because we need it to convert AMDIL
registers in BRANCH* instructions, but we don't need it for
instruction conversion any more.

12 years agoradeon/llvm: Remove AMDIL MOVE* instructions
Tom Stellard [Wed, 6 Jun 2012 00:48:41 +0000 (20:48 -0400)]
radeon/llvm: Remove AMDIL MOVE* instructions

12 years agoradeon/llvm: Add isMov() to AMDILInstrInfo
Tom Stellard [Sat, 2 Jun 2012 13:51:04 +0000 (09:51 -0400)]
radeon/llvm: Add isMov() to AMDILInstrInfo

This enables the CFGStructurizer to work without the AMDIL::MOV*
instructions.

12 years agoradeon/llvm: Remove deadcode from the AMDILISelLowering class
Tom Stellard [Sat, 2 Jun 2012 13:51:04 +0000 (09:51 -0400)]
radeon/llvm: Remove deadcode from the AMDILISelLowering class

12 years agoradeon/llvm: Don't lower RETURN to S_ENDPGM on SI
Tom Stellard [Sat, 2 Jun 2012 11:57:54 +0000 (07:57 -0400)]
radeon/llvm: Don't lower RETURN to S_ENDPGM on SI

Instead create an S_ENDPGM instruction in the CodeEmitter and emit
it after all the other instructions.

12 years agoradeon/llvm: Remove AMDIL VCREATE* instructions
Tom Stellard [Sat, 2 Jun 2012 11:09:16 +0000 (07:09 -0400)]
radeon/llvm: Remove AMDIL VCREATE* instructions

This obsoletes the AMDGPULowerInstruction pass.

12 years agoradeon/llvm: Remove AMDIL LOADCONST* instructions
Tom Stellard [Sat, 2 Jun 2012 10:16:18 +0000 (06:16 -0400)]
radeon/llvm: Remove AMDIL LOADCONST* instructions

This obsoletes the R600LowerInstruction and SIPropagateImmReads passes.

12 years agonouveau: fix scratch buffer leak
Marcin Slusarz [Tue, 5 Jun 2012 21:26:05 +0000 (23:26 +0200)]
nouveau: fix scratch buffer leak

...and create common function for destroying nouveau_context

12 years agonv50: fix nv50_stream_output_state leak
Marcin Slusarz [Tue, 5 Jun 2012 18:26:54 +0000 (20:26 +0200)]
nv50: fix nv50_stream_output_state leak

12 years agonv50: fix symbol table memory leak
Marcin Slusarz [Tue, 5 Jun 2012 18:18:33 +0000 (20:18 +0200)]
nv50: fix symbol table memory leak

12 years agoi965/fs: Fix user-defined FS outputs with less than four components.
Kenneth Graunke [Fri, 1 Jun 2012 20:16:58 +0000 (13:16 -0700)]
i965/fs: Fix user-defined FS outputs with less than four components.

OpenGL allows you to declare user-defined fragment shader outputs with
less than four components:

    out ivec2 color;

This makes sense if you're rendering to an RG format render target.

Previously, we assumed that all color outputs had four components (like
the built-in gl_FragColor/gl_FragData variables).  This caused us to
call emit_color_write for invalid indices, incrementing the output
virtual GRF's reg_offset beyond the size of the register.

This caused cascading failures: split_virtual_grfs would allocate new
size-1 registers based on the virtual GRF size, but then proceed to
rewrite the out-of-bounds accesses assuming that it had allocated enough
new (contiguously numbered) registers.  This resulted in instructions
that accessed size-1 GRFs which register numbers beyond
virtual_grf_next (i.e. registers that were never allocated).

Finally, this manifested as live variable analysis and instruction
scheduling accessing their temporary array with an out of bounds index
(as they're all sized based on virtual_grf_next), and the program would
segfault.

It looks like the hardware's Render Target Write message requires you to
send four components, even for RT formats such as RG or RGB.  This patch
continues to use all four MRFs, but doesn't bother to fill any data for
the last few, which should be unused.

+2 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965/vs: Fix texelFetchOffset() on pre-Gen7.
Kenneth Graunke [Mon, 4 Jun 2012 21:12:15 +0000 (14:12 -0700)]
i965/vs: Fix texelFetchOffset() on pre-Gen7.

Commit 4650aea7a536ddce120576fadb91845076e8e37a fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

NOTE: This and 4650aea7a536ddce are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Fix texelFetchOffset() on pre-Gen7.
Kenneth Graunke [Mon, 4 Jun 2012 21:07:13 +0000 (14:07 -0700)]
i965/fs: Fix texelFetchOffset() on pre-Gen7.

Commit f41ecade7b458c02d504158b522acb2231585040 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

NOTE: This and f41ecade7b458 are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agometa: Fix GL_RENDERBUFFER binding in decompress_texture_image().
Kenneth Graunke [Mon, 4 Jun 2012 18:40:23 +0000 (11:40 -0700)]
meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().

This isn't saved/restored by _mesa_meta_begin, so we need to do it
manually (like we do for the read/draw framebuffers).  Additionally,
we neglected to re-bind before the glRenderbufferStorage call.

+13 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Unbind ARB_transform_feedback2 binding points on Delete too.
Kenneth Graunke [Mon, 4 Jun 2012 07:51:34 +0000 (00:51 -0700)]
mesa: Unbind ARB_transform_feedback2 binding points on Delete too.

DeleteBuffer needs to unbind from these binding points as well, based on
the same rationale as the previous patch.

+51 oglconforms (together with the last patch).

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
Kenneth Graunke [Mon, 4 Jun 2012 07:48:23 +0000 (00:48 -0700)]
mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.

_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.

Now you can unbind your buffers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
Kenneth Graunke [Mon, 4 Jun 2012 05:34:32 +0000 (22:34 -0700)]
mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.

According to the GL 3.1 spec, section 2.9 ("Buffer Objects"):
"If a buffer object is deleted while it is bound, all bindings to that
 object in the current context (i.e. in the thread that called
 DeleteBuffers) are reset to zero."

The code already checked for a number of cases, but neglected these
newer binding points.

+21 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl/builtins: Fix textureGrad() for Array samplers.
Kenneth Graunke [Fri, 1 Jun 2012 09:56:50 +0000 (02:56 -0700)]
glsl/builtins: Fix textureGrad() for Array samplers.

We were incorrectly assuming that the coordinate's dimensionality is
equal to the gradient's dimensionality.  For array types, the coordinate
has one more component.

Fixes 12 subcases of oglconform's glsl-bif-tex-grad test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoconfigure.ac: Fail if egl x11 platform dependencies are not available
Kristian Høgsberg [Fri, 1 Jun 2012 18:14:20 +0000 (14:14 -0400)]
configure.ac: Fail if egl x11 platform dependencies are not available

Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available
we just silently fail and disables building the EGL DRI2 driver.

This commit cleans up the EGL platfrom checking and fails if a selected
platform can't find its required dependencies.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agor600g: add new Trinity PCI ids
Alex Deucher [Tue, 5 Jun 2012 14:16:42 +0000 (10:16 -0400)]
r600g: add new Trinity PCI ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: add new Sumo, Palm, BTC pci ids
Alex Deucher [Tue, 5 Jun 2012 14:15:16 +0000 (10:15 -0400)]
r600g: add new Sumo, Palm, BTC pci ids

Note this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoradeonsi: add new SI pci ids
Alex Deucher [Tue, 5 Jun 2012 14:12:21 +0000 (10:12 -0400)]
radeonsi: add new SI pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoFix .gitignore for ralloc-test
Paul Berry [Mon, 4 Jun 2012 22:44:48 +0000 (15:44 -0700)]
Fix .gitignore for ralloc-test

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agost/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Vinson Lee [Thu, 19 Apr 2012 05:57:58 +0000 (22:57 -0700)]
st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.

Fix uninitialized scalar field defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
12 years agoi965: Implement texture buffer objects on Gen6.
Kenneth Graunke [Fri, 1 Jun 2012 11:19:27 +0000 (04:19 -0700)]
i965: Implement texture buffer objects on Gen6.

Commit a07cf3397e332388d3599c83e50ac45511972890 added support for TBOs
on Gen7, but missed Gen6.

Passes piglit -t texture_buffer and oglconform's buffermapping
basic.read.texture tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
Kenneth Graunke [Sat, 28 Jan 2012 00:09:48 +0000 (16:09 -0800)]
mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).

According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE,
TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on
glPopAttrib(GL_TEXTURE_BIT).

Makes a number of oglconform tests happier.

v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture
    extensions, as suggested by Brian.  I'm not sure that any
    implementations still remain that don't support those, but why not?

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoautomake: Connect the libdricore target to make clean.
Eric Anholt [Wed, 30 May 2012 20:31:27 +0000 (13:31 -0700)]
automake: Connect the libdricore target to make clean.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: use -m32 in CCASFLAGS when using --enable-32-bit
Tapani Pälli [Thu, 31 May 2012 06:32:45 +0000 (09:32 +0300)]
automake: use -m32 in CCASFLAGS when using --enable-32-bit

this fixes libdricore directory build with --enable-32-bit on a x86_64 system

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoradeon/llvm: Fix VTX_READ patterns
Tom Stellard [Fri, 1 Jun 2012 18:49:03 +0000 (14:49 -0400)]
radeon/llvm: Fix VTX_READ patterns

The VTX_READ instructions were using the ADDRParam ComplexPattern which
allows a load instruction's offset to be a register, but VTX_READ
instructions can only handle an immediate offset.

Also, the load_param pattern fragment had an erroneous return true;
statement that was causing it to match the wrong load instructions.

12 years agoradeon/llvm: Emit 2 bytes for vertex fetch offsets
Tom Stellard [Fri, 1 Jun 2012 20:08:41 +0000 (16:08 -0400)]
radeon/llvm: Emit 2 bytes for vertex fetch offsets

12 years agoradeon/llvm: Only use indirect (vertex fetch) parameters for kernels
Tom Stellard [Fri, 1 Jun 2012 20:10:06 +0000 (16:10 -0400)]
radeon/llvm: Only use indirect (vertex fetch) parameters for kernels

Kernel parameters can only be retrieved via vertex fetchs.  Direct
parameters (i.e parameters stored in the constant buffer) are not
supported yet.

12 years agointel: Change vendor string to "Intel Open Source Technology Center".
Kenneth Graunke [Thu, 31 May 2012 23:19:17 +0000 (16:19 -0700)]
intel: Change vendor string to "Intel Open Source Technology Center".

Tungsten Graphics has not existed for several years, and the majority of
ongoing development and support is done by Intel.  I chose to include
"Open Source Technology Center" to distinguish it from, say, the closed
source Windows OpenGL driver.

The one downside to this patch is that applications that pattern match
against "Intel" may start applying workarounds meant for the Windows
driver.  However, it does seem like the right thing to do.

This does change oglconform behavior.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Remove spurious printf messages
Ian Romanick [Fri, 18 May 2012 23:25:31 +0000 (16:25 -0700)]
glsl: Remove spurious printf messages

These look like debug messages from the switch-statement development.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoradeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions
Tom Stellard [Fri, 1 Jun 2012 00:35:18 +0000 (20:35 -0400)]
radeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions

Add some hooks to the R600,SI InstrInfo and RegisterInfo classes, so
that the CFGStructurizer pass can run without any relying on AMDIL
instructions.

12 years agoradeon/llvm: Change prefix on tablegen files to AMDGPU
Tom Stellard [Wed, 30 May 2012 23:23:39 +0000 (19:23 -0400)]
radeon/llvm: Change prefix on tablegen files to AMDGPU

12 years agoradeon/llvm: Remove deadcode from the R600LowerInstructions pass
Tom Stellard [Thu, 31 May 2012 20:02:37 +0000 (16:02 -0400)]
radeon/llvm: Remove deadcode from the R600LowerInstructions pass

12 years agoradeon/llvm: Remove AMDIL GLOBALSTORE* instructions
Tom Stellard [Thu, 31 May 2012 19:58:17 +0000 (15:58 -0400)]
radeon/llvm: Remove AMDIL GLOBALSTORE* instructions

12 years agoradeon/llvm: Remove AMDIL GLOBALLOAD* instructions
Tom Stellard [Thu, 31 May 2012 18:03:29 +0000 (14:03 -0400)]
radeon/llvm: Remove AMDIL GLOBALLOAD* instructions

12 years agor600g: compute support for evergreen
Adam Rak [Wed, 30 Nov 2011 21:20:41 +0000 (22:20 +0100)]
r600g: compute support for evergreen

Tom Stellard:
  - Updated for gallium interface changes
  - Fixed a few bugs:
    + Set the loop counter
    + Calculate the correct number of pipes
  - Added hooks into the LLVM compiler

12 years agoclover: Add function for building a clover::module for non-TGSI targets v6
Tom Stellard [Tue, 24 Apr 2012 16:44:53 +0000 (12:44 -0400)]
clover: Add function for building a clover::module for non-TGSI targets v6

v2:
  -Separate IR type and LLVM triple
  -Do the OpenCL C->LLVM IR and linking steps for all PIPE_SHADER_IR
   types.

v3:
  - Coding style fixes
  - Removed compatibility code for LLVM < 3.1
  - Split build_module_llvm() into three functions:
    compile(), link(), and build_module_llvm()

v4:
  - Use struct pipe_compute_program

v5:
  - Don't malloc memory for struct pipe_llvm_program

v6:
  - Fix serialization of llvm bytecode

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agogallium: Add struct pipe_llvm_program_header v3
Tom Stellard [Fri, 25 May 2012 12:20:06 +0000 (08:20 -0400)]
gallium: Add struct pipe_llvm_program_header v3

This structure is used as a header that precedes LLVM bytecode programs
that are passed to the drivers.

v2:
  - s/pipe_compute_program/pipe_llvm_program/

v3:
  - Rename to struct pipe_llvm_program_header
  - Drop the char * prog member

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agoclover: Remove target argument from compile_program_tgsi()
Tom Stellard [Fri, 25 May 2012 12:15:02 +0000 (08:15 -0400)]
clover: Remove target argument from compile_program_tgsi()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agoclover: Add constructors to some of the module classes v3
Tom Stellard [Tue, 24 Apr 2012 16:36:34 +0000 (12:36 -0400)]
clover: Add constructors to some of the module classes v3

This is for the llvm code that can't use extended initializers.

v2:
  - Use const references for vector arguments
  - Move constructor defs before data members
  - Initialize all values in the default constructors

v3:
  - Fix typo

12 years agoclover: Add necessary flags to libclllvm_la_CXXFLAGS
Tom Stellard [Tue, 24 Apr 2012 14:42:56 +0000 (10:42 -0400)]
clover: Add necessary flags to libclllvm_la_CXXFLAGS

$(LLVM_CFLAGS) for LLVM defines
-DLIBCLC_PATH for libclc path
-DCLANG_RESOURCE_DIR for clang includes
$(DEFINES) for -DHAVE_LLVM

12 years agoclover: Link to the necessary LLVM and Clang libs
Tom Stellard [Wed, 2 May 2012 15:06:13 +0000 (11:06 -0400)]
clover: Link to the necessary LLVM and Clang libs

12 years agoconfigure.ac: Add variables LLVM_CPPFLAGS and LLVM_LIBDIR
Tom Stellard [Tue, 24 Apr 2012 14:34:57 +0000 (10:34 -0400)]
configure.ac: Add variables LLVM_CPPFLAGS and LLVM_LIBDIR

12 years agoconfigure.ac: Add option for libclc path
Tom Stellard [Mon, 12 Mar 2012 17:53:20 +0000 (13:53 -0400)]
configure.ac: Add option for libclc path

12 years agoclover: Add a function for retrieving a device's preferred ir v3
Tom Stellard [Mon, 23 Apr 2012 16:09:08 +0000 (12:09 -0400)]
clover: Add a function for retrieving a device's preferred ir v3

A device now has two function for getting information about the IR
it needs to return.

ir_format() => returns the preferred IR
ir_target() => returns the triple for the target that is understood by
                 clang/llvm.

v2:
  - renamed ir_target() to ir_format()
  - renamed llvm_triple() to ir_target()

v3:
  - Remove unnecessary include
  - Do proper conversion from std::vector<char> to std::string

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agogallium/compute: Add PIPE_COMPUTE_CAP_IR_TARGET v4
Francisco Jerez [Fri, 23 Mar 2012 00:40:40 +0000 (01:40 +0100)]
gallium/compute: Add PIPE_COMPUTE_CAP_IR_TARGET v4

v2: Tom Stellard
  - Update CAP description

v3: Tom Stellard
  - TGSI targets should pass an empty string for this CAP.

v4: Tom Stellard
  - TGSI targets can ignore this CAP.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agogallium: Add PIPE_SHADER_IR_LLVM to enum pipe_shader_ir v2
Tom Stellard [Mon, 23 Apr 2012 16:08:02 +0000 (12:08 -0400)]
gallium: Add PIPE_SHADER_IR_LLVM to enum pipe_shader_ir v2

v2:
  - s/PIPE_SHADER_IR_LLVM_R600/PIPE_SHADER_IR_LLVM/

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agoconfigure.ac: Add HAVE_OPENCL AM_CONDITIONAL v2
Tom Stellard [Fri, 20 Apr 2012 18:46:45 +0000 (14:46 -0400)]
configure.ac: Add HAVE_OPENCL AM_CONDITIONAL v2

v2:
  - Drop HAVE_OPENCL variable for non-automake builds
  - s/HAVE_OPENCL/HAVE_GALLIUM_COMPUTE

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agoscons: generate the glapitable.h file too
Brian Paul [Fri, 1 Jun 2012 14:27:21 +0000 (08:27 -0600)]
scons: generate the glapitable.h file too

12 years agosvga: fix saturated TEX instructions
Brian Paul [Wed, 30 May 2012 22:47:34 +0000 (16:47 -0600)]
svga: fix saturated TEX instructions

TEX instructions can't do saturation.  Do the TEX into a temp reg w/out
saturation, then do a MOV_SAT.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agoscons: add code to generate the various GL API files
Brian Paul [Wed, 30 May 2012 16:08:11 +0000 (10:08 -0600)]
scons: add code to generate the various GL API files

This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475

12 years agodraw: simplify index buffer specification
Brian Paul [Fri, 25 May 2012 15:44:53 +0000 (09:44 -0600)]
draw: simplify index buffer specification

Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with
draw_set_indexes() which simply takes a pointer and an index size.

12 years agoglsl/tests: Plumb $(PYTHON2) and $(PYTHON_FLAGS) into optimization-test.
Kenneth Graunke [Tue, 29 May 2012 18:16:34 +0000 (11:16 -0700)]
glsl/tests: Plumb $(PYTHON2) and $(PYTHON_FLAGS) into optimization-test.

Some distributions (like Arch Linux) make /usr/bin/python Python 3,
rather than Python 2.  Since compare_ir uses /usr/bin/env python,
such systems will fail to run optimization-test, causing 'make check' to
always fail.

Automake's TESTS_ENVIRONMENT variable provides a mechanism to run
programs or set environment variables in the test environment.
Ideally, I think we would want to use AM_TESTS_ENVIRONMENT, since
TESTS_ENVIRONMENT is supposed to be user-overridable.  However, it isn't
supported using the default/serial test runner.

Fixes 'make check' on Arch Linux and Gentoo.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
12 years agoralloc: Add some basic unit tests.
Kenneth Graunke [Tue, 22 May 2012 02:23:48 +0000 (19:23 -0700)]
ralloc: Add some basic unit tests.

I started writing unit tests for a new piece of code, and discovered
they all failed due to a bug in ralloc.  Clearly it needs a test suite.

v2: Rename to 'ralloc-test' and fix copyright date.  (idr review)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoralloc: Fix ralloc_parent() of memory allocated out of the NULL context.
Kenneth Graunke [Tue, 22 May 2012 02:34:13 +0000 (19:34 -0700)]
ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.

If an object is allocated out of the NULL context, info->parent will be
NULL.  Using the PTR_FROM_HEADER macro would be incorrect: it would say
that ralloc_parent(ralloc_context(NULL)) == sizeof(ralloc_header).

Fixes the new "null_parent" unit test.

NOTE: This is a candidate for the 7.9, 7.10, 7.11, and 8.0 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Check for 'indent' and fall back to 'cat' if not found.
Kenneth Graunke [Tue, 29 May 2012 23:03:05 +0000 (16:03 -0700)]
automake: Check for 'indent' and fall back to 'cat' if not found.

The glapi generator code uses indent to produce more readable code.
However, we don't want to make GNU indent a hard build dependency; check
for it in configure.ac and fall back to 'cat' if it's not available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50484
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
12 years agomesa: don't compile integer clear shaders for unsupported APIs
Oliver McFadden [Sat, 26 May 2012 07:13:07 +0000 (10:13 +0300)]
mesa: don't compile integer clear shaders for unsupported APIs

Discovered while running the Khronos conformance test suite and
receiving "implementation error: meta program compile failed."

This bug was recently introduced by the i965 clear patch set and would
only be detected while using the ES2 API and only on gen6+ hardware.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: Implement destination clipping and scissoring
Paul Berry [Mon, 14 May 2012 17:19:08 +0000 (10:19 -0700)]
i965/blorp: Implement destination clipping and scissoring

This patch implements clipping and scissoring of the destination rect
for blits that use the blorp engine (e.g. MSAA blits).

12 years agomesa: Clean up some dricore-related detritus in the old Makefile.
Eric Anholt [Thu, 24 May 2012 22:53:09 +0000 (15:53 -0700)]
mesa: Clean up some dricore-related detritus in the old Makefile.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Convert dricore building to automake.
Eric Anholt [Thu, 24 May 2012 20:59:21 +0000 (13:59 -0700)]
automake: Convert dricore building to automake.

This is performed in a subdirectory to avoid needing to convert all of
src/mesa/Makefile in one go.

I can now cherry-pick a commit containing glapi XML changes, do "(cd
src/mapi/glapi/gen && make) && make", and get a working driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Add a prefix variable to the common sources lists.
Eric Anholt [Thu, 24 May 2012 22:25:09 +0000 (15:25 -0700)]
automake: Add a prefix variable to the common sources lists.

In order to do the minimal change for libdricore conversion to
automake, I need to put its Makefile.am in a subdirectory.  Automake
gets whiny/broken if you use GNU make features like "addprefix" or
"$(FILES:%=../%)" to munge your *_SOURCES.  So, use a plain old
variable to be able to substitute in that "../"

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Rename variables in sources.mak to be automake compatible.
Eric Anholt [Wed, 16 May 2012 16:09:18 +0000 (09:09 -0700)]
automake: Rename variables in sources.mak to be automake compatible.

*_SOURCES is reserved for files lists for particular automake targets.
 Also, "-" in the variable names is not allowed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Remove generated source files during make clean.
Eric Anholt [Thu, 24 May 2012 17:55:08 +0000 (10:55 -0700)]
mesa: Remove generated source files during make clean.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: Enable silent rules for generation when used from automake.
Eric Anholt [Thu, 24 May 2012 22:56:27 +0000 (15:56 -0700)]
glapi: Enable silent rules for generation when used from automake.

This variable won't be set when called from non-automake makefiles,
but it cleans up shared-glapi's output.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoshared-glapi: Don't forget to clean our built file.
Eric Anholt [Thu, 24 May 2012 22:54:40 +0000 (15:54 -0700)]
shared-glapi: Don't forget to clean our built file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Restore installing of libGL for non-dri builds.
Eric Anholt [Thu, 24 May 2012 23:16:28 +0000 (16:16 -0700)]
mesa: Restore installing of libGL for non-dri builds.

Reported-by: Sven Joachim <svenjoac@gmx.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>