profile/ivi/mesa.git
12 years agovbo: call UpdateState directly when notifying a driver about _NEW_ARRAY
Marek Olšák [Sun, 22 Apr 2012 17:21:45 +0000 (19:21 +0200)]
vbo: call UpdateState directly when notifying a driver about _NEW_ARRAY

Core Mesa doesn't need to know about this.

This also removes the hack in recalculate_input_bindings.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agovbo: do FLUSH_CURRENT before validating and updating state
Marek Olšák [Sun, 22 Apr 2012 14:36:38 +0000 (16:36 +0200)]
vbo: do FLUSH_CURRENT before validating and updating state

This fixes an assertion failure since:
   commit 81afdd20f3f574ce29559d8ad77df5c77652009e
   vbo: don't check twice whether it's valid to render

FLUSH_CURRENT may set _NEW_CURRENT_ATTRIB.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agor300g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Marek Olšák [Thu, 19 Apr 2012 02:33:43 +0000 (04:33 +0200)]
r300g/automake: add $ARCH_FLAGS and $OPT_FLAGS

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Marek Olšák [Thu, 19 Apr 2012 02:33:43 +0000 (04:33 +0200)]
r600g/automake: add $ARCH_FLAGS and $OPT_FLAGS

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: init vars to silence warnings
Brian Paul [Mon, 23 Apr 2012 19:29:06 +0000 (13:29 -0600)]
r600g: init vars to silence warnings

12 years agobin/mklib: remove '-m32' for arm linux
Han Shen(沈涵) [Mon, 23 Apr 2012 14:28:12 +0000 (08:28 -0600)]
bin/mklib: remove '-m32' for arm linux

-m32 is not a valid option for ARM.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: no-op glCopyPixels if source region is out of bounds
Brian Paul [Fri, 20 Apr 2012 22:45:12 +0000 (16:45 -0600)]
st/mesa: no-op glCopyPixels if source region is out of bounds

If the source region for a glCopyPixels is completely outside the
source buffer bounds, no-op the copy.  Fixes a failed assertion.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agoradeon/llvm: Don't print an error message when there is no error
Tom Stellard [Fri, 20 Apr 2012 13:12:47 +0000 (09:12 -0400)]
radeon/llvm: Don't print an error message when there is no error

A blank line with an empty error message was being printed even when the
target lookup succeeded.

12 years agoradeon/llvm: Lower VCREATE_v4f32 for R600 and SI
Tom Stellard [Thu, 19 Apr 2012 14:14:41 +0000 (10:14 -0400)]
radeon/llvm: Lower VCREATE_v4f32 for R600 and SI

12 years agor600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG
Tom Stellard [Thu, 19 Apr 2012 14:09:52 +0000 (10:09 -0400)]
r600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG

12 years agor600g/llvm: Only emit an instruction's explicit operands
Tom Stellard [Thu, 19 Apr 2012 15:47:08 +0000 (11:47 -0400)]
r600g/llvm: Only emit an instruction's explicit operands

12 years agor600g/llvm: Handle copies between vector registers
Tom Stellard [Fri, 20 Apr 2012 13:07:37 +0000 (09:07 -0400)]
r600g/llvm: Handle copies between vector registers

12 years agor600g/llvm: Remove debugging hack from R600InstrInfo::copyPhysReg()
Tom Stellard [Thu, 19 Apr 2012 19:19:21 +0000 (15:19 -0400)]
r600g/llvm: Remove debugging hack from R600InstrInfo::copyPhysReg()

12 years agor600g/llvm: Tell the code emitter to ignore KILL and BUNDLE
Tom Stellard [Thu, 19 Apr 2012 14:12:05 +0000 (10:12 -0400)]
r600g/llvm: Tell the code emitter to ignore KILL and BUNDLE

12 years agor600/llvm: Add LOAD_VTX instruction
Tom Stellard [Tue, 28 Feb 2012 22:32:28 +0000 (17:32 -0500)]
r600/llvm: Add LOAD_VTX instruction

