platform/upstream/mesa.git
13 years agomesa: add some minor fixes for geometry shaders
Brian Paul [Fri, 3 Jun 2011 02:56:23 +0000 (20:56 -0600)]
mesa: add some minor fixes for geometry shaders

13 years agodri: add missing files from 873379a8818eed9ab16c24728b7091a3a3705c5b
Brian Paul [Fri, 3 Jun 2011 00:27:10 +0000 (18:27 -0600)]
dri: add missing files from 873379a8818eed9ab16c24728b7091a3a3705c5b

13 years agomesa: add implementation of glDrawElementsInstancedBaseVertex
Pierre-Eric Pelloux-Prayer [Tue, 31 May 2011 11:33:54 +0000 (13:33 +0200)]
mesa: add implementation of glDrawElementsInstancedBaseVertex

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoglapi: regenerated files
Pierre-Eric Pelloux-Prayer [Tue, 31 May 2011 11:34:34 +0000 (13:34 +0200)]
glapi: regenerated files

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoglapi: add glDrawElementsInstancedBaseVertex() function to xml
Brian Paul [Thu, 2 Jun 2011 23:54:40 +0000 (17:54 -0600)]
glapi: add glDrawElementsInstancedBaseVertex() function to xml

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agodri/nouveau: Fix build with --enable-shared-dricore.
Johannes Obermayr [Thu, 2 Jun 2011 23:15:44 +0000 (17:15 -0600)]
dri/nouveau: Fix build with --enable-shared-dricore.

- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agor300: remove MIN3 macro, already defined in macros.h
Brian Paul [Thu, 2 Jun 2011 23:04:30 +0000 (17:04 -0600)]
r300: remove MIN3 macro, already defined in macros.h

13 years agor600g: sampler and texture state doesn't need a range/block.
Dave Airlie [Thu, 2 Jun 2011 22:50:58 +0000 (08:50 +1000)]
r600g: sampler and texture state doesn't need a range/block.

These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoglx: Remove (unused, broken) fastImageUnpack fast path
Adam Jackson [Wed, 1 Jun 2011 17:00:57 +0000 (13:00 -0400)]
glx: Remove (unused, broken) fastImageUnpack fast path

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoglx: Fix another case of using req outside of the display lock
Adam Jackson [Wed, 1 Jun 2011 15:33:48 +0000 (11:33 -0400)]
glx: Fix another case of using req outside of the display lock

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agosoftpipe: add a better fake implementation of fences
Marek Olšák [Wed, 1 Jun 2011 22:50:45 +0000 (00:50 +0200)]
softpipe: add a better fake implementation of fences

The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.

13 years agoutil: faster logbase2
Brian Paul [Thu, 2 Jun 2011 14:43:07 +0000 (08:43 -0600)]
util: faster logbase2

13 years agomesa: faster logbase2
Benjamin Bellec [Thu, 2 Jun 2011 14:31:16 +0000 (08:31 -0600)]
mesa: faster logbase2

With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: add GL_R11F_G11F_B10F to format table
Brian Paul [Thu, 2 Jun 2011 14:01:26 +0000 (08:01 -0600)]
st/mesa: add GL_R11F_G11F_B10F to format table

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

13 years agod3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0
Christoph Bumiller [Thu, 2 Jun 2011 12:04:05 +0000 (14:04 +0200)]
d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0

13 years agod3d1x/sm4: fix swizzle for 1 component operands
Christoph Bumiller [Thu, 2 Jun 2011 12:01:24 +0000 (14:01 +0200)]
d3d1x/sm4: fix swizzle for 1 component operands

For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.

13 years agoi965: Raise const.MaxTextureLevels to 14 (8192)
Chris Wilson [Thu, 2 Jun 2011 07:27:09 +0000 (08:27 +0100)]
i965: Raise const.MaxTextureLevels to 14 (8192)

Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agor600g: add spi state and move spi/vgt to modify register
Dave Airlie [Thu, 2 Jun 2011 05:08:24 +0000 (15:08 +1000)]
r600g: add spi state and move spi/vgt to modify register

This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: decrease CPU time on set buffer resources
Dave Airlie [Thu, 2 Jun 2011 05:03:52 +0000 (15:03 +1000)]
r600g: decrease CPU time on set buffer resources

