3 Commits

Author SHA1 Message Date
Giovanni Mascellani
154acd2c2b Release 1.7.1. 2023-05-03 21:46:28 +02:00
Henri Verbeet
cb2acc35f2 vkd3d-utils: Export D3D12CreateDevice() once again.
Commit d27fee64ab inadvertently stopped
exporting D3D12CreateDevice().
2023-05-03 21:46:27 +02:00
Conor McCarthy
7b9b0179ec vkd3d: Leave the command queue op mutex locked after a partial flush.
All return paths in d3d12_command_queue_flush_ops_locked() must
leave the op mutex locked.
2023-05-03 21:46:25 +02:00
95 changed files with 9823 additions and 16786 deletions

View File

@@ -1,16 +1,12 @@
The Wine team is proud to announce that release 1.8 of vkd3d, the Direct3D to
The Wine team is proud to announce that release 1.7.1 of vkd3d, the Direct3D to
Vulkan translation library, is now available.
This release contains improvements that are listed in the release notes below.
The main highlights are:
- Support for still many more HLSL features and intrinsics.
- Performance improvements to vkd3d descriptor updates.
- Miscellaneous bug fixes.
This is a bugfix release, only containing targeted fixes for a couple
of defects that had slipped in in vkd3d 1.7.
The source is available from the following location:
https://dl.winehq.org/vkd3d/source/vkd3d-1.8.tar.xz
https://dl.winehq.org/vkd3d/source/vkd3d-1.7.1.tar.xz
The current source can also be pulled directly from the git repository:
@@ -21,73 +17,20 @@ for the complete list.
----------------------------------------------------------------
What's new in vkd3d 1.8
=======================
What's new in vkd3d 1.7.1
=========================
*** libvkd3d
- Performance improvements have been made to the code that handles descriptor
updates. In some applications the improvement can be quite significant.
- Release 1.7 has a bug that causes an internal mutex in its command
queue implementation to be unlocked too early under certain usage
patterns. This is known to further cause internal inconsistencies
that manifest as program deadlocks for some programs. In release
1.7.1 the mutex is correctly kept locked until required.
- Host-visible descriptor heaps are persistently mapped on creation. Some
applications access resource data from the CPU after calling Unmap(), and
that's supposed to work in practice.
*** libvkd3d-utils
- 1-dimensional texture unordered-access views and shader resource views are
implemented.
- Shader resource view, unordered access view, and constant buffer view root
descriptors with NULL GPU addresses are supported.
- Direct3D 12 descriptor heap destruction is delayed until all contained
resources are destroyed.
*** libvkd3d-shader
- New features for the HLSL source type:
- Support for the ternary conditional operator "?:".
- Support for "discard" statements.
- Support for the "packoffset" keyword.
- Support for semantics on array types.
- Support for RWBuffer loads and stores.
- Register allocation for arrays and structures of resources and samplers
is implemented.
- Support for the SV_IsFrontFace pixel shader system-value semantics.
- Support for using constant expressions as array sizes and indices.
- Support for dynamic selection of vector components.
- Support for the following intrinsic functions:
- D3DCOLORtoUBYTE4()
- any()
- asfloat()
- ddx() and ddy()
- fmod()
- log(), log2(), and log10()
- sign()
- trunc()
- The SampleBias(), SampleCmp(), SampleCmpLevelZero(), and SampleGrad()
texture object methods are implemented.
- Support for the case-insensitive variants of the "vector" and "matrix"
data types.
- Parser support for the "unroll" loop attribute. A warning is output for
"unroll" without iteration count, and an error is output when an iteration
count is specified. Actual unrolling is not implemented yet.
- Parser support for RWStructuredBuffer resources.
- Parser support for SamplerComparisonState objects. Note that outputting
compiled effects is not supported yet, but parsing these allows shaders
containing SamplerComparisonState state objects to be compiled.
- More improvements to HLSL support for the Direct3D shader model 1/2/3
profiles.
- The section alignment of DXBC blobs produced by
vkd3d_shader_serialize_dxbc() matches those produced by d3dcompiler more
closely.
- The "main" function for shaders produced by the SPIR-V target is always
terminated, even when the source was a TPF shader without explicit "ret"
instruction.
- Relative addressing of shader input registers is supported by SPIR-V
targets.
- Symbol D3D12CreateDevice is mistakenly not exported in release 1.7,
breaking library clients that need it. The symbol is exported again
in release 1.7.1.

View File

@@ -8,7 +8,6 @@ Chip Davis
Conor McCarthy
David Gow
Derek Lesho
Ethan Lee
Fabian Maurer
Francisco Casas
Francois Gouget
@@ -17,7 +16,6 @@ Hans-Kristian Arntzen
Henri Verbeet
Isabella Bosia
Jactry Zeng
Jan Sikorski
Joshua Ashton
JĂłzef Kucia
Martin Storsjö

View File