12 years agor600g: Add hooks for the LLVM shader compiler
Tom Stellard [Tue, 17 Apr 2012 13:26:28 +0000 (09:26 -0400)]
r600g: Add hooks for the LLVM shader compiler

The LLVM backend can now be enabled for r600g by using the
--enable-r600-llvm-compiler configure flag.  If you configure with this
flag, you can still use the default compiler by setting the envrionment
variable R600_USE_LLVM=0

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: Add TGSI->LLVM implementation v2
Tom Stellard [Tue, 17 Apr 2012 12:37:38 +0000 (08:37 -0400)]
r600g: Add TGSI->LLVM implementation v2

v2: Add case for ARUBA in r600_llvm_gpu_string()

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoradeon: Move radeon_llvm_emit.cpp declarations into their own header
Tom Stellard [Mon, 16 Apr 2012 21:48:44 +0000 (17:48 -0400)]
radeon: Move radeon_llvm_emit.cpp declarations into their own header

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoradeon: Remove HAVE_LLVM ifdefs
Tom Stellard [Mon, 16 Apr 2012 21:47:04 +0000 (17:47 -0400)]
radeon: Remove HAVE_LLVM ifdefs

Only LLVM 3.1 is supported, so these are not necessary.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: fix gpr number calculation
Vadim Girlin [Fri, 16 Dec 2011 03:32:07 +0000 (07:32 +0400)]
r600g: fix gpr number calculation

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
12 years agoconfigure.ac: Move HAVE_LLVM definition into configure.ac
Tom Stellard [Tue, 17 Apr 2012 13:24:29 +0000 (09:24 -0400)]
configure.ac: Move HAVE_LLVM definition into configure.ac

Otherwise HAVE_LLVM won't be included in the $(DEFINES) variable for
Automake generated Makefiles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: split add_reg into add_reg and add_reg_bo variants
Dave Airlie [Mon, 23 Apr 2012 09:20:10 +0000 (10:20 +0100)]
r600g: split add_reg into add_reg and add_reg_bo variants

This shaves 2k off the final dri.so, and removes lots of pointless
NULL, 0 passing.

most like pointless - but it looked nicer to me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglapi: Correct size of allocated _glapi_table struct
Jonas Maebe [Mon, 23 Apr 2012 03:39:32 +0000 (20:39 -0700)]
glapi: Correct size of allocated _glapi_table struct

The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agor600g: enable GLSL130 on all cards
Dave Airlie [Sun, 22 Apr 2012 07:09:05 +0000 (08:09 +0100)]
r600g: enable GLSL130 on all cards

Alexandre Demers sent me some cayman results with no major problems.

I'll rip out the env var in a week or so.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: enable dual src blending on r600 cards
Dave Airlie [Sat, 21 Apr 2012 16:46:35 +0000 (17:46 +0100)]
r600g: enable dual src blending on r600 cards

tested on my rv610 and it passes the tests with no hangs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: enable GLSL 1.30 for r600 class
Dave Airlie [Sat, 21 Apr 2012 16:40:32 +0000 (17:40 +0100)]
r600g: enable GLSL 1.30 for r600 class

Full piglit run on my rv610 with no regressions.

This only leaves cayman, however my cayman is resisting my attempt
to get through a full piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600: enable glsl 1.30 on r700
Dave Airlie [Sat, 21 Apr 2012 09:37:08 +0000 (10:37 +0100)]
r600: enable glsl 1.30 on r700

I've done a piglit run on rv740 and confirmed no regressions.

We don't get GL3 on r700 due to transform feedback being busted still.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: report INTEGERS cap if glsl130 is on.
Dave Airlie [Fri, 20 Apr 2012 18:33:22 +0000 (19:33 +0100)]
r600g: report INTEGERS cap if glsl130 is on.

