Commit graph

47291 commits

Author SHA1 Message Date
Ian Romanick
a04211ecb8 glsl: Generate an error for array-of-array declarations
Other parts of the code already caught things like 'float x[4][2]'.
However, nothing caught 'float [4] x[2]'.

Fixes piglit test array-multidimensional-new-syntax.vert.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:36 -07:00
Marek Olšák
e79aaf000b r300c/compiler: remove the compiler too
Gallium has a fork of this.
2011-10-28 21:28:31 +02:00
Kenneth Graunke
512431b357 i965/fs: Use the actual hardware g0 register for texel offset setup.
The idea here is to set up the message header with the Sampler State
pointer which the hardware provides as part of the PS Thread Payload in
register g0.

Unfortunately, the existing code

   fs_reg(GRF, 0, BRW_REGISTER_TYPE_UD))

actually references "virtual GRF 0" rather than the hardware g0.  This
is just some arbitrary GRF temporary which will get register allocated.

So, we ended up setting up the header with garbage.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-28 12:11:52 -07:00
Eric Anholt
058e712415 u_format: Fix -NaN handling for packing of 10F_11F_11F_REV to match GL specs.
Fixes the remainder of piglit GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
00d3716f4a u_format: Fix clamping of overflow in 10F_11F_11F_REV to match GL specs.
Fixes the 1000000.0 overflow cases of piglit
GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
b4d988bc9f mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.
From the GL_EXT_packed_float spec:

    For an RGBA color, if <type> is not one of FLOAT,
    UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT,
    or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB
    is FIXED_ONLY_ARB and the selected color (or texture) buffer is
    a fixed-point buffer, each component is first clamped to [0,1].
    Then the appropriate conversion formula from table 4.7 is applied
    the component."

(but we previously resolved that the CLAMP_READ_COLOR bit is not
relevant to glGetTexImage())

This fixes most of the cases in piglit GL_EXT_packed_float/pack.

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
3d7477206d u_format: Fix bitshifting for unpacking from 10F.
This code was copy and pasted from the 11F unpacking, but not updated
for actually being 10 bits instead of 11.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41206
Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
028ce1cd0f u_format: Fix bit definition of UF10_MANTISSA_BITS.
This is only used in the code for packing to INF, and resulted in an
extra bit set that was set anyway, so it was harmless except for the
confusion caused.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:09:47 -07:00
Eric Anholt
687e4446bf glsl: Implement GLSL 1.30's literal integer range restrictions.
From page 22 (28 of PDF) of GLSL 1.30 spec:
    It is an error to provide a literal integer whose magnitude is too
    large to store in a variable of matching signed or unsigned type.

    Unsigned integers have exactly 32 bits of precision.  Signed integers
    use 32 bits, including a sign bit, in two's complement form.

Fixes piglit int-literal-too-large-0[123].frag.

v2: Take care with INT_MIN, use stroull, and make it a function.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:03:03 -07:00
Eric Anholt
974c66875e radeon: Remove the non-libdrm kernel memory manager support.
We should have never been building this at this point.
2011-10-28 11:32:10 -07:00
Eric Anholt
830e546f94 radeon: Insist on libdrm being present to build.
There's no sense in building a broken driver.  Previously, there was
the potential of building a DRI1-only driver that would work for DRI1
and fail on DRI2 because the newer libdrm code wasn't present.  Now
the radeon build system should be matching intel and nouveau.
2011-10-28 11:32:00 -07:00
Eric Anholt
48c9925367 configure.ac: Fix equality checks in gallium st setup. 2011-10-28 11:31:11 -07:00
Eric Anholt
bd51e8e4f4 dri: Remove driver GenerateMipmap hooks.
Mesa sets up _mesa_meta_GenerateMipmap as the default hook, which does
this check for fallback and call the fallback itself.
2011-10-28 11:31:11 -07:00
Eric Anholt
eb135fe8c1 radeon: Drop some remaining DRI1 vblank support code. 2011-10-28 11:31:11 -07:00
Eric Anholt
a9f7515890 intel: remove dead prototype for old DRI1 code.
Noticed while grepping for radeon code.
2011-10-28 11:31:11 -07:00
Eric Anholt
339c1731c3 radeon: Simplify cliprects computation now that there's just 1.
This can probably be reduced even further by moving this logic to the
scissor state update or just removing the logic entirely, but I don't
trust myself in radeon quite that much.
2011-10-28 11:31:11 -07:00
Eric Anholt
cab4578024 radeon: Drop the clipping in spans, now that we always have (0,0) -> (w,h). 2011-10-28 11:31:11 -07:00
Eric Anholt
8c11f0a883 radeon: Drop the legacy BO manager code. 2011-10-28 11:27:56 -07:00
Eric Anholt
976d4f58fa radeon: Drop the DRI1 zero-copy TFP code. 2011-10-28 11:27:42 -07:00
Eric Anholt
1553723712 radeon: Drop the radeon_cs_legacy code now that we rely on kernel mm. 2011-10-28 11:23:43 -07:00
Eric Anholt
53b382637c radeon: Drop dri2 checks now that it's always true.
This makes LOCK_HARDWARE empty, so it goes away.
2011-10-28 11:23:33 -07:00
Eric Anholt
fb52b4303d radeon: Drop the DRI1 swapbuffers implementation. 2011-10-28 11:23:09 -07:00
Eric Anholt
0973a1ec78 radeon: Drop the non-kernel-memory-manager support, and thus DRI1.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Diff produced by treating kernel_mm as true, deleting the DRI1 paths
that produce kernel_mm false, and deleting code.
2011-10-28 11:23:09 -07:00
Eric Anholt
4a2f00889b r200: Drop the non-kernel-memory-manager and DRI1 code. 2011-10-28 11:22:26 -07:00
Eric Anholt
3996ed555e radeon: Unifdef RADEON_R300 and RADEON_R600. 2011-10-28 11:21:38 -07:00
Eric Anholt
b300d62617 docs: Update to note that r300 and r600 have been replaced. 2011-10-28 11:20:30 -07:00
Eric Anholt
de22b9018f r300c, r600c: Remove these DRI drivers.
They have been superseded by the gallium equivalents.