@@ -44,18 +44,14 @@ vkd3d_cross_tests = \
vkd3d_shader_tests = \
tests/abs.shader_test \
tests/all.shader_test \
tests/any.shader_test \
tests/arithmetic-float.shader_test \
tests/arithmetic-float-uniform.shader_test \
tests/arithmetic-int.shader_test \
tests/arithmetic-int-uniform.shader_test \
tests/arithmetic-uint.shader_test \
tests/array-index-expr.shader_test \
tests/array-parameters.shader_test \
tests/asfloat.shader_test \
tests/asuint.shader_test \
tests/bitwise.shader_test \
tests/bool-semantics.shader_test \
tests/cast-broadcast.shader_test \
tests/cast-componentwise-compatible.shader_test \
tests/cast-componentwise-equal.shader_test \
@@ -66,24 +62,18 @@ vkd3d_shader_tests = \
tests/cbuffer.shader_test \
tests/compute.shader_test \
tests/conditional.shader_test \
tests/ddxddy.shader_test \
tests/distance.shader_test \
tests/entry-point-semantics.shader_test \
tests/exp.shader_test \
tests/expr-indexing.shader_test \
tests/floor.shader_test \
tests/fmod.shader_test \
tests/frac.shader_test \
tests/function-return.shader_test \
tests/hlsl-array-dimension.shader_test \
tests/hlsl-array-size-expr.shader_test \
tests/hlsl-attributes.shader_test \
tests/hlsl-bool-cast.shader_test \
tests/hlsl-clamp.shader_test \
tests/hlsl-comma.shader_test \
tests/hlsl-cross.shader_test \
tests/hlsl-d3dcolor-to-ubyte4.shader_test \
tests/hlsl-discard.shader_test \
tests/hlsl-dot.shader_test \
tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
@@ -104,7 +94,6 @@ vkd3d_shader_tests = \
tests/hlsl-initializer-struct.shader_test \
tests/hlsl-intrinsic-override.shader_test \
tests/hlsl-invalid.shader_test \
tests/hlsl-is-front-face.shader_test \
tests/hlsl-ldexp.shader_test \
tests/hlsl-length.shader_test \
tests/hlsl-lerp.shader_test \
@@ -127,17 +116,12 @@ vkd3d_shader_tests = \
tests/hlsl-struct-array.shader_test \
tests/hlsl-struct-assignment.shader_test \
tests/hlsl-struct-semantics.shader_test \
tests/hlsl-ternary.shader_test \
tests/hlsl-transpose.shader_test \
tests/hlsl-trunc.shader_test \
tests/hlsl-type-names.shader_test \
tests/hlsl-vector-indexing.shader_test \
tests/hlsl-vector-indexing-uniform.shader_test \
tests/lit.shader_test \
tests/load-level.shader_test \
tests/log.shader_test \
tests/logic-operations.shader_test \
tests/loop.shader_test \
tests/majority-syntax.shader_test \
tests/math.shader_test \
tests/matrix-semantics.shader_test \
@@ -145,8 +129,6 @@ vkd3d_shader_tests = \
tests/minimum-precision.shader_test \
tests/multiple-rt.shader_test \
tests/nointerpolation.shader_test \
tests/object-field-offsets.shader_test \
tests/object-parameters.shader_test \
tests/object-references.shader_test \
tests/pow.shader_test \
tests/preproc-if.shader_test \
@@ -159,15 +141,10 @@ vkd3d_shader_tests = \
tests/register-reservations.shader_test \
tests/return.shader_test \
tests/round.shader_test \
tests/sample-bias.shader_test \
tests/sample-grad.shader_test \
tests/sample-level.shader_test \
tests/sampler.shader_test \
tests/sampler-offset.shader_test \
tests/saturate.shader_test \
tests/shader-interstage-interface.shader_test \
tests/side-effects.shader_test \
tests/sign.shader_test \
tests/sqrt.shader_test \
tests/step.shader_test \
tests/swizzle-constant-prop.shader_test \
@@ -176,11 +153,9 @@ vkd3d_shader_tests = \
tests/texture-load-offset.shader_test \
tests/texture-load-typed.shader_test \
tests/trigonometry.shader_test \
tests/uav.shader_test \
tests/uav-load.shader_test \
tests/uav-out-param.shader_test \
tests/uav-rwbuffer.shader_test \
tests/uav-rwstructuredbuffer.shader_test \
tests/uav-rwtexture.shader_test \
tests/writemask-assignop-0.shader_test \
tests/writemask-assignop-1.shader_test \
tests/writemask-assignop-2.shader_test \
@@ -267,7 +242,6 @@ libvkd3d_shader_la_SOURCES = \
include/private/vkd3d_memory.h \
include/vkd3d_shader.h \
libs/vkd3d-shader/checksum.c \
libs/vkd3d-shader/d3d_asm.c \
libs/vkd3d-shader/d3dbc.c \
libs/vkd3d-shader/dxbc.c \
libs/vkd3d-shader/glsl.c \
@@ -275,15 +249,17 @@ libvkd3d_shader_la_SOURCES = \
libs/vkd3d-shader/hlsl.h \
libs/vkd3d-shader/hlsl_codegen.c \
libs/vkd3d-shader/hlsl_constant_ops.c \
libs/vkd3d-shader/ir.c \
libs/vkd3d-shader/hlsl_sm1.c \
libs/vkd3d-shader/hlsl_sm4.c \
libs/vkd3d-shader/preproc.h \
libs/vkd3d-shader/sm4.h \
libs/vkd3d-shader/spirv.c \
libs/vkd3d-shader/tpf.c \
libs/vkd3d-shader/trace.c \
libs/vkd3d-shader/vkd3d_shader.map \
libs/vkd3d-shader/vkd3d_shader_main.c \
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_LDFLAGS = $(AM_LDFLAGS) -version-info 7:0:6
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 6:0:5
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@ -lm
if HAVE_LD_VERSION_SCRIPT
libvkd3d_shader_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map
@@ -317,7 +293,7 @@ libvkd3d_la_SOURCES = \
libs/vkd3d/vkd3d_shaders.h \
libs/vkd3d/vulkan_procs.h
libvkd3d_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SOURCE
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 9:0:8
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 8:0:7
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@
if HAVE_LD_VERSION_SCRIPT
libvkd3d_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map
@@ -329,7 +305,7 @@ libvkd3d_utils_la_SOURCES = \
libs/vkd3d-utils/vkd3d_utils_main.c \
libs/vkd3d-utils/vkd3d_utils_private.h
libvkd3d_utils_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_UTILS_SOURCE
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:4:3
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:3:3
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la libvkd3d.la @PTHREAD_LIBS@
if HAVE_LD_VERSION_SCRIPT
libvkd3d_utils_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map