This cap is used by u_blitter to decide if it can use integers
in vertex data.

fixes some crashes with glsl130 in piglit

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: enable glsl 130 on evergreen.
Dave Airlie [Fri, 20 Apr 2012 18:01:57 +0000 (19:01 +0100)]
r600g: enable glsl 130 on evergreen.

I've done a piglit run on my SUMO machine and I see no regressions.

Lots of things to fix (skip->fail), but hey maybe we can fix them
if we can see them.

I'll try and work my way across r600,700,cayman sometime if nobody
else gets to them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: disable I2F conversion for InstanceID if integers are supported
Vadim Girlin [Mon, 9 Apr 2012 15:35:40 +0000 (19:35 +0400)]
r600g: disable I2F conversion for InstanceID if integers are supported

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: store glsl_feature_level in the r600_screen
Vadim Girlin [Mon, 9 Apr 2012 15:35:39 +0000 (19:35 +0400)]
r600g: store glsl_feature_level in the r600_screen

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: move gl_array_attrib::NewState to gl_array_object::NewArrays
Brian Paul [Wed, 18 Apr 2012 16:47:10 +0000 (10:47 -0600)]
mesa: move gl_array_attrib::NewState to gl_array_object::NewArrays

The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agodocs: recommend 2GB of RAM for Viewperf tests
Brian Paul [Thu, 19 Apr 2012 20:38:45 +0000 (14:38 -0600)]
docs: recommend 2GB of RAM for Viewperf tests

12 years agoi965: Convert live interval computation to using live variable analysis.
Eric Anholt [Wed, 11 Apr 2012 20:24:22 +0000 (13:24 -0700)]
i965: Convert live interval computation to using live variable analysis.

Our previous live interval analysis just said that anything in a loop
was live for the whole loop.  If you had to spill a reg in a loop,
then we would consider the unspilled value live across the loop too,
so you never made progress by spilling.  Eventually it would consider
everything in the loop unspillable and fail out.

With the new analysis, things completely deffed and used inside the
loop won't be marked live across the loop, so even if you
spill/unspill something that used to be live across the loop, you
reduce register pressure.  But you usually don't even have to spill
any more, since our intervals are smaller than before.

This fixes assertion failure trying to compile the shader for the
"glyphy" text rasterier and piglit glsl-fs-unroll-explosion.

Improves Unigine Tropics performance 1.3% +/- 0.2% (n=5), by allowing
more shaders to be compiled in 16-wide mode.

12 years agoi965: Move the old live interval analysis code next to the new live vars code.
Eric Anholt [Wed, 11 Apr 2012 20:14:27 +0000 (13:14 -0700)]
i965: Move the old live interval analysis code next to the new live vars code.

I'm about to replace the insides of this using the new analysis.

12 years agoi965: Add support for live variable analysis using dataflow analysis.
Eric Anholt [Wed, 11 Apr 2012 20:12:33 +0000 (13:12 -0700)]
i965: Add support for live variable analysis using dataflow analysis.

12 years agoi965: Add basic block generator.
Eric Anholt [Tue, 10 Apr 2012 19:01:50 +0000 (12:01 -0700)]
i965: Add basic block generator.

This takes the fs_inst list generated by the visitor, and generates a
list of basic blocks with edges between them.  This is a building
block for data-flow analysis.

12 years agoi965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation.
Eric Anholt [Wed, 11 Apr 2012 20:45:55 +0000 (13:45 -0700)]
i965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation.

12 years agoglsl: Properly throw compile-time errors for conflicting FS output writes.
Eric Anholt [Fri, 30 Mar 2012 00:29:20 +0000 (17:29 -0700)]
glsl: Properly throw compile-time errors for conflicting FS output writes.

We were checking for these at link time previously, which is not as
early as mandated, and would actually fail to detect conflicting
writes if dead code removal removed some writes.