This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: work out range/block etc at state build time.
Dave Airlie [Thu, 2 Jun 2011 04:57:13 +0000 (14:57 +1000)]
r600g: work out range/block etc at state build time.

This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: deinline r600_pipe_state_add_reg.
Dave Airlie [Thu, 2 Jun 2011 04:53:15 +0000 (14:53 +1000)]
r600g: deinline r600_pipe_state_add_reg.

This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: prepare for passing ctx into _r600_pipe_state_add_reg
Dave Airlie [Thu, 2 Jun 2011 04:48:06 +0000 (14:48 +1000)]
r600g: prepare for passing ctx into _r600_pipe_state_add_reg

This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: migrate macros from r600_priv.h to r600.h
Dave Airlie [Thu, 2 Jun 2011 04:42:11 +0000 (14:42 +1000)]
r600g: migrate macros from r600_priv.h to r600.h

this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: remote ctx arg to block/range macros.
Dave Airlie [Thu, 2 Jun 2011 04:40:40 +0000 (14:40 +1000)]
r600g: remote ctx arg to block/range macros.

These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: avoid copying unnecessary pieces of a block.
Dave Airlie [Thu, 2 Jun 2011 04:29:37 +0000 (14:29 +1000)]
r600g: avoid copying unnecessary pieces of a block.

This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: optimise state setting in r600_draw_vbo.
Dave Airlie [Thu, 2 Jun 2011 00:16:57 +0000 (10:16 +1000)]
r600g: optimise state setting in r600_draw_vbo.

This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: force new evergreen blocks for large range.
Dave Airlie [Thu, 2 Jun 2011 04:21:39 +0000 (14:21 +1000)]
r600g: force new evergreen blocks for large range.

This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agost/mesa: add format table entry for GL_RGB9_E5
Brian Paul [Wed, 1 Jun 2011 22:25:35 +0000 (16:25 -0600)]
st/mesa: add format table entry for GL_RGB9_E5

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

13 years agoglapi: Make xserver location error more helpful
Nathan Kidd [Wed, 1 Jun 2011 14:29:26 +0000 (08:29 -0600)]
glapi: Make xserver location error more helpful

glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: queries of non-existent FBO attachments should return INVALID_OPERATION
Marek Olšák [Tue, 31 May 2011 18:36:07 +0000 (20:36 +0200)]
mesa: queries of non-existent FBO attachments should return INVALID_OPERATION

OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
13 years agomesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
Marek Olšák [Tue, 31 May 2011 12:59:44 +0000 (14:59 +0200)]
mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End

I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor300g: remove unused debug option DBG_UPLOAD
Marek Olšák [Tue, 31 May 2011 23:09:11 +0000 (01:09 +0200)]
r300g: remove unused debug option DBG_UPLOAD

And renumber the options.

13 years agor600c: add support for llano
Alex Deucher [Mon, 4 Apr 2011 16:29:50 +0000 (12:29 -0400)]
r600c: add support for llano

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agor600g: add llano support
Alex Deucher [Mon, 4 Apr 2011 16:06:11 +0000 (12:06 -0400)]
r600g: add llano support

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agoi965/fs: Use the embedded compare in SEL on gen6+.
Eric Anholt [Thu, 12 May 2011 16:03:24 +0000 (09:03 -0700)]
i965/fs: Use the embedded compare in SEL on gen6+.

This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agowayland-drm: Check visual for being NULL
Benjamin Franzke [Tue, 31 May 2011 12:20:59 +0000 (14:20 +0200)]
wayland-drm: Check visual for being NULL

13 years agoFiuxp make tarballs for wayland-egl/drm
Benjamin Franzke [Mon, 30 May 2011 12:33:30 +0000 (14:33 +0200)]
Fiuxp make tarballs for wayland-egl/drm

13 years agost/egl: Fix udev linkage when egl_dri2 is not build
Benjamin Franzke [Tue, 31 May 2011 09:14:46 +0000 (11:14 +0200)]
st/egl: Fix udev linkage when egl_dri2 is not build

