mesa.git
13 years agomesa/vbo: s/inline/INLINE/
Vinson Lee [Wed, 7 Sep 2011 04:43:51 +0000 (21:43 -0700)]
mesa/vbo: s/inline/INLINE/

MSVC does not support inline keyword.

13 years agoi965/vs: Fix point size handling on gen4.
Eric Anholt [Tue, 30 Aug 2011 22:34:43 +0000 (15:34 -0700)]
i965/vs: Fix point size handling on gen4.

Fixes glsl-vs-point-size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Use write commits on scratch writes in pre-gen6.
Eric Anholt [Wed, 31 Aug 2011 00:56:33 +0000 (17:56 -0700)]
i965/vs: Use write commits on scratch writes in pre-gen6.

This is required to ensure ordering between reads and writes within a
thread.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix setup of scratch space pointer on pre-gen6.
Eric Anholt [Tue, 30 Aug 2011 23:58:03 +0000 (16:58 -0700)]
i965/vs: Fix setup of scratch space pointer on pre-gen6.

We were failing to relocate, so on the first draw run our scratch
would tend to get written to 0x0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix message setup for array read/writes on pre-gen6.
Eric Anholt [Tue, 30 Aug 2011 23:47:43 +0000 (16:47 -0700)]
i965/vs: Fix message setup for array read/writes on pre-gen6.

We were passing an MRF as the source argument, instead of using the
implied move and putting the MRF number in the proper place in the
instruction encoding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix constant-indexed array read/write addresses on pre-gen6.
Eric Anholt [Tue, 30 Aug 2011 23:40:06 +0000 (16:40 -0700)]
i965/vs: Fix constant-indexed array read/write addresses on pre-gen6.

The second vertex was getting a garbage index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Add support for vector comparison ops resulting in bool cond codes.
Eric Anholt [Tue, 30 Aug 2011 23:23:44 +0000 (16:23 -0700)]
i965/vs: Add support for vector comparison ops resulting in bool cond codes.

Fixes a giant pile of VS tests on gen4.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Make pre-gen6 math operate in vector mode instead of scalar.
Eric Anholt [Tue, 30 Aug 2011 22:59:26 +0000 (15:59 -0700)]
i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.

On the old backend, we used scalar mode because Mesa IR math is
result.xyzw = math(op0.xxxx), which matched up well.  However, in GLSL
IR we do things like result.xy = math(op0.xy), so we want vector mode.
For the common case of result.x = math(op0.x), performance will be the
same (no cost for un-executed channels), though result.xyzw =
math(op0.xxxx) would be worse.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix copy-and-paste disaster in pre-gen6 POW support.
Eric Anholt [Fri, 2 Sep 2011 23:58:30 +0000 (16:58 -0700)]
i965/vs: Fix copy-and-paste disaster in pre-gen6 POW support.

Fixes vs-pow-float-float and friends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix gen4 comparisons used for predication.
Eric Anholt [Fri, 2 Sep 2011 23:46:46 +0000 (16:46 -0700)]
i965/vs: Fix gen4 comparisons used for predication.

When we tried to retype a brw_null_reg() in CMP(), the retyping didn't
take effect because HW_REG just ignores the type field.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965/vs: Fix GPU hangs in shaders with large virtual GRFs pre-gen6.
Eric Anholt [Tue, 30 Aug 2011 22:50:17 +0000 (15:50 -0700)]
i965/vs: Fix GPU hangs in shaders with large virtual GRFs pre-gen6.

If you get your total GRF count wrong, you write over some other
shader's g0, and the GPU fails shortly thereafter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: add casts to silence int/enum conversion warnings
Brian Paul [Tue, 6 Sep 2011 22:50:27 +0000 (16:50 -0600)]
i965: add casts to silence int/enum conversion warnings

13 years agostate_trackers/dri/sw: Implement texture_from_pixmap.
Stéphane Marchesin [Tue, 30 Aug 2011 00:22:03 +0000 (17:22 -0700)]
state_trackers/dri/sw: Implement texture_from_pixmap.

Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
13 years agoDuplicate state_tracker/dri/sw/dri_drawable.c
Stéphane Marchesin [Tue, 30 Aug 2011 00:19:29 +0000 (17:19 -0700)]
Duplicate state_tracker/dri/sw/dri_drawable.c