View File

@@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([vkd3d],[1.8])
AC_INIT([vkd3d],[1.7.1])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
@@ -142,8 +142,6 @@ VKD3D_CHECK_FUNC([HAVE_BUILTIN_POPCOUNT], [__builtin_popcount], [__builtin_popco
VKD3D_CHECK_FUNC([HAVE_BUILTIN_ADD_OVERFLOW], [__builtin_add_overflow], [__builtin_add_overflow(0, 0, (int *)0)])
VKD3D_CHECK_FUNC([HAVE_SYNC_ADD_AND_FETCH], [__sync_add_and_fetch], [__sync_add_and_fetch((int *)0, 0)])
VKD3D_CHECK_FUNC([HAVE_SYNC_SUB_AND_FETCH], [__sync_sub_and_fetch], [__sync_sub_and_fetch((int *)0, 0)])
VKD3D_CHECK_FUNC([HAVE_SYNC_BOOL_COMPARE_AND_SWAP], [__sync_bool_compare_and_swap], [__sync_bool_compare_and_swap((int *)0, 0, 0)])
VKD3D_CHECK_FUNC([HAVE_ATOMIC_EXCHANGE_N], [__atomic_exchange_n], [__atomic_exchange_n((int *)0, 0)])
dnl Makefiles
case $host_os in

View File

@@ -19,7 +19,7 @@
#define VK_NO_PROTOTYPES
#define VK_USE_PLATFORM_XCB_KHR
#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_8
#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_7
#include "config.h"
#include <vkd3d.h>
#include <vkd3d_utils.h>

View File

@@ -249,7 +249,6 @@ static inline LONG InterlockedDecrement(LONG volatile *x)
# else
# error "InterlockedDecrement() not implemented for this platform"
# endif
#endif /* _WIN32 */
static inline void vkd3d_parse_version(const char *version, int *major, int *minor)

View File

@@ -91,7 +91,7 @@ const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
#define FIXME_ONCE VKD3D_DBG_LOG_ONCE(FIXME, WARN)
#define VKD3D_DEBUG_ENV_NAME(name) const char *const vkd3d_dbg_env_name = name
#define VKD3D_DEBUG_ENV_NAME(name) const char *vkd3d_dbg_env_name = name
static inline const char *debugstr_guid(const GUID *guid)
{

View File

@@ -118,8 +118,7 @@ struct vkd3d_test_state
bool bug_enabled;
const char *test_name_filter;
char context[8][128];
unsigned int context_count;
char context[1024];
};
extern struct vkd3d_test_state vkd3d_test_state;
@@ -135,16 +134,6 @@ broken(bool condition)
return condition && vkd3d_test_platform_is_windows();
}
static void vkd3d_test_printf(unsigned int line, const char *msg)
{
unsigned int i;
printf("%s:%u: ", vkd3d_test_name, line);
for (i = 0; i < vkd3d_test_state.context_count; ++i)
printf("%s: ", vkd3d_test_state.context[i]);
printf("%s", msg);
}
static void
vkd3d_test_check_assert_that(unsigned int line, bool result, const char *fmt, va_list args)
{
@@ -152,12 +141,12 @@ vkd3d_test_check_assert_that(unsigned int line, bool result, const char *fmt, va
{
InterlockedIncrement(&vkd3d_test_state.success_count);
if (vkd3d_test_state.debug_level > 1)
vkd3d_test_printf(line, "Test succeeded.\n");
printf("%s:%d%s: Test succeeded.\n", vkd3d_test_name, line, vkd3d_test_state.context);
}
else
{
InterlockedIncrement(&vkd3d_test_state.failure_count);
vkd3d_test_printf(line, "Test failed: ");
printf("%s:%d%s: Test failed: ", vkd3d_test_name, line, vkd3d_test_state.context);
vprintf(fmt, args);
}
}
@@ -184,9 +173,9 @@ vkd3d_test_check_ok(unsigned int line, bool result, const char *fmt, va_list arg
if (is_todo)
result = !result;
if (result)
vkd3d_test_printf(line, "Fixed bug: ");
printf("%s:%d%s: Fixed bug: ", vkd3d_test_name, line, vkd3d_test_state.context);
else
vkd3d_test_printf(line, "Bug: ");
printf("%s:%d%s: Bug: ", vkd3d_test_name, line, vkd3d_test_state.context);
vprintf(fmt, args);
}
else if (is_todo)
@@ -194,12 +183,12 @@ vkd3d_test_check_ok(unsigned int line, bool result, const char *fmt, va_list arg
if (result)
{
InterlockedIncrement(&vkd3d_test_state.todo_success_count);
vkd3d_test_printf(line, "Todo succeeded: ");
printf("%s:%d%s: Todo succeeded: ", vkd3d_test_name, line, vkd3d_test_state.context);
}
else
{
InterlockedIncrement(&vkd3d_test_state.todo_count);
vkd3d_test_printf(line, "Todo: ");
printf("%s:%d%s: Todo: ", vkd3d_test_name, line, vkd3d_test_state.context);
}
vprintf(fmt, args);
}
@@ -224,7 +213,7 @@ vkd3d_test_skip(unsigned int line, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_printf(line, "Test skipped: ");
printf("%s:%d%s: Test skipped: ", vkd3d_test_name, line, vkd3d_test_state.context);
vprintf(fmt, args);
va_end(args);
InterlockedIncrement(&vkd3d_test_state.skip_count);
@@ -235,7 +224,7 @@ vkd3d_test_trace(unsigned int line, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_printf(line, "");
printf("%s:%d%s: ", vkd3d_test_name, line, vkd3d_test_state.context);
vprintf(fmt, args);
va_end(args);
}
@@ -405,25 +394,21 @@ static inline void vkd3d_test_end_bug(void)
vkd3d_test_state.bug_level >>= 1;
}
static inline void vkd3d_test_push_context(const char *fmt, ...)
static inline void vkd3d_test_set_context(const char *fmt, ...)
{
va_list args;
if (vkd3d_test_state.context_count < ARRAY_SIZE(vkd3d_test_state.context))
if (!fmt)
{
va_start(args, fmt);
vsnprintf(vkd3d_test_state.context[vkd3d_test_state.context_count],
sizeof(vkd3d_test_state.context), fmt, args);
va_end(args);
vkd3d_test_state.context[vkd3d_test_state.context_count][sizeof(vkd3d_test_state.context[0]) - 1] = '\0';
vkd3d_test_state.context[0] = '\0';
return;
}
++vkd3d_test_state.context_count;
}
static inline void vkd3d_test_pop_context(void)
{
if (vkd3d_test_state.context_count)
--vkd3d_test_state.context_count;
vkd3d_test_state.context[0] = ':';
va_start(args, fmt);
vsnprintf(&vkd3d_test_state.context[1], sizeof(vkd3d_test_state.context) - 1, fmt, args);
va_end(args);
vkd3d_test_state.context[sizeof(vkd3d_test_state.context) - 1] = '\0';
}
#define run_test(test_pfn) \

View File

@@ -76,7 +76,6 @@ enum vkd3d_api_version
VKD3D_API_VERSION_1_5,
VKD3D_API_VERSION_1_6,
VKD3D_API_VERSION_1_7,
VKD3D_API_VERSION_1_8,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_API_VERSION),
};

