summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-12 02:49:36 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-21 10:58:17 +0200
commit92617aeac109481258f0c3863d09c1b8903d438b (patch)
treed85d6a04e87d227964386ad1d6b3d6ae6954e179 /src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h
parent894a307a91d6437ec418800952da2ec174e092f5 (diff)
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.
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h')
-rwxr-xr-xsrc/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h297
1 files changed, 297 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h b/src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h
new file mode 100755
index 0000000000..316bcdfedd
--- /dev/null
+++ b/src/gallium/state_trackers/d3d1x/progs/d3d11spikysphere/d3d11spikysphere.hlsl.hs.h
@@ -0,0 +1,297 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
+//
+//
+// fxc /Fhd3d11spikysphere.hlsl.hs.h /Ehs /Ths_5_0 d3d11spikysphere.hlsl
+//
+//
+// Buffer Definitions:
+//
+// cbuffer cb_frame
+// {
+//
+// float4x4 model; // Offset: 0 Size: 64 [unused]
+// float4x4 view_proj; // Offset: 64 Size: 64 [unused]
+// float disp_scale; // Offset: 128 Size: 4 [unused]
+// float disp_freq; // Offset: 132 Size: 4 [unused]
+// float tess_factor; // Offset: 136 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// cb_frame cbuffer NA NA 0 1
+//
+//
+//
+// Patch Constant signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------ ------
+// SV_TessFactor 0 x 0 TRIEDGE float x
+// SV_TessFactor 1 x 1 TRIEDGE float x
+// SV_TessFactor 2 x 2 TRIEDGE float x
+// SV_InsideTessFactor 0 x 3 TRIINT float x
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------ ------
+// POSITION 0 xyz 0 NONE float xyz
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------ ------
+// POSITION 0 xyz 0 NONE float xyz
+//
+// Tessellation Domain # of control points
+// -------------------- --------------------
+// Triangle 3
+//
+// Tessellation Output Primitive Partitioning Type
+// ------------------------------ ------------------
+// Clockwise Triangles Even Fractional
+//
+hs_5_0
+hs_decls
+dcl_input_control_point_count 3
+dcl_output_control_point_count 3
+dcl_tessellator_domain domain_tri
+dcl_tessellator_partitioning partitioning_fractional_even
+dcl_tessellator_output_primitive output_triangle_cw
+dcl_globalFlags refactoringAllowed
+dcl_constantbuffer cb0[9], immediateIndexed
+hs_fork_phase
+dcl_hs_fork_phase_instance_count 3
+dcl_input vForkInstanceID
+dcl_output_siv o0.x, finalTriUeq0EdgeTessFactor
+dcl_output_siv o1.x, finalTriVeq0EdgeTessFactor
+dcl_output_siv o2.x, finalTriWeq0EdgeTessFactor
+dcl_temps 1
+dcl_indexrange o0.x 3
+mov r0.x, vForkInstanceID.x
+mov o[r0.x + 0].x, cb0[8].z
+ret
+hs_fork_phase
+dcl_output_siv o3.x, finalTriInsideTessFactor
+mov o3.x, cb0[8].z
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_hs[] =
+{
+ 68, 88, 66, 67, 174, 23,
+ 253, 184, 171, 234, 181, 122,
+ 114, 17, 23, 172, 69, 130,
+ 17, 19, 1, 0, 0, 0,
+ 212, 4, 0, 0, 6, 0,
+ 0, 0, 56, 0, 0, 0,
+ 68, 2, 0, 0, 120, 2,
+ 0, 0, 172, 2, 0, 0,
+ 64, 3, 0, 0, 56, 4,
+ 0, 0, 82, 68, 69, 70,
+ 4, 2, 0, 0, 1, 0,
+ 0, 0, 104, 0, 0, 0,
+ 1, 0, 0, 0, 60, 0,
+ 0, 0, 0, 5, 83, 72,
+ 0, 1, 0, 0, 210, 1,
+ 0, 0, 82, 68, 49, 49,
+ 60, 0, 0, 0, 24, 0,
+ 0, 0, 32, 0, 0, 0,
+ 40, 0, 0, 0, 36, 0,
+ 0, 0, 12, 0, 0, 0,
+ 0, 0, 0, 0, 92, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 99, 98, 95, 102, 114, 97,
+ 109, 101, 0, 171, 171, 171,
+ 92, 0, 0, 0, 5, 0,
+ 0, 0, 128, 0, 0, 0,
+ 144, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 72, 1, 0, 0, 0, 0,
+ 0, 0, 64, 0, 0, 0,
+ 0, 0, 0, 0, 88, 1,
+ 0, 0, 0, 0, 0, 0,
+ 255, 255, 255, 255, 0, 0,
+ 0, 0, 255, 255, 255, 255,
+ 0, 0, 0, 0, 124, 1,
+ 0, 0, 64, 0, 0, 0,
+ 64, 0, 0, 0, 0, 0,
+ 0, 0, 88, 1, 0, 0,
+ 0, 0, 0, 0, 255, 255,
+ 255, 255, 0, 0, 0, 0,
+ 255, 255, 255, 255, 0, 0,
+ 0, 0, 134, 1, 0, 0,
+ 128, 0, 0, 0, 4, 0,
+ 0, 0, 0, 0, 0, 0,
+ 152, 1, 0, 0, 0, 0,
+ 0, 0, 255, 255, 255, 255,
+ 0, 0, 0, 0, 255, 255,
+ 255, 255, 0, 0, 0, 0,
+ 188, 1, 0, 0, 132, 0,
+ 0, 0, 4, 0, 0, 0,
+ 0, 0, 0, 0, 152, 1,
+ 0, 0, 0, 0, 0, 0,
+ 255, 255, 255, 255, 0, 0,
+ 0, 0, 255, 255, 255, 255,
+ 0, 0, 0, 0, 198, 1,
+ 0, 0, 136, 0, 0, 0,
+ 4, 0, 0, 0, 2, 0,
+ 0, 0, 152, 1, 0, 0,
+ 0, 0, 0, 0, 255, 255,
+ 255, 255, 0, 0, 0, 0,
+ 255, 255, 255, 255, 0, 0,
+ 0, 0, 109, 111, 100, 101,
+ 108, 0, 102, 108, 111, 97,
+ 116, 52, 120, 52, 0, 171,
+ 3, 0, 3, 0, 4, 0,
+ 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 78, 1, 0, 0,
+ 118, 105, 101, 119, 95, 112,
+ 114, 111, 106, 0, 100, 105,
+ 115, 112, 95, 115, 99, 97,
+ 108, 101, 0, 102, 108, 111,
+ 97, 116, 0, 171, 0, 0,
+ 3, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 145, 1, 0, 0, 100, 105,
+ 115, 112, 95, 102, 114, 101,
+ 113, 0, 116, 101, 115, 115,
+ 95, 102, 97, 99, 116, 111,
+ 114, 0, 77, 105, 99, 114,
+ 111, 115, 111, 102, 116, 32,
+ 40, 82, 41, 32, 72, 76,
+ 83, 76, 32, 83, 104, 97,
+ 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114,
+ 32, 57, 46, 50, 57, 46,
+ 57, 53, 50, 46, 51, 49,
+ 49, 49, 0, 171, 73, 83,
+ 71, 78, 44, 0, 0, 0,
+ 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 3, 0, 0, 0,
+ 0, 0, 0, 0, 7, 7,
+ 0, 0, 80, 79, 83, 73,
+ 84, 73, 79, 78, 0, 171,
+ 171, 171, 79, 83, 71, 78,
+ 44, 0, 0, 0, 1, 0,
+ 0, 0, 8, 0, 0, 0,
+ 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0,
+ 0, 0, 7, 8, 0, 0,
+ 80, 79, 83, 73, 84, 73,
+ 79, 78, 0, 171, 171, 171,
+ 80, 67, 83, 71, 140, 0,
+ 0, 0, 4, 0, 0, 0,
+ 8, 0, 0, 0, 104, 0,
+ 0, 0, 0, 0, 0, 0,
+ 13, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0,
+ 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