Acked-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Acked-by: Corbin Simpson <mostawesomedude@gmail.com>
2011-10-28 11:20:30 -07:00
Eric Anholt
2f4c7ebea6 mesa: Remove build infrastructure for r300c and r600c.
These drivers have been superseded by the gallium equivalents.
2011-10-28 11:19:56 -07:00
Eric Anholt
9171bfe5f6 radeon: Delete DRI1 screen init code and thus support for !kernel_mm.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Cleanup of the resulting dead code to follow.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
2011-10-28 11:19:14 -07:00
Eric Anholt
a34c28f1aa dri: Drop _dri_texformats that just obfuscate MESA_FORMAT names.
The remaining _dri_texformats are the ones that are variable depending
on the endianness of the system.
2011-10-28 11:19:14 -07:00
Eric Anholt
8d9c5167ac radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup. 2011-10-28 11:19:14 -07:00
Eric Anholt
964c5195a2 radeon: Remove dead swrast renderbuffer setup code.
This was from the stub code in the initial commit of this file.
2011-10-28 11:19:14 -07:00
Kenneth Graunke
3b4d2eac60 glsl: Remove pointless uses of glsl_type::get_base_type().
These are effectively doing type->get_base_type()->base_type, which is
equivalent to type->base_type.  Just use that, as it's simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 11:12:33 -07:00
Marek Olšák
1e1a7011ee r600g: don't flush before reading query results
Taken care of by the winsys.
2011-10-28 19:29:05 +02:00
Marek Olšák
e9b6f21a50 r600g: only maintain the list of active queries
And not all existing queries. The only reason we have that list is to be able
to suspend and resume the active ones.

This reduces looping over queries when suspending and resuming.
The queries no longer have to track some of their states.
2011-10-28 19:29:05 +02:00
Marek Olšák
b70a51318a r600g: cleanup r600_query_result 2011-10-28 19:29:05 +02:00
Marek Olšák
1de02d7364 r600g: don't flush in r600_get_backend_mask
The winsys does the flush in buffer_map.
2011-10-28 19:29:05 +02:00
Marek Olšák
6e79127e79 r600g: remove redundant variable r600_query::buffer_size 2011-10-28 19:29:05 +02:00
Marek Olšák
671af44b19 r300g: remove useless code 2011-10-28 19:29:04 +02:00
Alan Coopersmith
68657183b0 gallium/auxiliary/util: Solaris also has standard Unix sockets
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-27 22:43:02 -07:00
Tom Stellard
17a1c0cb0d r300/compiler: Fix scheduler bug causing texture corruption
We weren't setting TEX_SEM_WAIT on instructions that read the value of a
TEX instruction and also wrote the same register as the TEX instruction.

This is the sequence we were miscompiling:

1: TEX temp[0], input[2].xy__, 2D[0]
...
16: src0.xyz = temp[22], src1.xyz = temp[0], src2.xyz = temp[19]
      MAD temp[0].xyz, src0.xxx, src1.xyz, src2.xxx