13 years agoegl_dri2: Fix usage of bool values
Benjamin Franzke [Tue, 31 May 2011 09:45:51 +0000 (11:45 +0200)]
egl_dri2: Fix usage of bool values

13 years agowayland-egl: Remove left-over headers and struct
Benjamin Franzke [Tue, 31 May 2011 09:13:57 +0000 (11:13 +0200)]
wayland-egl: Remove left-over headers and struct

13 years agoi965: Remove brw_surface_state struct that is now unused.
Eric Anholt [Tue, 24 May 2011 19:33:42 +0000 (12:33 -0700)]
i965: Remove brw_surface_state struct that is now unused.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Switch brw_state_dump to using bitshifting for surface state.
Eric Anholt [Tue, 24 May 2011 19:32:19 +0000 (12:32 -0700)]
i965: Switch brw_state_dump to using bitshifting for surface state.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Replace struct with bit shifting for WM null surfaces.
Eric Anholt [Tue, 17 May 2011 17:55:40 +0000 (10:55 -0700)]
i965: Replace struct with bit shifting for WM null surfaces.

Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Replace struct with bit shifting for WM pull constant surfaces.
Eric Anholt [Tue, 17 May 2011 17:51:45 +0000 (10:51 -0700)]
i965: Replace struct with bit shifting for WM pull constant surfaces.

This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Replace struct with bit shifting for WM render target surfaces.
Eric Anholt [Tue, 17 May 2011 17:35:07 +0000 (10:35 -0700)]
i965: Replace struct with bit shifting for WM render target surfaces.

This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Replace structs with bitfield shifting for WM texture surfaces.
Eric Anholt [Thu, 28 Apr 2011 04:50:20 +0000 (21:50 -0700)]
i965: Replace structs with bitfield shifting for WM texture surfaces.

This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Add defines for surface state setup using bitfield shifting.
Eric Anholt [Tue, 31 May 2011 19:03:52 +0000 (12:03 -0700)]
i965: Add defines for surface state setup using bitfield shifting.

It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).

13 years agoi965: Don't compute brw->wm.input_size_masks when it's unused.
Eric Anholt [Thu, 28 Apr 2011 04:50:20 +0000 (21:50 -0700)]
i965: Don't compute brw->wm.input_size_masks when it's unused.

It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Eric Anholt [Tue, 17 May 2011 16:20:04 +0000 (09:20 -0700)]
i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.

Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Eric Anholt [Tue, 17 May 2011 16:11:38 +0000 (09:11 -0700)]
i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.

Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agointel: Remove unused NO_TILE macro
Ian Romanick [Thu, 19 May 2011 12:34:19 +0000 (14:34 +0200)]
intel: Remove unused NO_TILE macro

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agor300g: set squared microtiling for the dummy zbuffer
Marek Olšák [Tue, 31 May 2011 13:53:11 +0000 (15:53 +0200)]
r300g: set squared microtiling for the dummy zbuffer

The pitch of 4 is allowed for squared microtiling only.

13 years agor600g: cs init fixes
Alex Deucher [Tue, 31 May 2011 14:43:31 +0000 (10:43 -0400)]
r600g: cs init fixes

- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agor300g: log when getting unsupported texture format
Marek Olšák [Mon, 30 May 2011 23:16:20 +0000 (01:16 +0200)]
r300g: log when getting unsupported texture format

13 years agogallium: include limits.h in p_config.h
Dave Airlie [Mon, 30 May 2011 10:21:16 +0000 (20:21 +1000)]
gallium: include limits.h in p_config.h

We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor600g: add context control to start of CS
Dave Airlie [Tue, 31 May 2011 05:33:07 +0000 (15:33 +1000)]
r600g: add context control to start of CS

On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: don't emit color blend register on original R600.
Dave Airlie [Tue, 31 May 2011 00:52:07 +0000 (10:52 +1000)]
r600g: don't emit color blend register on original R600.

The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agomesa: forbid UseProgram to be called inside Begin/End
Marek Olšák [Sun, 29 May 2011 16:58:45 +0000 (18:58 +0200)]
mesa: forbid UseProgram to be called inside Begin/End

The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: don't use resource_copy_region for CopyPixels with conditional render
Marek Olšák [Sun, 29 May 2011 04:21:39 +0000 (06:21 +0200)]
st/mesa: don't use resource_copy_region for CopyPixels with conditional render