Fixes failures in piglit
glsl-*/compiler/fragment-outputs/write-gl_Frag*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Track in each ir_variable whether it was ever assigned.
Eric Anholt [Fri, 30 Mar 2012 00:02:15 +0000 (17:02 -0700)]
glsl: Track in each ir_variable whether it was ever assigned.

This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Convert the tests directory to automake.
Eric Anholt [Mon, 16 Apr 2012 16:53:29 +0000 (09:53 -0700)]
glsl: Convert the tests directory to automake.

This runs optimization-test and produces the usual automake test
output, which may be interesting to automated build systems.

This doesn't convert the tests to be individually exposed to the
automake runner, because automake doesn't like wildcards (due to being
nonportable in make, not that we care).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Fix up some comments in structure splitting, based on array-split work.
Eric Anholt [Mon, 16 Apr 2012 16:52:45 +0000 (09:52 -0700)]
glsl: Fix up some comments in structure splitting, based on array-split work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Don't allow array splitting on function arguments.
Eric Anholt [Mon, 16 Apr 2012 16:45:07 +0000 (09:45 -0700)]
glsl: Don't allow array splitting on function arguments.

This is the reason the declaration member existed in the reference
visitor, but I didn't copy the code from structure splitting that
avoided setting it.

This wasn't currently a problem, because we don't allow splitting of
in/out variables.  But that would be nice to change some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Rename the "whole_array_access" member in array splitting.
Eric Anholt [Mon, 16 Apr 2012 16:26:32 +0000 (09:26 -0700)]
glsl: Rename the "whole_array_access" member in array splitting.

This was carried over from structure splitting, without thinking about
whether the name still made sense in this context.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Fix up a comment explaining what a visitor class does.
Eric Anholt [Mon, 16 Apr 2012 16:17:46 +0000 (09:17 -0700)]
glsl: Fix up a comment explaining what a visitor class does.

Ken noted that some of the "actual work" was happening in the caller
of this class.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Use the column_types() helper method.
Eric Anholt [Mon, 16 Apr 2012 16:15:36 +0000 (09:15 -0700)]
glsl: Use the column_types() helper method.

Ken noted this in a review of this patch that I pushed early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.
Eric Anholt [Mon, 16 Apr 2012 21:33:34 +0000 (14:33 -0700)]
glx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agoRevert "mesa: only update _MaxElement when we actually need it"
Marek Olšák [Thu, 19 Apr 2012 18:47:22 +0000 (20:47 +0200)]
Revert "mesa: only update _MaxElement when we actually need it"

This reverts commit 0de5a21470b3bff9b7c8714e5d960d5ed9d01b9c.

I was wrong, we use it in the vbo module too.
This fixes a performance regression in Nexuiz.

12 years agoradeonsi: Fix VGPR_BIT() definition.
Michel Dänzer [Thu, 19 Apr 2012 17:14:45 +0000 (19:14 +0200)]
radeonsi: Fix VGPR_BIT() definition.

Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.

12 years agoradeonsi: Replace magic numbers for vertex buffer resource.
Michel Dänzer [Thu, 19 Apr 2012 14:46:15 +0000 (16:46 +0200)]
radeonsi: Replace magic numbers for vertex buffer resource.

12 years agoradeonsi: (User) SGPR related cleanups.
Michel Dänzer [Thu, 19 Apr 2012 09:41:48 +0000 (11:41 +0200)]
radeonsi: (User) SGPR related cleanups.

Use the same user SGPRs for the same purpose in vertex and pixel shaders.

Better calculation of the number of SGPRs to reserve.

12 years agoradeonsi: Fix sampler offsets for shader intrinsic.
Michel Dänzer [Thu, 19 Apr 2012 08:35:31 +0000 (10:35 +0200)]
radeonsi: Fix sampler offsets for shader intrinsic.

The sampler number is in TGSI source register 1, and the S_LOAD_DWORD*
instructions take offsets in DWORDs, not bytes.