We need this for the upcoming fix for sw texture_from_pixmap.

Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
13 years agoEnable GLX_EXT_texture_from_pixmap in software.
nobled [Mon, 29 Aug 2011 23:24:59 +0000 (16:24 -0700)]
Enable GLX_EXT_texture_from_pixmap in software.

Signed-off-by: nobled <nobled@dreamwidth.org>
Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
13 years agost/mesa: remove unneeded #include
Brian Paul [Tue, 6 Sep 2011 21:44:44 +0000 (15:44 -0600)]
st/mesa: remove unneeded #include

13 years agomesa: whitespace fixes, just to be consistent
Brian Paul [Tue, 6 Sep 2011 21:30:14 +0000 (15:30 -0600)]
mesa: whitespace fixes, just to be consistent

13 years agomesa: put _mesa_ prefix on vert_result_to_frag_attrib()
Brian Paul [Tue, 6 Sep 2011 21:29:24 +0000 (15:29 -0600)]
mesa: put _mesa_ prefix on vert_result_to_frag_attrib()

13 years agomesa: fix vert_result_to_frag_attrib() parameter type
Brian Paul [Tue, 6 Sep 2011 21:24:14 +0000 (15:24 -0600)]
mesa: fix vert_result_to_frag_attrib() parameter type

13 years agomesa: s/inline/INLINE/ to fix MSVC build
Brian Paul [Tue, 6 Sep 2011 21:20:33 +0000 (15:20 -0600)]
mesa: s/inline/INLINE/ to fix MSVC build

13 years agoDrop some Glide remnants
Adam Jackson [Tue, 6 Sep 2011 19:58:00 +0000 (15:58 -0400)]
Drop some Glide remnants

Apparently the x11 driver had a hack for glide passthrough.  Who knew?

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoRemove an AmiWin leftover
Adam Jackson [Tue, 6 Sep 2011 19:55:11 +0000 (15:55 -0400)]
Remove an AmiWin leftover

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoRemove dead glfbdev.h
Adam Jackson [Tue, 6 Sep 2011 19:50:11 +0000 (15:50 -0400)]
Remove dead glfbdev.h

This belonged to the now-dead swrast-on-fbdev driver.

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agoDrop documentation references for deleted backends
Adam Jackson [Wed, 29 Jun 2011 14:48:43 +0000 (10:48 -0400)]
Drop documentation references for deleted backends

Signed-off-by: Adam Jackson <ajax@redhat.com>
13 years agortasm,translate: Disable on Mingw-w64.
José Fonseca [Tue, 6 Sep 2011 19:40:21 +0000 (20:40 +0100)]
rtasm,translate: Disable on Mingw-w64.

Causes crash and stack corruption.

Needs more investigation. Disable for now.

13 years agodocs: skeleton file for 7.12 release notes
Ian Romanick [Wed, 31 Aug 2011 20:20:00 +0000 (13:20 -0700)]
docs: skeleton file for 7.12 release notes

Current just the items that have been removed from Mesa are mentioned
in the release notes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove support for unpacking from client memory to color-index pixels
Ian Romanick [Mon, 29 Aug 2011 21:33:51 +0000 (14:33 -0700)]
mesa: Remove support for unpacking from client memory to color-index pixels

Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoswrast: Use GL_STENCIL_INDEX for address calculations
Ian Romanick [Mon, 29 Aug 2011 21:06:00 +0000 (14:06 -0700)]
swrast: Use GL_STENCIL_INDEX for address calculations

GL_COLOR_INDEX produced the same result (because GL_BITMAP is always
used for stencil glDrawPixels), but it was confusing to read.  I spent
about 15 minutes wondering, "WTF?"

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove GL_COLOR_INDEX from _mesa_{dest,source}_buffer_exists
Ian Romanick [Mon, 29 Aug 2011 20:59:49 +0000 (13:59 -0700)]
mesa: Remove GL_COLOR_INDEX from _mesa_{dest,source}_buffer_exists

Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove GL_COLOR_INDEX from base format assertions
Ian Romanick [Mon, 29 Aug 2011 20:34:52 +0000 (13:34 -0700)]
mesa: Remove GL_COLOR_INDEX from base format assertions