The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: conditional rendering should not kill texture decompression via blit
Marek Olšák [Sun, 29 May 2011 16:20:36 +0000 (18:20 +0200)]
st/mesa: conditional rendering should not kill texture decompression via blit

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
Marek Olšák [Sun, 29 May 2011 13:35:25 +0000 (15:35 +0200)]
st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: BlitFramebuffer should not be killed by conditional rendering
Marek Olšák [Sun, 29 May 2011 15:52:29 +0000 (17:52 +0200)]
st/mesa: BlitFramebuffer should not be killed by conditional rendering

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: BlitFramebuffer should not be killed by conditional rendering
Marek Olšák [Sun, 29 May 2011 15:52:29 +0000 (17:52 +0200)]
swrast: BlitFramebuffer should not be killed by conditional rendering

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: GenerateMipmap should not be killed by conditional rendering
Marek Olšák [Sun, 29 May 2011 13:35:25 +0000 (15:35 +0200)]
st/mesa: GenerateMipmap should not be killed by conditional rendering

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: fix typos and add some format fallbacks in format_map
Marek Olšák [Sat, 28 May 2011 14:30:51 +0000 (16:30 +0200)]
st/mesa: fix typos and add some format fallbacks in format_map

Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: consolidate listing of depth formats
Marek Olšák [Sat, 28 May 2011 13:50:10 +0000 (15:50 +0200)]
st/mesa: consolidate listing of depth formats

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: add GL_DEPTH_COMPONENT32 fallback formats
Marek Olšák [Sat, 28 May 2011 12:51:16 +0000 (14:51 +0200)]
st/mesa: add GL_DEPTH_COMPONENT32 fallback formats

This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: fix changing internal format via RenderbufferStorage
Marek Olšák [Sat, 28 May 2011 12:28:19 +0000 (14:28 +0200)]
st/mesa: fix changing internal format via RenderbufferStorage

The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e5783d8810d0ab88e1c470958fd5eb2eb
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e5783d8810d0ab88e1c470958fd5eb2eb is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agotgsi/ureg: bump the limit of immediates
Marek Olšák [Sun, 29 May 2011 00:53:01 +0000 (02:53 +0200)]
tgsi/ureg: bump the limit of immediates

Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agotrace: implement texture_barrier
Marek Olšák [Sun, 29 May 2011 01:34:00 +0000 (03:34 +0200)]
trace: implement texture_barrier

13 years agotrace: implement render_condition
Marek Olšák [Sun, 29 May 2011 01:32:54 +0000 (03:32 +0200)]
trace: implement render_condition

13 years agor300g: clear can be killed by render condition
Marek Olšák [Sun, 29 May 2011 04:12:22 +0000 (06:12 +0200)]
r300g: clear can be killed by render condition

Fixes piglit:
- NV_conditional_render/clear

13 years agor300g: Fix non-dri builds
Tom Stellard [Wed, 25 May 2011 04:11:03 +0000 (21:11 -0700)]
r300g: Fix non-dri builds

This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.

13 years agor300g: fix occlusion queries when depth test is disabled or zbuffer is missing
Marek Olšák [Sun, 29 May 2011 02:36:36 +0000 (04:36 +0200)]
r300g: fix occlusion queries when depth test is disabled or zbuffer is missing

From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array

13 years agor300g: cleanup render_condition a bit
Marek Olšák [Sun, 29 May 2011 01:59:07 +0000 (03:59 +0200)]
r300g: cleanup render_condition a bit

13 years agor300g: remove fake occlusion queries (debug option)
Marek Olšák [Sun, 29 May 2011 01:46:15 +0000 (03:46 +0200)]
r300g: remove fake occlusion queries (debug option)

13 years agor300g: remove debug option DBG_FALL
Marek Olšák [Sun, 29 May 2011 01:44:21 +0000 (03:44 +0200)]
r300g: remove debug option DBG_FALL

13 years agor300g: print some HyperZ debug info
Marek Olšák [Sun, 15 May 2011 00:34:16 +0000 (02:34 +0200)]
r300g: print some HyperZ debug info