12 years agodocs: overhaul the Mesa build/install instructions
Brian Paul [Thu, 19 Apr 2012 15:56:36 +0000 (09:56 -0600)]
docs: overhaul the Mesa build/install instructions

Rearrange thing in general.  Mark the legacy Makefile system as deprecated.

12 years agodocs: freshen up the download/unpack instructions
Brian Paul [Thu, 19 Apr 2012 14:56:02 +0000 (08:56 -0600)]
docs: freshen up the download/unpack instructions

12 years agomesa: move unrefs of array objects earlier in _mesa_free_context_data()
Brian Paul [Thu, 19 Apr 2012 13:56:05 +0000 (07:56 -0600)]
mesa: move unrefs of array objects earlier in _mesa_free_context_data()

If a non-default array object was bound at context destruction time
we'd try to unreference the array object after it was already deleted
in _mesa_free_varray_data().  Now do the unref first.

Fixes a regression from commit 86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agonv50,nvc0: prevent multiple flushes when user spins on get_query_result
Christoph Bumiller [Thu, 19 Apr 2012 12:44:56 +0000 (14:44 +0200)]
nv50,nvc0: prevent multiple flushes when user spins on get_query_result

12 years agonv50/ir/opt: swap VP inputs to first source where possible
Christoph Bumiller [Wed, 18 Apr 2012 15:00:52 +0000 (17:00 +0200)]
nv50/ir/opt: swap VP inputs to first source where possible

12 years agovbo: remove vbo_context::mat_currval
Marek Olšák [Mon, 16 Apr 2012 14:41:09 +0000 (16:41 +0200)]
vbo: remove vbo_context::mat_currval

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agovbo: remove vbo_context::generic_currval
Marek Olšák [Mon, 16 Apr 2012 14:35:58 +0000 (16:35 +0200)]
vbo: remove vbo_context::generic_currval

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agovbo: remove vbo_context::legacy_currval
Marek Olšák [Mon, 16 Apr 2012 14:24:39 +0000 (16:24 +0200)]
vbo: remove vbo_context::legacy_currval

It's not nice when you have several variables pointing to the same array
and you wanna ask your editor "where is this used" and you only get an answer
for one of the four currval, legacy_currval, generic_currval, mat_currval,
which is quite useless, because you never see the whole picture.

Let's get rid of the additional pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agovbo: remove unused variables in vbo_context
Marek Olšák [Mon, 16 Apr 2012 12:37:29 +0000 (14:37 +0200)]
vbo: remove unused variables in vbo_context

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agovbo: don't check twice whether it's valid to render
Marek Olšák [Mon, 16 Apr 2012 03:55:08 +0000 (05:55 +0200)]
vbo: don't check twice whether it's valid to render

It's already done in _mesa_validate_Draw* and it's not needed to do it again
unless I am missing something.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & valid
Marek Olšák [Mon, 16 Apr 2012 14:04:52 +0000 (16:04 +0200)]
mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & valid

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs
Marek Olšák [Mon, 16 Apr 2012 02:21:03 +0000 (04:21 +0200)]
mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs

This is a frequently-updated state and _NEW_ARRAY already causes revalidation
of the vbo module. It's kinda counter-productive to recompute arrays
in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa,vbo: properly detect when vertex arrays need to be recalculated
Marek Olšák [Mon, 16 Apr 2012 01:34:22 +0000 (03:34 +0200)]
mesa,vbo: properly detect when vertex arrays need to be recalculated

This moves the RebindArrays flag into the vbo module, consolidates the code,
and adds missing vbo_draw_method calls.

Also with this change, the vertex arrays are not needlessly recalculated twice.
The issue with the old code was:
- If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set.
- _mesa_update_state is called and the vp_varying_inputs change causes
  regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM.
- The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets
  the recalculate_inputs flag to TRUE again.
