mesa.git
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>
13 years agoi965: Remove dead shadowtex_mask entry in the WM key.
Eric Anholt [Thu, 19 May 2011 16:54:07 +0000 (09:54 -0700)]
i965: Remove dead shadowtex_mask entry in the WM key.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
Eric Anholt [Thu, 19 May 2011 15:48:42 +0000 (08:48 -0700)]
i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.

From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agointel: Drop doubly irrelevant code in intelReadBuffers.
Eric Anholt [Wed, 25 May 2011 20:56:04 +0000 (13:56 -0700)]
intel: Drop doubly irrelevant code in intelReadBuffers.

First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Flush vertices before updating drawbuffer computed state.
Eric Anholt [Wed, 25 May 2011 20:46:47 +0000 (13:46 -0700)]
mesa: Flush vertices before updating drawbuffer computed state.

Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
Eric Anholt [Wed, 25 May 2011 20:51:26 +0000 (13:51 -0700)]
mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.

From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
Eric Anholt [Wed, 25 May 2011 20:43:02 +0000 (13:43 -0700)]
mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.

glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: minor whitespace fixes
Brian Paul [Thu, 26 May 2011 03:05:23 +0000 (21:05 -0600)]
mesa: minor whitespace fixes

13 years agomesa: plug in sync object display list functions
Brian Paul [Thu, 26 May 2011 02:45:48 +0000 (20:45 -0600)]
mesa: plug in sync object display list functions

Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.

13 years agomesa: display list support for glProgramParameteriARB()
Brian Paul [Thu, 26 May 2011 02:44:35 +0000 (20:44 -0600)]
mesa: display list support for glProgramParameteriARB()

13 years agomesa: plug shader object functions into display list dispatch
Brian Paul [Thu, 26 May 2011 02:39:08 +0000 (20:39 -0600)]
mesa: plug shader object functions into display list dispatch

13 years agomesa: plug in GL 3.0 ClearBuffer() display list functions
Brian Paul [Thu, 26 May 2011 02:27:44 +0000 (20:27 -0600)]
mesa: plug in GL 3.0 ClearBuffer() display list functions

13 years agomesa: fill in missing sampler object display list functions
Brian Paul [Thu, 26 May 2011 02:20:22 +0000 (20:20 -0600)]
mesa: fill in missing sampler object display list functions

13 years agost/mesa: simplify some st_context(ctx)->pipe code
Brian Paul [Thu, 26 May 2011 00:16:03 +0000 (18:16 -0600)]
st/mesa: simplify some st_context(ctx)->pipe code

13 years agost/mesa: fix incorrect texture level/face/slice accesses
Brian Paul [Thu, 26 May 2011 00:07:33 +0000 (18:07 -0600)]
st/mesa: fix incorrect texture level/face/slice accesses

If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.

13 years agoi915g: Bump texture sizes
Jakob Bornecrantz [Wed, 25 May 2011 20:00:09 +0000 (22:00 +0200)]
i915g: Bump texture sizes

Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
13 years agoi965: Warnings cleanup.
Eric Anholt [Mon, 23 May 2011 16:26:42 +0000 (09:26 -0700)]
i965: Warnings cleanup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Fix assertion failures in unused brw_reg setup by deleting it.
Eric Anholt [Tue, 24 May 2011 19:36:50 +0000 (12:36 -0700)]
i965: Fix assertion failures in unused brw_reg setup by deleting it.

I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agor600g: remove duplicate opcode in r600_opcodes.h
Alex Deucher [Wed, 25 May 2011 15:04:25 +0000 (11:04 -0400)]
r600g: remove duplicate opcode in r600_opcodes.h

V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agointel: Change FBO validation criteria to accomodate hiz and seprate stencil
Chad Versace [Mon, 23 May 2011 20:48:18 +0000 (13:48 -0700)]
intel: Change FBO validation criteria to accomodate hiz and seprate stencil

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
Chad Versace [Mon, 23 May 2011 20:47:42 +0000 (13:47 -0700)]
intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil

The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Add hiz_region to intel_mipmap_tree
Chad Versace [Mon, 23 May 2011 20:48:14 +0000 (13:48 -0700)]
intel: Add hiz_region to intel_mipmap_tree

When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Refactor the wrapping of textures with renderbuffers
Chad Versace [Mon, 23 May 2011 20:48:10 +0000 (13:48 -0700)]
intel: Refactor the wrapping of textures with renderbuffers

Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Add hiz_region to intel_renderbuffer
Chad Versace [Mon, 23 May 2011 20:48:04 +0000 (13:48 -0700)]
intel: Add hiz_region to intel_renderbuffer

A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Add is_hiz_depth_format() to intel_contex.vtbl
Chad Versace [Mon, 23 May 2011 20:47:57 +0000 (13:47 -0700)]
intel: Add is_hiz_depth_format() to intel_contex.vtbl

Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Allocate region for separate stencil buffer
Chad Versace [Mon, 23 May 2011 20:47:35 +0000 (13:47 -0700)]
intel: Allocate region for separate stencil buffer

... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Change supported texture formats for separate stencil
Chad Versace [Mon, 23 May 2011 20:47:27 +0000 (13:47 -0700)]
intel: Change supported texture formats for separate stencil

When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agomesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Chad Versace [Mon, 23 May 2011 20:47:17 +0000 (13:47 -0700)]
mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format

Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agointel: Add flags to intel_context for hiz and separate stencil
Chad Versace [Mon, 23 May 2011 20:47:01 +0000 (13:47 -0700)]
intel: Add flags to intel_context for hiz and separate stencil

Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agoglx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
Adam Jackson [Wed, 25 May 2011 10:11:20 +0000 (06:11 -0400)]
glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay

... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoegl_dri2: add new cayman pci ids
Alex Deucher [Wed, 25 May 2011 05:27:34 +0000 (01:27 -0400)]
egl_dri2: add new cayman pci ids

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agor600g: fix eg/cayman scissor workaround
Alex Deucher [Wed, 25 May 2011 02:44:16 +0000 (22:44 -0400)]
r600g: fix eg/cayman scissor workaround

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agor600g: add workaround for buggy hw scissor on eg/cayman.
Dave Airlie [Tue, 24 May 2011 23:25:03 +0000 (09:25 +1000)]
r600g: add workaround for buggy hw scissor on eg/cayman.

This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: add initial cayman acceleration support.
Dave Airlie [Thu, 10 Mar 2011 02:54:13 +0000 (12:54 +1000)]
r600g: add initial cayman acceleration support.

Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
- some changes to how instructions are placed into slots
- removal of END_OF_PROGRAM bit in favour of END flow control clause
- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: don't lookup a vs semantic for position/face.
Dave Airlie [Wed, 25 May 2011 00:01:25 +0000 (10:01 +1000)]
r600g: don't lookup a vs semantic for position/face.

These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: flush the DB dest base as well.
Dave Airlie [Tue, 24 May 2011 23:37:33 +0000 (09:37 +1000)]
r600g: flush the DB dest base as well.

If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoglx: More comment cleanup
Adam Jackson [Fri, 29 Apr 2011 20:30:50 +0000 (16:30 -0400)]
glx: More comment cleanup

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoglx: Remove some misleading comments
Adam Jackson [Fri, 29 Apr 2011 19:40:38 +0000 (15:40 -0400)]
glx: Remove some misleading comments

These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agodrisw: Namespace better for ease of navigation
Adam Jackson [Fri, 29 Apr 2011 19:17:42 +0000 (15:17 -0400)]
drisw: Namespace better for ease of navigation

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agodrisw: dead store removal
Adam Jackson [Thu, 28 Apr 2011 19:35:30 +0000 (15:35 -0400)]
drisw: dead store removal

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agomesa: fix glGetTexImage for cases when srgb decode is skipped
Mike Kaplinskiy [Sat, 21 May 2011 23:05:29 +0000 (19:05 -0400)]
mesa: fix glGetTexImage for cases when srgb decode is skipped

