Commit graph

39225 commits

Author SHA1 Message Date
Brian Paul
bd6b8107ad configs: remove egl-swrast target from linux-dri config 2010-09-22 09:30:16 -06:00
Kristian Høgsberg
b91dba49e0 intel: Fix GL_ARB_shading_language_120 commit
Fix commit e7087175f8.  Move the reference to
GL_VERSION_2_1_functions to intel_extensions.c where it's available,
don't try to enable a non-existing extension and advertise 1.20 for all
intel chipsets, not just GEN4 and up.
2010-09-22 11:01:45 -04:00
Jerome Glisse
1abe48afbe r600g: flush color buffer after draw command
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 10:35:14 -04:00
José Fonseca
87267c71f6 llvmpipe: Make rgb/alpha bland func/factors match, when there is no alpha.
Makes AoS blending easier, and state more canonical.
2010-09-22 15:02:39 +01:00
José Fonseca
9a8e9f4595 llvmpipe: Special case complementary and identify blend factors in SoA.
One multiplication instead of two.

Also fix floating point random number generation and verification.

TODO: Do the same for AoS blending.
2010-09-22 15:02:39 +01:00
José Fonseca
162b0efff6 gallivm: Add unorm support to lp_build_lerp()
Unfortunately this can cause segfault with LLVM 2.6, if x is a constant.
2010-09-22 15:02:39 +01:00
José Fonseca
256b9d99fb util: Flush stdout on util_format. 2010-09-22 15:02:39 +01:00
Luca Barbieri
cac1565b98 d3d1x: fix segfault when hashing 2010-09-22 13:54:07 +02:00
Luca Barbieri
d83b7a69a0 d3d1x: fix warning 2010-09-22 13:25:45 +02:00
Luca Barbieri
1aed6f42e9 d3d1x: fix cf analysis 2010-09-22 13:24:55 +02:00
Luca Barbieri
12044e4c99 d3d1x: link with CXXFLAGS
Otherwise, -m32 doesn't make it there.
2010-09-22 13:22:00 +02:00
Luca Barbieri
d092c0c60d d3d1x: add missing memory barrier 2010-09-22 13:21:13 +02:00
Luca Barbieri
6d0c39ce36 d3d1x: don't build progs automatically
progs requires winsys, which hasn't yet been built by the time we
go into state_trackers.

It may be a good idea to also move it into tests.

After a normal build, run make in src/gallium/state_trackers/d3d1x/progs
to build them.
2010-09-22 11:36:35 +02:00
Luca Barbieri
feb9c8c510 winsys: automatically build sw winsys needed by EGL and d3d1x
A cleaner solution would be preferable, but this does no harm and works.
2010-09-22 09:37:23 +02:00
Luca Barbieri
a0e5103200 glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
The Gallium EGL state tracker reuses dri2.c but not the GLX code.

Currently there is a bit of code in dri2.c that is incorrectly tied
to GLX: instead, make it call an helper that both GLX and Gallium EGL
implement, like dri2InvalidateBuffers.

This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId
is undefined.

Note that we might want to move the whole event translation elsewhere,
and probably stop using non-XCB DRI2 altogether, but this seems to be
the minimal fix.
2010-09-22 08:01:49 +02:00
Luca Barbieri
e1e7c8df7f nvfx: remove gl_PointCoord hack
Now Gallium has the proper fix, thanks to Brian Paul.
2010-09-22 08:00:20 +02:00
Luca Barbieri
86bb64f889 d3d1x: attempt to fix/workaround bug #30322
This may just be hiding some other bug though, since the types are supposed
to be the same (and it compiles for me).

Anyway, this interface will likely need to changed, since it seems Wine needs
a more powerful one capable of expressing window subregions and called at
every Present.
2010-09-22 08:00:19 +02:00
Dave Airlie
2b1ea90342 r600g: disable dirty handling on texture from depth code.
nothing was every dirtying the object again, the mesa-demos
reflect test was just stalling.

this fixes glean readPixSanity.
2010-09-22 14:27:58 +10:00
Dave Airlie
d18f3accb0 r600g: make stencil readback work
need to write two components to get stencil components as well
2010-09-22 14:19:16 +10:00
Dave Airlie
41ef78c5af r600g: cleanup some of the DB blit code
add cb/db flush states to the blit code.
add support for the rv6xx that need special treatment.
according to R6xx_7xx_3D.pdf

set r700 CB_SHADER_CONTROL reg in blit code
docs say dual export should be disabled for DB->CB
2010-09-22 13:33:57 +10:00
Dave Airlie
6e901e330a r600g: fix typo in struct member name 2010-09-22 12:57:08 +10:00
Jerome Glisse
ca35292a44 r600g: occlusion query for new design
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 20:25:39 -04:00
Brian Paul
e7087175f8 mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.

