Commit graph

39169 commits

Author SHA1 Message Date
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
Tilman Sauerbeck
894a307a91 r600g: Removed debug code.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-21 08:13:35 +02:00
Dave Airlie
8893427377 r600g: fix eg texture borders.
texture border regs are indexed on evergreen.
2010-09-21 20:53:09 +10:00
Dave Airlie
b6ced8ee7b r600g: fixup evergreen miptree setup.
eg seems to have a higher pitch aligmment requirement and uses r700 cube setup

this fixes a couple of piglit tests here.
2010-09-21 20:53:09 +10:00
Tom Stellard
610aed81db r300/compiler: Refactor the pair instruction data structures
Use rc_pair_ prefix for all pair instruction structs

Create a named struct for pair instruction args

Replace structs radeon_pair_instruction_{rgb,alpha} with struct
radeon_pair_sub_instruction.  These two structs were nearly identical
and were creating a lot of cut and paste code.  These changes are the
first step towards removing some of that code.
2010-09-20 18:48:47 -07:00
Dave Airlie
84997cd566 r600g: set back to correct codepaths.
Jerome please use git diff and git show before pushing.
2010-09-21 11:32:15 +10:00
Dave Airlie
8e8b60588b r600g: deal with overflow of VTX/TEX CF clauses.
running piglit's texrect-many caused the vtx to overflow.
2010-09-21 11:26:01 +10:00
Vinson Lee
2491258436 tgsi: Remove duplicate case value. 2010-09-20 18:20:04 -07:00
Francisco Jerez
bf8f24c1c8 dri/nouveau: Fix software mipmap generation on 1x1 textures. 2010-09-21 03:04:04 +02:00
Francisco Jerez
98add55fff dri/nv10-nv20: Fix texturing in some cases after a base level change. 2010-09-21 03:03:39 +02:00
Francisco Jerez
22c83ac47a dri/nouveau: Cleanup more references to old FBOs and VBOs. 2010-09-21 03:03:01 +02:00
Francisco Jerez
13c246bcea dri/nouveau: Remove unnecessary assertion. 2010-09-21 02:43:12 +02:00
Francisco Jerez
72e5fd5c02 dri/nv04: Use nvgl_wrap_mode(). 2010-09-21 02:43:11 +02:00
Jakob Bornecrantz
d21301675c tgsi: Actually care what check_soa_dependencies says
Thanks to José for the more complete list of supported opcodes.

NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:19:09 +02:00
José Fonseca
c66f0c4629 tgsi: Don't ignore indirect registers in tgsi_check_soa_dependencies
NOTE: This is a candidate for the 7.9 branch.
2010-09-21 02:18:43 +02:00
Timo Wiren
99907303f6 Fix typos in comments and debug output strings.
Bug #30208.
2010-09-20 15:28:32 -07:00
Jerome Glisse
4fc5050f82 r600g: add back reference check when mapping buffer
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 17:21:37 -04:00
Jerome Glisse
0f099f2906 r600g: use pipe context for flushing inside map
This allow to share code path btw old & new, also
remove check on reference this might make things
a little slower but new design doesn't use reference
stuff.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 16:02:13 -04:00
Tilman Sauerbeck
021e68b2cd python/tests: Fixed tri.py for API and TGSI syntax changes.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:43:01 +02:00
Tilman Sauerbeck
ef419599d9 r600g: Implemented the Z and W component write for the SCS opcode.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:27:59 +02:00
Tilman Sauerbeck
57bf96b43b r600g: Honour destination operand's writemask in the SCS implementation.
If we are not going to write to the X or Y components of the destination
vector we also don't need to prepare to compute SIN or COS.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-20 21:22:48 +02:00
Luca Barbieri
86d5ec70d1 softpipe: fix whitespace 2010-09-20 20:49:48 +02:00
Luca Barbieri
de71e7a4c9 tgsi: add switch/case opcodes to tgsi_opcode_tmp.h 2010-09-20 20:23:35 +02:00
Luca Barbieri
2e7d1c2c86 softpipe: make z/s test always pass if no zsbuf, instead of crashing
D3D10 specifies this.
2010-09-20 20:23:35 +02:00
Luca Barbieri
6d0b695fa7 gallium: avoid the C++ keyword "template" in sw_winsys.h 2010-09-20 20:23:34 +02:00
Brian Paul
b2ad8b5c22 gallivm: remove debug code 2010-09-20 11:21:44 -06:00
Brian Paul
7888a2f822 llvmpipe: fix query bug when no there's no scene 2010-09-20 10:50:35 -06:00
Marek Olšák
168554904b st/mesa: fix assertion failure in GetTexImage for cubemaps
Can be reproduced with mesa/demos/src/tests/blitfb.