View File

@@ -49,7 +49,6 @@ enum vkd3d_shader_api_version
VKD3D_SHADER_API_VERSION_1_5,
VKD3D_SHADER_API_VERSION_1_6,
VKD3D_SHADER_API_VERSION_1_7,
VKD3D_SHADER_API_VERSION_1_8,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_API_VERSION),
};

View File

@@ -40,9 +40,9 @@
#define VKD3D_DEBUG_BUFFER_COUNT 64
#define VKD3D_DEBUG_BUFFER_SIZE 512
extern const char *const vkd3d_dbg_env_name;
extern const char *vkd3d_dbg_env_name;
static const char *const debug_level_names[] =
static const char *debug_level_names[] =
{
/* VKD3D_DBG_LEVEL_NONE */ "none",
/* VKD3D_DBG_LEVEL_ERR */ "err",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -24,9 +24,7 @@
#include "rbtree.h"
#include "vkd3d_d3dcommon.h"
#include "vkd3d_d3dx9shader.h"
enum vkd3d_sm4_register_type;
enum vkd3d_sm4_swizzle_type;
#include "sm4.h"
/* The general IR structure is inspired by Mesa GLSL hir, even though the code
* ends up being quite different in practice. Anyway, here comes the relevant
@@ -104,22 +102,18 @@ enum hlsl_base_type
enum hlsl_sampler_dim
{
HLSL_SAMPLER_DIM_GENERIC,
HLSL_SAMPLER_DIM_COMPARISON,
HLSL_SAMPLER_DIM_1D,
HLSL_SAMPLER_DIM_2D,
HLSL_SAMPLER_DIM_3D,
HLSL_SAMPLER_DIM_CUBE,
HLSL_SAMPLER_DIM_LAST_SAMPLER = HLSL_SAMPLER_DIM_CUBE,
HLSL_SAMPLER_DIM_1DARRAY,
HLSL_SAMPLER_DIM_2DARRAY,
HLSL_SAMPLER_DIM_2DMS,
HLSL_SAMPLER_DIM_2DMSARRAY,
HLSL_SAMPLER_DIM_CUBEARRAY,
HLSL_SAMPLER_DIM_LAST_TEXTURE = HLSL_SAMPLER_DIM_CUBEARRAY,
HLSL_SAMPLER_DIM_BUFFER,
HLSL_SAMPLER_DIM_STRUCTURED_BUFFER,
HLSL_SAMPLER_DIM_MAX = HLSL_SAMPLER_DIM_STRUCTURED_BUFFER,
HLSL_SAMPLER_DIM_GENERIC,
HLSL_SAMPLER_DIM_1D,
HLSL_SAMPLER_DIM_2D,
HLSL_SAMPLER_DIM_3D,
HLSL_SAMPLER_DIM_CUBE,
HLSL_SAMPLER_DIM_LAST_SAMPLER = HLSL_SAMPLER_DIM_CUBE,
HLSL_SAMPLER_DIM_1DARRAY,
HLSL_SAMPLER_DIM_2DARRAY,
HLSL_SAMPLER_DIM_2DMS,
HLSL_SAMPLER_DIM_2DMSARRAY,
HLSL_SAMPLER_DIM_CUBEARRAY,
HLSL_SAMPLER_DIM_MAX = HLSL_SAMPLER_DIM_CUBEARRAY,
};
enum hlsl_regset
@@ -140,17 +134,16 @@ struct hlsl_type
/* Item entry in hlsl_scope->types. hlsl_type->name is used as key (if not NULL). */
struct rb_entry scope_entry;
enum hlsl_type_class class;
enum hlsl_type_class type;
/* If type is <= HLSL_CLASS_LAST_NUMERIC, then base_type is <= HLSL_TYPE_LAST_SCALAR.
* If type is HLSL_CLASS_OBJECT, then base_type is > HLSL_TYPE_LAST_SCALAR.
* Otherwise, base_type is not used. */
enum hlsl_base_type base_type;
/* If base_type is HLSL_TYPE_SAMPLER, then sampler_dim is <= HLSL_SAMPLER_DIM_LAST_SAMPLER.
* If base_type is HLSL_TYPE_TEXTURE, then sampler_dim is <= HLSL_SAMPLER_DIM_LAST_TEXTURE.
* If base_type is HLSL_TYPE_UAV, then sampler_dim must be one of HLSL_SAMPLER_DIM_1D,
* HLSL_SAMPLER_DIM_2D, HLSL_SAMPLER_DIM_3D, HLSL_SAMPLER_DIM_1DARRAY, HLSL_SAMPLER_DIM_2DARRAY,
* HLSL_SAMPLER_DIM_BUFFER, or HLSL_SAMPLER_DIM_STRUCTURED_BUFFER.
* If base_type is HLSL_TYPE_TEXTURE, then sampler_dim can have any value of the enum.
* If base_type is HLSL_TYPE_UAV, them sampler_dim must be one of HLSL_SAMPLER_DIM_1D,
* HLSL_SAMPLER_DIM_2D, HLSL_SAMPLER_DIM_3D, HLSL_SAMPLER_DIM_1DARRAY, or HLSL_SAMPLER_DIM_2DARRAY.
* Otherwise, sampler_dim is not used */
enum hlsl_sampler_dim sampler_dim;
/* Name, in case the type is a named struct or a typedef. */
@@ -214,16 +207,6 @@ struct hlsl_semantic
{
const char *name;
uint32_t index;
/* If the variable or field that stores this hlsl_semantic has already reported that it is missing. */
bool reported_missing;
/* In case the variable or field that stores this semantic has already reported to use a
* duplicated output semantic, this value stores the last reported index + 1. Otherwise it is 0. */
uint32_t reported_duplicated_output_next_index;
/* In case the variable or field that stores this semantic has already reported to use a
* duplicated input semantic with incompatible values, this value stores the last reported
* index + 1. Otherwise it is 0. */
uint32_t reported_duplicated_input_incompatible_next_index;
};
/* A field within a struct type declaration, used in hlsl_type.e.fields. */
@@ -245,21 +228,16 @@ struct hlsl_struct_field
size_t name_bytecode_offset;
};
/* Information of the register(s) allocated for an instruction node or variable.
/* Information of the register allocated for an instruction node or variable.
* These values are initialized at the end of hlsl_emit_bytecode(), after the compilation passes,
* just before writing the bytecode.
* For numeric registers, a writemask can be provided to indicate the reservation of only some of the
* 4 components.
* The type of register (register class) is implied from its use, so it is not stored in this
* struct. */
struct hlsl_reg
{
/* Index of the first register allocated. */
uint32_t id;
/* Number of registers to be allocated.
* Unlike the variable's type's regsize, it is not expressed in register components, but rather
* in whole registers, and may depend on which components are used within the shader. */
uint32_t bind_count;
/* For numeric registers, a writemask can be provided to indicate the reservation of only some
* of the 4 components. */
unsigned int writemask;
/* Whether the register has been allocated. */
bool allocated;
@@ -276,7 +254,6 @@ enum hlsl_ir_node_type
HLSL_IR_CONSTANT,
HLSL_IR_EXPR,
HLSL_IR_IF,
HLSL_IR_INDEX,
HLSL_IR_LOAD,
HLSL_IR_LOOP,
HLSL_IR_JUMP,
@@ -365,17 +342,12 @@ struct hlsl_attribute
#define HLSL_ARRAY_ELEMENTS_COUNT_IMPLICIT 0
/* Reservation of a register and/or an offset for objects inside constant buffers, to be used as a
* starting point of their allocation. They are available through the register(·) and the
* packoffset(·) syntaxes, respectivelly.
* The costant buffer offset is measured register components. */
/* Reservation of a specific register to a variable, field, or buffer, written in the HLSL source
* using the register(·) syntax */
struct hlsl_reg_reservation
{
char reg_type;
unsigned int reg_index;
char offset_type;
unsigned int offset_index;
char type;
unsigned int index;
};
struct hlsl_ir_var
@@ -388,7 +360,8 @@ struct hlsl_ir_var
struct hlsl_buffer *buffer;
/* Bitfield for storage modifiers (type modifiers are stored in data_type->modifiers). */
unsigned int storage_modifiers;
/* Optional reservations of registers and/or offsets for variables within constant buffers. */
/* Optional register to be used as a starting point for the variable allocation, specified
* by the user via the register(·) syntax. */
struct hlsl_reg_reservation reg_reservation;
/* Item entry in hlsl_scope.vars. Specifically hlsl_ctx.globals.vars if the variable is global. */
@@ -411,13 +384,6 @@ struct hlsl_ir_var
* and the buffer_offset instead. */
struct hlsl_reg regs[HLSL_REGSET_LAST + 1];
struct
{
bool used;
enum hlsl_sampler_dim sampler_dim;
struct vkd3d_shader_location first_sampler_dim_loc;
} *objects_usage[HLSL_REGSET_LAST_OBJECT + 1];
uint32_t is_input_semantic : 1;
uint32_t is_output_semantic : 1;
uint32_t is_uniform : 1;
@@ -480,8 +446,8 @@ struct hlsl_ir_if
{
struct hlsl_ir_node node;
struct hlsl_src condition;
struct hlsl_block then_block;
struct hlsl_block else_block;
struct hlsl_block then_instrs;
struct hlsl_block else_instrs;
};
struct hlsl_ir_loop
@@ -519,7 +485,6 @@ enum hlsl_ir_expr_op
HLSL_OP1_SIN,
HLSL_OP1_SIN_REDUCED, /* Reduced range [-pi, pi] */
HLSL_OP1_SQRT,
HLSL_OP1_TRUNC,
HLSL_OP2_ADD,
HLSL_OP2_BIT_AND,
@@ -575,12 +540,6 @@ struct hlsl_ir_swizzle
DWORD swizzle;
};
struct hlsl_ir_index
{
struct hlsl_ir_node node;
struct hlsl_src val, idx;
};
/* Reference to a variable, or a part of it (e.g. a vector within a matrix within a struct). */
struct hlsl_deref
{
@@ -615,11 +574,7 @@ enum hlsl_resource_load_type
{
HLSL_RESOURCE_LOAD,
HLSL_RESOURCE_SAMPLE,
HLSL_RESOURCE_SAMPLE_CMP,
HLSL_RESOURCE_SAMPLE_CMP_LZ,
HLSL_RESOURCE_SAMPLE_LOD,
HLSL_RESOURCE_SAMPLE_LOD_BIAS,
HLSL_RESOURCE_SAMPLE_GRAD,
HLSL_RESOURCE_GATHER_RED,
HLSL_RESOURCE_GATHER_GREEN,
HLSL_RESOURCE_GATHER_BLUE,
@@ -631,8 +586,7 @@ struct hlsl_ir_resource_load
struct hlsl_ir_node node;
enum hlsl_resource_load_type load_type;
struct hlsl_deref resource, sampler;
struct hlsl_src coords, lod, ddx, ddy, cmp, sample_index, texel_offset;
enum hlsl_sampler_dim sampling_dim;
struct hlsl_src coords, lod, texel_offset;
};
struct hlsl_ir_resource_store
@@ -653,16 +607,13 @@ struct hlsl_ir_store
struct hlsl_ir_constant
{
struct hlsl_ir_node node;
struct hlsl_constant_value
union hlsl_constant_value
{
union hlsl_constant_value_component
{
uint32_t u;
int32_t i;
float f;
double d;
} u[4];
} value;
uint32_t u;
int32_t i;
float f;
double d;
} value[4];
/* Constant register of type 'c' where the constant value is stored for SM1. */
struct hlsl_reg reg;
};
@@ -723,9 +674,6 @@ struct hlsl_buffer
unsigned size, used_size;
/* Register of type 'b' on which the buffer is allocated. */
struct hlsl_reg reg;
bool manually_packed_elements;
bool automatically_packed_elements;
};
struct hlsl_ctx
@@ -796,8 +744,9 @@ struct hlsl_ctx
struct hlsl_type *Void;
} builtin_types;
/* List of the instruction nodes for initializing static variables. */
struct hlsl_block static_initializers;
/* List of the instruction nodes for initializing static variables; linked by the
* hlsl_ir_node.entry fields. */
struct list static_initializers;
/* Dynamic array of constant values that appear in the shader, associated to the 'c' registers.
* Only used for SM1 profiles. */
@@ -831,9 +780,8 @@ struct hlsl_resource_load_params
{
struct hlsl_type *format;
enum hlsl_resource_load_type type;
struct hlsl_ir_node *resource, *sampler;
struct hlsl_ir_node *coords, *lod, *ddx, *ddy, *cmp, *sample_index, *texel_offset;
enum hlsl_sampler_dim sampling_dim;
struct hlsl_deref resource, sampler;
struct hlsl_ir_node *coords, *lod, *texel_offset;
};
static inline struct hlsl_ir_call *hlsl_ir_call(const struct hlsl_ir_node *node)
@@ -902,27 +850,6 @@ static inline struct hlsl_ir_swizzle *hlsl_ir_swizzle(const struct hlsl_ir_node
return CONTAINING_RECORD(node, struct hlsl_ir_swizzle, node);
}
static inline struct hlsl_ir_index *hlsl_ir_index(const struct hlsl_ir_node *node)
{
assert(node->type == HLSL_IR_INDEX);
return CONTAINING_RECORD(node, struct hlsl_ir_index, node);
}
static inline void hlsl_block_init(struct hlsl_block *block)
{
list_init(&block->instrs);
}
static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir_node *instr)
{
list_add_tail(&block->instrs, &instr->entry);
}
static inline void hlsl_block_add_block(struct hlsl_block *block, struct hlsl_block *add)
{
list_move_tail(&block->instrs, &add->instrs);
}
static inline void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node)
{
src->node = node;
@@ -946,15 +873,6 @@ static inline void *hlsl_alloc(struct hlsl_ctx *ctx, size_t size)
return ptr;
}
static inline void *hlsl_calloc(struct hlsl_ctx *ctx, size_t count, size_t size)
{
void *ptr = vkd3d_calloc(count, size);
if (!ptr)
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
return ptr;
}
static inline void *hlsl_realloc(struct hlsl_ctx *ctx, void *ptr, size_t size)
{
void *ret = vkd3d_realloc(ptr, size);
@@ -1030,8 +948,6 @@ static inline unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim)
switch (dim)
{
case HLSL_SAMPLER_DIM_1D:
case HLSL_SAMPLER_DIM_BUFFER:
case HLSL_SAMPLER_DIM_STRUCTURED_BUFFER:
return 1;
case HLSL_SAMPLER_DIM_1DARRAY:
case HLSL_SAMPLER_DIM_2D:
@@ -1058,12 +974,11 @@ struct vkd3d_string_buffer *hlsl_type_to_string(struct hlsl_ctx *ctx, const stru
struct vkd3d_string_buffer *hlsl_modifiers_to_string(struct hlsl_ctx *ctx, unsigned int modifiers);
const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type);
struct hlsl_ir_node *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *instrs,
struct hlsl_ir_load *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *instrs,
struct hlsl_ir_node *condition, struct hlsl_ir_node *if_true, struct hlsl_ir_node *if_false);
void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function_decl *decl);
bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var);
void hlsl_block_cleanup(struct hlsl_block *block);
bool hlsl_clone_block(struct hlsl_ctx *ctx, struct hlsl_block *dst_block, const struct hlsl_block *src_block);
void hlsl_dump_function(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *func);
@@ -1071,7 +986,6 @@ void hlsl_dump_function(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl
int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func,
enum vkd3d_shader_target_type target_type, struct vkd3d_shader_code *out);
bool hlsl_init_deref_from_index_chain(struct hlsl_ctx *ctx, struct hlsl_deref *deref, struct hlsl_ir_node *chain);
bool hlsl_copy_deref(struct hlsl_ctx *ctx, struct hlsl_deref *deref, const struct hlsl_deref *other);
void hlsl_cleanup_deref(struct hlsl_deref *deref);
@@ -1098,73 +1012,64 @@ const char *hlsl_jump_type_to_string(enum hlsl_ir_jump_type type);
struct hlsl_type *hlsl_new_array_type(struct hlsl_ctx *ctx, struct hlsl_type *basic_type, unsigned int array_size);
struct hlsl_ir_node *hlsl_new_binary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1,
struct hlsl_ir_node *arg2);
struct hlsl_ir_node *hlsl_new_bool_constant(struct hlsl_ctx *ctx, bool b, const struct vkd3d_shader_location *loc);
struct hlsl_ir_constant *hlsl_new_bool_constant(struct hlsl_ctx *ctx, bool b, const struct vkd3d_shader_location *loc);
struct hlsl_buffer *hlsl_new_buffer(struct hlsl_ctx *ctx, enum hlsl_buffer_type type, const char *name,
const struct hlsl_reg_reservation *reservation, const struct vkd3d_shader_location *loc);
const struct hlsl_reg_reservation *reservation, struct vkd3d_shader_location loc);
struct hlsl_ir_node *hlsl_new_call(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *decl,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type,
struct hlsl_ir_expr *hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type,
const struct hlsl_constant_value *value, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_copy(struct hlsl_ctx *ctx, struct hlsl_ir_node *node);
struct hlsl_ir_constant *hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_expr *hlsl_new_copy(struct hlsl_ctx *ctx, struct hlsl_ir_node *node);
struct hlsl_ir_node *hlsl_new_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op,
struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS],
struct hlsl_type *data_type, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_float_constant(struct hlsl_ctx *ctx,
struct hlsl_ir_constant *hlsl_new_float_constant(struct hlsl_ctx *ctx,
float f, const struct vkd3d_shader_location *loc);
struct hlsl_ir_function_decl *hlsl_new_func_decl(struct hlsl_ctx *ctx,
struct hlsl_type *return_type, const struct hlsl_func_parameters *parameters,
const struct hlsl_semantic *semantic, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condition,
struct hlsl_block *then_block, struct hlsl_block *else_block, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_int_constant(struct hlsl_ctx *ctx, int32_t n, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_jump(struct hlsl_ctx *ctx,
enum hlsl_ir_jump_type type, const struct vkd3d_shader_location *loc);
struct hlsl_ir_if *hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condition, struct vkd3d_shader_location loc);
struct hlsl_ir_constant *hlsl_new_int_constant(struct hlsl_ctx *ctx, int n,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_jump *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type type, struct vkd3d_shader_location loc);
void hlsl_init_simple_deref_from_var(struct hlsl_deref *deref, struct hlsl_ir_var *var);
struct hlsl_ir_load *hlsl_new_var_load(struct hlsl_ctx *ctx, struct hlsl_ir_var *var,
const struct vkd3d_shader_location *loc);
struct vkd3d_shader_location loc);
struct hlsl_ir_load *hlsl_new_load_index(struct hlsl_ctx *ctx, const struct hlsl_deref *deref,
struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc);
struct hlsl_ir_load *hlsl_new_load_parent(struct hlsl_ctx *ctx, const struct hlsl_deref *deref,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_block *block,
struct hlsl_ir_load *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_block *block,
const struct hlsl_deref *deref, unsigned int comp, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_simple_store(struct hlsl_ctx *ctx, struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs);
struct hlsl_ir_node *hlsl_new_store_index(struct hlsl_ctx *ctx, const struct hlsl_deref *lhs,
struct hlsl_ir_store *hlsl_new_simple_store(struct hlsl_ctx *ctx, struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs);
struct hlsl_ir_store *hlsl_new_store_index(struct hlsl_ctx *ctx, const struct hlsl_deref *lhs,
struct hlsl_ir_node *idx, struct hlsl_ir_node *rhs, unsigned int writemask, const struct vkd3d_shader_location *loc);
bool hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl_block *block,
struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl_block *block,
const struct hlsl_deref *lhs, unsigned int comp, struct hlsl_ir_node *rhs);
bool hlsl_index_is_noncontiguous(struct hlsl_ir_index *index);
bool hlsl_index_is_resource_access(struct hlsl_ir_index *index);
struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *val,
struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx,
struct hlsl_block *block, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx,
struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, struct vkd3d_shader_location loc);
struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx,
const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource,
struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource,
struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc);
struct hlsl_type *hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name,
struct hlsl_struct_field *fields, size_t field_count);
struct hlsl_ir_node *hlsl_new_swizzle(struct hlsl_ctx *ctx, DWORD s, unsigned int components,
struct hlsl_ir_swizzle *hlsl_new_swizzle(struct hlsl_ctx *ctx, DWORD s, unsigned int components,
struct hlsl_ir_node *val, const struct vkd3d_shader_location *loc);
struct hlsl_ir_var *hlsl_new_synthetic_var(struct hlsl_ctx *ctx, const char *template,
struct hlsl_type *type, const struct vkd3d_shader_location *loc);
struct hlsl_type *hlsl_new_texture_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim, struct hlsl_type *format,
unsigned int sample_count);
struct hlsl_type *hlsl_new_uav_type(struct hlsl_ctx *ctx, enum hlsl_sampler_dim dim, struct hlsl_type *format);
struct hlsl_ir_node *hlsl_new_uint_constant(struct hlsl_ctx *ctx, unsigned int n,
struct hlsl_ir_constant *hlsl_new_uint_constant(struct hlsl_ctx *ctx, unsigned int n,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_new_unary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg,
const struct vkd3d_shader_location *loc);
struct vkd3d_shader_location loc);
struct hlsl_ir_var *hlsl_new_var(struct hlsl_ctx *ctx, const char *name, struct hlsl_type *type,
const struct vkd3d_shader_location *loc, const struct hlsl_semantic *semantic, unsigned int modifiers,
const struct vkd3d_shader_location loc, const struct hlsl_semantic *semantic, unsigned int modifiers,
const struct hlsl_reg_reservation *reg_reservation);
void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc,
@@ -1196,9 +1101,6 @@ enum hlsl_regset hlsl_type_get_regset(const struct hlsl_type *type);
unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int offset);
bool hlsl_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2);
const struct hlsl_type *hlsl_get_multiarray_element_type(const struct hlsl_type *type);
unsigned int hlsl_get_multiarray_size(const struct hlsl_type *type);
unsigned int hlsl_combine_swizzles(unsigned int first, unsigned int second, unsigned int dim);
unsigned int hlsl_combine_writemasks(unsigned int first, unsigned int second);
unsigned int hlsl_map_swizzle(unsigned int swizzle, unsigned int writemask);
@@ -1207,17 +1109,12 @@ unsigned int hlsl_swizzle_from_writemask(unsigned int writemask);
struct hlsl_type *hlsl_deref_get_type(struct hlsl_ctx *ctx, const struct hlsl_deref *deref);
bool hlsl_component_index_range_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref,
unsigned int *start, unsigned int *count);
bool hlsl_regset_index_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref,
enum hlsl_regset regset, unsigned int *index);
bool hlsl_offset_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref, unsigned int *offset);
unsigned int hlsl_offset_from_deref_safe(struct hlsl_ctx *ctx, const struct hlsl_deref *deref);
struct hlsl_reg hlsl_reg_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref);
bool hlsl_copy_propagation_execute(struct hlsl_ctx *ctx, struct hlsl_block *block);
bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context);
bool hlsl_fold_constant_swizzles(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context);
bool hlsl_transform_ir(struct hlsl_ctx *ctx, bool (*func)(struct hlsl_ctx *ctx, struct hlsl_ir_node *, void *),
struct hlsl_block *block, void *context);
bool hlsl_sm1_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic,
bool output, D3DSHADER_PARAM_REGISTER_TYPE *type, unsigned int *reg);
@@ -1227,7 +1124,7 @@ int hlsl_sm1_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun
bool hlsl_sm4_usage_from_semantic(struct hlsl_ctx *ctx,
const struct hlsl_semantic *semantic, bool output, D3D_NAME *usage);
bool hlsl_sm4_register_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semantic *semantic,
bool output, unsigned int *type, enum vkd3d_sm4_swizzle_type *swizzle_type, bool *has_idx);
bool output, enum vkd3d_sm4_register_type *type, enum vkd3d_sm4_swizzle_type *swizzle_type, bool *has_idx);
int hlsl_sm4_write(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, struct vkd3d_shader_code *out);
int hlsl_lexer_compile(struct hlsl_ctx *ctx, const struct vkd3d_shader_code *hlsl);