See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agost/mesa: prefer formats without stencil for DEPTH_COMPONENT
Brian Paul [Tue, 24 May 2011 14:59:09 +0000 (08:59 -0600)]
st/mesa: prefer formats without stencil for DEPTH_COMPONENT

for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.

13 years agost/mesa: rewrite st_choose_format() to be table driven
Brian Paul [Sat, 21 May 2011 16:43:49 +0000 (10:43 -0600)]
st/mesa: rewrite st_choose_format() to be table driven

Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.

13 years agowgl: Don't hold on to user supplied HDC.
José Fonseca [Mon, 23 May 2011 19:38:41 +0000 (20:38 +0100)]
wgl: Don't hold on to user supplied HDC.

Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).

13 years agomesa: Fix remap_table setup.
Thierry Reding [Sun, 22 May 2011 12:07:22 +0000 (14:07 +0200)]
mesa: Fix remap_table setup.

Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.

13 years agomesa: Fix return type of _mesa_get_format_bytes() (#37351)
Adam Jackson [Fri, 20 May 2011 22:21:15 +0000 (18:21 -0400)]
mesa: Fix return type of  _mesa_get_format_bytes() (#37351)

Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoi965/gen7: Fix miptree layout for cube surfaces.
Kenneth Graunke [Sun, 22 May 2011 05:51:42 +0000 (22:51 -0700)]
i965/gen7: Fix miptree layout for cube surfaces.

Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Remove comments about pre-965 hardware.
Kenneth Graunke [Sun, 22 May 2011 14:09:53 +0000 (07:09 -0700)]
i965: Remove comments about pre-965 hardware.

They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agost/mesa: assign renderbuffer's format field when allocating storage
pepp [Tue, 12 Apr 2011 15:42:02 +0000 (17:42 +0200)]
st/mesa: assign renderbuffer's format field when allocating storage

See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agor600g: fix "Fixed-Point Data Conversions"
Christian König [Sat, 21 May 2011 13:37:29 +0000 (15:37 +0200)]
r600g: fix "Fixed-Point Data Conversions"

According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.

13 years agoi965: Fix sampling on Ivybridge after headerless change.
Kenneth Graunke [Fri, 20 May 2011 23:25:59 +0000 (16:25 -0700)]
i965: Fix sampling on Ivybridge after headerless change.

Fixes a regression since 90e922267a89fa9bef254bb257405531ceff7356.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Remove "TXD" from justification of sampler message headers.
Kenneth Graunke [Fri, 20 May 2011 23:28:29 +0000 (16:28 -0700)]
i965: Remove "TXD" from justification of sampler message headers.

The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
Kenneth Graunke [Wed, 18 May 2011 23:28:28 +0000 (16:28 -0700)]
i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.

The same as 3e43adef95ee24dd218279d2de56939b90edcb4c but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agost/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA
Benjamin Franzke [Fri, 13 May 2011 11:03:13 +0000 (13:03 +0200)]
st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA

13 years agost/dri: Support dri2 useflags in dri2_create_image
Benjamin Franzke [Fri, 13 May 2011 09:55:15 +0000 (11:55 +0200)]
st/dri: Support dri2 useflags in dri2_create_image

13 years agost/egl/wayland: Deal with wayland visual changes
Benjamin Franzke [Fri, 20 May 2011 07:33:47 +0000 (09:33 +0200)]
st/egl/wayland: Deal with wayland visual changes

Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.

13 years agomesa: Emit definition of GLAPIENTRYP in es_generator.py.
Thierry Reding [Fri, 20 May 2011 06:26:18 +0000 (08:26 +0200)]
mesa: Emit definition of GLAPIENTRYP in es_generator.py.

GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.

13 years agoglapi: More type-checking in Get_xxx too.
José Fonseca [Thu, 19 May 2011 16:44:06 +0000 (17:44 +0100)]
glapi: More type-checking in Get_xxx too.

13 years agogallivm: Fix for dynamically linked LLVM 2.8 library.
José Fonseca [Fri, 20 May 2011 10:54:18 +0000 (11:54 +0100)]
gallivm: Fix for dynamically linked LLVM 2.8 library.

This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.

13 years agor300: move declaration before code
Brian Paul [Fri, 20 May 2011 03:23:39 +0000 (21:23 -0600)]
r300: move declaration before code

13 years agost/glx: define/set new ST_CONTEXT_FLAG_bits
Brian Paul [Fri, 20 May 2011 01:40:32 +0000 (19:40 -0600)]
st/glx: define/set new ST_CONTEXT_FLAG_bits

13 years agost/glx: pass major, minor, context flags, etc to XMesaCreateContext()
Brian Paul [Fri, 20 May 2011 01:31:01 +0000 (19:31 -0600)]
st/glx: pass major, minor, context flags, etc to XMesaCreateContext()

13 years agost/glx: implement glXCreateContextAttribsARB()
Brian Paul [Fri, 20 May 2011 01:27:51 +0000 (19:27 -0600)]
st/glx: implement glXCreateContextAttribsARB()

13 years agost/glx: pass version, context flags, etc to create_context()
Brian Paul [Fri, 20 May 2011 01:25:49 +0000 (19:25 -0600)]
st/glx: pass version, context flags, etc to create_context()

13 years agost/glx: refactor create-context functions
Brian Paul [Fri, 20 May 2011 01:21:21 +0000 (19:21 -0600)]
st/glx: refactor create-context functions

13 years agomesa: fix vertex array enable checking in check_valid_to_render()
Brian Paul [Wed, 18 May 2011 22:19:06 +0000 (16:19 -0600)]
mesa: fix vertex array enable checking in check_valid_to_render()

In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.

13 years agomesa: handle some srgb cases in the fast path in _mesa_get_teximage
Roland Scheidegger [Thu, 14 Apr 2011 21:36:51 +0000 (23:36 +0200)]
mesa: handle some srgb cases in the fast path in _mesa_get_teximage

Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).

13 years agowayland-drm: Use new generic error event
Kristian Høgsberg [Wed, 11 May 2011 19:28:19 +0000 (15:28 -0400)]
wayland-drm: Use new generic error event

13 years agoglapi: Implement SET_xxx as inline functions instead of macros.
José Fonseca [Thu, 19 May 2011 15:49:49 +0000 (16:49 +0100)]
glapi: Implement SET_xxx as inline functions instead of macros.

In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.

13 years agomesa: add another missing GLAPIENTRY keyword
José Fonseca [Thu, 19 May 2011 15:39:57 +0000 (16:39 +0100)]
mesa: add another missing GLAPIENTRY keyword

NOTE: this is a candidate for the 7.10 branch.

13 years agonv50: add support for user clip planes
Maxim Levitsky [Thu, 19 May 2011 10:50:28 +0000 (12:50 +0200)]
nv50: add support for user clip planes

Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.

13 years agowayland: Fix link order for libwayland-drm.a
Kristian Høgsberg [Mon, 16 May 2011 20:29:53 +0000 (16:29 -0400)]
wayland: Fix link order for libwayland-drm.a

13 years agoi965: Add support for rendering to depthbuffer mipmap levels > 0.
Eric Anholt [Fri, 13 May 2011 19:13:40 +0000 (12:13 -0700)]
i965: Add support for rendering to depthbuffer mipmap levels > 0.

Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats

13 years agoi965: Stop caching the combined depth/stencil region in brw_context.c.
Eric Anholt [Fri, 13 May 2011 18:54:15 +0000 (11:54 -0700)]
i965: Stop caching the combined depth/stencil region in brw_context.c.

This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.

13 years agoi965/gen6: Add support for point min/max size from ARB_point_parameters.
Eric Anholt [Thu, 12 May 2011 21:19:51 +0000 (14:19 -0700)]
i965/gen6: Add support for point min/max size from ARB_point_parameters.

Fixes glean pointAtten.

13 years agoi965/fs: Don't emit a header on gen5+ sample messages unless required.
Eric Anholt [Thu, 12 May 2011 17:30:23 +0000 (10:30 -0700)]
i965/fs: Don't emit a header on gen5+ sample messages unless required.

Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
Eric Anholt [Thu, 12 May 2011 15:49:53 +0000 (08:49 -0700)]
i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.

In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Add support for correct GL_CLAMP behavior by clamping coordinates.
Eric Anholt [Tue, 2 Nov 2010 16:11:17 +0000 (09:11 -0700)]
i965: Add support for correct GL_CLAMP behavior by clamping coordinates.

This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
13 years agoi965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
Eric Anholt [Wed, 11 May 2011 20:08:03 +0000 (13:08 -0700)]
i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.

These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.

13 years agoi965/fs: Add support for "if" statements in 16-wide mode on gen6+.
Eric Anholt [Tue, 10 May 2011 19:55:12 +0000 (12:55 -0700)]
i965/fs: Add support for "if" statements in 16-wide mode on gen6+.

It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Fix discard and alpha test in 16-wide.
Eric Anholt [Wed, 11 May 2011 19:43:28 +0000 (12:43 -0700)]
i965/fs: Fix discard and alpha test in 16-wide.

As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/gen6: Fix blending state when no color buffer is bound.
Eric Anholt [Wed, 11 May 2011 21:07:44 +0000 (14:07 -0700)]
i965/gen6: Fix blending state when no color buffer is bound.

This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99b285f348cb8a1bba2931f120f7c0a1 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.

13 years agoi965/fs: Cut an instruction and a temporary from gen6 discard statements.
Eric Anholt [Tue, 10 May 2011 22:30:11 +0000 (15:30 -0700)]
i965/fs: Cut an instruction and a temporary from gen6 discard statements.

I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/fs: Fix compiler warnings about dead code from 963431829055f63ec94d
Eric Anholt [Mon, 9 May 2011 21:58:39 +0000 (14:58 -0700)]
i965/fs: Fix compiler warnings about dead code from 963431829055f63ec94d

13 years agogallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
José Fonseca [Wed, 18 May 2011 17:00:55 +0000 (18:00 +0100)]
gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.

Fixes fdo 36738.

13 years agoswrast: anisotropic filtering extension
Andreas Faenger [Wed, 18 May 2011 14:14:33 +0000 (08:14 -0600)]
swrast: anisotropic filtering extension

Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agomesa: simplify error check in _mesa_MapBufferRange()
Brian Paul [Wed, 18 May 2011 14:14:32 +0000 (08:14 -0600)]
mesa: simplify error check in _mesa_MapBufferRange()

13 years agomesa: only update array _MaxElement if array is enabled
Brian Paul [Wed, 18 May 2011 14:14:32 +0000 (08:14 -0600)]
mesa: only update array _MaxElement if array is enabled

Fixes failed assertion when calling _mesa_print_arrays() debug function.

13 years agomesa: check that flex/bison are installed
Brian Paul [Wed, 18 May 2011 13:50:21 +0000 (07:50 -0600)]
mesa: check that flex/bison are installed

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

NOTE: This is a candidate for the 7.10 branch.

13 years agoi965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
Kenneth Graunke [Wed, 18 May 2011 06:53:52 +0000 (23:53 -0700)]
i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.

This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoadd $SELINUX_LIBS to EGL and OpenVG lib deps
Tapani Pälli [Mon, 16 May 2011 13:56:43 +0000 (16:56 +0300)]
add $SELINUX_LIBS to EGL and OpenVG lib deps

Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>