_mesa_make_temp_float_image can't work on color-index textures, but
there is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoswrast: Remove GL_COLOR_INDEX from assertions
Ian Romanick [Mon, 29 Aug 2011 20:30:46 +0000 (13:30 -0700)]
swrast: Remove GL_COLOR_INDEX from assertions

These sampling functions don't work on color-index textures, but there
is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove unused struct gl_color_table
Ian Romanick [Mon, 29 Aug 2011 18:39:20 +0000 (11:39 -0700)]
mesa: Remove unused struct gl_color_table

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove unused functions _mesa_lookup_rgba_{float,ubyte}
Ian Romanick [Mon, 29 Aug 2011 18:38:55 +0000 (11:38 -0700)]
mesa: Remove unused functions _mesa_lookup_rgba_{float,ubyte}

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove all mention of GL_COLOR_INDEX*_EXT
Ian Romanick [Mon, 29 Aug 2011 16:49:04 +0000 (09:49 -0700)]
mesa: Remove all mention of GL_COLOR_INDEX*_EXT

These enums were only valid with the paletted texture extensions.
This allows a couple other trivial clean-ups.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ::UpdateText...
Ian Romanick [Mon, 29 Aug 2011 16:38:09 +0000 (09:38 -0700)]
mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ::UpdateTexturePalette

There's nothing left that can call any of these functions.  This also
removes the meta-ops code that implemented the first two.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agomesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette
Ian Romanick [Mon, 29 Aug 2011 16:37:24 +0000 (09:37 -0700)]
mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette

This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.

v2: A lot of bits that were missed in the previous patch have been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoi965: Remove two_side_color from brw_compute_vue_map().
Paul Berry [Sat, 3 Sep 2011 15:42:28 +0000 (08:42 -0700)]
i965: Remove two_side_color from brw_compute_vue_map().

Since we now lay out the VUE the same way regardless of whether
two-sided color is enabled, brw_compute_vue_map() no longer needs to
know whether two-sided color is enabled.  This allows the two-sided
color flag to be removed from the clip, GS, and VS keys, so that fewer
GPU programs need to be recompiled when turning two-sided color on and
off.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: For GEN6+, always make front/back colors adjacent in VUE.
Paul Berry [Sat, 3 Sep 2011 15:23:27 +0000 (08:23 -0700)]
i965: For GEN6+, always make front/back colors adjacent in VUE.

When doing two-sided color on GEN6+, we use the SF unit's
INPUTATTR_FACING mode to cause front colors to be used on front-facing
triangles, and back colors to be used on back-facing triangles.  This
mode requires that the front and back colors be adjacent in the VUE.

Previously, we would only place front and back colors adjacent in the
VUE when two-sided color was enabled.  Now we place them adjacent in
the VUE whether two-sided color is enabled or not.  (We still only
swizzle the colors when two-sided color is enabled, so there should be
no user-visible change).

This simplifies the implementation of the VUE map and reduces the
amount of code that is dependent on two-sided color mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: GS: Use the VUE map to compute URB size.
Paul Berry [Tue, 30 Aug 2011 17:54:14 +0000 (10:54 -0700)]
i965: GS: Use the VUE map to compute URB size.

The previous computation had two bugs: (a) it used a formula based on
Gen5 for Gen6 and Gen7 as well. (b) it failed to account for the fact
that PSIZ is stored in the VUE header.  Fortunately, both bugs caused
it to compute a URB size that was too large, which was benign.  This
patch computes the URB size directly from the VUE map, so it gets the
result correct in all circumstances.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Remove no-longer-needed variables.
Paul Berry [Fri, 26 Aug 2011 16:30:35 +0000 (09:30 -0700)]
i965: clip: Remove no-longer-needed variables.

The variables offset[], idx_to_attr[], nr_bytes, nr_attrs, and
header_regs were all serving purposes which are now served by the VUE
map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()
Paul Berry [Fri, 26 Aug 2011 19:17:56 +0000 (12:17 -0700)]
i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()