See fd.o bug 29910

NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
2010-09-21 18:13:04 -06:00
Vinson Lee
3642ca2f66 glut: Define eventParser for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_input.c:295: warning: 'eventParser' defined but not used
2010-09-21 15:17:52 -07:00
Vinson Lee
13cd131b0f glut: Define markWindowHidden for non-Windows only.
Fixes this GCC warning on MinGW build.
glut_event.c:255: warning: 'markWindowHidden' defined but not used
2010-09-21 15:11:00 -07:00
Brian Paul
9e8d9f456f softpipe: add missing calls to set draw vertex samplers/views
Part of the fix for running softpipe w/ LLVM-enabled draw module.
2010-09-21 15:31:33 -06:00
Brian Paul
ffa2d203fb gallivm: fix lp_build_sample_compare()
The old code didn't really make sense.  We only need to compare the
X channel of the texture (depth) against the texcoord.

For (bi)linear sampling we should move the calls to this function
and compute the final result as (s1+s2+s3+s4) * 0.25.  Someday.

This fixes the glean glsl1 shadow2D() tests.  See fd.o bug 29307.
2010-09-21 15:31:32 -06:00
Luca Barbieri
83ea4878db d3d1x: ignore errors while building docs
Some versions of dot apparently lack pdf output.
2010-09-21 23:26:47 +02:00
Jerome Glisse
45d10c7d59 r600g: fix multi buffer rendering
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 16:57:55 -04:00
Brian Paul
2b95525429 glsl2: fix typo in error msg 2010-09-21 14:57:10 -06:00
Luca Barbieri
c02bf81629 d3d1x: fix GCC 4.1/4.2 build 2010-09-21 22:47:09 +02:00
Luca Barbieri
b4b2091655 d3d1x: add template parameters to base class ctor calls for GCC 4.4
GCC 4.5 is fine without them, but GCC 4.4 requires them.
Should fully fix the build on GCC 4.4
2010-09-21 22:35:01 +02:00
Luca Barbieri
82c346673a d3d1x: fix build with compilers other than GCC 4.5
There was some libstdc++-specific code that would only build with GCC 4.5
Now it should be much more compatible, at the price of reimplementing
the generic hash function.
2010-09-21 22:16:52 +02:00
Tilman Sauerbeck
1bcdc504d1 gallium/docs: The RET opcode may appear anywhere in a subroutine.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 21:59:57 +02:00
Eric Anholt
dd9a88f4dd i965: Track the windowizer's dispatch for kill pixel, promoted, and OQ
Looks like the problem was we weren't passing the depth to the render
target as expected, so the chip would wedge.  Fixes GPU hang in
occlusion-query-discard.

Bug #30097
2010-09-21 12:29:57 -07:00
Eric Anholt
4a0bc4716d i965: Also enable CC statistics when doing OQs.
This is required by the spec, so respect that.
2010-09-21 12:29:57 -07:00
Eric Anholt
23c507f135 i965: Share the KIL_NV implementation between glsl and non-glsl. 2010-09-21 12:29:57 -07:00
Jerome Glisse
6048be8969 r600g: directly allocate bo for user buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 14:37:38 -04:00
Eric Anholt
b5bb215629 glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.
Fixes glsl2/builtin-texturematrix.
Bug #30196.
2010-09-21 10:09:46 -07:00
José Fonseca
b556bb7c44 llvmpipe: When failing free fs shader too. 2010-09-21 17:51:29 +01:00
José Fonseca
388c94195a llvmpipe: Describe how to profile llvmpipe. 2010-09-21 17:51:29 +01:00
Brian Paul
b3a647276e draw: new draw_fs.[ch] files 2010-09-21 10:07:52 -06:00
Brian Paul
d49f153ab3 Merge branch 'sprite-coord' 2010-09-21 09:57:25 -06:00
Kristian Høgsberg
441344ba7e glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-21 10:20:23 -04:00
Luca Barbieri
bb26272bea d3d1x: actually enable and fix blob apis 2010-09-21 16:01:26 +02:00
Luca Barbieri
f815b57b88 d3d1x: add missing file 2010-09-21 15:51:02 +02:00
Luca Barbieri
cb7cc36fff d3d1x: fix compilation with recent Wine versions installed
Recent Wine versions provide a d3d11shader.h, which is however empty
and was getting used instead of our non-empty one.