- The new code sets the flag to FALSE after the second _mesa_update_state,
  because there can't possibly be any change which would require recalculating
  the arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa: only update _MaxElement when we actually need it
Marek Olšák [Mon, 16 Apr 2012 00:14:18 +0000 (02:14 +0200)]
mesa: only update _MaxElement when we actually need it

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agost/mesa: use bitshifting to define state flags
Marek Olšák [Sun, 15 Apr 2012 21:12:19 +0000 (23:12 +0200)]
st/mesa: use bitshifting to define state flags

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agoradeonsi: MIMG shader instructions require waiting for the results.
Michel Dänzer [Thu, 19 Apr 2012 07:36:52 +0000 (09:36 +0200)]
radeonsi: MIMG shader instructions require waiting for the results.

12 years agoradeonsi: Replace more magic numbers for sampler state.
Michel Dänzer [Thu, 19 Apr 2012 07:36:52 +0000 (09:36 +0200)]
radeonsi: Replace more magic numbers for sampler state.

12 years agoradeonsi: Fix mip filter encoding in sampler state.
Michel Dänzer [Thu, 19 Apr 2012 07:36:51 +0000 (09:36 +0200)]
radeonsi: Fix mip filter encoding in sampler state.

Blits are starting to work.

12 years agoradeonsi: Set tiling mode index for depth/stencil buffers.
Michel Dänzer [Thu, 19 Apr 2012 07:36:51 +0000 (09:36 +0200)]
radeonsi: Set tiling mode index for depth/stencil buffers.

12 years agoglsl: Remove unused mem_ctx field from ir_array_splitting_visitor.
Kenneth Graunke [Thu, 19 Apr 2012 02:10:03 +0000 (19:10 -0700)]
glsl: Remove unused mem_ctx field from ir_array_splitting_visitor.

Vinson reported that we failed to initialize this, which would lead to
all kinds of crashes if we actually used it.  Since we don't use it,
we may as well just delete the broken code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Rename BRW_MAX_SURFACES to BRW_MAX_WM_SURFACES.
Kenneth Graunke [Thu, 19 Apr 2012 01:25:01 +0000 (18:25 -0700)]
i965: Rename BRW_MAX_SURFACES to BRW_MAX_WM_SURFACES.

Now that we use separate binding tables for WM, VS, and GS, and have
BRW_MAX_VS_SURFACES and BRW_MAX_GS_SURFACES macros, we really shouldn't
have an unqualified BRW_MAX_SURFACES macro.  It's confusing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Fix outdated comments about binding tables.
Kenneth Graunke [Thu, 19 Apr 2012 01:21:24 +0000 (18:21 -0700)]
i965: Fix outdated comments about binding tables.

They had a number of issues:
- A paragraph states that we use a single binding table, but we don't.
- We labelled the WM binding table diagram as SOL/WM.
- The WM diagram had an "Only relevant to the WM" comment.  Duh.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Use array object constructor.
Mathias Fröhlich [Wed, 2 Nov 2011 18:54:26 +0000 (19:54 +0100)]
mesa: Use array object constructor.

This change uses the array object factory for gl_array_objects. This
prevents crashes when deriving from gl_array_object.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agosvga: flush drawing before clearing
Brian Paul [Wed, 18 Apr 2012 14:31:45 +0000 (08:31 -0600)]
svga: flush drawing before clearing

We don't normally clear immediately after drawing something.  But as it
was, the drawing would incorrectly appear after the clear.

Fixes piglit clear-varray-2.0 failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agopipebuffer: split up assertion
Brian Paul [Wed, 18 Apr 2012 14:30:30 +0000 (08:30 -0600)]
pipebuffer: split up assertion

The problem with assert(a && b) is you don't know which term is zero
when there's a failure.

12 years agosvga: return PIPE_OK instead of 0
Brian Paul [Tue, 17 Apr 2012 19:58:05 +0000 (13:58 -0600)]
svga: return PIPE_OK instead of 0

