mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
Compare commits
168 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1eaf73147c | ||
|
d5f810068b | ||
|
21302c09eb | ||
|
1b11b57652 | ||
|
fc652d2b27 | ||
|
43631bde4d | ||
|
bd501ce336 | ||
|
f100f5b726 | ||
|
dd1008867e | ||
|
f21693b284 | ||
|
90e6e418a3 | ||
|
6873b71304 | ||
|
2fa913ccaa | ||
|
3153ce3145 | ||
|
6f6ba8aa56 | ||
|
3857ca06fa | ||
|
718c79b823 | ||
|
d6799bd5d3 | ||
|
da56f41ceb | ||
|
1019bbead6 | ||
|
c0782a9029 | ||
|
4d17758657 | ||
|
520c7457a9 | ||
|
4173158c8b | ||
|
e2aed38509 | ||
|
ba08825ccd | ||
|
35b48a8b04 | ||
|
58c7c4b806 | ||
|
c416627e64 | ||
|
9bdae4dfaa | ||
|
03f9d16047 | ||
|
0a2aaa690e | ||
|
12e397de9a | ||
|
2ec67e0f10 | ||
|
4096d453c4 | ||
|
8044fce040 | ||
|
52069386c4 | ||
|
b711b2d66b | ||
|
fcef269347 | ||
|
588645a79a | ||
|
5af7316a12 | ||
|
d21fd584b1 | ||
|
1c77811648 | ||
|
d93ce28995 | ||
|
fb751b48c5 | ||
|
0a345a2b73 | ||
|
963ea98a52 | ||
|
0ef04659c7 | ||
|
fea50d243c | ||
|
7115a94063 | ||
|
62fd13059b | ||
|
75494a4ae6 | ||
|
6f1f14d97a | ||
|
c9198735fd | ||
|
c644244bcd | ||
|
b6a6a927a7 | ||
|
d1da5436f4 | ||
|
0a07ac6f88 | ||
|
eb119878f7 | ||
|
85856473f6 | ||
|
09d7442cb1 | ||
|
653b109d8f | ||
|
5a1b0dbf44 | ||
|
e56db9bda5 | ||
|
791f8a8faa | ||
|
3bae0c92c7 | ||
|
ab8f418207 | ||
|
eb7b594002 | ||
|
4c13ae5764 | ||
|
ef4990d996 | ||
|
5442f4236c | ||
|
8e5aefb309 | ||
|
a43242a3e6 | ||
|
303ce66cef | ||
|
6b45f290f7 | ||
|
20fc4375ad | ||
|
1e10b5e616 | ||
|
2d4d2e1244 | ||
|
eb70f1aeb5 | ||
|
3d85d77ced | ||
|
763f7dfa61 | ||
|
1655d309bd | ||
|
d600f0488e | ||
|
4ab1a4cef5 | ||
|
73cf9dee8a | ||
|
b74a546034 | ||
|
f8da100052 | ||
|
3fc2fdc37f | ||
|
4c5fd9c7b9 | ||
|
15a0b44ada | ||
|
fb724d60e3 | ||
|
e3123f5bd0 | ||
|
991cddd139 | ||
|
32999fc12b | ||
|
27a6963d6a | ||
|
d5fd309ef8 | ||
|
56b2f56b86 | ||
|
d484a08d10 | ||
|
6381bc4857 | ||
|
1e559cd51d | ||
|
b7c94b0213 | ||
|
53d6966a5d | ||
|
7393e6ed13 | ||
|
8e07423ba1 | ||
|
609632279f | ||
|
32e6f594f2 | ||
|
15b19b15c0 | ||
|
c4be4a4ebf | ||
|
562f647c2a | ||
|
652906aea7 | ||
|
d6f45b730f | ||
|
3d9baef321 | ||
|
96a7236700 | ||
|
6989266e76 | ||
|
1bba18aa75 | ||
|
b5b08bd8a0 | ||
|
10bd0c48f8 | ||
|
a8b77b85ca | ||
|
732f1737f4 | ||
|
e9829fdc65 | ||
|
f3432966da | ||
|
f843a7babb | ||
|
1c61b20616 | ||
|
577014c017 | ||
|
d7d2fe145f | ||
|
1b69adbd13 | ||
|
c572adbf2a | ||
|
349aab2a6a | ||
|
5b664c7a5c | ||
|
f3289e1661 | ||
|
7515b8255b | ||
|
4fede46c9a | ||
|
a2996c2d59 | ||
|
2dcfc888fb | ||
|
039b69ace9 | ||
|
a32157f586 | ||
|
4112c36076 | ||
|
4afe69d04a | ||
|
971ab01add | ||
|
3dbd2ceca6 | ||
|
d7554accbc | ||
|
5168929edc | ||
|
5749ae4700 | ||
|
aae4e31ba8 | ||
|
3b579f6fe7 | ||
|
c1071fda52 | ||
|
a7a4eb95e5 | ||
|
b9435fb1ff | ||
|
300a6c8fc3 | ||
|
e5905bbf0f | ||
|
2ec6d4d3ff | ||
|
448f856c09 | ||
|
15e4b9bafb | ||
|
02d92c9af6 | ||
|
3e88a46d4c | ||
|
98ebe9b69c | ||
|
06c22b6a65 | ||
|
4016ddff77 | ||
|
4a692dca4e | ||
|
8cb865d65a | ||
|
0ddaa80616 | ||
|
7682da58a8 | ||
|
bb32ffad18 | ||
|
c7198bc964 | ||
|
58d017ccc1 | ||
|
80586bf7a9 | ||
|
0462d81484 | ||
|
7b6e782139 |
90
ANNOUNCE
90
ANNOUNCE
@@ -1,96 +1,60 @@
|
|||||||
The Wine team is proud to announce that release 1.4 of vkd3d, the Direct3D to
|
The Wine team is proud to announce that release 1.6 of vkd3d, the Direct3D to
|
||||||
Vulkan translation library, is now available.
|
Vulkan translation library, is now available.
|
||||||
|
|
||||||
This release contains improvements that are listed in the release notes below.
|
This release contains improvements that are listed in the release notes below.
|
||||||
The main highlights are:
|
The main highlights are:
|
||||||
|
|
||||||
- Many improvements to the HLSL compiler.
|
- Initial support for HLSL compute shaders.
|
||||||
- A new descriptor heap implementation using the VK_EXT_descriptor_indexing
|
- More support for HLSL features and intrinsics.
|
||||||
extension.
|
- Miscellaneous bug fixes.
|
||||||
- A new fence implementation using the VK_KHR_timeline_semaphore extension.
|
|
||||||
|
|
||||||
The source is available from the following location:
|
The source is available from the following location:
|
||||||
|
|
||||||
https://dl.winehq.org/vkd3d/source/vkd3d-1.4.tar.xz
|
https://dl.winehq.org/vkd3d/source/vkd3d-1.6.tar.xz
|
||||||
|
|
||||||
The current source can also be pulled directly from the git repository:
|
The current source can also be pulled directly from the git repository:
|
||||||
|
|
||||||
https://source.winehq.org/git/vkd3d.git/
|
https://gitlab.winehq.org/wine/vkd3d.git
|
||||||
|
|
||||||
Vkd3d is available thanks to the work of multiple people. See the file AUTHORS
|
Vkd3d is available thanks to the work of multiple people. See the file AUTHORS
|
||||||
for the complete list.
|
for the complete list.
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
What's new in vkd3d 1.4
|
What's new in vkd3d 1.6
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
|
||||||
*** libvkd3d
|
|
||||||
|
|
||||||
- A new descriptor heap implementation using the VK_EXT_descriptor_indexing
|
|
||||||
extension. In particular, the new implementation is more efficient when
|
|
||||||
large descriptor heaps are used by multiple command lists. The new
|
|
||||||
`virtual_heaps' configuration option can be used to select the original
|
|
||||||
implementation even when the VK_EXT_descriptor_indexing extension is
|
|
||||||
available.
|
|
||||||
|
|
||||||
- A new fence implementation using the VK_KHR_timeline_semaphore extension.
|
|
||||||
The new implementation addresses a number of edge cases the original
|
|
||||||
implementation was unable to, as well as being somewhat more efficient.
|
|
||||||
|
|
||||||
- When the VK_EXT_robustness2 extension is available, it is used to implement
|
|
||||||
null views. This more accurately matches Direct3D 12 behaviour. For example,
|
|
||||||
all reads from such a null view return zeroes, while that isn't necessarily
|
|
||||||
the case for out-of-bounds reads with the original implementation.
|
|
||||||
|
|
||||||
- New interfaces:
|
|
||||||
- vkd3d_set_log_callback() allows writing log output via a custom callback.
|
|
||||||
This can be used to integrate vkd3d's log output with other logging
|
|
||||||
systems.
|
|
||||||
|
|
||||||
|
|
||||||
*** libvkd3d-shader
|
*** libvkd3d-shader
|
||||||
|
|
||||||
- New features for the HLSL source type:
|
- New features for the HLSL source type:
|
||||||
- Support for integer arithmetic, bitwise and shift operations.
|
- Initial support for compute shaders.
|
||||||
- Support for matrix and vector subscripting.
|
- Improved support for initialisation and assignment of compound objects
|
||||||
- Support for the mul() intrinsic function.
|
like structures and arrays, including casts and implicit conversions.
|
||||||
- Support for matrix copying, casting, and entry-wise operations.
|
- Support for loads and stores of texture resource unordered-access views.
|
||||||
- Support for complex initialisers.
|
- Support for function attributes. In particular, the required "numthreads"
|
||||||
- Support for the `nointerpolation' modifier. This modifier is applied by
|
attribute for compute shader entry points is now supported.
|
||||||
default to integer variables.
|
- Support for the asuint() intrinsic function.
|
||||||
- Support for the SV_VertexID semantic.
|
- Support for the length() intrinsic function.
|
||||||
- Support for matrix-typed varyings.
|
- Support for the normalize() intrinsic function.
|
||||||
- Constant folding for a number of operators.
|
- Support for integer division and modulus.
|
||||||
- Copy propagation across branches and loops. This allows use of non-numeric
|
- Support for taking the absolute value of integers.
|
||||||
variables anywhere in a program, as well as more optimised code for
|
- Support for floating-point modulus.
|
||||||
accessing numeric variables within branches and loops.
|
|
||||||
|
|
||||||
- The disassembler supports the shader model 5 `msad' instruction.
|
|
||||||
|
|
||||||
- New interfaces:
|
- New interfaces:
|
||||||
- vkd3d_shader_set_log_callback() allows writing log output via a custom
|
- The VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_ATOMICS descriptor info flag is
|
||||||
callback.
|
used to indicate that atomic operations are used on unordered-access view
|
||||||
|
descriptors.
|
||||||
|
|
||||||
|
|
||||||
*** libvkd3d-utils
|
*** libvkd3d-common
|
||||||
|
|
||||||
- New interfaces:
|
- vkd3d debug output is prefixed with "vkd3d:" in order to make it easier to
|
||||||
- vkd3d_utils_set_log_callback() allows writing log output via a custom
|
distinguish from output produced by applications or other libraries.
|
||||||
callback.
|
|
||||||
|
|
||||||
|
|
||||||
*** build
|
*** demos
|
||||||
|
|
||||||
- The minimum required version of Vulkan-Headers and SPIRV-Headers for this
|
- The demos now use libvkd3d-shader to compile HLSL shaders at run-time.
|
||||||
release is version 1.2.139.
|
|
||||||
|
|
||||||
- The SONAME_LIBVULKAN configure variable can be used to specify the shared
|
|
||||||
object name of the Vulkan library. Because vkd3d loads the Vulkan library
|
|
||||||
dynamically, specifying this removes the need for a Vulkan import library at
|
|
||||||
build time.
|
|
||||||
|
|
||||||
- The `crosstests' target no longer builds Win32/PE demos or tests when these
|
|
||||||
were not enabled at configure time.
|
|
||||||
|
|
||||||
|
2
AUTHORS
2
AUTHORS
@@ -3,6 +3,7 @@ Andrew Eikum
|
|||||||
Andrey Gusev
|
Andrey Gusev
|
||||||
Atharva Nimbalkar
|
Atharva Nimbalkar
|
||||||
Biswapriyo Nath
|
Biswapriyo Nath
|
||||||
|
Brendan Shanks
|
||||||
Chip Davis
|
Chip Davis
|
||||||
Conor McCarthy
|
Conor McCarthy
|
||||||
David Gow
|
David Gow
|
||||||
@@ -16,6 +17,7 @@ Isabella Bosia
|
|||||||
Jactry Zeng
|
Jactry Zeng
|
||||||
Joshua Ashton
|
Joshua Ashton
|
||||||
JĂłzef Kucia
|
JĂłzef Kucia
|
||||||
|
Martin Storsjö
|
||||||
Matteo Bruni
|
Matteo Bruni
|
||||||
Nikolay Sivov
|
Nikolay Sivov
|
||||||
Philip Rebohle
|
Philip Rebohle
|
||||||
|
38
Makefile.am
38
Makefile.am
@@ -31,15 +31,6 @@ vkd3d_public_headers = \
|
|||||||
include/vkd3d_utils.h \
|
include/vkd3d_utils.h \
|
||||||
include/vkd3d_windows.h
|
include/vkd3d_windows.h
|
||||||
|
|
||||||
vkd3d_demos_shaders = \
|
|
||||||
demos/gears.hlsl \
|
|
||||||
demos/gears_ps_flat.h \
|
|
||||||
demos/gears_ps_smooth.h \
|
|
||||||
demos/gears_vs.h \
|
|
||||||
demos/triangle.hlsl \
|
|
||||||
demos/triangle_ps.h \
|
|
||||||
demos/triangle_vs.h
|
|
||||||
|
|
||||||
vkd3d_tests = \
|
vkd3d_tests = \
|
||||||
tests/vkd3d_api \
|
tests/vkd3d_api \
|
||||||
tests/vkd3d_common \
|
tests/vkd3d_common \
|
||||||
@@ -53,21 +44,29 @@ vkd3d_cross_tests = \
|
|||||||
vkd3d_shader_tests = \
|
vkd3d_shader_tests = \
|
||||||
tests/abs.shader_test \
|
tests/abs.shader_test \
|
||||||
tests/arithmetic-float.shader_test \
|
tests/arithmetic-float.shader_test \
|
||||||
|
tests/arithmetic-float-uniform.shader_test \
|
||||||
tests/arithmetic-int.shader_test \
|
tests/arithmetic-int.shader_test \
|
||||||
|
tests/arithmetic-int-uniform.shader_test \
|
||||||
tests/arithmetic-uint.shader_test \
|
tests/arithmetic-uint.shader_test \
|
||||||
tests/bitwise.shader_test \
|
tests/bitwise.shader_test \
|
||||||
tests/cast-broadcast.shader_test \
|
tests/cast-broadcast.shader_test \
|
||||||
|
tests/cast-componentwise-equal.shader_test \
|
||||||
|
tests/cast-componentwise-compatible.shader_test \
|
||||||
tests/cast-to-float.shader_test \
|
tests/cast-to-float.shader_test \
|
||||||
tests/cast-to-half.shader_test \
|
tests/cast-to-half.shader_test \
|
||||||
tests/cast-to-int.shader_test \
|
tests/cast-to-int.shader_test \
|
||||||
tests/cast-to-uint.shader_test \
|
tests/cast-to-uint.shader_test \
|
||||||
|
tests/cbuffer.shader_test \
|
||||||
|
tests/compute.shader_test \
|
||||||
tests/conditional.shader_test \
|
tests/conditional.shader_test \
|
||||||
tests/floor.shader_test \
|
tests/floor.shader_test \
|
||||||
tests/hlsl-array-dimension.shader_test \
|
tests/hlsl-array-dimension.shader_test \
|
||||||
|
tests/hlsl-attributes.shader_test \
|
||||||
tests/hlsl-bool-cast.shader_test \
|
tests/hlsl-bool-cast.shader_test \
|
||||||
tests/hlsl-clamp.shader_test \
|
tests/hlsl-clamp.shader_test \
|
||||||
tests/hlsl-comma.shader_test \
|
tests/hlsl-comma.shader_test \
|
||||||
tests/hlsl-cross.shader_test \
|
tests/hlsl-cross.shader_test \
|
||||||
|
tests/hlsl-dot.shader_test \
|
||||||
tests/hlsl-duplicate-modifiers.shader_test \
|
tests/hlsl-duplicate-modifiers.shader_test \
|
||||||
tests/hlsl-for.shader_test \
|
tests/hlsl-for.shader_test \
|
||||||
tests/hlsl-function.shader_test \
|
tests/hlsl-function.shader_test \
|
||||||
@@ -87,13 +86,18 @@ vkd3d_shader_tests = \
|
|||||||
tests/hlsl-initializer-struct.shader_test \
|
tests/hlsl-initializer-struct.shader_test \
|
||||||
tests/hlsl-intrinsic-override.shader_test \
|
tests/hlsl-intrinsic-override.shader_test \
|
||||||
tests/hlsl-invalid.shader_test \
|
tests/hlsl-invalid.shader_test \
|
||||||
|
tests/hlsl-ldexp.shader_test \
|
||||||
|
tests/hlsl-length.shader_test \
|
||||||
|
tests/hlsl-lerp.shader_test \
|
||||||
tests/hlsl-majority-pragma.shader_test \
|
tests/hlsl-majority-pragma.shader_test \
|
||||||
tests/hlsl-majority-typedef.shader_test \
|
tests/hlsl-majority-typedef.shader_test \
|
||||||
tests/hlsl-matrix-indexing.shader_test \
|
tests/hlsl-matrix-indexing.shader_test \
|
||||||
tests/hlsl-mul.shader_test \
|
tests/hlsl-mul.shader_test \
|
||||||
tests/hlsl-nested-arrays.shader_test \
|
tests/hlsl-nested-arrays.shader_test \
|
||||||
|
tests/hlsl-normalize.shader_test \
|
||||||
tests/hlsl-numeric-constructor-truncation.shader_test \
|
tests/hlsl-numeric-constructor-truncation.shader_test \
|
||||||
tests/hlsl-numeric-types.shader_test \
|
tests/hlsl-numeric-types.shader_test \
|
||||||
|
tests/hlsl-numthreads.shader_test \
|
||||||
tests/hlsl-return-implicit-conversion.shader_test \
|
tests/hlsl-return-implicit-conversion.shader_test \
|
||||||
tests/hlsl-return-void.shader_test \
|
tests/hlsl-return-void.shader_test \
|
||||||
tests/hlsl-shape.shader_test \
|
tests/hlsl-shape.shader_test \
|
||||||
@@ -109,8 +113,10 @@ vkd3d_shader_tests = \
|
|||||||
tests/logic-operations.shader_test \
|
tests/logic-operations.shader_test \
|
||||||
tests/math.shader_test \
|
tests/math.shader_test \
|
||||||
tests/matrix-semantics.shader_test \
|
tests/matrix-semantics.shader_test \
|
||||||
|
tests/max.shader_test \
|
||||||
tests/multiple-rt.shader_test \
|
tests/multiple-rt.shader_test \
|
||||||
tests/nointerpolation.shader_test \
|
tests/nointerpolation.shader_test \
|
||||||
|
tests/object-references.shader_test \
|
||||||
tests/pow.shader_test \
|
tests/pow.shader_test \
|
||||||
tests/preproc-if.shader_test \
|
tests/preproc-if.shader_test \
|
||||||
tests/preproc-ifdef.shader_test \
|
tests/preproc-ifdef.shader_test \
|
||||||
@@ -135,6 +141,7 @@ vkd3d_shader_tests = \
|
|||||||
tests/texture-load-typed.shader_test \
|
tests/texture-load-typed.shader_test \
|
||||||
tests/trigonometry.shader_test \
|
tests/trigonometry.shader_test \
|
||||||
tests/uav.shader_test \
|
tests/uav.shader_test \
|
||||||
|
tests/uav-load.shader_test \
|
||||||
tests/writemask-assignop-0.shader_test \
|
tests/writemask-assignop-0.shader_test \
|
||||||
tests/writemask-assignop-1.shader_test \
|
tests/writemask-assignop-1.shader_test \
|
||||||
tests/writemask-assignop-2.shader_test \
|
tests/writemask-assignop-2.shader_test \
|
||||||
@@ -167,6 +174,7 @@ libvkd3d_common_la_SOURCES = \
|
|||||||
libs/vkd3d-common/error.c \
|
libs/vkd3d-common/error.c \
|
||||||
libs/vkd3d-common/memory.c \
|
libs/vkd3d-common/memory.c \
|
||||||
libs/vkd3d-common/utf8.c
|
libs/vkd3d-common/utf8.c
|
||||||
|
libvkd3d_common_la_LIBADD = @PTHREAD_LIBS@
|
||||||
|
|
||||||
lib_LTLIBRARIES = libvkd3d-shader.la libvkd3d.la libvkd3d-utils.la
|
lib_LTLIBRARIES = libvkd3d-shader.la libvkd3d.la libvkd3d-utils.la
|
||||||
|
|
||||||
@@ -237,7 +245,7 @@ libvkd3d_shader_la_SOURCES = \
|
|||||||
libs/vkd3d-shader/vkd3d_shader_main.c \
|
libs/vkd3d-shader/vkd3d_shader_main.c \
|
||||||
libs/vkd3d-shader/vkd3d_shader_private.h
|
libs/vkd3d-shader/vkd3d_shader_private.h
|
||||||
libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SHADER_SOURCE -I$(srcdir)/libs/vkd3d-shader @SPIRV_TOOLS_CFLAGS@
|
libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SHADER_SOURCE -I$(srcdir)/libs/vkd3d-shader @SPIRV_TOOLS_CFLAGS@
|
||||||
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 3:0:2
|
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 5:0:4
|
||||||
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@ -lm
|
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@ -lm
|
||||||
if HAVE_LD_VERSION_SCRIPT
|
if HAVE_LD_VERSION_SCRIPT
|
||||||
libvkd3d_shader_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map
|
libvkd3d_shader_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map
|
||||||
@@ -271,7 +279,7 @@ libvkd3d_la_SOURCES = \
|
|||||||
libs/vkd3d/vkd3d_shaders.h \
|
libs/vkd3d/vkd3d_shaders.h \
|
||||||
libs/vkd3d/vulkan_procs.h
|
libs/vkd3d/vulkan_procs.h
|
||||||
libvkd3d_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SOURCE
|
libvkd3d_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SOURCE
|
||||||
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 5:0:4
|
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:0:6
|
||||||
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@
|
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@
|
||||||
if HAVE_LD_VERSION_SCRIPT
|
if HAVE_LD_VERSION_SCRIPT
|
||||||
libvkd3d_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map
|
libvkd3d_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map
|
||||||
@@ -283,7 +291,7 @@ libvkd3d_utils_la_SOURCES = \
|
|||||||
libs/vkd3d-utils/vkd3d_utils_main.c \
|
libs/vkd3d-utils/vkd3d_utils_main.c \
|
||||||
libs/vkd3d-utils/vkd3d_utils_private.h
|
libs/vkd3d-utils/vkd3d_utils_private.h
|
||||||
libvkd3d_utils_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_UTILS_SOURCE
|
libvkd3d_utils_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_UTILS_SOURCE
|
||||||
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:0:3
|
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:2:3
|
||||||
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la libvkd3d.la @PTHREAD_LIBS@
|
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la libvkd3d.la @PTHREAD_LIBS@
|
||||||
if HAVE_LD_VERSION_SCRIPT
|
if HAVE_LD_VERSION_SCRIPT
|
||||||
libvkd3d_utils_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map
|
libvkd3d_utils_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map
|
||||||
@@ -334,11 +342,11 @@ DEMOS_LDADD = $(LDADD) libvkd3d-shader.la @DL_LIBS@ @DEMO_LIBS@
|
|||||||
DEMOS_CFLAGS = $(AM_CFLAGS) @DEMO_CFLAGS@
|
DEMOS_CFLAGS = $(AM_CFLAGS) @DEMO_CFLAGS@
|
||||||
bin_PROGRAMS += $(vkd3d_demos)
|
bin_PROGRAMS += $(vkd3d_demos)
|
||||||
|
|
||||||
demos_vkd3d_gears_SOURCES = demos/gears.c
|
demos_vkd3d_gears_SOURCES = demos/gears.c demos/gears_hlsl.h
|
||||||
demos_vkd3d_gears_CFLAGS = $(DEMOS_CFLAGS)
|
demos_vkd3d_gears_CFLAGS = $(DEMOS_CFLAGS)
|
||||||
demos_vkd3d_gears_LDADD = $(DEMOS_LDADD) -lm
|
demos_vkd3d_gears_LDADD = $(DEMOS_LDADD) -lm
|
||||||
|
|
||||||
demos_vkd3d_triangle_SOURCES = demos/triangle.c
|
demos_vkd3d_triangle_SOURCES = demos/triangle.c demos/triangle_hlsl.h
|
||||||
demos_vkd3d_triangle_CFLAGS = $(DEMOS_CFLAGS)
|
demos_vkd3d_triangle_CFLAGS = $(DEMOS_CFLAGS)
|
||||||
demos_vkd3d_triangle_LDADD = $(DEMOS_LDADD)
|
demos_vkd3d_triangle_LDADD = $(DEMOS_LDADD)
|
||||||
endif
|
endif
|
||||||
@@ -361,8 +369,6 @@ else
|
|||||||
@echo "widl is required to generate $@"
|
@echo "widl is required to generate $@"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST += $(vkd3d_demos_shaders)
|
|
||||||
|
|
||||||
libvkd3d-utils.pc: $(srcdir)/libs/vkd3d-utils/libvkd3d-utils.pc.in Makefile
|
libvkd3d-utils.pc: $(srcdir)/libs/vkd3d-utils/libvkd3d-utils.pc.in Makefile
|
||||||
$(AM_V_GEN)$(SED) -e 's![@]prefix[@]!$(prefix)!g' \
|
$(AM_V_GEN)$(SED) -e 's![@]prefix[@]!$(prefix)!g' \
|
||||||
-e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
|
-e 's![@]exec_prefix[@]!$(exec_prefix)!g' \
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_INIT([vkd3d],[1.4])
|
AC_INIT([vkd3d],[1.6])
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([bin])
|
AC_CONFIG_AUX_DIR([bin])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vkd3d_dxgi1_4.h>
|
#include <vkd3d_dxgi1_4.h>
|
||||||
|
#include <vkd3d_d3dcompiler.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#define VK_NO_PROTOTYPES
|
#define VK_NO_PROTOTYPES
|
||||||
#define VK_USE_PLATFORM_XCB_KHR
|
#define VK_USE_PLATFORM_XCB_KHR
|
||||||
#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_4
|
#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_6
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <vkd3d.h>
|
#include <vkd3d.h>
|
||||||
#include <vkd3d_utils.h>
|
#include <vkd3d_utils.h>
|
||||||
|
@@ -48,9 +48,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
|
|
||||||
#include "gears_vs.h"
|
#include "gears_hlsl.h"
|
||||||
#include "gears_ps_flat.h"
|
|
||||||
#include "gears_ps_smooth.h"
|
|
||||||
|
|
||||||
struct cxg_fence
|
struct cxg_fence
|
||||||
{
|
{
|
||||||
@@ -659,6 +657,7 @@ static void cxg_load_assets(struct cx_gears *cxg)
|
|||||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE dsv_handle;
|
D3D12_CPU_DESCRIPTOR_HANDLE dsv_handle;
|
||||||
D3D12_ROOT_PARAMETER root_parameter;
|
D3D12_ROOT_PARAMETER root_parameter;
|
||||||
|
ID3DBlob *vs, *ps_flat, *ps_smooth;
|
||||||
D3D12_RESOURCE_DESC resource_desc;
|
D3D12_RESOURCE_DESC resource_desc;
|
||||||
D3D12_HEAP_PROPERTIES heap_desc;
|
D3D12_HEAP_PROPERTIES heap_desc;
|
||||||
D3D12_RANGE read_range = {0, 0};
|
D3D12_RANGE read_range = {0, 0};
|
||||||
@@ -682,14 +681,21 @@ static void cxg_load_assets(struct cx_gears *cxg)
|
|||||||
hr = demo_create_root_signature(cxg->device, &root_signature_desc, &cxg->root_signature);
|
hr = demo_create_root_signature(cxg->device, &root_signature_desc, &cxg->root_signature);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
|
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
|
||||||
|
assert(SUCCEEDED(hr));
|
||||||
|
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "ps_main_flat", "ps_5_0", 0, 0, &ps_flat, NULL);
|
||||||
|
assert(SUCCEEDED(hr));
|
||||||
|
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "ps_main_smooth", "ps_5_0", 0, 0, &ps_smooth, NULL);
|
||||||
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
memset(&pso_desc, 0, sizeof(pso_desc));
|
memset(&pso_desc, 0, sizeof(pso_desc));
|
||||||
pso_desc.InputLayout.pInputElementDescs = il_desc;
|
pso_desc.InputLayout.pInputElementDescs = il_desc;
|
||||||
pso_desc.InputLayout.NumElements = ARRAY_SIZE(il_desc);
|
pso_desc.InputLayout.NumElements = ARRAY_SIZE(il_desc);
|
||||||
pso_desc.pRootSignature = cxg->root_signature;
|
pso_desc.pRootSignature = cxg->root_signature;
|
||||||
pso_desc.VS.pShaderBytecode = g_vs_main;
|
pso_desc.VS.pShaderBytecode = ID3D10Blob_GetBufferPointer(vs);
|
||||||
pso_desc.VS.BytecodeLength = sizeof(g_vs_main);
|
pso_desc.VS.BytecodeLength = ID3D10Blob_GetBufferSize(vs);
|
||||||
pso_desc.PS.pShaderBytecode = g_ps_main_flat;
|
pso_desc.PS.pShaderBytecode = ID3D10Blob_GetBufferPointer(ps_flat);
|
||||||
pso_desc.PS.BytecodeLength = sizeof(g_ps_main_flat);
|
pso_desc.PS.BytecodeLength = ID3D10Blob_GetBufferSize(ps_flat);
|
||||||
|
|
||||||
demo_rasterizer_desc_init_default(&pso_desc.RasterizerState);
|
demo_rasterizer_desc_init_default(&pso_desc.RasterizerState);
|
||||||
pso_desc.RasterizerState.FrontCounterClockwise = TRUE;
|
pso_desc.RasterizerState.FrontCounterClockwise = TRUE;
|
||||||
@@ -708,12 +714,16 @@ static void cxg_load_assets(struct cx_gears *cxg)
|
|||||||
&IID_ID3D12PipelineState, (void **)&cxg->pipeline_state_flat);
|
&IID_ID3D12PipelineState, (void **)&cxg->pipeline_state_flat);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
pso_desc.PS.pShaderBytecode = g_ps_main_smooth;
|
pso_desc.PS.pShaderBytecode = ID3D10Blob_GetBufferPointer(ps_smooth);
|
||||||
pso_desc.PS.BytecodeLength = sizeof(g_ps_main_smooth);
|
pso_desc.PS.BytecodeLength = ID3D10Blob_GetBufferSize(ps_smooth);
|
||||||
hr = ID3D12Device_CreateGraphicsPipelineState(cxg->device, &pso_desc,
|
hr = ID3D12Device_CreateGraphicsPipelineState(cxg->device, &pso_desc,
|
||||||
&IID_ID3D12PipelineState, (void **)&cxg->pipeline_state_smooth);
|
&IID_ID3D12PipelineState, (void **)&cxg->pipeline_state_smooth);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
|
ID3D10Blob_Release(vs);
|
||||||
|
ID3D10Blob_Release(ps_flat);
|
||||||
|
ID3D10Blob_Release(ps_smooth);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(cxg->command_list); ++i)
|
for (i = 0; i < ARRAY_SIZE(cxg->command_list); ++i)
|
||||||
{
|
{
|
||||||
hr = ID3D12Device_CreateCommandList(cxg->device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT,
|
hr = ID3D12Device_CreateCommandList(cxg->device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||||
|
@@ -1,55 +0,0 @@
|
|||||||
cbuffer gear_block : register(b0)
|
|
||||||
{
|
|
||||||
float4x4 mvp_matrix;
|
|
||||||
float3x3 normal_matrix;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct vs_in
|
|
||||||
{
|
|
||||||
float4 position : POSITION;
|
|
||||||
float3 normal : NORMAL;
|
|
||||||
float3 diffuse : DIFFUSE;
|
|
||||||
float4 transform : TRANSFORM;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct vs_out
|
|
||||||
{
|
|
||||||
float4 position : SV_POSITION;
|
|
||||||
float4 colour : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct vs_out vs_main(struct vs_in i)
|
|
||||||
{
|
|
||||||
const float3 l_pos = float3(5.0, 5.0, 10.0);
|
|
||||||
float3 dir, normal;
|
|
||||||
float4 position;
|
|
||||||
struct vs_out o;
|
|
||||||
float att;
|
|
||||||
|
|
||||||
position.x = i.transform.x * i.position.x - i.transform.y * i.position.y + i.transform.z;
|
|
||||||
position.y = i.transform.x * i.position.y + i.transform.y * i.position.x + i.transform.w;
|
|
||||||
position.zw = i.position.zw;
|
|
||||||
|
|
||||||
o.position = mul(mvp_matrix, position);
|
|
||||||
dir = normalize(l_pos - o.position.xyz / o.position.w);
|
|
||||||
|
|
||||||
normal.x = i.transform.x * i.normal.x - i.transform.y * i.normal.y;
|
|
||||||
normal.y = i.transform.x * i.normal.y + i.transform.y * i.normal.x;
|
|
||||||
normal.z = i.normal.z;
|
|
||||||
att = 0.2 + dot(dir, normalize(mul(normal_matrix, normal)));
|
|
||||||
|
|
||||||
o.colour.xyz = i.diffuse.xyz * att;
|
|
||||||
o.colour.w = 1.0;
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
float4 ps_main_smooth(float4 position : SV_POSITION, float4 colour : COLOR) : SV_TARGET
|
|
||||||
{
|
|
||||||
return colour;
|
|
||||||
}
|
|
||||||
|
|
||||||
float4 ps_main_flat(float4 position : SV_POSITION, nointerpolation float4 colour : COLOR) : SV_TARGET
|
|
||||||
{
|
|
||||||
return colour;
|
|
||||||
}
|
|
56
demos/gears_hlsl.h
Normal file
56
demos/gears_hlsl.h
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
static const char gears_hlsl[] =
|
||||||
|
"cbuffer gear_block : register(b0)\n"
|
||||||
|
"{\n"
|
||||||
|
" float4x4 mvp_matrix;\n"
|
||||||
|
" float3x3 normal_matrix;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct vs_in\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 position : POSITION;\n"
|
||||||
|
" float3 normal : NORMAL;\n"
|
||||||
|
" float3 diffuse : DIFFUSE;\n"
|
||||||
|
" float4 transform : TRANSFORM;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct vs_out\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 position : SV_POSITION;\n"
|
||||||
|
" float4 colour : COLOR;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct vs_out vs_main(struct vs_in i)\n"
|
||||||
|
"{\n"
|
||||||
|
" const float3 l_pos = float3(5.0, 5.0, 10.0);\n"
|
||||||
|
" float3 dir, normal;\n"
|
||||||
|
" float4 position;\n"
|
||||||
|
" struct vs_out o;\n"
|
||||||
|
" float att;\n"
|
||||||
|
"\n"
|
||||||
|
" position.x = i.transform.x * i.position.x - i.transform.y * i.position.y + i.transform.z;\n"
|
||||||
|
" position.y = i.transform.x * i.position.y + i.transform.y * i.position.x + i.transform.w;\n"
|
||||||
|
" position.zw = i.position.zw;\n"
|
||||||
|
"\n"
|
||||||
|
" o.position = mul(mvp_matrix, position);\n"
|
||||||
|
" dir = normalize(l_pos - o.position.xyz / o.position.w);\n"
|
||||||
|
"\n"
|
||||||
|
" normal.x = i.transform.x * i.normal.x - i.transform.y * i.normal.y;\n"
|
||||||
|
" normal.y = i.transform.x * i.normal.y + i.transform.y * i.normal.x;\n"
|
||||||
|
" normal.z = i.normal.z;\n"
|
||||||
|
" att = 0.2 + dot(dir, normalize(mul(normal_matrix, normal)));\n"
|
||||||
|
"\n"
|
||||||
|
" o.colour.xyz = i.diffuse.xyz * att;\n"
|
||||||
|
" o.colour.w = 1.0;\n"
|
||||||
|
"\n"
|
||||||
|
" return o;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
"float4 ps_main_smooth(float4 position : SV_POSITION, float4 colour : COLOR) : SV_TARGET\n"
|
||||||
|
"{\n"
|
||||||
|
" return colour;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
"float4 ps_main_flat(float4 position : SV_POSITION, nointerpolation float4 colour : COLOR) : SV_TARGET\n"
|
||||||
|
"{\n"
|
||||||
|
" return colour;\n"
|
||||||
|
"}\n";
|
@@ -1,73 +0,0 @@
|
|||||||
#if 0
|
|
||||||
//
|
|
||||||
// Generated by Microsoft (R) D3D Shader Disassembler
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Input signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_POSITION 0 xyzw 0 POS float
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Output signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_TARGET 0 xyzw 0 TARGET float xyzw
|
|
||||||
//
|
|
||||||
ps_5_0
|
|
||||||
dcl_globalFlags refactoringAllowed
|
|
||||||
dcl_input_ps constant v1.xyzw
|
|
||||||
dcl_output o0.xyzw
|
|
||||||
mov o0.xyzw, v1.xyzw
|
|
||||||
ret
|
|
||||||
// Approximately 0 instruction slots used
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const BYTE g_ps_main_flat[] =
|
|
||||||
{
|
|
||||||
68, 88, 66, 67, 254, 211,
|
|
||||||
50, 72, 228, 208, 73, 13,
|
|
||||||
143, 221, 134, 105, 6, 165,
|
|
||||||
26, 140, 1, 0, 0, 0,
|
|
||||||
248, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 44, 0, 0, 0,
|
|
||||||
128, 0, 0, 0, 180, 0,
|
|
||||||
0, 0, 73, 83, 71, 78,
|
|
||||||
76, 0, 0, 0, 2, 0,
|
|
||||||
0, 0, 8, 0, 0, 0,
|
|
||||||
56, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 1, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 0, 0, 0,
|
|
||||||
68, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
83, 86, 95, 80, 79, 83,
|
|
||||||
73, 84, 73, 79, 78, 0,
|
|
||||||
67, 79, 76, 79, 82, 0,
|
|
||||||
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, 15, 0, 0, 0,
|
|
||||||
83, 86, 95, 84, 65, 82,
|
|
||||||
71, 69, 84, 0, 171, 171,
|
|
||||||
83, 72, 69, 88, 60, 0,
|
|
||||||
0, 0, 80, 0, 0, 0,
|
|
||||||
15, 0, 0, 0, 106, 8,
|
|
||||||
0, 1, 98, 8, 0, 3,
|
|
||||||
242, 16, 16, 0, 1, 0,
|
|
||||||
0, 0, 101, 0, 0, 3,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 54, 0, 0, 5,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 30, 16, 0,
|
|
||||||
1, 0, 0, 0, 62, 0,
|
|
||||||
0, 1
|
|
||||||
};
|
|
@@ -1,73 +0,0 @@
|
|||||||
#if 0
|
|
||||||
//
|
|
||||||
// Generated by Microsoft (R) D3D Shader Disassembler
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Input signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_POSITION 0 xyzw 0 POS float
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Output signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_TARGET 0 xyzw 0 TARGET float xyzw
|
|
||||||
//
|
|
||||||
ps_5_0
|
|
||||||
dcl_globalFlags refactoringAllowed
|
|
||||||
dcl_input_ps linear v1.xyzw
|
|
||||||
dcl_output o0.xyzw
|
|
||||||
mov o0.xyzw, v1.xyzw
|
|
||||||
ret
|
|
||||||
// Approximately 0 instruction slots used
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const BYTE g_ps_main_smooth[] =
|
|
||||||
{
|
|
||||||
68, 88, 66, 67, 80, 239,
|
|
||||||
109, 26, 0, 147, 6, 156,
|
|
||||||
240, 104, 206, 124, 185, 57,
|
|
||||||
18, 98, 1, 0, 0, 0,
|
|
||||||
248, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 44, 0, 0, 0,
|
|
||||||
128, 0, 0, 0, 180, 0,
|
|
||||||
0, 0, 73, 83, 71, 78,
|
|
||||||
76, 0, 0, 0, 2, 0,
|
|
||||||
0, 0, 8, 0, 0, 0,
|
|
||||||
56, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 1, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 0, 0, 0,
|
|
||||||
68, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
83, 86, 95, 80, 79, 83,
|
|
||||||
73, 84, 73, 79, 78, 0,
|
|
||||||
67, 79, 76, 79, 82, 0,
|
|
||||||
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, 15, 0, 0, 0,
|
|
||||||
83, 86, 95, 84, 65, 82,
|
|
||||||
71, 69, 84, 0, 171, 171,
|
|
||||||
83, 72, 69, 88, 60, 0,
|
|
||||||
0, 0, 80, 0, 0, 0,
|
|
||||||
15, 0, 0, 0, 106, 8,
|
|
||||||
0, 1, 98, 16, 0, 3,
|
|
||||||
242, 16, 16, 0, 1, 0,
|
|
||||||
0, 0, 101, 0, 0, 3,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 54, 0, 0, 5,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 30, 16, 0,
|
|
||||||
1, 0, 0, 0, 62, 0,
|
|
||||||
0, 1
|
|
||||||
};
|
|
272
demos/gears_vs.h
272
demos/gears_vs.h
@@ -1,272 +0,0 @@
|
|||||||
#if 0
|
|
||||||
//
|
|
||||||
// Generated by Microsoft (R) D3D Shader Disassembler
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Input signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// POSITION 0 xyzw 0 NONE float xyzw
|
|
||||||
// NORMAL 0 xyz 1 NONE float xyz
|
|
||||||
// DIFFUSE 0 xyz 2 NONE float xyz
|
|
||||||
// TRANSFORM 0 xyzw 3 NONE float xyzw
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Output signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_POSITION 0 xyzw 0 POS float xyzw
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
vs_5_0
|
|
||||||
dcl_globalFlags refactoringAllowed
|
|
||||||
dcl_constantbuffer CB0[7], immediateIndexed
|
|
||||||
dcl_input v0.xyzw
|
|
||||||
dcl_input v1.xyz
|
|
||||||
dcl_input v2.xyz
|
|
||||||
dcl_input v3.xyzw
|
|
||||||
dcl_output_siv o0.xyzw, position
|
|
||||||
dcl_output o1.xyzw
|
|
||||||
dcl_temps 2
|
|
||||||
mul r0.x, v0.y, v3.y
|
|
||||||
mad r0.x, v3.x, v0.x, -r0.x
|
|
||||||
dp2 r0.y, v3.yxyy, v0.xyxx
|
|
||||||
add r0.xy, r0.xyxx, v3.zwzz
|
|
||||||
mul r1.xyzw, r0.yyyy, cb0[1].xyzw
|
|
||||||
mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw
|
|
||||||
mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw
|
|
||||||
mad r0.xyzw, cb0[3].xyzw, v0.wwww, r0.xyzw
|
|
||||||
mov o0.xyzw, r0.xyzw
|
|
||||||
div r0.xyz, r0.xyzx, r0.wwww
|
|
||||||
add r0.xyz, -r0.xyzx, l(5.000000, 5.000000, 10.000000, 0.000000)
|
|
||||||
dp3 r0.w, r0.xyzx, r0.xyzx
|
|
||||||
rsq r0.w, r0.w
|
|
||||||
mul r0.xyz, r0.wwww, r0.xyzx
|
|
||||||
mul r0.w, v1.y, v3.y
|
|
||||||
mad r0.w, v3.x, v1.x, -r0.w
|
|
||||||
dp2 r1.x, v3.yxyy, v1.xyxx
|
|
||||||
mul r1.xyz, r1.xxxx, cb0[5].xyzx
|
|
||||||
mad r1.xyz, cb0[4].xyzx, r0.wwww, r1.xyzx
|
|
||||||
mad r1.xyz, cb0[6].xyzx, v1.zzzz, r1.xyzx
|
|
||||||
dp3 r0.w, r1.xyzx, r1.xyzx
|
|
||||||
rsq r0.w, r0.w
|
|
||||||
mul r1.xyz, r0.wwww, r1.xyzx
|
|
||||||
dp3 r0.x, r0.xyzx, r1.xyzx
|
|
||||||
add r0.x, r0.x, l(0.200000)
|
|
||||||
mul o1.xyz, r0.xxxx, v2.xyzx
|
|
||||||
mov o1.w, l(1.000000)
|
|
||||||
ret
|
|
||||||
// Approximately 0 instruction slots used
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const BYTE g_vs_main[] =
|
|
||||||
{
|
|
||||||
68, 88, 66, 67, 82, 90,
|
|
||||||
22, 185, 41, 66, 113, 173,
|
|
||||||
43, 53, 199, 35, 30, 50,
|
|
||||||
78, 7, 1, 0, 0, 0,
|
|
||||||
208, 4, 0, 0, 3, 0,
|
|
||||||
0, 0, 44, 0, 0, 0,
|
|
||||||
192, 0, 0, 0, 20, 1,
|
|
||||||
0, 0, 73, 83, 71, 78,
|
|
||||||
140, 0, 0, 0, 4, 0,
|
|
||||||
0, 0, 8, 0, 0, 0,
|
|
||||||
104, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
113, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 7, 7, 0, 0,
|
|
||||||
120, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 2, 0,
|
|
||||||
0, 0, 7, 7, 0, 0,
|
|
||||||
128, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
80, 79, 83, 73, 84, 73,
|
|
||||||
79, 78, 0, 78, 79, 82,
|
|
||||||
77, 65, 76, 0, 68, 73,
|
|
||||||
70, 70, 85, 83, 69, 0,
|
|
||||||
84, 82, 65, 78, 83, 70,
|
|
||||||
79, 82, 77, 0, 171, 171,
|
|
||||||
79, 83, 71, 78, 76, 0,
|
|
||||||
0, 0, 2, 0, 0, 0,
|
|
||||||
8, 0, 0, 0, 56, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
15, 0, 0, 0, 68, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 1, 0, 0, 0,
|
|
||||||
15, 0, 0, 0, 83, 86,
|
|
||||||
95, 80, 79, 83, 73, 84,
|
|
||||||
73, 79, 78, 0, 67, 79,
|
|
||||||
76, 79, 82, 0, 171, 171,
|
|
||||||
83, 72, 69, 88, 180, 3,
|
|
||||||
0, 0, 80, 0, 1, 0,
|
|
||||||
237, 0, 0, 0, 106, 8,
|
|
||||||
0, 1, 89, 0, 0, 4,
|
|
||||||
70, 142, 32, 0, 0, 0,
|
|
||||||
0, 0, 7, 0, 0, 0,
|
|
||||||
95, 0, 0, 3, 242, 16,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
95, 0, 0, 3, 114, 16,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
95, 0, 0, 3, 114, 16,
|
|
||||||
16, 0, 2, 0, 0, 0,
|
|
||||||
95, 0, 0, 3, 242, 16,
|
|
||||||
16, 0, 3, 0, 0, 0,
|
|
||||||
103, 0, 0, 4, 242, 32,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 101, 0,
|
|
||||||
0, 3, 242, 32, 16, 0,
|
|
||||||
1, 0, 0, 0, 104, 0,
|
|
||||||
0, 2, 2, 0, 0, 0,
|
|
||||||
56, 0, 0, 7, 18, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
26, 16, 16, 0, 0, 0,
|
|
||||||
0, 0, 26, 16, 16, 0,
|
|
||||||
3, 0, 0, 0, 50, 0,
|
|
||||||
0, 10, 18, 0, 16, 0,
|
|
||||||
0, 0, 0, 0, 10, 16,
|
|
||||||
16, 0, 3, 0, 0, 0,
|
|
||||||
10, 16, 16, 0, 0, 0,
|
|
||||||
0, 0, 10, 0, 16, 128,
|
|
||||||
65, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 0, 0, 7,
|
|
||||||
34, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 22, 21, 16, 0,
|
|
||||||
3, 0, 0, 0, 70, 16,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 7, 50, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 230, 26, 16, 0,
|
|
||||||
3, 0, 0, 0, 56, 0,
|
|
||||||
0, 8, 242, 0, 16, 0,
|
|
||||||
1, 0, 0, 0, 86, 5,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 142, 32, 0, 0, 0,
|
|
||||||
0, 0, 1, 0, 0, 0,
|
|
||||||
50, 0, 0, 10, 242, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 142, 32, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
6, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 14, 16, 0,
|
|
||||||
1, 0, 0, 0, 50, 0,
|
|
||||||
0, 10, 242, 0, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 142,
|
|
||||||
32, 0, 0, 0, 0, 0,
|
|
||||||
2, 0, 0, 0, 166, 26,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 14, 16, 0, 0, 0,
|
|
||||||
0, 0, 50, 0, 0, 10,
|
|
||||||
242, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 142, 32, 0,
|
|
||||||
0, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 246, 31, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 14,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
54, 0, 0, 5, 242, 32,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 14, 16, 0, 0, 0,
|
|
||||||
0, 0, 14, 0, 0, 7,
|
|
||||||
114, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 2, 16, 0,
|
|
||||||
0, 0, 0, 0, 246, 15,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 11, 114, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 2, 16, 128, 65, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
2, 64, 0, 0, 0, 0,
|
|
||||||
160, 64, 0, 0, 160, 64,
|
|
||||||
0, 0, 32, 65, 0, 0,
|
|
||||||
0, 0, 16, 0, 0, 7,
|
|
||||||
130, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 2, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 2,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
68, 0, 0, 5, 130, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
58, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 56, 0, 0, 7,
|
|
||||||
114, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 246, 15, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 2,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
56, 0, 0, 7, 130, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
26, 16, 16, 0, 1, 0,
|
|
||||||
0, 0, 26, 16, 16, 0,
|
|
||||||
3, 0, 0, 0, 50, 0,
|
|
||||||
0, 10, 130, 0, 16, 0,
|
|
||||||
0, 0, 0, 0, 10, 16,
|
|
||||||
16, 0, 3, 0, 0, 0,
|
|
||||||
10, 16, 16, 0, 1, 0,
|
|
||||||
0, 0, 58, 0, 16, 128,
|
|
||||||
65, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 0, 0, 7,
|
|
||||||
18, 0, 16, 0, 1, 0,
|
|
||||||
0, 0, 22, 21, 16, 0,
|
|
||||||
3, 0, 0, 0, 70, 16,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
56, 0, 0, 8, 114, 0,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
6, 0, 16, 0, 1, 0,
|
|
||||||
0, 0, 70, 130, 32, 0,
|
|
||||||
0, 0, 0, 0, 5, 0,
|
|
||||||
0, 0, 50, 0, 0, 10,
|
|
||||||
114, 0, 16, 0, 1, 0,
|
|
||||||
0, 0, 70, 130, 32, 0,
|
|
||||||
0, 0, 0, 0, 4, 0,
|
|
||||||
0, 0, 246, 15, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 2,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
50, 0, 0, 10, 114, 0,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
70, 130, 32, 0, 0, 0,
|
|
||||||
0, 0, 6, 0, 0, 0,
|
|
||||||
166, 26, 16, 0, 1, 0,
|
|
||||||
0, 0, 70, 2, 16, 0,
|
|
||||||
1, 0, 0, 0, 16, 0,
|
|
||||||
0, 7, 130, 0, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 2,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
70, 2, 16, 0, 1, 0,
|
|
||||||
0, 0, 68, 0, 0, 5,
|
|
||||||
130, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 58, 0, 16, 0,
|
|
||||||
0, 0, 0, 0, 56, 0,
|
|
||||||
0, 7, 114, 0, 16, 0,
|
|
||||||
1, 0, 0, 0, 246, 15,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 2, 16, 0, 1, 0,
|
|
||||||
0, 0, 16, 0, 0, 7,
|
|
||||||
18, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 2, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 2,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
0, 0, 0, 7, 18, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
10, 0, 16, 0, 0, 0,
|
|
||||||
0, 0, 1, 64, 0, 0,
|
|
||||||
205, 204, 76, 62, 56, 0,
|
|
||||||
0, 7, 114, 32, 16, 0,
|
|
||||||
1, 0, 0, 0, 6, 0,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
70, 18, 16, 0, 2, 0,
|
|
||||||
0, 0, 54, 0, 0, 5,
|
|
||||||
130, 32, 16, 0, 1, 0,
|
|
||||||
0, 0, 1, 64, 0, 0,
|
|
||||||
0, 0, 128, 63, 62, 0,
|
|
||||||
0, 1
|
|
||||||
};
|
|
@@ -45,8 +45,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
|
|
||||||
#include "triangle_vs.h"
|
#include "triangle_hlsl.h"
|
||||||
#include "triangle_ps.h"
|
|
||||||
|
|
||||||
struct cxt_fence
|
struct cxt_fence
|
||||||
{
|
{
|
||||||
@@ -277,6 +276,7 @@ static void cxt_load_assets(struct cx_triangle *cxt)
|
|||||||
D3D12_RESOURCE_DESC resource_desc;
|
D3D12_RESOURCE_DESC resource_desc;
|
||||||
D3D12_HEAP_PROPERTIES heap_desc;
|
D3D12_HEAP_PROPERTIES heap_desc;
|
||||||
D3D12_RANGE read_range = {0, 0};
|
D3D12_RANGE read_range = {0, 0};
|
||||||
|
ID3DBlob *vs, *ps;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
@@ -285,14 +285,19 @@ static void cxt_load_assets(struct cx_triangle *cxt)
|
|||||||
hr = demo_create_root_signature(cxt->device, &root_signature_desc, &cxt->root_signature);
|
hr = demo_create_root_signature(cxt->device, &root_signature_desc, &cxt->root_signature);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
|
hr = D3DCompile(triangle_hlsl, strlen(triangle_hlsl), NULL, NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
|
||||||
|
assert(SUCCEEDED(hr));
|
||||||
|
hr = D3DCompile(triangle_hlsl, strlen(triangle_hlsl), NULL, NULL, NULL, "ps_main", "ps_5_0", 0, 0, &ps, NULL);
|
||||||
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
memset(&pso_desc, 0, sizeof(pso_desc));
|
memset(&pso_desc, 0, sizeof(pso_desc));
|
||||||
pso_desc.InputLayout.pInputElementDescs = il_desc;
|
pso_desc.InputLayout.pInputElementDescs = il_desc;
|
||||||
pso_desc.InputLayout.NumElements = ARRAY_SIZE(il_desc);
|
pso_desc.InputLayout.NumElements = ARRAY_SIZE(il_desc);
|
||||||
pso_desc.pRootSignature = cxt->root_signature;
|
pso_desc.pRootSignature = cxt->root_signature;
|
||||||
pso_desc.VS.pShaderBytecode = g_vs_main;
|
pso_desc.VS.pShaderBytecode = ID3D10Blob_GetBufferPointer(vs);
|
||||||
pso_desc.VS.BytecodeLength = sizeof(g_vs_main);
|
pso_desc.VS.BytecodeLength = ID3D10Blob_GetBufferSize(vs);
|
||||||
pso_desc.PS.pShaderBytecode = g_ps_main;
|
pso_desc.PS.pShaderBytecode = ID3D10Blob_GetBufferPointer(ps);
|
||||||
pso_desc.PS.BytecodeLength = sizeof(g_ps_main);
|
pso_desc.PS.BytecodeLength = ID3D10Blob_GetBufferSize(ps);
|
||||||
demo_rasterizer_desc_init_default(&pso_desc.RasterizerState);
|
demo_rasterizer_desc_init_default(&pso_desc.RasterizerState);
|
||||||
demo_blend_desc_init_default(&pso_desc.BlendState);
|
demo_blend_desc_init_default(&pso_desc.BlendState);
|
||||||
pso_desc.DepthStencilState.DepthEnable = FALSE;
|
pso_desc.DepthStencilState.DepthEnable = FALSE;
|
||||||
@@ -306,6 +311,9 @@ static void cxt_load_assets(struct cx_triangle *cxt)
|
|||||||
&IID_ID3D12PipelineState, (void **)&cxt->pipeline_state);
|
&IID_ID3D12PipelineState, (void **)&cxt->pipeline_state);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
|
||||||
|
ID3D10Blob_Release(vs);
|
||||||
|
ID3D10Blob_Release(ps);
|
||||||
|
|
||||||
hr = ID3D12Device_CreateCommandList(cxt->device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT, cxt->command_allocator,
|
hr = ID3D12Device_CreateCommandList(cxt->device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT, cxt->command_allocator,
|
||||||
cxt->pipeline_state, &IID_ID3D12GraphicsCommandList, (void **)&cxt->command_list);
|
cxt->pipeline_state, &IID_ID3D12GraphicsCommandList, (void **)&cxt->command_list);
|
||||||
assert(SUCCEEDED(hr));
|
assert(SUCCEEDED(hr));
|
||||||
|
@@ -1,20 +0,0 @@
|
|||||||
struct ps_in
|
|
||||||
{
|
|
||||||
float4 position : SV_POSITION;
|
|
||||||
float4 colour : COLOR;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ps_in vs_main(float4 position : POSITION, float4 colour : COLOR)
|
|
||||||
{
|
|
||||||
struct ps_in o;
|
|
||||||
|
|
||||||
o.position = position;
|
|
||||||
o.colour = colour;
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
float4 ps_main(struct ps_in i) : SV_TARGET
|
|
||||||
{
|
|
||||||
return i.colour;
|
|
||||||
}
|
|
21
demos/triangle_hlsl.h
Normal file
21
demos/triangle_hlsl.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
static const char triangle_hlsl[] =
|
||||||
|
"struct ps_in\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 position : SV_POSITION;\n"
|
||||||
|
" float4 colour : COLOR;\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"struct ps_in vs_main(float4 position : POSITION, float4 colour : COLOR)\n"
|
||||||
|
"{\n"
|
||||||
|
" struct ps_in o;\n"
|
||||||
|
"\n"
|
||||||
|
" o.position = position;\n"
|
||||||
|
" o.colour = colour;\n"
|
||||||
|
"\n"
|
||||||
|
" return o;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
"float4 ps_main(struct ps_in i) : SV_TARGET\n"
|
||||||
|
"{\n"
|
||||||
|
" return i.colour;\n"
|
||||||
|
"}\n";
|
@@ -1,73 +0,0 @@
|
|||||||
#if 0
|
|
||||||
//
|
|
||||||
// Generated by Microsoft (R) D3D Shader Disassembler
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Input signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_POSITION 0 xyzw 0 POS float
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Output signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_TARGET 0 xyzw 0 TARGET float xyzw
|
|
||||||
//
|
|
||||||
ps_5_0
|
|
||||||
dcl_globalFlags refactoringAllowed
|
|
||||||
dcl_input_ps linear v1.xyzw
|
|
||||||
dcl_output o0.xyzw
|
|
||||||
mov o0.xyzw, v1.xyzw
|
|
||||||
ret
|
|
||||||
// Approximately 0 instruction slots used
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const BYTE g_ps_main[] =
|
|
||||||
{
|
|
||||||
68, 88, 66, 67, 80, 239,
|
|
||||||
109, 26, 0, 147, 6, 156,
|
|
||||||
240, 104, 206, 124, 185, 57,
|
|
||||||
18, 98, 1, 0, 0, 0,
|
|
||||||
248, 0, 0, 0, 3, 0,
|
|
||||||
0, 0, 44, 0, 0, 0,
|
|
||||||
128, 0, 0, 0, 180, 0,
|
|
||||||
0, 0, 73, 83, 71, 78,
|
|
||||||
76, 0, 0, 0, 2, 0,
|
|
||||||
0, 0, 8, 0, 0, 0,
|
|
||||||
56, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 1, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 0, 0, 0,
|
|
||||||
68, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
83, 86, 95, 80, 79, 83,
|
|
||||||
73, 84, 73, 79, 78, 0,
|
|
||||||
67, 79, 76, 79, 82, 0,
|
|
||||||
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, 15, 0, 0, 0,
|
|
||||||
83, 86, 95, 84, 65, 82,
|
|
||||||
71, 69, 84, 0, 171, 171,
|
|
||||||
83, 72, 69, 88, 60, 0,
|
|
||||||
0, 0, 80, 0, 0, 0,
|
|
||||||
15, 0, 0, 0, 106, 8,
|
|
||||||
0, 1, 98, 16, 0, 3,
|
|
||||||
242, 16, 16, 0, 1, 0,
|
|
||||||
0, 0, 101, 0, 0, 3,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 54, 0, 0, 5,
|
|
||||||
242, 32, 16, 0, 0, 0,
|
|
||||||
0, 0, 70, 30, 16, 0,
|
|
||||||
1, 0, 0, 0, 62, 0,
|
|
||||||
0, 1
|
|
||||||
};
|
|
@@ -1,89 +0,0 @@
|
|||||||
#if 0
|
|
||||||
//
|
|
||||||
// Generated by Microsoft (R) D3D Shader Disassembler
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Input signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// POSITION 0 xyzw 0 NONE float xyzw
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Output signature:
|
|
||||||
//
|
|
||||||
// Name Index Mask Register SysValue Format Used
|
|
||||||
// -------------------- ----- ------ -------- -------- ------- ------
|
|
||||||
// SV_POSITION 0 xyzw 0 POS float xyzw
|
|
||||||
// COLOR 0 xyzw 1 NONE float xyzw
|
|
||||||
//
|
|
||||||
vs_5_0
|
|
||||||
dcl_globalFlags refactoringAllowed
|
|
||||||
dcl_input v0.xyzw
|
|
||||||
dcl_input v1.xyzw
|
|
||||||
dcl_output_siv o0.xyzw, position
|
|
||||||
dcl_output o1.xyzw
|
|
||||||
mov o0.xyzw, v0.xyzw
|
|
||||||
mov o1.xyzw, v1.xyzw
|
|
||||||
ret
|
|
||||||
// Approximately 0 instruction slots used
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const BYTE g_vs_main[] =
|
|
||||||
{
|
|
||||||
68, 88, 66, 67, 17, 201,
|
|
||||||
143, 165, 233, 56, 0, 40,
|
|
||||||
84, 255, 207, 20, 40, 195,
|
|
||||||
63, 228, 1, 0, 0, 0,
|
|
||||||
68, 1, 0, 0, 3, 0,
|
|
||||||
0, 0, 44, 0, 0, 0,
|
|
||||||
124, 0, 0, 0, 208, 0,
|
|
||||||
0, 0, 73, 83, 71, 78,
|
|
||||||
72, 0, 0, 0, 2, 0,
|
|
||||||
0, 0, 8, 0, 0, 0,
|
|
||||||
56, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
65, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
3, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 15, 15, 0, 0,
|
|
||||||
80, 79, 83, 73, 84, 73,
|
|
||||||
79, 78, 0, 67, 79, 76,
|
|
||||||
79, 82, 0, 171, 79, 83,
|
|
||||||
71, 78, 76, 0, 0, 0,
|
|
||||||
2, 0, 0, 0, 8, 0,
|
|
||||||
0, 0, 56, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 1, 0,
|
|
||||||
0, 0, 3, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 15, 0,
|
|
||||||
0, 0, 68, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 3, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 15, 0,
|
|
||||||
0, 0, 83, 86, 95, 80,
|
|
||||||
79, 83, 73, 84, 73, 79,
|
|
||||||
78, 0, 67, 79, 76, 79,
|
|
||||||
82, 0, 171, 171, 83, 72,
|
|
||||||
69, 88, 108, 0, 0, 0,
|
|
||||||
80, 0, 1, 0, 27, 0,
|
|
||||||
0, 0, 106, 8, 0, 1,
|
|
||||||
95, 0, 0, 3, 242, 16,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
95, 0, 0, 3, 242, 16,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
103, 0, 0, 4, 242, 32,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 101, 0,
|
|
||||||
0, 3, 242, 32, 16, 0,
|
|
||||||
1, 0, 0, 0, 54, 0,
|
|
||||||
0, 5, 242, 32, 16, 0,
|
|
||||||
0, 0, 0, 0, 70, 30,
|
|
||||||
16, 0, 0, 0, 0, 0,
|
|
||||||
54, 0, 0, 5, 242, 32,
|
|
||||||
16, 0, 1, 0, 0, 0,
|
|
||||||
70, 30, 16, 0, 1, 0,
|
|
||||||
0, 0, 62, 0, 0, 1
|
|
||||||
};
|
|
@@ -150,8 +150,8 @@ static inline unsigned int list_count( const struct list *list )
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move all elements from src to the tail of dst */
|
/* move all elements from src to before the specified element */
|
||||||
static inline void list_move_tail( struct list *dst, struct list *src )
|
static inline void list_move_before( struct list *dst, struct list *src )
|
||||||
{
|
{
|
||||||
if (list_empty(src)) return;
|
if (list_empty(src)) return;
|
||||||
|
|
||||||
@@ -162,8 +162,8 @@ static inline void list_move_tail( struct list *dst, struct list *src )
|
|||||||
list_init(src);
|
list_init(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move all elements from src to the head of dst */
|
/* move all elements from src to after the specified element */
|
||||||
static inline void list_move_head( struct list *dst, struct list *src )
|
static inline void list_move_after( struct list *dst, struct list *src )
|
||||||
{
|
{
|
||||||
if (list_empty(src)) return;
|
if (list_empty(src)) return;
|
||||||
|
|
||||||
@@ -174,6 +174,18 @@ static inline void list_move_head( struct list *dst, struct list *src )
|
|||||||
list_init(src);
|
list_init(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* move all elements from src to the head of dst */
|
||||||
|
static inline void list_move_head( struct list *dst, struct list *src )
|
||||||
|
{
|
||||||
|
list_move_after( dst, src );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* move all elements from src to the tail of dst */
|
||||||
|
static inline void list_move_tail( struct list *dst, struct list *src )
|
||||||
|
{
|
||||||
|
list_move_before( dst, src );
|
||||||
|
}
|
||||||
|
|
||||||
/* iterate through the list */
|
/* iterate through the list */
|
||||||
#define LIST_FOR_EACH(cursor,list) \
|
#define LIST_FOR_EACH(cursor,list) \
|
||||||
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
|
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
|
||||||
|
@@ -54,14 +54,32 @@ static inline size_t align(size_t addr, size_t alignment)
|
|||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# define VKD3D_NORETURN __attribute__((noreturn))
|
# define VKD3D_NORETURN __attribute__((noreturn))
|
||||||
|
# ifdef __MINGW_PRINTF_FORMAT
|
||||||
|
# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args)))
|
||||||
|
# else
|
||||||
# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args)))
|
# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args)))
|
||||||
|
# endif
|
||||||
# define VKD3D_UNUSED __attribute__((unused))
|
# define VKD3D_UNUSED __attribute__((unused))
|
||||||
|
# define VKD3D_UNREACHABLE __builtin_unreachable()
|
||||||
#else
|
#else
|
||||||
# define VKD3D_NORETURN
|
# define VKD3D_NORETURN
|
||||||
# define VKD3D_PRINTF_FUNC(fmt, args)
|
# define VKD3D_PRINTF_FUNC(fmt, args)
|
||||||
# define VKD3D_UNUSED
|
# define VKD3D_UNUSED
|
||||||
|
# define VKD3D_UNREACHABLE (void)0
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
VKD3D_NORETURN static inline void vkd3d_unreachable_(const char *filename, unsigned int line)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s:%u: Aborting, reached unreachable code.\n", filename, line);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
#define vkd3d_unreachable() VKD3D_UNREACHABLE
|
||||||
|
#else
|
||||||
|
#define vkd3d_unreachable() vkd3d_unreachable_(__FILE__, __LINE__)
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline unsigned int vkd3d_popcount(unsigned int v)
|
static inline unsigned int vkd3d_popcount(unsigned int v)
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@@ -115,5 +115,6 @@ struct vkd3d_debug_option
|
|||||||
bool vkd3d_debug_list_has_member(const char *string, const char *member);
|
bool vkd3d_debug_list_has_member(const char *string, const char *member);
|
||||||
uint64_t vkd3d_parse_debug_options(const char *string,
|
uint64_t vkd3d_parse_debug_options(const char *string,
|
||||||
const struct vkd3d_debug_option *options, unsigned int option_count);
|
const struct vkd3d_debug_option *options, unsigned int option_count);
|
||||||
|
void vkd3d_set_thread_name(const char *name);
|
||||||
|
|
||||||
#endif /* __VKD3D_DEBUG_H */
|
#endif /* __VKD3D_DEBUG_H */
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user