View File

@@ -37,7 +37,6 @@ static void update_location(struct hlsl_ctx *ctx, YYLTYPE *loc);
%option bison-locations
%option extra-type="struct hlsl_ctx *"
%option never-interactive
%option nodefault
%option noinput
%option nounput
%option noyywrap
@@ -96,7 +95,6 @@ matrix {return KW_MATRIX; }
namespace {return KW_NAMESPACE; }
nointerpolation {return KW_NOINTERPOLATION; }
out {return KW_OUT; }
packoffset {return KW_PACKOFFSET; }
pass {return KW_PASS; }
PixelShader {return KW_PIXELSHADER; }
precise {return KW_PRECISE; }
@@ -104,8 +102,6 @@ RasterizerState {return KW_RASTERIZERSTATE; }
RenderTargetView {return KW_RENDERTARGETVIEW; }
return {return KW_RETURN; }
register {return KW_REGISTER; }
RWBuffer {return KW_RWBUFFER; }
RWStructuredBuffer {return KW_RWSTRUCTUREDBUFFER; }
RWTexture1D {return KW_RWTEXTURE1D; }
RWTexture2D {return KW_RWTEXTURE2D; }
RWTexture3D {return KW_RWTEXTURE3D; }
@@ -269,10 +265,6 @@ row_major {return KW_ROW_MAJOR; }
return STRING;
}
<pp_line>{WS}+ {}
<pp_line>{ANY} {
FIXME("Malformed preprocessor line directive?\n");
BEGIN(INITIAL);
}
<pp_line>{NEWLINE} {
FIXME("Malformed preprocessor line directive?\n");
BEGIN(INITIAL);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More