12 years agogallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush
Marek Olšák [Fri, 13 Apr 2012 19:20:18 +0000 (21:20 +0200)]
gallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush

There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.

12 years agogallium/u_blit: don't release vertex buffer at end of frame / in glFlush
Marek Olšák [Fri, 13 Apr 2012 19:20:18 +0000 (21:20 +0200)]
gallium/u_blit: don't release vertex buffer at end of frame / in glFlush

There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.

12 years agogallium: remove PIPE_TRANSFER_NOOVERWRITE, use equivalent UNSYNCHRONIZED
Marek Olšák [Fri, 13 Apr 2012 19:10:21 +0000 (21:10 +0200)]
gallium: remove PIPE_TRANSFER_NOOVERWRITE, use equivalent UNSYNCHRONIZED

12 years agost/mesa: write vertices directly into the buffer for glClear fallback
Marek Olšák [Fri, 13 Apr 2012 18:37:41 +0000 (20:37 +0200)]
st/mesa: write vertices directly into the buffer for glClear fallback

12 years agost/mesa: use u_upload_mgr to upload vertices for glClear fallback
Marek Olšák [Fri, 13 Apr 2012 17:27:45 +0000 (19:27 +0200)]
st/mesa: use u_upload_mgr to upload vertices for glClear fallback

12 years agost/mesa: write vertices directly into the buffer in glDrawPixels
Marek Olšák [Fri, 13 Apr 2012 18:37:41 +0000 (20:37 +0200)]
st/mesa: write vertices directly into the buffer in glDrawPixels

12 years agost/mesa: use u_upload_mgr to upload vertices for glDrawPixels
Marek Olšák [Fri, 13 Apr 2012 17:27:45 +0000 (19:27 +0200)]
st/mesa: use u_upload_mgr to upload vertices for glDrawPixels

12 years agost/mesa: use u_upload_mgr to upload vertices for glDrawTexOES
Marek Olšák [Fri, 13 Apr 2012 17:27:45 +0000 (19:27 +0200)]
st/mesa: use u_upload_mgr to upload vertices for glDrawTexOES

12 years agost/mesa: write vertices directly into the buffer for glBitmap
Marek Olšák [Fri, 13 Apr 2012 18:37:41 +0000 (20:37 +0200)]
st/mesa: write vertices directly into the buffer for glBitmap

12 years agost/mesa: use u_upload_mgr to upload vertices for glBitmap
Marek Olšák [Fri, 13 Apr 2012 17:27:45 +0000 (19:27 +0200)]
st/mesa: use u_upload_mgr to upload vertices for glBitmap

instead of recreating the vertex buffer for each draw_vbo call.

12 years agoradeonsi: Improve calculation of number of pixel shader interpolants.
Michel Dänzer [Wed, 18 Apr 2012 08:44:03 +0000 (10:44 +0200)]
radeonsi: Improve calculation of number of pixel shader interpolants.

12 years agoradeonsi: Fix calculation of pitch value in sampler view state.
Michel Dänzer [Wed, 18 Apr 2012 08:37:15 +0000 (10:37 +0200)]
radeonsi: Fix calculation of pitch value in sampler view state.

12 years agoradeonsi: Set tiling mode index in sampler view state.
Michel Dänzer [Wed, 18 Apr 2012 08:51:48 +0000 (10:51 +0200)]
radeonsi: Set tiling mode index in sampler view state.

Hardcode index for linear mode for now.

12 years agoradeonsi: Replace magic numbers with register definitions in sampler state.
Michel Dänzer [Wed, 18 Apr 2012 08:29:23 +0000 (10:29 +0200)]
radeonsi: Replace magic numbers with register definitions in sampler state.

12 years agoradeonsi: Fix white border color type in sampler state.
Michel Dänzer [Wed, 18 Apr 2012 08:48:26 +0000 (10:48 +0200)]
radeonsi: Fix white border color type in sampler state.

