mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
tests/shader-runner: Test shaders with dxcompiler.
The location of dxcompiler should be set during configuration with 'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with LD_LIBRARY_PATH, WINEPATH or PATH as applicable. A new 'fail(sm<6)' decoration is needed on many shader declarations because dxcompiler succeeds on many shaders which fail with fxc. The opposite case is less common and is flagged with 'fail(sm>=6)'. A few tests cause dxcompiler to crash or hang, so these are avoided using [require], which now skips tests until reset instead of exiting. Also, 'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results.
This commit is contained in:
parent
d211160b89
commit
57280673e5
Notes:
Alexandre Julliard
2023-10-11 22:53:48 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
10
Makefile.am
10
Makefile.am
@ -14,7 +14,8 @@ widl_headers = \
|
||||
include/vkd3d_dxgi1_4.h \
|
||||
include/vkd3d_dxgibase.h \
|
||||
include/vkd3d_dxgiformat.h \
|
||||
include/vkd3d_dxgitype.h
|
||||
include/vkd3d_dxgitype.h \
|
||||
tests/dxcompiler.h
|
||||
|
||||
vkd3d_public_headers = \
|
||||
include/vkd3d.h \
|
||||
@ -181,6 +182,7 @@ vkd3d_shader_tests = \
|
||||
tests/hlsl/uav-rwbuffer.shader_test \
|
||||
tests/hlsl/uav-rwstructuredbuffer.shader_test \
|
||||
tests/hlsl/uav-rwtexture.shader_test \
|
||||
tests/hlsl/uniform-parameters.shader_test \
|
||||
tests/hlsl/uniform-semantics.shader_test \
|
||||
tests/hlsl/vector-indexing-uniform.shader_test \
|
||||
tests/hlsl/vector-indexing.shader_test \
|
||||
@ -198,6 +200,7 @@ vkd3d_shader_tests = \
|
||||
vkd3d_test_headers = \
|
||||
tests/d3d12_crosstest.h \
|
||||
tests/d3d12_test_utils.h \
|
||||
tests/dxcompiler.h \
|
||||
tests/shader_runner.h \
|
||||
tests/utils.h \
|
||||
tests/vulkan_procs.h
|
||||
@ -380,6 +383,7 @@ tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @DL_LIBS@
|
||||
tests_d3d12_invalid_usage_LDADD = $(LDADD) @DL_LIBS@
|
||||
tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@
|
||||
tests_shader_runner_LDADD = $(LDADD) @DL_LIBS@
|
||||
tests_shader_runner_CFLAGS = $(AM_CFLAGS) -I$(builddir)/tests
|
||||
tests_shader_runner_SOURCES = \
|
||||
tests/shader_runner.c \
|
||||
tests/shader_runner_d3d9.c \
|
||||
@ -420,7 +424,7 @@ endif
|
||||
EXTRA_DIST += $(widl_headers) $(widl_headers:.h=.idl)
|
||||
$(widl_headers): %.h: %.idl
|
||||
if HAVE_WIDL
|
||||
$(VKD3D_V_WIDL)$(WIDL) -h -o $@ $<
|
||||
$(VKD3D_V_WIDL)$(WIDL) -I$(srcdir)/include -h -o $@ $<
|
||||
else
|
||||
@echo "widl is required to generate $@"
|
||||
endif
|
||||
@ -464,7 +468,7 @@ dummy-vkd3d-version:
|
||||
|
||||
## Cross-compile tests
|
||||
cross_implibs = crosslibs/d3d12
|
||||
CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include
|
||||
CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include -I$(builddir)/tests
|
||||
CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=0 -DVKD3D_CROSSTEST=1
|
||||
EXTRA_DIST += $(cross_implibs:=.cross32.def) $(cross_implibs:=.cross64.def)
|
||||
EXTRA_DIST += tests/shader_runner_d3d11.c tests/shader_runner_d3d9.c
|
||||
|
10
README
10
README
@ -83,6 +83,16 @@ commas or semicolons.
|
||||
|
||||
* VKD3D_TEST_BUG - set to 0 to disable bug_if() conditions in tests.
|
||||
|
||||
If the configuration defines 'DXCOMPILER_LIBS=-L/path/to/dxcompiler', Shader
|
||||
Runner attempts to load libdxcompiler.so or dxcompiler.dll to compile test
|
||||
shaders in Shader Model 6. LD_LIBRARY_PATH (linux), WINEPATH (wine) or PATH
|
||||
(native windows) should include the location of dxcompiler if SM 6 shader
|
||||
tests are desired. If dxcompiler is not found, Shader Runner will compile the
|
||||
test shaders only in earlier shader models. The DXC source does not contain
|
||||
code for adding DXBC checksums, so the official release should be installed
|
||||
from:
|
||||
https://github.com/microsoft/DirectXShaderCompiler/releases
|
||||
|
||||
================
|
||||
Developing vkd3d
|
||||
================
|
||||
|
@ -120,6 +120,12 @@ AS_IF([test "x$SONAME_LIBVULKAN" = "x"],
|
||||
[VKD3D_CHECK_VULKAN],
|
||||
[AC_DEFINE_UNQUOTED([SONAME_LIBVULKAN],["$SONAME_LIBVULKAN"],[Define to the shared object name of the Vulkan library.])])
|
||||
|
||||
AC_ARG_VAR([SONAME_LIBDXCOMPILER], [shared object name for the dxcompiler library])
|
||||
AC_ARG_VAR([DXCOMPILER_LIBS], [linker flags for the dxcompiler library])
|
||||
AS_IF([test "x$SONAME_LIBDXCOMPILER" = "x"],
|
||||
[VKD3D_CHECK_SONAME([dxcompiler], [DxcCreateInstance], [HAVE_DXCOMPILER=yes], [HAVE_DXCOMPILER=no], [$DXCOMPILER_LIBS])],
|
||||
[AC_DEFINE_UNQUOTED([SONAME_LIBDXCOMPILER],["$SONAME_LIBDXCOMPILER"],[Define to the shared object name of the dxcompiler library.])])
|
||||
|
||||
AS_IF([test "x$with_ncurses" != "xno"],
|
||||
[PKG_CHECK_MODULES([NCURSES], [ncurses],
|
||||
[AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if you have ncurses.]) with_ncurses=yes],
|
||||
@ -183,6 +189,7 @@ AS_ECHO(["
|
||||
Have ncurses: ${with_ncurses}
|
||||
Have SPIRV-Tools: ${with_spirv_tools}
|
||||
Have xcb: ${HAVE_XCB}
|
||||
Have dxcompiler: ${HAVE_DXCOMPILER}
|
||||
|
||||
Building demos: ${enable_demos}
|
||||
Building tests: ${enable_tests}
|
||||
|
168
tests/dxcompiler.idl
Normal file
168
tests/dxcompiler.idl
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright 2023 Conor McCarthy for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
import "vkd3d_windows.h";
|
||||
|
||||
#include "vkd3d_unknown.idl"
|
||||
|
||||
/* The linux build of dxcompiler does not apply the ms_abi calling convention to its COM interfaces,
|
||||
* so they default to sysv_abi. The '__stdcall' macro is set in vkd3d_windows.h to ms_abi, and widl
|
||||
* emits STDMETHODCALLTYPE for COM interfaces, so '__stdcall' must be temporarily undefined. Doing
|
||||
* this in a PE build (x86 or x64) is unnecessary since the default calling convention is identical.
|
||||
* A 32-bit linux release of dxcompiler is not available.
|
||||
* TODO: modily widl to optionally omit STDMETHODCALLTYPE? */
|
||||
cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)")
|
||||
cpp_quote("# pragma push_macro(\"__stdcall\")")
|
||||
cpp_quote("# undef __stdcall")
|
||||
cpp_quote("# define __stdcall")
|
||||
cpp_quote("#endif")
|
||||
|
||||
static const HRESULT DXC_E_LLVM_CAST_ERROR = 0x80aa001d;
|
||||
|
||||
[
|
||||
uuid(73e22d93-e6ce-47f3-b5bf-f0664f39c1b0)
|
||||
]
|
||||
coclass DxcCompiler
|
||||
{
|
||||
}
|
||||
|
||||
[
|
||||
uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcBlob : IUnknown
|
||||
{
|
||||
void *GetBufferPointer();
|
||||
SIZE_T GetBufferSize();
|
||||
}
|
||||
|
||||
[
|
||||
uuid(7241d424-2646-4191-97c0-98e96e42fc68),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcBlobEncoding : IDxcBlob
|
||||
{
|
||||
HRESULT GetEncoding(BOOL *known, UINT32 *code_page);
|
||||
}
|
||||
|
||||
[
|
||||
uuid(3da636c9-ba71-4024-a301-30cbf125305b),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcBlobUtf8 : IDxcBlobEncoding
|
||||
{
|
||||
const char *GetStringPointer();
|
||||
SIZE_T GetStringLength();
|
||||
}
|
||||
|
||||
[
|
||||
uuid(a3f84eab-0faa-497e-a39c-ee6ed60b2d84),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcBlobUtf16 : IDxcBlobEncoding
|
||||
{
|
||||
const WCHAR *GetStringPointer();
|
||||
SIZE_T GetStringLength();
|
||||
}
|
||||
|
||||
[
|
||||
uuid(7f61fc7d-950d-467f-b3e3-3c02fb49187c),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcIncludeHandler : IUnknown
|
||||
{
|
||||
HRESULT LoadSource(const WCHAR *filename, IDxcBlob **include_source);
|
||||
}
|
||||
|
||||
typedef struct DxcBuffer
|
||||
{
|
||||
const void *Ptr;
|
||||
SIZE_T Size;
|
||||
UINT Encoding;
|
||||
} DxcBuffer;
|
||||
|
||||
[
|
||||
uuid(cedb484a-d4e9-445a-b991-ca21ca157dc2),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcOperationResult : IUnknown
|
||||
{
|
||||
HRESULT GetStatus(HRESULT *status);
|
||||
|
||||
HRESULT GetResult(IDxcBlob **result);
|
||||
|
||||
HRESULT GetErrorBuffer(IDxcBlobEncoding **errors);
|
||||
}
|
||||
|
||||
typedef enum DXC_OUT_KIND
|
||||
{
|
||||
DXC_OUT_NONE = 0,
|
||||
DXC_OUT_OBJECT = 1,
|
||||
DXC_OUT_ERRORS = 2,
|
||||
DXC_OUT_PDB = 3,
|
||||
DXC_OUT_SHADER_HASH = 4,
|
||||
DXC_OUT_DISASSEMBLY = 5,
|
||||
DXC_OUT_HLSL = 6,
|
||||
DXC_OUT_TEXT = 7,
|
||||
DXC_OUT_REFLECTION = 8,
|
||||
DXC_OUT_ROOT_SIGNATURE = 9,
|
||||
DXC_OUT_EXTRA_OUTPUTS = 10,
|
||||
|
||||
DXC_OUT_FORCE_DWORD = 0xFFFFFFFF
|
||||
} DXC_OUT_KIND;
|
||||
|
||||
[
|
||||
uuid(58346cda-dde7-4497-9461-6f87af5e0659),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcResult : IDxcOperationResult
|
||||
{
|
||||
BOOL HasOutput(DXC_OUT_KIND dxc_out_kind);
|
||||
HRESULT GetOutput(DXC_OUT_KIND dxc_out_kind,
|
||||
REFIID iid, void **object, IDxcBlobUtf16 **output_name);
|
||||
|
||||
UINT32 GetNumOutputs();
|
||||
DXC_OUT_KIND GetOutputByIndex(UINT32 index);
|
||||
DXC_OUT_KIND PrimaryOutput();
|
||||
}
|
||||
|
||||
[
|
||||
uuid(228b4687-5a6a-4730-900c-9702b2203f54),
|
||||
object,
|
||||
local,
|
||||
]
|
||||
interface IDxcCompiler3 : IUnknown
|
||||
{
|
||||
HRESULT Compile(const DxcBuffer *source, const WCHAR **arguments, UINT32 arg_count,
|
||||
IDxcIncludeHandler *include_handler, REFIID riid, void **result);
|
||||
|
||||
HRESULT Disassemble(const DxcBuffer *object, REFIID riid, void **result);
|
||||
}
|
||||
|
||||
typedef HRESULT (__stdcall *DxcCreateInstanceProc)(const IID *rclsid, REFIID riid, void **ppv);
|
||||
|
||||
cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)")
|
||||
cpp_quote("# pragma pop_macro(\"__stdcall\")")
|
||||
cpp_quote("#endif")
|
@ -1,13 +1,15 @@
|
||||
[pixel shader]
|
||||
float4 main(uniform float2 u) : sv_target
|
||||
uniform float2 u;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(abs(u), abs(u.x - 0.5), abs(-0.4));
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 float4 0.1 0.7 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.1, 0.7, 0.4, 0.4)
|
||||
uniform 0 float4 -0.7 0.1 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.7, 0.1, 1.2, 0.4)
|
||||
|
@ -11,17 +11,17 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 -1.1 1.6 1.3 0.5
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
[test]
|
||||
uniform 0 float4 0.0 1.6 1.3 0.5
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 0.0 1.3 0.5
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -34,12 +34,12 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
[test]
|
||||
uniform 0 float4 0.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -53,11 +53,11 @@ float4 main() : sv_target
|
||||
[test]
|
||||
uniform 0 float4 1.0 2.0 0.0 0.0
|
||||
uniform 4 float4 3.0 4.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 2.0 0.0 0.0
|
||||
uniform 4 float4 0.0 4.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
@ -8,25 +8,25 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 1.0 1.0 1.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 1.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 0.0 1.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 0.0 0.0 1.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 0.0 0.0 0.0 1.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 0.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
uniform 0 float4 -1.0 -1.0 -1.0 -1.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -39,13 +39,13 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 float4 0.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
uniform 0 float4 -1.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
[require]
|
||||
@ -61,22 +61,22 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 uint4 1 1 1 1
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 1 0 0 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 0 1 0 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 0 0 1 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 0 0 0 1
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 0 0 0 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -89,8 +89,8 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 uint4 1 0 0 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1.0, 1.0, 1.0, 1.0)
|
||||
uniform 0 uint4 0 0 0 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
@ -10,7 +10,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 5.0 15.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (20.0, -10.0, 75.0, 0.33333333) 1
|
||||
|
||||
[pixel shader]
|
||||
@ -25,7 +25,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 5.0 15.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (5.0, 5.0, -5.0, 3.0) 1
|
||||
|
||||
[pixel shader]
|
||||
@ -40,7 +40,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 42.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (2.0, -2.0, 2.0, -2.0) 16
|
||||
|
||||
[pixel shader]
|
||||
@ -55,7 +55,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 45.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -69,7 +69,7 @@ float4 main() : sv_target
|
||||
[test]
|
||||
uniform 0 float4 5.0 -42.1 4.0 45.0
|
||||
uniform 4 float4 15.0 -5.0 4.1 5.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (5.0, -2.1, 4.0, 0.0) 4
|
||||
|
||||
[require]
|
||||
@ -88,5 +88,5 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1.0 0.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (1e99, 1e99, 1e99, 1e99)
|
||||
|
@ -61,7 +61,7 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (5.0, -2.1, 4.0, 0.0) 4
|
||||
probe all rgba (5.0, -2.1, 4.0, 0.0) 6
|
||||
|
||||
[require]
|
||||
% Infinities are not allowed in SM1
|
||||
|
@ -10,7 +10,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 5.0 16.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (21.0, -11.0, 80.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -25,7 +25,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 5.0 16.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (5.0, 5.0, -5.0, 3.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -40,7 +40,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 42.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (8.0, -8.0, -8.0, 8.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -55,7 +55,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 42.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (2.0, -2.0, 2.0, -2.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -70,7 +70,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 45.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (9.0, -9.0, -9.0, 9.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -85,7 +85,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 45.0 5.0 0.0 0.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -98,7 +98,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float4 5.0 -7.0 0.0 -10.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (5.0, 7.0, 0.0, 10.0)
|
||||
|
||||
[pixel shader]
|
||||
@ -117,5 +117,5 @@ float4 main() : sv_target
|
||||
[test]
|
||||
uniform 0 float4 45.0 5.0 50.0 10.0
|
||||
uniform 4 float4 3.0 8.0 2.0 5.0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (9.0, 5.0, 1.0, 3.0)
|
||||
|
@ -76,7 +76,7 @@ float4 main() : SV_TARGET
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader fail]
|
||||
[pixel shader fail(sm<6)]
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
int x = 1;
|
||||
@ -85,7 +85,11 @@ float4 main() : SV_TARGET
|
||||
return x / y;
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader fail(sm<6)]
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
int x = 1;
|
||||
@ -94,8 +98,14 @@ float4 main() : SV_TARGET
|
||||
return x % y;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[require]
|
||||
shader model >= 4.0
|
||||
% dxcompiler performs this calculation on unsigned values and emits zero.
|
||||
shader model < 6.0
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : SV_TARGET
|
||||
@ -110,6 +120,9 @@ float4 main() : SV_TARGET
|
||||
draw quad
|
||||
probe all rgba (-2147483648.0, -2147483648.0, -2147483648.0, -2147483648.0)
|
||||
|
||||
[require]
|
||||
shader model >= 4.0
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ float4 main() : SV_TARGET
|
||||
draw quad
|
||||
probe all rgba (5.0, 5.0, 4294967296.0, 3.0)
|
||||
|
||||
[pixel shader fail]
|
||||
[pixel shader fail(sm<6)]
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
uint x = 1;
|
||||
@ -36,7 +36,11 @@ float4 main() : SV_TARGET
|
||||
return x / y;
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader fail(sm<6)]
|
||||
float4 main() : SV_TARGET
|
||||
{
|
||||
uint x = 1;
|
||||
@ -44,3 +48,7 @@ float4 main() : SV_TARGET
|
||||
|
||||
return x % y;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (0.0, 0.0, 0.0, 0.0)
|
||||
|
@ -5,7 +5,12 @@ float4 main() : sv_target
|
||||
{
|
||||
const int dim = 4;
|
||||
float a[2 * 2] = {0.1, 0.2, 0.3, 0.4};
|
||||
#ifdef __hlsl_dx_compiler
|
||||
/* float array dimensions are not valid. */
|
||||
float b[4] = a;
|
||||
#else
|
||||
float b[4.1] = a;
|
||||
#endif
|
||||
float c[dim] = b;
|
||||
float d[true] = {c[0]};
|
||||
float e[65536];
|
||||
@ -13,5 +18,5 @@ float4 main() : sv_target
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
todo(sm<6) draw quad
|
||||
probe all rgba (0.1, 0.1, 0.2, 0.4)
|
||||
|
@ -36,16 +36,16 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (11.0, 11.0, 11.0, 11.0)
|
||||
uniform 0 float 1
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (12.0, 12.0, 12.0, 12.0)
|
||||
uniform 0 float 2
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (13.0, 13.0, 13.0, 13.0)
|
||||
uniform 0 float 3
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (14.0, 14.0, 14.0, 14.0)
|
||||
|
||||
|
||||
@ -61,16 +61,16 @@ float4 main() : SV_TARGET
|
||||
|
||||
[test]
|
||||
uniform 0 float 0
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (21.0, 1.0, 24.0, 0.0)
|
||||
uniform 0 float 1
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (22.0, 0.0, 23.0, 1.0)
|
||||
uniform 0 float 2
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (23.0, 1.0, 22.0, 0.0)
|
||||
uniform 0 float 3
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (24.0, 0.0, 21.0, 1.0)
|
||||
|
||||
|
||||
|
@ -111,7 +111,7 @@ float4 main() : sv_target
|
||||
|
||||
|
||||
% Implicit size arrays are not allowed.
|
||||
[pixel shader fail]
|
||||
[pixel shader fail(sm<6)]
|
||||
float fun(float a[])
|
||||
{
|
||||
return 0;
|
||||
|
@ -53,7 +53,7 @@ draw quad
|
||||
probe all rgba (2, 3, 6, 1)
|
||||
|
||||
% Additional level of indirection
|
||||
[pixel shader todo]
|
||||
[pixel shader todo fail(sm>=6)]
|
||||
static const float array[8] = {1, 2, 3, 4, 5, 6, 7, 8};
|
||||
static const int idx = 2;
|
||||
static const float array2[array[idx]] = {1, 2, 3};
|
||||
|
@ -2,7 +2,12 @@
|
||||
shader model >= 4.0
|
||||
|
||||
[pixel shader]
|
||||
float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target
|
||||
uniform float f;
|
||||
uniform int i;
|
||||
uniform uint u;
|
||||
uniform half h;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 ret;
|
||||
|
||||
@ -15,11 +20,14 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
|
||||
|
||||
[test]
|
||||
uniform 0 float4 123.0 -2.0 456 0.01
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe (320,240) rgba (123.0, -2.0, 456.0, 0.01)
|
||||
|
||||
[pixel shader]
|
||||
float4 main(uniform float2x2 m, uniform float4 v) : sv_target
|
||||
uniform float2x2 m;
|
||||
uniform float4 v;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(asfloat(m)[0][1], asfloat(v).y, 0, 0);
|
||||
}
|
||||
@ -28,7 +36,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target
|
||||
uniform 0 float4 11 12 0 0
|
||||
uniform 4 float4 13 14 0 0
|
||||
uniform 8 float4 20 21 22 23
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
|
||||
|
||||
[pixel shader fail]
|
||||
|
@ -2,8 +2,12 @@
|
||||
shader model >= 4.0
|
||||
|
||||
[pixel shader]
|
||||
uniform float f;
|
||||
uniform int i;
|
||||
uniform uint u;
|
||||
uniform half h;
|
||||
|
||||
float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target
|
||||
float4 main() : sv_target
|
||||
{
|
||||
uint4 ret;
|
||||
|
||||
@ -16,13 +20,15 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
|
||||
|
||||
[test]
|
||||
uniform 0 uint4 123 0xc0000000 456 0x7fd69345
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe (320,240) rgba (123.0, 3221225472.0, 456.0, 2144768896.0)
|
||||
|
||||
|
||||
[pixel shader]
|
||||
uniform float2x2 m;
|
||||
uniform float4 v;
|
||||
|
||||
float4 main(uniform float2x2 m, uniform float4 v) : sv_target
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(asuint(m)[0][1], asuint(v).y, 0, 0);
|
||||
}
|
||||
@ -31,7 +37,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target
|
||||
uniform 0 uint4 11 12 0 0
|
||||
uniform 4 uint4 13 14 0 0
|
||||
uniform 8 uint4 20 21 22 23
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
|
||||
|
||||
|
||||
|
@ -2,32 +2,32 @@
|
||||
% we need to get the parsing syntax right. Most of the following tests which
|
||||
% succeed print warnings.
|
||||
|
||||
[pixel shader]
|
||||
[pixel shader fail(sm>=6)]
|
||||
|
||||
[numthreads]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader]
|
||||
[pixel shader fail(sm>=6)]
|
||||
|
||||
[ numthreads ]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader]
|
||||
[pixel shader fail(sm>=6)]
|
||||
|
||||
[numthreads(1)]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader todo fail(sm>=6)]
|
||||
|
||||
[numthreads("")]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader todo fail(sm>=6)]
|
||||
|
||||
[numthreads("one")]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader todo]
|
||||
[pixel shader todo fail(sm>=6)]
|
||||
|
||||
uniform float4 f;
|
||||
|
||||
@ -77,12 +77,12 @@ float4 main() : sv_target { return 0; }
|
||||
[one][two]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader fail todo]
|
||||
[pixel shader fail(sm<6) todo]
|
||||
|
||||
[one][one]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader fail todo]
|
||||
[pixel shader fail(sm<6) todo]
|
||||
|
||||
[one][one(1)]
|
||||
float4 main() : sv_target { return 0; }
|
||||
@ -92,7 +92,7 @@ float4 main() : sv_target { return 0; }
|
||||
[one][One]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader]
|
||||
[pixel shader fail(sm>=6)]
|
||||
|
||||
[numthreads]
|
||||
float4 main();
|
||||
@ -112,7 +112,7 @@ static int i = 1;
|
||||
[three(i = 4)]
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
[pixel shader fail]
|
||||
[pixel shader fail(sm<6)]
|
||||
|
||||
[one]
|
||||
float4 f;
|
||||
|
@ -30,7 +30,7 @@ float4 main() : SV_TARGET
|
||||
[test]
|
||||
uniform 0 float4 0.0 0.0 2.0 4.0
|
||||
uniform 4 int4 0 1 0 10
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (0.0, 10.0, 1.0, 11.0)
|
||||
|
||||
|
||||
@ -44,5 +44,5 @@ float4 main() : sv_target
|
||||
|
||||
[test]
|
||||
uniform 0 uint4 0x00000001 0x00000002 0x80000000 0x00000000
|
||||
draw quad
|
||||
todo(sm>=6) draw quad
|
||||
probe all rgba (2.0, 2.0, 2.0, 0.0)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user