13 years agoglx: Fix glXGetFBConfigFromVisualSGIX.
Stéphane Marchesin [Fri, 27 May 2011 00:19:03 +0000 (17:19 -0700)]
glx: Fix glXGetFBConfigFromVisualSGIX.

We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: set parameter list StateFlags field in _mesa_layout_parameters()
Pierre-Eric Pelloux-Prayer [Thu, 26 May 2011 18:06:42 +0000 (20:06 +0200)]
mesa: set parameter list StateFlags field in _mesa_layout_parameters()

When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoi965/fs: Fix up for 8752764076e5b3f052a57e0134424a37bf2e9164.
Eric Anholt [Fri, 27 May 2011 16:50:34 +0000 (09:50 -0700)]
i965/fs: Fix up for 8752764076e5b3f052a57e0134424a37bf2e9164.

I failed to commit and squash before pushing.

13 years agomesa: Include shader target in dumps of GLSL source.
Eric Anholt [Tue, 17 May 2011 15:21:27 +0000 (08:21 -0700)]
mesa: Include shader target in dumps of GLSL source.

This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Do a FS compile up front at link time to produce link errors.
Eric Anholt [Mon, 16 May 2011 22:10:26 +0000 (15:10 -0700)]
i965/fs: Do a FS compile up front at link time to produce link errors.

At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.

13 years agoi965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
Eric Anholt [Tue, 24 May 2011 23:45:17 +0000 (16:45 -0700)]
i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.

We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Split the BRW native code emit to brw_fs_emit.cpp
Eric Anholt [Tue, 24 May 2011 23:34:27 +0000 (16:34 -0700)]
i965/fs: Split the BRW native code emit to brw_fs_emit.cpp

This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
Eric Anholt [Thu, 26 May 2011 17:01:10 +0000 (10:01 -0700)]
i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.

These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Move non-FS-specific shader support to brw_shader.cpp.
Eric Anholt [Thu, 26 May 2011 16:57:36 +0000 (09:57 -0700)]
i965: Move non-FS-specific shader support to brw_shader.cpp.

These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Avoid generating MOVs for assignments of expressions.
Eric Anholt [Wed, 27 Apr 2011 00:58:04 +0000 (17:58 -0700)]
i965: Avoid generating MOVs for assignments of expressions.

No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.

13 years agoi965/fs: Move the computation of register block count from unit to compile.
Eric Anholt [Tue, 17 May 2011 15:55:11 +0000 (08:55 -0700)]
i965/fs: Move the computation of register block count from unit to compile.

No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
Eric Anholt [Mon, 23 May 2011 16:12:07 +0000 (09:12 -0700)]
i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.

There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b89038937bd428f7c89ed9859189a0ab0b in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

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

13 years agoi965/fs: Add a helper function for add_dep(before, after, before->latency).
Eric Anholt [Fri, 20 May 2011 21:13:59 +0000 (14:13 -0700)]
i965/fs: Add a helper function for add_dep(before, after, before->latency).

This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agonv50: fix emit_add_a16 to emit correct source reg
Trevor Davenport [Fri, 27 May 2011 08:25:40 +0000 (10:25 +0200)]
nv50: fix emit_add_a16 to emit correct source reg

emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.

13 years agomesa: s/height/depth/ in texsubimage()
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: s/height/depth/ in texsubimage()

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

13 years agomesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table

13 years agomesa: plug in GL_ARB_vertex_array_object display list functions
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: plug in GL_ARB_vertex_array_object display list functions

13 years agomesa: more geometry shader display list functions
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: more geometry shader display list functions

13 years agomesa: more transform feedback display list functions
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: more transform feedback display list functions

13 years agomesa: make query object API functions static
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: make query object API functions static

Only directly referenced by the _mesa_init_queryobj_dispatch() function.

13 years agomesa: simplify query object display list dispatch setup
Brian Paul [Fri, 27 May 2011 01:25:44 +0000 (19:25 -0600)]
mesa: simplify query object display list dispatch setup

13 years agoi965: Pack the lookup and line_aa bits into the first dword of the key.
Eric Anholt [Thu, 19 May 2011 16:56:27 +0000 (09:56 -0700)]
i965: Pack the lookup and line_aa bits into the first dword of the key.

They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>