12 years agoglsl/builtins: Rework profiles to use the new '.glsl' common suffix.
Kenneth Graunke [Mon, 16 Apr 2012 20:29:42 +0000 (13:29 -0700)]
glsl/builtins: Rework profiles to use the new '.glsl' common suffix.

Deletes a lot of pointless duplication, as well as some run-time effort.

Conveniently, GLSL 1.40 no longer needs a .vert variant, since it
doesn't define any built-ins specific to the vertex shader stage.

ARB_texture_rectangle and OES_EGL_image_external also only need a single
profile, since the .vert and .frag variants were identical.

I didn't bother with EXT_texture_array and OES_texture_3D because
they're so tiny that the savings would be miniscule.

Cuts the generated builtin_function.cpp from 1.7MB to 1.0MB (41%).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl/builtins: Support stage-agnostic built-in profiles.
Kenneth Graunke [Tue, 17 Apr 2012 18:26:29 +0000 (11:26 -0700)]
glsl/builtins: Support stage-agnostic built-in profiles.

The built-in subsystem uses "profiles," or GLSL shaders containing
prototypes for all built-ins supported within a particular language
version (or extension) and shader stage.

Since profiles were stage-specific, we had to cut and paste almost all
the prototypes between (e.g.) 110.vert and 110.frag.  Naturally, this
led to sundry cut and paste bugs, where someone fixed an issue in .frag
but neglected to update .vert, or vice-versa.  Geometry shaders would
have only made this worse.

This patch introduces support for a new '.glsl' profile suffix which
contains prototypes common to all shader stages.  The existing '.frag'
and '.vert' profiles need only contain the few stage-specific built-ins.

Not only does this remove duplication, it makes built-in setup slightly
faster: we don't need to re-read the common prototypes and function
bodies for both the vertex and fragment shader stage.

Internally, this was trivial.  We already create a list of gl_shader
objects to search through for built-ins: one for the core language
version/stage, and additional shaders for any extensions in use.  This
patch simply adds another shader to the list: core/common, core/stage,
and extensions.

The next patch will update the profiles to remove the duplication.
It's separated out purely to make review easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Make the standalone compiler accept '.glsl' files.
Kenneth Graunke [Mon, 16 Apr 2012 21:40:45 +0000 (14:40 -0700)]
glsl: Make the standalone compiler accept '.glsl' files.

These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()
Brian Paul [Tue, 17 Apr 2012 16:49:16 +0000 (10:49 -0600)]
mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()

Accelerates a few glReadPixels cases for WebGL.
See https://bugs.freedesktop.org/show_bug.cgi?id=48545

v2: Per Jose, use bit twiddling for the swizzle case instead of ubyte
arrays (it's about 44% faster).

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoconfigure.ac: add IA64 support.
Dave Airlie [Tue, 17 Apr 2012 18:58:39 +0000 (19:58 +0100)]
configure.ac: add IA64 support.

ia64 on Linux can use DRI as well.

Reported-by: russiane39 on #radeon
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=48788
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglsl/builtins: Use ivec for texel offsets in textureProjGradOffset.
Kenneth Graunke [Mon, 16 Apr 2012 20:37:20 +0000 (13:37 -0700)]
glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.

The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

The GLSL 4.20 specification corrects these to "ivec2", but doesn't
mention this as being a conscious change in behavior.  Nor does the
ARB_shading_language_420pack extension.  So presumably it was a typo.

At any rate, our builtin functions all use ivec already, so the fact
that these prototypes use plain vecs will only lead to applications
dying in a fire when trying to use them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agonv50: specify location of UCPs to code generator
Christoph Bumiller [Tue, 17 Apr 2012 16:35:16 +0000 (18:35 +0200)]
nv50: specify location of UCPs to code generator

Was made configurable in e44089b2f79aa2dcaacf348911433d1e21235c0c
for Kepler but forgot to update nv50.