NOTE: This is a candidate for the 7.9 branch.
2010-09-20 18:14:23 +02:00
Jerome Glisse
363dfb83f1 r600g: move chip class to radeon common structure
So texture code can be shared btw new state design
& old one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 11:59:20 -04:00
Kenneth Graunke
6ea16b6c51 glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the
meaning of these two opcodes changed to return vectors rather than a
single scalar, but the constant expression handling code was incorrectly
written and only worked for scalars.  As a result, only the first
component of the returned vector would be properly initialized.
2010-09-20 17:33:13 +02:00
Kenneth Graunke
14eea26828 glsl: Add comments to clarify the types of comparison binops. 2010-09-20 17:31:16 +02:00
Brian Paul
0bc3e1f4f4 docs: mark as obsolete, remove dead links 2010-09-20 08:59:04 -06:00
Brian Paul
a8fde1ba4d docs: remove old broken link 2010-09-20 08:59:01 -06:00
Brian Paul
1739124159 glsl2: silence compiler warnings in printf() calls
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
2010-09-20 08:22:54 -06:00
Brian Paul
5522887842 mesa: don't call valid_texture_object() in non-debug builds
This reverts commit c32bac57ed
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.
2010-09-20 08:21:00 -06:00
Ian Romanick
e053d62aa5 glsl: Add doxygen comments 2010-09-20 07:09:03 -07:00
Jakob Bornecrantz
208f1f3810 i915g: Link with wrapper sw winsys with scons 2010-09-20 15:33:20 +02:00
Michal Krol
279492386f svga: Integer constant register file has a separate namespace.
Count int and float constants independently. Since there are only
few i# constants available and hundreds of c# constants, it would
be too easy to end up with an i# declaration out of its range.
2010-09-20 09:26:49 +01:00
Michal Krol
0742e0b376 svga: Fix relative addressing translation for pixel shaders.
Pixel shaders do not have address registers a#, only one
loop register aL. Our only hope is to assume the address
register is in fact a loop counter and replace it with aL.

Do not translate ARL instruction for pixel shaders -- MOVA
instruction is only valid for vertex saders.

Make it more explicit relative addressing of inputs is only valid
for pixel shaders and constants for vertex shaders.
2010-09-20 09:26:17 +01:00
Corbin Simpson
0d53dfa3c5 r600g: Cleanup viewport floats. 2010-09-19 23:05:02 -07:00
Corbin Simpson
e98062673e r600g: Clean up PS setup.
I didn't do r600d according to the docs; I split EXPORT_MODE to be a bit more
useful and obvious. Hope this is okay.
2010-09-19 23:05:02 -07:00
Dave Airlie
f4020c66fd r600g: only flush for the correct colorbuffer, not all of them. 2010-09-20 15:39:03 +10:00
Dave Airlie
7e5173d065 r600g: add missing BC_INST wrapper for evergreen 2010-09-20 15:38:40 +10:00
Dave Airlie
b110ddd9a9 r600g: fixup r700 CB_SHADER_CONTROL register.
r600c emits this with a mask of each written output.
2010-09-20 15:36:52 +10:00
Dave Airlie
d172ef3138 r600g: fix r700 cube map sizing.
this fixes fbo-cubemap on r700.
2010-09-20 15:30:52 +10:00