Correct the include path order to fix this.
2010-09-21 15:44:41 +02:00
Luca Barbieri
70fed0b0ec d3d1x: add blob and signature extraction APIs
NOTE: untested, needs a testing tool!
2010-09-21 15:44:41 +02:00
Keith Whitwell
2ec86793bd llvmpipe: fix flatshading in new line code
Calculate interpolants before rearranging the vertices.
2010-09-21 14:36:55 +01:00
Luca Barbieri
92617aeac1 d3d1x: add new Direct3D 10/11 COM state tracker for Gallium
This is a new implementation of the Direct3D 11 COM API for Gallium.

Direct3D 10 and 10.1 implementations are also provided, which are
automatically generated with s/D3D11/D3D10/g plus a bunch of #ifs.

While this is an initial version, most of the code is there (limited
to what Gallium can express), and tri, gears and texturing demos
are working.

The primary goal is to realize Gallium's promise of multiple API
support, and provide an API that can be easily implemented with just
a very thin wrapper over Gallium, instead of the enormous amount of
complex code needed for OpenGL.

The secondary goal is to run Windows Direct3D 10/11 games on Linux
using Wine.
Wine dlls are currently not provided, but adding them should be
quite easy.

Fglrx and nvidia drivers can also be supported by writing a Gallium
driver that talks to them using OpenGL, which is a relatively easy
task.
Thanks to the great design of Direct3D 10/11 and closeness to Gallium,
this approach should not result in detectable overhead, and is the
most maintainable way to do it, providing a path to switch to the
open Gallium drivers once they are on par with the proprietary ones.

Currently Wine has a very limited Direct3D 10 implementation, and
completely lacks a Direct3D 11 implementation.

Note that Direct3D 10/11 are completely different from Direct3D 9
and earlier, and thus warrant a fully separate implementation.

The third goal is to provide a superior alternative to OpenGL for
graphics programming on non-Windows systems, particularly Linux
and other free and open systems.

Thanks to a very clean and well-though design done from scratch,
the Direct3D 10/11 APIs are vastly better than OpenGL and can be
supported with orders of magnitude less code and development time,
as you can see by comparing the lines of code of this commit and
those in the existing Mesa OpenGL implementation.

This would have been true for the Longs Peak proposal as well, but
unfortunately it was abandoned by Khronos, leaving the OpenGL
ecosystem without a graphics API with a modern design.

A binding of Direct3D 10/11 to EGL would solve this issue in the
most economical way possible, and this would be great to provide
in Mesa, since DXGI, the API used to bind Direct3D 10/11 to Windows,
is a bit suboptimal, especially on non-Windows platforms.

Finally, a mature Direct3D 10/11 implementation is intrinsically going
to be faster and more reliable than an OpenGL implementation, thanks
to the dramatically smaller API and the segregation of all nontrivial
work to object creation that the application must perform ahead of
time.

Currently, this commit contains:
- Independently created headers for Direct3D 10, 10.1, 11 and DXGI 1.1,
  partially based on the existing Wine headers for D3D10 and DXGI 1.0
- A parser for Direct3D 10/11 DXBC and TokenizedProgramFormat (TPF)
- A shader translator from TokenizedProgramFormat to TGSI
- Implementation of the Direct3D 11 core interfaces
- Automatically generated implementation of Direct3D 10 and 10.1
- Implementation of DXGI using the "native" framework of the EGL st
- Demos, usable either on Windows or on this implementation
  - d3d11tri, a clone of tri
  - d3d11tex, a (multi)texturing demo
  - d3d11gears, an improved version of glxgears
  - d3d11spikysphere, a D3D11 tessellation demo (currently Windows-only)
- A downloader for the Microsoft HLSL compiler, needed to recompile
  the shaders (compiled shader bytecode is also included)

To compile this, configure at least with these options:
--with-state-trackers=egl,d3d1x --with-egl-platforms=x11
plus some gallium drivers (such as softpipe with --enable-gallium-swrast)

The Wine headers (usually from a wine-dev or wine-devel package) must
be installed.
Only x86-32 has been tested.

You may need to run "make" in the subdirectories of src/gallium/winsys/sw
and you may need to manually run "sudo make install" in
src/gallium/targets/egl

To test it, run the demos in the "progs" directory.
Windows binaries are included to find out how demos should work, and to
test Wine integration when it will be done.

Enjoy, and let me know if you manage to compile and run this, or
which issues you are facing if not.

Using softpipe is recommended for now, and your mileage with hardware
drivers may vary.
However, getting this to work on hardware drivers is also obviously very
important.

Note that currently llvmpipe is buggy and causes all 3 gears to be
drawn with the same color.
Use export GALLIUM_DRIVER=softpipe to avoid this.

Thanks to all the Gallium contributors and especially the VMware
team, whose work made it possible to implement Direct3D 10/11 much
more easily than it would have been otherwise.
2010-09-21 10:58:17 +02:00