Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
NOTE: untested, needs a testing tool!
|
|
Calculate interpolants before rearranging the vertices.
|
|
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.
|
|
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
|
|
texture border regs are indexed on evergreen.
|
|
eg seems to have a higher pitch aligmment requirement and uses r700 cube setup
this fixes a couple of piglit tests here.
|
|
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.
|
|
Jerome please use git diff and git show before pushing.
|
|
running piglit's texrect-many caused the vtx to overflow.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thanks to José for the more complete list of supported opcodes.
NOTE: This is a candidate for the 7.9 branch.
|
|
NOTE: This is a candidate for the 7.9 branch.
|
|
Bug #30208.
|
|
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
|
|
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>
|
|
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
|
|
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
|
|
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>
|
|
|
|
|
|
D3D10 specifies this.
|
|
|
|
|
|
|
|
Can be reproduced with mesa/demos/src/tests/blitfb.
NOTE: This is a candidate for the 7.9 branch.
|
|
So texture code can be shared btw new state design
& old one.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
|
|
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.
|
|
|
|
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’,
but argument 2 has type ‘ir_variable*’"
|
|
This reverts commit c32bac57ed445e48856d74113364287ed6e5cdd4
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
r600c emits this with a mask of each written output.
|
|
this fixes fbo-cubemap on r700.
|
|
|
|
|
|
needed to emit some more relocs to the kernel.
|