https://bugs.freedesktop.org/show_bug.cgi?id=42090
2011-10-27 20:35:31 -04:00
Paul Berry
5aa96286e7 i965/gen6+: Add support for noperspective interpolation.
This required the following changes:

- WM setup now makes the appropriate set of barycentric coordinates
  (perspective vs. noperspective) available to the fragment shader,
  based on whether the shader requires perspective interpolation,
  noperspective interpolation, both, or neither.

- The fragment shader backend now uses the appropriate set of
  barycentric coordiantes when interpolating, based on the
  interpolation mode returned by
  ir_variable::determine_interpolation_mode().

- SF setup now uses gl_fragment_program::InterpQualifier to determine
  which attributes are to be flat shaded (as opposed to the old logic,
  which only flat shaded colors).

- CLIP setup now ensures that the clipper outputs non-perspective
  barycentric coordinates when they are needed by the fragment shader.

Fixes the remaining piglit tests of interpolation qualifiers that were
failing:
- interpolation-flat-*-smooth-none
- interpolation-flat-other-flat-none
- interpolation-noperspective-*
- interpolation-smooth-gl_*Color-flat-*

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:20 -07:00
Paul Berry
4d563ec1cc i965/gen6+: Rename GEN6_CLIP_BARYCENTRIC_ENABLE.
The name was misleading.  The actual effect of the bit is to cause
the clipper to emit *non-perspective* barycentric coordinate
information (which is only needed when doing noperspective
interpolation).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:08 -07:00
Paul Berry
f8386a29f0 i965/fs: use determine_interpolation_mode().
This patch changes how fs_visitor::emit_general_interpolation()
decides what kind of interpolation to do.  Previously, it used the
shade model to determine how to interpolate colors, and used smooth
interpolation on everything else.  Now it uses
ir_variable::determine_interpolation_mode(), so that it respects GLSL
1.30 interpolation qualifiers.

Fixes piglit tests interpolation-flat-*-smooth-{distance,fixed,vertex}
and interpolation-flat-other-flat-{distance,fixed,vertex}.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:00 -07:00
Paul Berry
e04bdeae82 i965/gen6+: Parameterize barycentric interpolation modes.
This patch modifies the fragment shader back-end so that instead of
using a single delta_x/delta_y register pair to store barycentric
coordinates, it uses an array of such register pairs, one for each
possible intepolation mode.

When setting up the WM, we intstruct it to only provide the
barycentric coordinates that are actually needed by the fragment
shader--that is computed by brw_compute_barycentric_interp_modes().
Currently this function returns just
BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC, because this is the only
interpolation mode we support.  However, that will change in a later
patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:53 -07:00
Paul Berry
102bdd26e1 i965/fs: Fix split_virtual_grfs() when delta_xy not in a virtual register.
This patch modifies the special case in
fs_visitor::split_virtual_grfs() that prevents splitting from being
applied to the delta_x/delta_y register pair (this register pair needs
to remain contiguous so that it can be used by the PLN instruction).

When gen>=6, this register pair is in a fixed location, not a virtual
register, so it was in no danger of being split.  And
split_virtual_grfs' attempt not to split it was preventing some other
unrelated register from being split.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:47 -07:00
Paul Berry
baf7f99fd7 glsl: add ir_variable::determine_interpolation_mode() function.
This function determines how a variable should be interpolated based
both on interpolation qualifiers and the current shade model.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:32 -07:00
Paul Berry
c488150dea glsl: Distinguish between no interpolation qualifier and 'smooth'
Previously, we treated the 'smooth' qualifier as equivalent to no
qualifier at all.  However, this is incorrect for the built-in color
variables (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and
gl_BackSecondaryColor).  For those variables, if there is no qualifier
at all, interpolation should be flat if the shade model is GL_FLAT,
and smooth if the shade model is GL_SMOOTH.

To make this possible, I added a new value to the
glsl_interp_qualifier enum, INTERP_QUALIFIER_NONE.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:20 -07:00
Paul Berry
cf45949d6a mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.
This patch makes GLSL interpolation qualifiers visible to drivers via
the array InterpQualifier[] in gl_fragment_program, so that they can
easily be used by driver back-ends to select the correct interpolation
mode.

Previous to this patch, the GLSL compiler was using the enum
ir_variable_interpolation to represent interpolation types.  Rather
than make a duplicate enum in core mesa to represent the same thing, I
moved the enum into mtypes.h and renamed it to be more consistent with
the other enums defined there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:30:58 -07:00
Marek Olšák
0fbc8d301b docs: update GL3 status
EXT_texture_array has been completed for quite a while.

Removing BindBufferBase+Range, because they're part of EXT_transform_feedback.
2011-10-27 15:57:08 +02:00