Previously, brw_clip_interp_vertex() iterated only through the
"non-header" elements of the VUE when performing interpolation
(because header elements don't need interpolation).  This code now
refers exclusively to the VUE map to figure out which elements need
interpolation, so that brw_clip_interp_vertex() doesn't need to know
the header size.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Change computation of nr_regs to use VUE map.
Paul Berry [Fri, 26 Aug 2011 19:08:43 +0000 (12:08 -0700)]
i965: clip: Change computation of nr_regs to use VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Convert computations to ..._to_offset() for clarity.
Paul Berry [Wed, 31 Aug 2011 22:34:01 +0000 (15:34 -0700)]
i965: clip: Convert computations to ..._to_offset() for clarity.

This patch replaces some ad-hoc computations using ATTR_SIZE and the
offset[] array to use the VUE map functions
brw_vert_result_to_offset() and brw_vue_slot_to_offset().

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Add a function to determine whether a vert_result is in use.
Paul Berry [Thu, 25 Aug 2011 20:27:57 +0000 (13:27 -0700)]
i965: clip: Add a function to determine whether a vert_result is in use.

Previously we would examine the offset[] array (since an offset of 0
meant "not in use").  This paves the way for removing the offset[]
array.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Rework brw_clip_interp_vertex() to use the VUE map.
Paul Berry [Thu, 25 Aug 2011 18:14:47 +0000 (11:14 -0700)]
i965: clip: Rework brw_clip_interp_vertex() to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Modify brw_clip_interp_vertex() to use the VUE map.
Paul Berry [Thu, 25 Aug 2011 17:42:29 +0000 (10:42 -0700)]
i965: clip: Modify brw_clip_interp_vertex() to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Move header_regs into brw_clip_compile.
Paul Berry [Thu, 25 Aug 2011 16:58:30 +0000 (09:58 -0700)]
i965: clip: Move header_regs into brw_clip_compile.

This makes header_regs available for computing VUE offsets within clip code.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Modify brw_clip_tri_alloc_regs() to use the VUE map.
Paul Berry [Thu, 25 Aug 2011 15:06:31 +0000 (08:06 -0700)]
i965: clip: Modify brw_clip_tri_alloc_regs() to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Move hpos_offest and ndc_offset into local functions.
Paul Berry [Thu, 25 Aug 2011 03:03:35 +0000 (20:03 -0700)]
i965: clip: Move hpos_offest and ndc_offset into local functions.

The offsets within the VUE of HPOS and NDC are needed only in a few
auxiliary clipping functions.  This patch moves computation of those
offsets into the functions that need them, and does the computation
using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: rename header_position_offset to the more correct ndc_offset.
Paul Berry [Thu, 25 Aug 2011 02:57:51 +0000 (19:57 -0700)]
i965: clip: rename header_position_offset to the more correct ndc_offset.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: clip: Add VUE map computation to clip stage for Gen4-5.
Paul Berry [Thu, 25 Aug 2011 02:51:54 +0000 (19:51 -0700)]
i965: clip: Add VUE map computation to clip stage for Gen4-5.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Change gen{6,7}_sf_state.c to compute URB read length based on VUE map.
Paul Berry [Wed, 31 Aug 2011 16:31:00 +0000 (09:31 -0700)]
i965: SF: Change gen{6,7}_sf_state.c to compute URB read length based on VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Move outputs_written to a local variable for clarity.
Paul Berry [Wed, 31 Aug 2011 16:33:57 +0000 (09:33 -0700)]
i965: SF: Move outputs_written to a local variable for clarity.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: New implementation of get_attr_override using the VUE map.
Paul Berry [Tue, 30 Aug 2011 20:06:14 +0000 (13:06 -0700)]
i965: SF: New implementation of get_attr_override using the VUE map.

This patch changes get_attr_override() (which computes the
relationship between vertex shader outputs and fragment shader inputs)
to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Remove unnecessary variables.
Paul Berry [Thu, 25 Aug 2011 02:04:31 +0000 (19:04 -0700)]
i965: SF: Remove unnecessary variables.

This patch removes the variables nr_attrs and nr_setup_attrs, whose
purpose is now being served by the VUE map.  nr_attr_regs and
nr_setup_regs are still needed, however they are now computed using
the VUE map rather than by counting the number of vertex shader
outputs (which caused subtle bugs when gl_PointSize was written).

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Stop using nr_setup_attrs in compute_masks.
Paul Berry [Thu, 25 Aug 2011 01:57:32 +0000 (18:57 -0700)]
i965: SF: Stop using nr_setup_attrs in compute_masks.

Previously, the SF used nr_setup_attrs to determine whether it was
looking at the last element of the VUE.  Changed this code to use the
VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Remove attr_to_idx and idx_to_attr.
Paul Berry [Thu, 25 Aug 2011 01:41:30 +0000 (18:41 -0700)]
i965: SF: Remove attr_to_idx and idx_to_attr.

These data structures were serving the same purpose as the VUE map,
but were buggy.  Now that the code has been transitioned to use the
VUE map, they are not needed.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Change calculate_masks to use the VUE map.
Paul Berry [Wed, 24 Aug 2011 22:48:55 +0000 (15:48 -0700)]
i965: SF: Change calculate_masks to use the VUE map.

Previously, SF code used the idx_to_attr[] array to compute the
location of entries in the VUE map.  This array didn't properly
account for gl_PointSize.  Now we use the VUE map directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Change the flags that refer to "attr" to be based on gl_vert_result.
Paul Berry [Wed, 24 Aug 2011 22:32:17 +0000 (15:32 -0700)]
i965: SF: Change the flags that refer to "attr" to be based on gl_vert_result.

Previously, some of the code in SF erroneously used bitfields based on
the gl_frag_attrib enum when actually referring to vertex results.
This worked, because coincidentally the particular enum values being
used happened to match between gl_frag_attrib and gl_vert_result.  But
it was fragile, because a future change to either gl_vert_result or
gl_frag_attrib would have made the enum values stop matching up.  This
patch switches the SF code to use the correct enum.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: change get_vert_attr to use the VUE map, and rename it.
Paul Berry [Wed, 24 Aug 2011 19:19:10 +0000 (12:19 -0700)]
i965: SF: change get_vert_attr to use the VUE map, and rename it.

The new function, called get_vert_result(), uses the VUE map to find
the register containing a given vertex attribute.  Previously, we used
the attr_to_idx[] array, which served the same purpose but didn't
account for gl_PointSize correctly.

This fixes a bug on pre-Gen6 wherein the back side of a triangle would
be rendered incorrectyl if the vertex shader wrote to gl_PointSize.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Modify calculate_point_sprite_mask to use the VUE map.
Paul Berry [Tue, 23 Aug 2011 22:49:32 +0000 (15:49 -0700)]
i965: SF: Modify calculate_point_sprite_mask to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: SF: Move the computation of urb_entry_read_offset.
Paul Berry [Tue, 23 Aug 2011 20:49:19 +0000 (13:49 -0700)]
i965: SF: Move the computation of urb_entry_read_offset.

This patch moves the computation of the SF URB entry read offset from
upload_sf_unit() to its own function, so that it can be re-used when
creating the gen4-5 SF program.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: Compute urb entry size based on the VUE map.
Paul Berry [Tue, 23 Aug 2011 18:43:46 +0000 (11:43 -0700)]
i965: new VS: Compute urb entry size based on the VUE map.

Previously, the new VS backend computed the size of the URB entry by
counting the number of MRFs used in emitting the URB entry.  Now it
just gets it straight from the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: Clarify comments about max_usable_mrf and add an assertion.
Paul Berry [Tue, 23 Aug 2011 18:41:41 +0000 (11:41 -0700)]
i965: new VS: Clarify comments about max_usable_mrf and add an assertion.

max_usable_mrf has been carefully set such that (max_usable_mrf -
base_mrf) is a multiple of 2, so that an even number of VUE slots are
emitted with each URB write (which Gen6 requires).  This patch adds an
assertion to confirm that this is the case, and moves the comment to
this effect to be near the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: use the VUE map to write out vertex attributes.
Paul Berry [Tue, 23 Aug 2011 18:07:56 +0000 (11:07 -0700)]
i965: new VS: use the VUE map to write out vertex attributes.

Previously, the new VS backend used two functions,
emit_vue_header_gen6() and emit_vue_header_gen4() to emit the fixed
parts of the VUE, and then a pair of carefully-constructed loops to
emit the rest of the VUE, leaving out the parts that were already
emitted as part of the header.

This patch changes the new VS backend to use the VUE map to emit the
entire VUE.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: move clip distance computation (GEN5+) to a separate function.
Paul Berry [Tue, 23 Aug 2011 17:41:31 +0000 (10:41 -0700)]
i965: new VS: move clip distance computation (GEN5+) to a separate function.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: Move PSIZ/flags computation to a separate function.
Paul Berry [Tue, 23 Aug 2011 17:29:48 +0000 (10:29 -0700)]
i965: new VS: Move PSIZ/flags computation to a separate function.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: move NDC computation (GEN4-5) to a separate function.
Paul Berry [Tue, 23 Aug 2011 17:26:15 +0000 (10:26 -0700)]
i965: new VS: move NDC computation (GEN4-5) to a separate function.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: new VS: Use output_reg[] to find NDC and HPOS registers.
Paul Berry [Tue, 23 Aug 2011 17:17:34 +0000 (10:17 -0700)]
i965: new VS: Use output_reg[] to find NDC and HPOS registers.

Previously, emit_vue_header_gen4() used local variables to keep track
of which registers were storing the NDC and HPOS.  This patch uses the
output_reg[] array instead, so that the code that manipulates NDC and
HPOS can be more easily refactored.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: old VS: use the VUE map to compute the URB entry size.
Paul Berry [Tue, 23 Aug 2011 05:09:02 +0000 (22:09 -0700)]
i965: old VS: use the VUE map to compute the URB entry size.

Previously, the old VS backend computed the URB entry size by adding
the number of vertex shader outputs to the size of the URB header.
This often produced a larger result than necessary, because some
vertex shader outputs are stored in the header, so they were being
double counted.  This patch changes the old VS backend to compute the
URB entry size directly from the number of slots in the VUE map.

Note: there's a subtle change in that we no longer count header
registers towards the size of the VF input.  I believe this is
correct, because the header is only emitted in the output of the VS
stage--it is not present in the input.  (As evidence for this, note
that brw_vs_state.c sets urb_entry_read_offset to 0--it does not
include space for the header as part of the VS input).

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: old VS: Use brw_vue_map instead of implicit assumptions about VUE structure.
Paul Berry [Wed, 31 Aug 2011 22:04:42 +0000 (15:04 -0700)]
i965: old VS: Use brw_vue_map instead of implicit assumptions about VUE structure.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Add functions to compute offsets within the VUE map.
Paul Berry [Thu, 1 Sep 2011 22:30:21 +0000 (15:30 -0700)]
i965: Add functions to compute offsets within the VUE map.

Some parts of the i965 driver keep track of locations within the VUE
(vertex URB entry) using byte offsets.  This patch adds inline
functions to compute these byte offsets using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Write code to compute a VUE map.
Paul Berry [Wed, 31 Aug 2011 22:04:23 +0000 (15:04 -0700)]
i965: Write code to compute a VUE map.

Several places in the i965 code make implicit assumptions about the
structure of data in the VUE (vertex URB entry).  This patch adds a
function, brw_compute_vue_map(), which computes the structure of the
VUE explicitly.  Future patches will modify the rest of the driver to
use the explicitly computed map rather than rely on implicit
assumptions about it.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoRefactor code that converts between gl_vert_result and gl_frag_attrib.
Paul Berry [Tue, 30 Aug 2011 18:46:29 +0000 (11:46 -0700)]
Refactor code that converts between gl_vert_result and gl_frag_attrib.

Previously, this conversion was duplicated in several places in the
i965 driver.  This patch moves it to a common location in mtypes.h,
near the declaration of gl_vert_result and gl_frag_attrib.

I've also added comments to remind us that we may need to revisit the
conversion code when adding elements to gl_vert_result and
gl_frag_attrib.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agodocs: more info about non-subscriber list postings
Brian Paul [Tue, 6 Sep 2011 15:19:36 +0000 (09:19 -0600)]
docs: more info about non-subscriber list postings

13 years agodocs: update link, remove dead links
Brian Paul [Tue, 6 Sep 2011 14:40:53 +0000 (08:40 -0600)]
docs: update link, remove dead links

13 years agoscons: Set -static-libstdc++ on mingw-w64
José Fonseca [Tue, 6 Sep 2011 12:14:09 +0000 (13:14 +0100)]
scons: Set -static-libstdc++ on mingw-w64

To avoid depending on libstdc++-xxx.dll

13 years agoscons: Move MinGW flags from crossmingw.py to gallium.py
José Fonseca [Tue, 6 Sep 2011 12:13:32 +0000 (13:13 +0100)]
scons: Move MinGW flags from crossmingw.py to gallium.py

So that they are used by native MinGW compilers too.

13 years agor600g: add TXQ and TXF support
Dave Airlie [Wed, 24 Aug 2011 12:29:56 +0000 (13:29 +0100)]
r600g: add TXQ and TXF support

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: add initial evergreen integer opcode support
Dave Airlie [Fri, 5 Aug 2011 18:08:10 +0000 (19:08 +0100)]
r600g: add initial evergreen integer opcode support

This just adds the opcodes for evergreen, need to work on r600 and cayman
implementations.

don't advertise nativeintegers yet until we work out all the regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodocs: update gl3.txt for ARB_vertex_type_2_10_10_10_rev
Dave Airlie [Sun, 4 Sep 2011 07:25:00 +0000 (08:25 +0100)]
docs: update gl3.txt for ARB_vertex_type_2_10_10_10_rev

13 years agomesa/st: add support for 2101010 vertex format conversion.
Dave Airlie [Sat, 19 Feb 2011 21:04:19 +0000 (07:04 +1000)]
mesa/st: add support for 2101010 vertex format conversion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agomesa/varray: add interface support for ARB_vertex_type_2_10_10_10_rev (v2)
Dave Airlie [Sat, 13 Aug 2011 14:30:38 +0000 (15:30 +0100)]
mesa/varray: add interface support for ARB_vertex_type_2_10_10_10_rev (v2)

This just adds all the API check for vertex arrays using 2101010 types.

2101010 is also useable with GL_BGRA.

v2: fix whitespace.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agomesa/vbo: add ARB_vertex_type_2_10_10_10_rev APIs.
Dave Airlie [Sun, 4 Sep 2011 08:04:13 +0000 (09:04 +0100)]
mesa/vbo: add ARB_vertex_type_2_10_10_10_rev APIs.

This adds the vertex processing paths for the 2101010 types. It converts
the attributes to floats for all the immediate entry points, some entrypoints
are normalised and the attrib APIs take a normalized parameter.

There are four main paths,
ui10 -> float unnormalized
i10 -> float unnormalized
ui10 -> float normalized
i10 -> float normalized
along with the ui2/i2 equivs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agomesa: add initial API changes for ARB_vertex_type_2_10_10_10_rev.
Dave Airlie [Sun, 21 Nov 2010 22:12:57 +0000 (08:12 +1000)]
mesa: add initial API changes for ARB_vertex_type_2_10_10_10_rev.

add new APIs to the internal mesa driver interface + set funcs in vtxfmt.c

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoglapi: regen API files for new extension
Dave Airlie [Sun, 4 Sep 2011 07:45:32 +0000 (08:45 +0100)]
glapi: regen API files for new extension

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoglapi: add ARB_vertex_type_2_10_10_10_rev entrypoints. (v2)
Dave Airlie [Sun, 21 Nov 2010 22:11:46 +0000 (08:11 +1000)]
glapi: add ARB_vertex_type_2_10_10_10_rev entrypoints. (v2)

These are the new API entrypoints for ARB_vertex_type_2_10_10_10_rev
extension, along with the new INT_2_10_10_10_REV enum.

v2: fixup crazy whitespace cut-n-paste mess

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agomesa: add a UniformBooleanTrue option
Bryan Cain [Mon, 5 Sep 2011 19:54:37 +0000 (14:54 -0500)]
mesa: add a UniformBooleanTrue option

Drivers supporting native integers set UniformBooleanTrue to the integer value
that should be used for true when uploading uniform booleans.  This is ~0 for
Gallium and 1 for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agor600g: add 10/10/10/2 vertex format conversion.
Dave Airlie [Mon, 5 Sep 2011 14:03:34 +0000 (15:03 +0100)]
r600g: add 10/10/10/2 vertex format conversion.

13 years agogallium: add missing formats for ARB_vertex_type_2_10_10_10_rev
Dave Airlie [Sun, 21 Nov 2010 22:11:03 +0000 (08:11 +1000)]
gallium: add missing formats for ARB_vertex_type_2_10_10_10_rev

This just reorgs one define in csv file, and adds all the new formats
that are needed for this extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agogallivm: fix build with LLVM 3.0svn
Tobias Droste [Sun, 4 Sep 2011 01:14:23 +0000 (03:14 +0200)]
gallivm: fix build with LLVM 3.0svn

LLVM 3.0svn moved TargetRegistry.h and TargetSelect.h.
See revision 138450 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
13 years agoglsl_to_tgsi: fixes for native integers and integer booleans
Bryan Cain [Sun, 4 Sep 2011 19:31:16 +0000 (14:31 -0500)]
glsl_to_tgsi: fixes for native integers and integer booleans

This fixes all but one of the piglit regressions from enabling native integers
in softpipe.  The change to fix the last regression is still being discussed.

13 years agoxvmc: Replace frame_started by picture_structure
Maarten Lankhorst [Fri, 2 Sep 2011 14:20:02 +0000 (16:20 +0200)]
xvmc: Replace frame_started by picture_structure

The preferred solution to keeping track of the picture structure
has been putting it in the state tracker, so use picture_structure
instead of frame_started to check if a frame needs to begin.

If picture_structure has been changed, end the frame and start again.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
13 years agointel: fix build error
Yuanhan Liu [Sat, 3 Sep 2011 22:02:14 +0000 (06:02 +0800)]
intel: fix build error

Fix a build error introduced by commit 6862b54f:
i965_dri.so.tmp: undefined reference to `strerr'

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
13 years agomesa: handle zero-size buffers in MapBuffer and ranges in MapBufferRange (v3)
Marek Olšák [Tue, 30 Aug 2011 17:10:06 +0000 (19:10 +0200)]
mesa: handle zero-size buffers in MapBuffer and ranges in MapBufferRange (v3)

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoglsl_to_tgsi: fix more potential shader reference leaks
Marek Olšák [Tue, 30 Aug 2011 15:11:34 +0000 (17:11 +0200)]
glsl_to_tgsi: fix more potential shader reference leaks

The last one has been pointed out by Ian.

13 years agointel: Give an explanation why we are exiting for debugging.
Eugeni Dodonov [Fri, 2 Sep 2011 13:29:31 +0000 (10:29 -0300)]
intel: Give an explanation why we are exiting for debugging.

This could happen in 3 different cases, and ERRNO can explain what
happened. First case would be EIO (gpu hang), second EINVAL (something is
wrong inside the batch), and we also discovered that sometimes it happens
with ENOSPACE. All of those cases are different it it could be worth to at
least know what happened.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
13 years agoi965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.
Kenneth Graunke [Tue, 30 Aug 2011 19:34:13 +0000 (12:34 -0700)]
i965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.

According to the comment, we need to load /some/ push constants on
pre-Gen6 hardware or the GPU will hang.  The existing code set these
bogus parameters to NULL pointers; unfortunately, the code in
brw_curbe.c that loads them dereferences those pointers.  So, change
them to be pointers to an actual floating point value of 0.0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agointel: Upload batchbuffer contents even if INTEL_NO_HW is set.
Eric Anholt [Wed, 31 Aug 2011 00:36:57 +0000 (17:36 -0700)]
intel: Upload batchbuffer contents even if INTEL_NO_HW is set.

It is useful for debugging to dump batchbuffers while not actually
executing them.

13 years agogallium: add caps for MIN/MAX texel offsets.
Dave Airlie [Mon, 29 Aug 2011 13:35:16 +0000 (14:35 +0100)]
gallium: add caps for MIN/MAX texel offsets.

As per Brian's suggestion, add caps for drivers that support texture
offsets to advertise a min/max via TGSI, also use it in the state tracker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>