Commit Graph

50192 Commits

Author SHA1 Message Date
Michel Dänzer bb79126420 radeonsi: Fix calculation of pitch value in sampler view state. 2012-04-18 10:52:33 +02:00
Michel Dänzer f2c81a4bff radeonsi: Set tiling mode index in sampler view state.
Hardcode index for linear mode for now.
2012-04-18 10:51:48 +02:00
Michel Dänzer 29d7186e4c radeonsi: Replace magic numbers with register definitions in sampler state. 2012-04-18 10:49:00 +02:00
Michel Dänzer c4bf6517ed radeonsi: Fix white border color type in sampler state. 2012-04-18 10:48:26 +02:00
Kenneth Graunke 32f7676e9c glsl/builtins: Rework profiles to use the new '.glsl' common suffix.
Deletes a lot of pointless duplication, as well as some run-time effort.

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

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

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

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:18 -07:00
Kenneth Graunke fbea94ae59 glsl/builtins: Support stage-agnostic built-in profiles.
The built-in subsystem uses "profiles," or GLSL shaders containing
prototypes for all built-ins supported within a particular language
version (or extension) and shader stage.

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

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

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

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

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:15 -07:00
Kenneth Graunke 7e35d97a02 glsl: Make the standalone compiler accept '.glsl' files.
These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:04:57 -07:00
Brian Paul a5e95a419e mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()
Accelerates a few glReadPixels cases for WebGL.
See https://bugs.freedesktop.org/show_bug.cgi?id=48545

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-17 13:22:18 -06:00
Dave Airlie b814506e87 configure.ac: add IA64 support.
ia64 on Linux can use DRI as well.

Reported-by: russiane39 on #radeon
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=48788
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-17 19:59:26 +01:00
Kenneth Graunke f4f6e1f5a0 glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.
The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

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

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-17 11:27:51 -07:00
Christoph Bumiller 48aec56559 nv50: specify location of UCPs to code generator
Was made configurable in e44089b2f7
for Kepler but forgot to update nv50.
2012-04-17 18:35:16 +02:00
Tom Stellard 6077b347ae r600g: Use automake to generate Makefile 2012-04-17 09:54:02 -04:00
Eric Anholt 35f2fb70d3 Revert "glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function."
This reverts commit 4ec449a6ed.

I meant to not push this one.  Review found that a link error is not
mandated: it should link, but you get undefined rendering if you rely
on a missing stage.

     page 42/55 section 2.11 "Vertex Shaders":

     "If the program object has no vertex shader, or no program object
      is currently in use, the results of vertex shader execution are
      undefined."

(and similar for page 160/173 section 3.9 "Fragment Shaders" for FS,
and page 45/58 section 2.11.2 "Program Objects" for program being 0)

It turns out the commit was broken anyway, because it was missing a
"goto done", so linkstatus got smashed back to true later and the
error just showed up as a warning in the infolog.
2012-04-16 13:50:05 -07:00
Eric Anholt f084b5ad32 docs: Update GLSL 1.40 status.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt 252d99e4fa docs: Update that int textures got done for GL3.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt 45f460f61e docs: Update that ARB_draw_instanced is on in i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt 61c4e5cd68 docs: Update TBO support.
All I know of that needs finishing in Mesa is to enable the extension
in a GL3.1 core context on i965 -- we're not going to expose it in
non-3.1 core contexts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt 4ec449a6ed glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt acd4024e0a glsl: Add remaining *sampler2DRect* texture functions.
Fixes the new piglit texelFetch() tests on these.  Note that the rest
of the new functions are not tested (same as the non-2DRect versions
of most of them).
2012-04-16 11:59:29 -07:00
Eric Anholt b9fed9f3d5 glsl: Fix the prototype of textureProjGradOffset(sampler2DShadow)
Indirectly caught by Ken's review of my GLSL 1.40 changes where I
copy-and-pasted this line.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:19 -07:00
Eric Anholt 56e2f97697 glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.
The non-integer versions were already reserved in 1.30, but apparently
these were forgotten.

Fixes piglit glsl-1.40/compiler/reserved/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:21 -07:00
Eric Anholt d91c8edd85 glsl: Add textureSize(*samplerBuffer) support.
Fixes the corresponding new tests in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:18 -07:00
Eric Anholt 9a01e09ee5 glsl: Fix comment typo in 1.40 work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:16 -07:00
Eric Anholt ecc4c361a6 mesa: Remove dead _mesa_sizeof_glsl_type().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:14 -07:00
Eric Anholt 9d921b168b gtest: Don't actually install a library.
The whole point of importing it was that you're not supposed to
install this library.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=411825
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:25:39 -07:00
Brian Paul 6f89f5a524 svga: add case for PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-16 10:35:36 -06:00
Dylan Noblesmith a3d56734df autoconf: add AM_PROG_CC_C_O
Prevents this error with Automake 1.9:

src/gallium/drivers/Makefile.am: C objects in subdir but
`AM_PROG_CC_C_O' not in `configure.ac'
autoreconf: automake failed with exit status: 1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 15:45:32 +00:00
Christoph Bumiller 847c898702 nvc0: fix nve4 linear copies 2012-04-16 00:38:17 +02:00
Christoph Bumiller 1ce9205f79 targets/xvmc-nouveau: fix accidental hardcoded include path
5b0cd37324 wasn't meant to be pushed.
2012-04-15 16:40:53 +02:00
Christoph Bumiller e55c276255 nv50: use correct semantic map value for undefined PointSize output 2012-04-15 16:30:13 +02:00
Christoph Bumiller 5b0cd37324 targets/xvmc-nouveau: add libdrm include path 2012-04-15 16:26:21 +02:00
Ben Skeggs d37f90f131 nv30: init sample_mask to some default value at context creation time
Fixes demos/lodbias.
2012-04-15 22:18:02 +10:00
Ben Skeggs 29128e5ee2 nv30: fix some sifm transfer issues 2012-04-15 21:56:20 +10:00
José Fonseca abfe759172 scons: Fix egl-static build due to conflicting symbols.
radeonsi and r600 have duplicate symbols, so it's not possible to
statically link both.  Remove the newcomer, radeonsi, until duplicate
symbols are fixed.
2012-04-15 11:32:21 +01:00
Christoph Bumiller e44089b2f7 nvc0: add initial support for nve4+ (Kepler) chipsets
Most things that work on Fermi should work on Kepler too.

There are a few performance optimizations left to do, like better
placement of texture barriers and adding scheduling data to the
shader instructions (without them, a thread group will be masked
for 32 cycles after each single instruction issue).
2012-04-15 00:08:51 +02:00
Tom Stellard 69a921892d radeonsi: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS/
Fixes build broken by commit 0d29fb017b
2012-04-14 17:40:35 -04:00
Christoph Bumiller a6fcf14c23 nv50/ir/opt: extend handleCVT for nv50's SET u32 to f32 chain 2012-04-14 21:54:04 +02:00
Christoph Bumiller a9f22b91e5 nv50/ir: print interpolation mode 2012-04-14 21:54:04 +02:00
Christoph Bumiller dcc91fc5d3 nv50: update FP linkage state on one/two-sided lighting switch 2012-04-14 21:54:04 +02:00
Christoph Bumiller df982399cc nv50: delete old shader compiler files 2012-04-14 21:54:04 +02:00
Christoph Bumiller 0bbf1659df nv50: hook up to new shader code generator 2012-04-14 21:54:04 +02:00
Christoph Bumiller 322bc7ed68 nv50/ir: import nv50 target 2012-04-14 21:54:04 +02:00
Christoph Bumiller 15ce0f76e2 nv50/ir: fix off-by-ones in CSE and nvc0 insnCanLoad 2012-04-14 21:54:04 +02:00
Christoph Bumiller ce04221081 nv50/ir/tgsi: generate UCPs with actual outputs instead of SVs
gl_ClipDistance is treated the same way, this is just nicer and
easier assign slots for them on nv50.
2012-04-14 21:54:04 +02:00
Francisco Jerez d07e4421ab nv50/ir: Fix type of the instruction created by mkCmp() for dst in FILE_FLAGS. 2012-04-14 21:54:04 +02:00
Christoph Bumiller f8c3212cbb nv50/ir: fix Instruction::isCommutationLegal for WAW 2012-04-14 21:54:03 +02:00
Francisco Jerez 93508b5b0d nv50/ir/opt: Add isOptSupported() check in logical arith optimization. 2012-04-14 21:54:03 +02:00
Francisco Jerez f4dbdcbfcf nv50/ir/ra: Fix live set propagation in the secondary passes of buildLiveSets(). 2012-04-14 21:54:03 +02:00
Christoph Bumiller 2fc014f8c0 nv50/ir/opt: don't regard OP_WRSV as dead code 2012-04-14 21:54:03 +02:00
Christoph Bumiller a765d7880f nv50/ir: add isUniform query to Values 2012-04-14 21:54:03 +02:00