Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Makefile.am b/Makefile.am index 5b3c4ff0..8dd803d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -170,7 +170,9 @@ libvkd3d_shader_la_SOURCES = \ libs/vkd3d-shader/checksum.c \ libs/vkd3d-shader/dxbc.c \ libs/vkd3d-shader/hlsl.c \ + libs/vkd3d-shader/hlsl.h \ libs/vkd3d-shader/hlsl_codegen.c \ + libs/vkd3d-shader/preproc.h \ libs/vkd3d-shader/spirv.c \ libs/vkd3d-shader/trace.c \ libs/vkd3d-shader/vkd3d_shader.map \
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- This is going to conflict with what other people are doing, sorry about that.
Makefile.am | 1 + libs/vkd3d-shader/dxbc.c | 457 +-------------------- libs/vkd3d-shader/sm4.h | 485 +++++++++++++++++++++++ libs/vkd3d-shader/vkd3d_shader_private.h | 13 - 4 files changed, 487 insertions(+), 469 deletions(-) create mode 100644 libs/vkd3d-shader/sm4.h
diff --git a/Makefile.am b/Makefile.am index 8dd803d1..6aca401c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -173,6 +173,7 @@ libvkd3d_shader_la_SOURCES = \ libs/vkd3d-shader/hlsl.h \ libs/vkd3d-shader/hlsl_codegen.c \ libs/vkd3d-shader/preproc.h \ + libs/vkd3d-shader/sm4.h \ libs/vkd3d-shader/spirv.c \ libs/vkd3d-shader/trace.c \ libs/vkd3d-shader/vkd3d_shader.map \ diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 26911255..aba2d2cd 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -18,462 +18,7 @@ */
#include "vkd3d_shader_private.h" - -#define VKD3D_SM4_INSTRUCTION_MODIFIER (0x1u << 31) - -#define VKD3D_SM4_MODIFIER_MASK 0x3fu - -#define VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT 6 -#define VKD3D_SM5_MODIFIER_DATA_TYPE_MASK (0xffffu << VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT) - -#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT 6 -#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT) - -#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT 11 -#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK (0xfffu << VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT) - -#define VKD3D_SM4_AOFFIMMI_U_SHIFT 9 -#define VKD3D_SM4_AOFFIMMI_U_MASK (0xfu << VKD3D_SM4_AOFFIMMI_U_SHIFT) -#define VKD3D_SM4_AOFFIMMI_V_SHIFT 13 -#define VKD3D_SM4_AOFFIMMI_V_MASK (0xfu << VKD3D_SM4_AOFFIMMI_V_SHIFT) -#define VKD3D_SM4_AOFFIMMI_W_SHIFT 17 -#define VKD3D_SM4_AOFFIMMI_W_MASK (0xfu << VKD3D_SM4_AOFFIMMI_W_SHIFT) - -#define VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT 24 -#define VKD3D_SM4_INSTRUCTION_LENGTH_MASK (0x1fu << VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT) - -#define VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT 11 -#define VKD3D_SM4_INSTRUCTION_FLAGS_MASK (0x7u << VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT) - -#define VKD3D_SM4_RESOURCE_TYPE_SHIFT 11 -#define VKD3D_SM4_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM4_RESOURCE_TYPE_SHIFT) - -#define VKD3D_SM4_PRIMITIVE_TYPE_SHIFT 11 -#define VKD3D_SM4_PRIMITIVE_TYPE_MASK (0x3fu << VKD3D_SM4_PRIMITIVE_TYPE_SHIFT) - -#define VKD3D_SM4_INDEX_TYPE_SHIFT 11 -#define VKD3D_SM4_INDEX_TYPE_MASK (0x1u << VKD3D_SM4_INDEX_TYPE_SHIFT) - -#define VKD3D_SM4_SAMPLER_MODE_SHIFT 11 -#define VKD3D_SM4_SAMPLER_MODE_MASK (0xfu << VKD3D_SM4_SAMPLER_MODE_SHIFT) - -#define VKD3D_SM4_SHADER_DATA_TYPE_SHIFT 11 -#define VKD3D_SM4_SHADER_DATA_TYPE_MASK (0xfu << VKD3D_SM4_SHADER_DATA_TYPE_SHIFT) - -#define VKD3D_SM4_INTERPOLATION_MODE_SHIFT 11 -#define VKD3D_SM4_INTERPOLATION_MODE_MASK (0xfu << VKD3D_SM4_INTERPOLATION_MODE_SHIFT) - -#define VKD3D_SM4_GLOBAL_FLAGS_SHIFT 11 -#define VKD3D_SM4_GLOBAL_FLAGS_MASK (0xffu << VKD3D_SM4_GLOBAL_FLAGS_SHIFT) - -#define VKD3D_SM5_PRECISE_SHIFT 19 -#define VKD3D_SM5_PRECISE_MASK (0xfu << VKD3D_SM5_PRECISE_SHIFT) - -#define VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT 11 -#define VKD3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT) - -#define VKD3D_SM5_FP_ARRAY_SIZE_SHIFT 16 -#define VKD3D_SM5_FP_TABLE_COUNT_MASK 0xffffu - -#define VKD3D_SM5_UAV_FLAGS_SHIFT 15 -#define VKD3D_SM5_UAV_FLAGS_MASK (0x1ffu << VKD3D_SM5_UAV_FLAGS_SHIFT) - -#define VKD3D_SM5_SYNC_FLAGS_SHIFT 11 -#define VKD3D_SM5_SYNC_FLAGS_MASK (0xffu << VKD3D_SM5_SYNC_FLAGS_SHIFT) - -#define VKD3D_SM5_TESSELLATOR_SHIFT 11 -#define VKD3D_SM5_TESSELLATOR_MASK (0xfu << VKD3D_SM5_TESSELLATOR_SHIFT) - -#define VKD3D_SM4_OPCODE_MASK 0xff - -#define VKD3D_SM4_REGISTER_MODIFIER (0x1u << 31) - -#define VKD3D_SM4_ADDRESSING_SHIFT2 28 -#define VKD3D_SM4_ADDRESSING_MASK2 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT2) - -#define VKD3D_SM4_ADDRESSING_SHIFT1 25 -#define VKD3D_SM4_ADDRESSING_MASK1 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT1) - -#define VKD3D_SM4_ADDRESSING_SHIFT0 22 -#define VKD3D_SM4_ADDRESSING_MASK0 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT0) - -#define VKD3D_SM4_REGISTER_ORDER_SHIFT 20 -#define VKD3D_SM4_REGISTER_ORDER_MASK (0x3u << VKD3D_SM4_REGISTER_ORDER_SHIFT) - -#define VKD3D_SM4_REGISTER_TYPE_SHIFT 12 -#define VKD3D_SM4_REGISTER_TYPE_MASK (0xffu << VKD3D_SM4_REGISTER_TYPE_SHIFT) - -#define VKD3D_SM4_SWIZZLE_TYPE_SHIFT 2 -#define VKD3D_SM4_SWIZZLE_TYPE_MASK (0x3u << VKD3D_SM4_SWIZZLE_TYPE_SHIFT) - -#define VKD3D_SM4_DIMENSION_SHIFT 0 -#define VKD3D_SM4_DIMENSION_MASK (0x3u << VKD3D_SM4_DIMENSION_SHIFT) - -#define VKD3D_SM4_WRITEMASK_SHIFT 4 -#define VKD3D_SM4_WRITEMASK_MASK (0xfu << VKD3D_SM4_WRITEMASK_SHIFT) - -#define VKD3D_SM4_SWIZZLE_SHIFT 4 -#define VKD3D_SM4_SWIZZLE_MASK (0xffu << VKD3D_SM4_SWIZZLE_SHIFT) - -#define VKD3D_SM4_VERSION_MAJOR(version) (((version) >> 4) & 0xf) -#define VKD3D_SM4_VERSION_MINOR(version) (((version) >> 0) & 0xf) - -#define VKD3D_SM4_ADDRESSING_RELATIVE 0x2 -#define VKD3D_SM4_ADDRESSING_OFFSET 0x1 - -#define VKD3D_SM4_INSTRUCTION_FLAG_SATURATE 0x4 - -#define VKD3D_SM4_CONDITIONAL_NZ (0x1u << 18) - -#define VKD3D_SM4_TYPE_COMPONENT(com, i) (((com) >> (4 * (i))) & 0xfu) - -enum vkd3d_sm4_opcode -{ - VKD3D_SM4_OP_ADD = 0x00, - VKD3D_SM4_OP_AND = 0x01, - VKD3D_SM4_OP_BREAK = 0x02, - VKD3D_SM4_OP_BREAKC = 0x03, - VKD3D_SM4_OP_CASE = 0x06, - VKD3D_SM4_OP_CONTINUE = 0x07, - VKD3D_SM4_OP_CONTINUEC = 0x08, - VKD3D_SM4_OP_CUT = 0x09, - VKD3D_SM4_OP_DEFAULT = 0x0a, - VKD3D_SM4_OP_DERIV_RTX = 0x0b, - VKD3D_SM4_OP_DERIV_RTY = 0x0c, - VKD3D_SM4_OP_DISCARD = 0x0d, - VKD3D_SM4_OP_DIV = 0x0e, - VKD3D_SM4_OP_DP2 = 0x0f, - VKD3D_SM4_OP_DP3 = 0x10, - VKD3D_SM4_OP_DP4 = 0x11, - VKD3D_SM4_OP_ELSE = 0x12, - VKD3D_SM4_OP_EMIT = 0x13, - VKD3D_SM4_OP_ENDIF = 0x15, - VKD3D_SM4_OP_ENDLOOP = 0x16, - VKD3D_SM4_OP_ENDSWITCH = 0x17, - VKD3D_SM4_OP_EQ = 0x18, - VKD3D_SM4_OP_EXP = 0x19, - VKD3D_SM4_OP_FRC = 0x1a, - VKD3D_SM4_OP_FTOI = 0x1b, - VKD3D_SM4_OP_FTOU = 0x1c, - VKD3D_SM4_OP_GE = 0x1d, - VKD3D_SM4_OP_IADD = 0x1e, - VKD3D_SM4_OP_IF = 0x1f, - VKD3D_SM4_OP_IEQ = 0x20, - VKD3D_SM4_OP_IGE = 0x21, - VKD3D_SM4_OP_ILT = 0x22, - VKD3D_SM4_OP_IMAD = 0x23, - VKD3D_SM4_OP_IMAX = 0x24, - VKD3D_SM4_OP_IMIN = 0x25, - VKD3D_SM4_OP_IMUL = 0x26, - VKD3D_SM4_OP_INE = 0x27, - VKD3D_SM4_OP_INEG = 0x28, - VKD3D_SM4_OP_ISHL = 0x29, - VKD3D_SM4_OP_ISHR = 0x2a, - VKD3D_SM4_OP_ITOF = 0x2b, - VKD3D_SM4_OP_LABEL = 0x2c, - VKD3D_SM4_OP_LD = 0x2d, - VKD3D_SM4_OP_LD2DMS = 0x2e, - VKD3D_SM4_OP_LOG = 0x2f, - VKD3D_SM4_OP_LOOP = 0x30, - VKD3D_SM4_OP_LT = 0x31, - VKD3D_SM4_OP_MAD = 0x32, - VKD3D_SM4_OP_MIN = 0x33, - VKD3D_SM4_OP_MAX = 0x34, - VKD3D_SM4_OP_SHADER_DATA = 0x35, - VKD3D_SM4_OP_MOV = 0x36, - VKD3D_SM4_OP_MOVC = 0x37, - VKD3D_SM4_OP_MUL = 0x38, - VKD3D_SM4_OP_NE = 0x39, - VKD3D_SM4_OP_NOP = 0x3a, - VKD3D_SM4_OP_NOT = 0x3b, - VKD3D_SM4_OP_OR = 0x3c, - VKD3D_SM4_OP_RESINFO = 0x3d, - VKD3D_SM4_OP_RET = 0x3e, - VKD3D_SM4_OP_RETC = 0x3f, - VKD3D_SM4_OP_ROUND_NE = 0x40, - VKD3D_SM4_OP_ROUND_NI = 0x41, - VKD3D_SM4_OP_ROUND_PI = 0x42, - VKD3D_SM4_OP_ROUND_Z = 0x43, - VKD3D_SM4_OP_RSQ = 0x44, - VKD3D_SM4_OP_SAMPLE = 0x45, - VKD3D_SM4_OP_SAMPLE_C = 0x46, - VKD3D_SM4_OP_SAMPLE_C_LZ = 0x47, - VKD3D_SM4_OP_SAMPLE_LOD = 0x48, - VKD3D_SM4_OP_SAMPLE_GRAD = 0x49, - VKD3D_SM4_OP_SAMPLE_B = 0x4a, - VKD3D_SM4_OP_SQRT = 0x4b, - VKD3D_SM4_OP_SWITCH = 0x4c, - VKD3D_SM4_OP_SINCOS = 0x4d, - VKD3D_SM4_OP_UDIV = 0x4e, - VKD3D_SM4_OP_ULT = 0x4f, - VKD3D_SM4_OP_UGE = 0x50, - VKD3D_SM4_OP_UMUL = 0x51, - VKD3D_SM4_OP_UMAX = 0x53, - VKD3D_SM4_OP_UMIN = 0x54, - VKD3D_SM4_OP_USHR = 0x55, - VKD3D_SM4_OP_UTOF = 0x56, - VKD3D_SM4_OP_XOR = 0x57, - VKD3D_SM4_OP_DCL_RESOURCE = 0x58, - VKD3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59, - VKD3D_SM4_OP_DCL_SAMPLER = 0x5a, - VKD3D_SM4_OP_DCL_INDEX_RANGE = 0x5b, - VKD3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c, - VKD3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d, - VKD3D_SM4_OP_DCL_VERTICES_OUT = 0x5e, - VKD3D_SM4_OP_DCL_INPUT = 0x5f, - VKD3D_SM4_OP_DCL_INPUT_SGV = 0x60, - VKD3D_SM4_OP_DCL_INPUT_SIV = 0x61, - VKD3D_SM4_OP_DCL_INPUT_PS = 0x62, - VKD3D_SM4_OP_DCL_INPUT_PS_SGV = 0x63, - VKD3D_SM4_OP_DCL_INPUT_PS_SIV = 0x64, - VKD3D_SM4_OP_DCL_OUTPUT = 0x65, - VKD3D_SM4_OP_DCL_OUTPUT_SIV = 0x67, - VKD3D_SM4_OP_DCL_TEMPS = 0x68, - VKD3D_SM4_OP_DCL_INDEXABLE_TEMP = 0x69, - VKD3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a, - VKD3D_SM4_OP_LOD = 0x6c, - VKD3D_SM4_OP_GATHER4 = 0x6d, - VKD3D_SM4_OP_SAMPLE_POS = 0x6e, - VKD3D_SM4_OP_SAMPLE_INFO = 0x6f, - VKD3D_SM5_OP_HS_DECLS = 0x71, - VKD3D_SM5_OP_HS_CONTROL_POINT_PHASE = 0x72, - VKD3D_SM5_OP_HS_FORK_PHASE = 0x73, - VKD3D_SM5_OP_HS_JOIN_PHASE = 0x74, - VKD3D_SM5_OP_EMIT_STREAM = 0x75, - VKD3D_SM5_OP_CUT_STREAM = 0x76, - VKD3D_SM5_OP_FCALL = 0x78, - VKD3D_SM5_OP_BUFINFO = 0x79, - VKD3D_SM5_OP_DERIV_RTX_COARSE = 0x7a, - VKD3D_SM5_OP_DERIV_RTX_FINE = 0x7b, - VKD3D_SM5_OP_DERIV_RTY_COARSE = 0x7c, - VKD3D_SM5_OP_DERIV_RTY_FINE = 0x7d, - VKD3D_SM5_OP_GATHER4_C = 0x7e, - VKD3D_SM5_OP_GATHER4_PO = 0x7f, - VKD3D_SM5_OP_GATHER4_PO_C = 0x80, - VKD3D_SM5_OP_RCP = 0x81, - VKD3D_SM5_OP_F32TOF16 = 0x82, - VKD3D_SM5_OP_F16TOF32 = 0x83, - VKD3D_SM5_OP_COUNTBITS = 0x86, - VKD3D_SM5_OP_FIRSTBIT_HI = 0x87, - VKD3D_SM5_OP_FIRSTBIT_LO = 0x88, - VKD3D_SM5_OP_FIRSTBIT_SHI = 0x89, - VKD3D_SM5_OP_UBFE = 0x8a, - VKD3D_SM5_OP_IBFE = 0x8b, - VKD3D_SM5_OP_BFI = 0x8c, - VKD3D_SM5_OP_BFREV = 0x8d, - VKD3D_SM5_OP_SWAPC = 0x8e, - VKD3D_SM5_OP_DCL_STREAM = 0x8f, - VKD3D_SM5_OP_DCL_FUNCTION_BODY = 0x90, - VKD3D_SM5_OP_DCL_FUNCTION_TABLE = 0x91, - VKD3D_SM5_OP_DCL_INTERFACE = 0x92, - VKD3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93, - VKD3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94, - VKD3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95, - VKD3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING = 0x96, - VKD3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97, - VKD3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98, - VKD3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99, - VKD3D_SM5_OP_DCL_HS_JOIN_PHASE_INSTANCE_COUNT = 0x9a, - VKD3D_SM5_OP_DCL_THREAD_GROUP = 0x9b, - VKD3D_SM5_OP_DCL_UAV_TYPED = 0x9c, - VKD3D_SM5_OP_DCL_UAV_RAW = 0x9d, - VKD3D_SM5_OP_DCL_UAV_STRUCTURED = 0x9e, - VKD3D_SM5_OP_DCL_TGSM_RAW = 0x9f, - VKD3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0, - VKD3D_SM5_OP_DCL_RESOURCE_RAW = 0xa1, - VKD3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2, - VKD3D_SM5_OP_LD_UAV_TYPED = 0xa3, - VKD3D_SM5_OP_STORE_UAV_TYPED = 0xa4, - VKD3D_SM5_OP_LD_RAW = 0xa5, - VKD3D_SM5_OP_STORE_RAW = 0xa6, - VKD3D_SM5_OP_LD_STRUCTURED = 0xa7, - VKD3D_SM5_OP_STORE_STRUCTURED = 0xa8, - VKD3D_SM5_OP_ATOMIC_AND = 0xa9, - VKD3D_SM5_OP_ATOMIC_OR = 0xaa, - VKD3D_SM5_OP_ATOMIC_XOR = 0xab, - VKD3D_SM5_OP_ATOMIC_CMP_STORE = 0xac, - VKD3D_SM5_OP_ATOMIC_IADD = 0xad, - VKD3D_SM5_OP_ATOMIC_IMAX = 0xae, - VKD3D_SM5_OP_ATOMIC_IMIN = 0xaf, - VKD3D_SM5_OP_ATOMIC_UMAX = 0xb0, - VKD3D_SM5_OP_ATOMIC_UMIN = 0xb1, - VKD3D_SM5_OP_IMM_ATOMIC_ALLOC = 0xb2, - VKD3D_SM5_OP_IMM_ATOMIC_CONSUME = 0xb3, - VKD3D_SM5_OP_IMM_ATOMIC_IADD = 0xb4, - VKD3D_SM5_OP_IMM_ATOMIC_AND = 0xb5, - VKD3D_SM5_OP_IMM_ATOMIC_OR = 0xb6, - VKD3D_SM5_OP_IMM_ATOMIC_XOR = 0xb7, - VKD3D_SM5_OP_IMM_ATOMIC_EXCH = 0xb8, - VKD3D_SM5_OP_IMM_ATOMIC_CMP_EXCH = 0xb9, - VKD3D_SM5_OP_IMM_ATOMIC_IMAX = 0xba, - VKD3D_SM5_OP_IMM_ATOMIC_IMIN = 0xbb, - VKD3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc, - VKD3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd, - VKD3D_SM5_OP_SYNC = 0xbe, - VKD3D_SM5_OP_DADD = 0xbf, - VKD3D_SM5_OP_DEQ = 0xc3, - VKD3D_SM5_OP_DMOV = 0xc7, - VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, - VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, - VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce, -}; - -enum vkd3d_sm4_instruction_modifier -{ - VKD3D_SM4_MODIFIER_AOFFIMMI = 0x1, - VKD3D_SM5_MODIFIER_RESOURCE_TYPE = 0x2, - VKD3D_SM5_MODIFIER_DATA_TYPE = 0x3, -}; - -enum vkd3d_sm4_register_type -{ - VKD3D_SM4_RT_TEMP = 0x00, - VKD3D_SM4_RT_INPUT = 0x01, - VKD3D_SM4_RT_OUTPUT = 0x02, - VKD3D_SM4_RT_INDEXABLE_TEMP = 0x03, - VKD3D_SM4_RT_IMMCONST = 0x04, - VKD3D_SM4_RT_IMMCONST64 = 0x05, - VKD3D_SM4_RT_SAMPLER = 0x06, - VKD3D_SM4_RT_RESOURCE = 0x07, - VKD3D_SM4_RT_CONSTBUFFER = 0x08, - VKD3D_SM4_RT_IMMCONSTBUFFER = 0x09, - VKD3D_SM4_RT_PRIMID = 0x0b, - VKD3D_SM4_RT_DEPTHOUT = 0x0c, - VKD3D_SM4_RT_NULL = 0x0d, - VKD3D_SM4_RT_RASTERIZER = 0x0e, - VKD3D_SM4_RT_OMASK = 0x0f, - VKD3D_SM5_RT_STREAM = 0x10, - VKD3D_SM5_RT_FUNCTION_BODY = 0x11, - VKD3D_SM5_RT_FUNCTION_POINTER = 0x13, - VKD3D_SM5_RT_OUTPUT_CONTROL_POINT_ID = 0x16, - VKD3D_SM5_RT_FORK_INSTANCE_ID = 0x17, - VKD3D_SM5_RT_JOIN_INSTANCE_ID = 0x18, - VKD3D_SM5_RT_INPUT_CONTROL_POINT = 0x19, - VKD3D_SM5_RT_OUTPUT_CONTROL_POINT = 0x1a, - VKD3D_SM5_RT_PATCH_CONSTANT_DATA = 0x1b, - VKD3D_SM5_RT_DOMAIN_LOCATION = 0x1c, - VKD3D_SM5_RT_UAV = 0x1e, - VKD3D_SM5_RT_SHARED_MEMORY = 0x1f, - VKD3D_SM5_RT_THREAD_ID = 0x20, - VKD3D_SM5_RT_THREAD_GROUP_ID = 0x21, - VKD3D_SM5_RT_LOCAL_THREAD_ID = 0x22, - VKD3D_SM5_RT_COVERAGE = 0x23, - VKD3D_SM5_RT_LOCAL_THREAD_INDEX = 0x24, - VKD3D_SM5_RT_GS_INSTANCE_ID = 0x25, - VKD3D_SM5_RT_DEPTHOUT_GREATER_EQUAL = 0x26, - VKD3D_SM5_RT_DEPTHOUT_LESS_EQUAL = 0x27, -}; - -enum vkd3d_sm4_register_modifier -{ - VKD3D_SM4_REGISTER_MODIFIER_NONE = 0x01, - VKD3D_SM4_REGISTER_MODIFIER_NEGATE = 0x41, - VKD3D_SM4_REGISTER_MODIFIER_ABS = 0x81, - VKD3D_SM4_REGISTER_MODIFIER_ABS_NEGATE = 0xc1, -}; - -enum vkd3d_sm4_output_primitive_type -{ - VKD3D_SM4_OUTPUT_PT_POINTLIST = 0x1, - VKD3D_SM4_OUTPUT_PT_LINESTRIP = 0x3, - VKD3D_SM4_OUTPUT_PT_TRIANGLESTRIP = 0x5, -}; - -enum vkd3d_sm4_input_primitive_type -{ - VKD3D_SM4_INPUT_PT_POINT = 0x01, - VKD3D_SM4_INPUT_PT_LINE = 0x02, - VKD3D_SM4_INPUT_PT_TRIANGLE = 0x03, - VKD3D_SM4_INPUT_PT_LINEADJ = 0x06, - VKD3D_SM4_INPUT_PT_TRIANGLEADJ = 0x07, - VKD3D_SM5_INPUT_PT_PATCH1 = 0x08, - VKD3D_SM5_INPUT_PT_PATCH2 = 0x09, - VKD3D_SM5_INPUT_PT_PATCH3 = 0x0a, - VKD3D_SM5_INPUT_PT_PATCH4 = 0x0b, - VKD3D_SM5_INPUT_PT_PATCH5 = 0x0c, - VKD3D_SM5_INPUT_PT_PATCH6 = 0x0d, - VKD3D_SM5_INPUT_PT_PATCH7 = 0x0e, - VKD3D_SM5_INPUT_PT_PATCH8 = 0x0f, - VKD3D_SM5_INPUT_PT_PATCH9 = 0x10, - VKD3D_SM5_INPUT_PT_PATCH10 = 0x11, - VKD3D_SM5_INPUT_PT_PATCH11 = 0x12, - VKD3D_SM5_INPUT_PT_PATCH12 = 0x13, - VKD3D_SM5_INPUT_PT_PATCH13 = 0x14, - VKD3D_SM5_INPUT_PT_PATCH14 = 0x15, - VKD3D_SM5_INPUT_PT_PATCH15 = 0x16, - VKD3D_SM5_INPUT_PT_PATCH16 = 0x17, - VKD3D_SM5_INPUT_PT_PATCH17 = 0x18, - VKD3D_SM5_INPUT_PT_PATCH18 = 0x19, - VKD3D_SM5_INPUT_PT_PATCH19 = 0x1a, - VKD3D_SM5_INPUT_PT_PATCH20 = 0x1b, - VKD3D_SM5_INPUT_PT_PATCH21 = 0x1c, - VKD3D_SM5_INPUT_PT_PATCH22 = 0x1d, - VKD3D_SM5_INPUT_PT_PATCH23 = 0x1e, - VKD3D_SM5_INPUT_PT_PATCH24 = 0x1f, - VKD3D_SM5_INPUT_PT_PATCH25 = 0x20, - VKD3D_SM5_INPUT_PT_PATCH26 = 0x21, - VKD3D_SM5_INPUT_PT_PATCH27 = 0x22, - VKD3D_SM5_INPUT_PT_PATCH28 = 0x23, - VKD3D_SM5_INPUT_PT_PATCH29 = 0x24, - VKD3D_SM5_INPUT_PT_PATCH30 = 0x25, - VKD3D_SM5_INPUT_PT_PATCH31 = 0x26, - VKD3D_SM5_INPUT_PT_PATCH32 = 0x27, -}; - -enum vkd3d_sm4_swizzle_type -{ - VKD3D_SM4_SWIZZLE_NONE = 0x0, - VKD3D_SM4_SWIZZLE_VEC4 = 0x1, - VKD3D_SM4_SWIZZLE_SCALAR = 0x2, -}; - -enum vkd3d_sm4_dimension -{ - VKD3D_SM4_DIMENSION_NONE = 0x0, - VKD3D_SM4_DIMENSION_SCALAR = 0x1, - VKD3D_SM4_DIMENSION_VEC4 = 0x2, -}; - -enum vkd3d_sm4_resource_type -{ - VKD3D_SM4_RESOURCE_BUFFER = 0x1, - VKD3D_SM4_RESOURCE_TEXTURE_1D = 0x2, - VKD3D_SM4_RESOURCE_TEXTURE_2D = 0x3, - VKD3D_SM4_RESOURCE_TEXTURE_2DMS = 0x4, - VKD3D_SM4_RESOURCE_TEXTURE_3D = 0x5, - VKD3D_SM4_RESOURCE_TEXTURE_CUBE = 0x6, - VKD3D_SM4_RESOURCE_TEXTURE_1DARRAY = 0x7, - VKD3D_SM4_RESOURCE_TEXTURE_2DARRAY = 0x8, - VKD3D_SM4_RESOURCE_TEXTURE_2DMSARRAY = 0x9, - VKD3D_SM4_RESOURCE_TEXTURE_CUBEARRAY = 0xa, - VKD3D_SM4_RESOURCE_RAW_BUFFER = 0xb, - VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER = 0xc, -}; - -enum vkd3d_sm4_data_type -{ - VKD3D_SM4_DATA_UNORM = 0x1, - VKD3D_SM4_DATA_SNORM = 0x2, - VKD3D_SM4_DATA_INT = 0x3, - VKD3D_SM4_DATA_UINT = 0x4, - VKD3D_SM4_DATA_FLOAT = 0x5, - VKD3D_SM4_DATA_MIXED = 0x6, - VKD3D_SM4_DATA_DOUBLE = 0x7, - VKD3D_SM4_DATA_CONTINUED = 0x8, - VKD3D_SM4_DATA_UNUSED = 0x9, -}; - -enum vkd3d_sm4_sampler_mode -{ - VKD3D_SM4_SAMPLER_DEFAULT = 0x0, - VKD3D_SM4_SAMPLER_COMPARISON = 0x1, -}; - -enum vkd3d_sm4_shader_data_type -{ - VKD3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER = 0x3, - VKD3D_SM4_SHADER_DATA_MESSAGE = 0x4, -}; +#include "sm4.h"
struct vkd3d_shader_src_param_entry { diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h new file mode 100644 index 00000000..1a25350c --- /dev/null +++ b/libs/vkd3d-shader/sm4.h @@ -0,0 +1,485 @@ +/* + * Copyright 2009 Henri Verbeet 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 + */ + +#ifndef __VKD3D_SM4_H +#define __VKD3D_SM4_H + +#define VKD3D_SM4_PS 0x0000u +#define VKD3D_SM4_VS 0x0001u +#define VKD3D_SM4_GS 0x0002u +#define VKD3D_SM5_HS 0x0003u +#define VKD3D_SM5_DS 0x0004u +#define VKD3D_SM5_CS 0x0005u + +#define VKD3D_SM4_INSTRUCTION_MODIFIER (0x1u << 31) + +#define VKD3D_SM4_MODIFIER_MASK 0x3fu + +#define VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT 6 +#define VKD3D_SM5_MODIFIER_DATA_TYPE_MASK (0xffffu << VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT) + +#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT 6 +#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT) + +#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT 11 +#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK (0xfffu << VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT) + +#define VKD3D_SM4_AOFFIMMI_U_SHIFT 9 +#define VKD3D_SM4_AOFFIMMI_U_MASK (0xfu << VKD3D_SM4_AOFFIMMI_U_SHIFT) +#define VKD3D_SM4_AOFFIMMI_V_SHIFT 13 +#define VKD3D_SM4_AOFFIMMI_V_MASK (0xfu << VKD3D_SM4_AOFFIMMI_V_SHIFT) +#define VKD3D_SM4_AOFFIMMI_W_SHIFT 17 +#define VKD3D_SM4_AOFFIMMI_W_MASK (0xfu << VKD3D_SM4_AOFFIMMI_W_SHIFT) + +#define VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT 24 +#define VKD3D_SM4_INSTRUCTION_LENGTH_MASK (0x1fu << VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT) + +#define VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT 11 +#define VKD3D_SM4_INSTRUCTION_FLAGS_MASK (0x7u << VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT) + +#define VKD3D_SM4_RESOURCE_TYPE_SHIFT 11 +#define VKD3D_SM4_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM4_RESOURCE_TYPE_SHIFT) + +#define VKD3D_SM4_PRIMITIVE_TYPE_SHIFT 11 +#define VKD3D_SM4_PRIMITIVE_TYPE_MASK (0x3fu << VKD3D_SM4_PRIMITIVE_TYPE_SHIFT) + +#define VKD3D_SM4_INDEX_TYPE_SHIFT 11 +#define VKD3D_SM4_INDEX_TYPE_MASK (0x1u << VKD3D_SM4_INDEX_TYPE_SHIFT) + +#define VKD3D_SM4_SAMPLER_MODE_SHIFT 11 +#define VKD3D_SM4_SAMPLER_MODE_MASK (0xfu << VKD3D_SM4_SAMPLER_MODE_SHIFT) + +#define VKD3D_SM4_SHADER_DATA_TYPE_SHIFT 11 +#define VKD3D_SM4_SHADER_DATA_TYPE_MASK (0xfu << VKD3D_SM4_SHADER_DATA_TYPE_SHIFT) + +#define VKD3D_SM4_INTERPOLATION_MODE_SHIFT 11 +#define VKD3D_SM4_INTERPOLATION_MODE_MASK (0xfu << VKD3D_SM4_INTERPOLATION_MODE_SHIFT) + +#define VKD3D_SM4_GLOBAL_FLAGS_SHIFT 11 +#define VKD3D_SM4_GLOBAL_FLAGS_MASK (0xffu << VKD3D_SM4_GLOBAL_FLAGS_SHIFT) + +#define VKD3D_SM5_PRECISE_SHIFT 19 +#define VKD3D_SM5_PRECISE_MASK (0xfu << VKD3D_SM5_PRECISE_SHIFT) + +#define VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT 11 +#define VKD3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT) + +#define VKD3D_SM5_FP_ARRAY_SIZE_SHIFT 16 +#define VKD3D_SM5_FP_TABLE_COUNT_MASK 0xffffu + +#define VKD3D_SM5_UAV_FLAGS_SHIFT 15 +#define VKD3D_SM5_UAV_FLAGS_MASK (0x1ffu << VKD3D_SM5_UAV_FLAGS_SHIFT) + +#define VKD3D_SM5_SYNC_FLAGS_SHIFT 11 +#define VKD3D_SM5_SYNC_FLAGS_MASK (0xffu << VKD3D_SM5_SYNC_FLAGS_SHIFT) + +#define VKD3D_SM5_TESSELLATOR_SHIFT 11 +#define VKD3D_SM5_TESSELLATOR_MASK (0xfu << VKD3D_SM5_TESSELLATOR_SHIFT) + +#define VKD3D_SM4_OPCODE_MASK 0xff + +#define VKD3D_SM4_REGISTER_MODIFIER (0x1u << 31) + +#define VKD3D_SM4_ADDRESSING_SHIFT2 28 +#define VKD3D_SM4_ADDRESSING_MASK2 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT2) + +#define VKD3D_SM4_ADDRESSING_SHIFT1 25 +#define VKD3D_SM4_ADDRESSING_MASK1 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT1) + +#define VKD3D_SM4_ADDRESSING_SHIFT0 22 +#define VKD3D_SM4_ADDRESSING_MASK0 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT0) + +#define VKD3D_SM4_REGISTER_ORDER_SHIFT 20 +#define VKD3D_SM4_REGISTER_ORDER_MASK (0x3u << VKD3D_SM4_REGISTER_ORDER_SHIFT) + +#define VKD3D_SM4_REGISTER_TYPE_SHIFT 12 +#define VKD3D_SM4_REGISTER_TYPE_MASK (0xffu << VKD3D_SM4_REGISTER_TYPE_SHIFT) + +#define VKD3D_SM4_SWIZZLE_TYPE_SHIFT 2 +#define VKD3D_SM4_SWIZZLE_TYPE_MASK (0x3u << VKD3D_SM4_SWIZZLE_TYPE_SHIFT) + +#define VKD3D_SM4_DIMENSION_SHIFT 0 +#define VKD3D_SM4_DIMENSION_MASK (0x3u << VKD3D_SM4_DIMENSION_SHIFT) + +#define VKD3D_SM4_WRITEMASK_SHIFT 4 +#define VKD3D_SM4_WRITEMASK_MASK (0xfu << VKD3D_SM4_WRITEMASK_SHIFT) + +#define VKD3D_SM4_SWIZZLE_SHIFT 4 +#define VKD3D_SM4_SWIZZLE_MASK (0xffu << VKD3D_SM4_SWIZZLE_SHIFT) + +#define VKD3D_SM4_VERSION_MAJOR(version) (((version) >> 4) & 0xf) +#define VKD3D_SM4_VERSION_MINOR(version) (((version) >> 0) & 0xf) + +#define VKD3D_SM4_ADDRESSING_RELATIVE 0x2 +#define VKD3D_SM4_ADDRESSING_OFFSET 0x1 + +#define VKD3D_SM4_INSTRUCTION_FLAG_SATURATE 0x4 + +#define VKD3D_SM4_CONDITIONAL_NZ (0x1u << 18) + +#define VKD3D_SM4_TYPE_COMPONENT(com, i) (((com) >> (4 * (i))) & 0xfu) + +enum vkd3d_sm4_opcode +{ + VKD3D_SM4_OP_ADD = 0x00, + VKD3D_SM4_OP_AND = 0x01, + VKD3D_SM4_OP_BREAK = 0x02, + VKD3D_SM4_OP_BREAKC = 0x03, + VKD3D_SM4_OP_CASE = 0x06, + VKD3D_SM4_OP_CONTINUE = 0x07, + VKD3D_SM4_OP_CONTINUEC = 0x08, + VKD3D_SM4_OP_CUT = 0x09, + VKD3D_SM4_OP_DEFAULT = 0x0a, + VKD3D_SM4_OP_DERIV_RTX = 0x0b, + VKD3D_SM4_OP_DERIV_RTY = 0x0c, + VKD3D_SM4_OP_DISCARD = 0x0d, + VKD3D_SM4_OP_DIV = 0x0e, + VKD3D_SM4_OP_DP2 = 0x0f, + VKD3D_SM4_OP_DP3 = 0x10, + VKD3D_SM4_OP_DP4 = 0x11, + VKD3D_SM4_OP_ELSE = 0x12, + VKD3D_SM4_OP_EMIT = 0x13, + VKD3D_SM4_OP_ENDIF = 0x15, + VKD3D_SM4_OP_ENDLOOP = 0x16, + VKD3D_SM4_OP_ENDSWITCH = 0x17, + VKD3D_SM4_OP_EQ = 0x18, + VKD3D_SM4_OP_EXP = 0x19, + VKD3D_SM4_OP_FRC = 0x1a, + VKD3D_SM4_OP_FTOI = 0x1b, + VKD3D_SM4_OP_FTOU = 0x1c, + VKD3D_SM4_OP_GE = 0x1d, + VKD3D_SM4_OP_IADD = 0x1e, + VKD3D_SM4_OP_IF = 0x1f, + VKD3D_SM4_OP_IEQ = 0x20, + VKD3D_SM4_OP_IGE = 0x21, + VKD3D_SM4_OP_ILT = 0x22, + VKD3D_SM4_OP_IMAD = 0x23, + VKD3D_SM4_OP_IMAX = 0x24, + VKD3D_SM4_OP_IMIN = 0x25, + VKD3D_SM4_OP_IMUL = 0x26, + VKD3D_SM4_OP_INE = 0x27, + VKD3D_SM4_OP_INEG = 0x28, + VKD3D_SM4_OP_ISHL = 0x29, + VKD3D_SM4_OP_ISHR = 0x2a, + VKD3D_SM4_OP_ITOF = 0x2b, + VKD3D_SM4_OP_LABEL = 0x2c, + VKD3D_SM4_OP_LD = 0x2d, + VKD3D_SM4_OP_LD2DMS = 0x2e, + VKD3D_SM4_OP_LOG = 0x2f, + VKD3D_SM4_OP_LOOP = 0x30, + VKD3D_SM4_OP_LT = 0x31, + VKD3D_SM4_OP_MAD = 0x32, + VKD3D_SM4_OP_MIN = 0x33, + VKD3D_SM4_OP_MAX = 0x34, + VKD3D_SM4_OP_SHADER_DATA = 0x35, + VKD3D_SM4_OP_MOV = 0x36, + VKD3D_SM4_OP_MOVC = 0x37, + VKD3D_SM4_OP_MUL = 0x38, + VKD3D_SM4_OP_NE = 0x39, + VKD3D_SM4_OP_NOP = 0x3a, + VKD3D_SM4_OP_NOT = 0x3b, + VKD3D_SM4_OP_OR = 0x3c, + VKD3D_SM4_OP_RESINFO = 0x3d, + VKD3D_SM4_OP_RET = 0x3e, + VKD3D_SM4_OP_RETC = 0x3f, + VKD3D_SM4_OP_ROUND_NE = 0x40, + VKD3D_SM4_OP_ROUND_NI = 0x41, + VKD3D_SM4_OP_ROUND_PI = 0x42, + VKD3D_SM4_OP_ROUND_Z = 0x43, + VKD3D_SM4_OP_RSQ = 0x44, + VKD3D_SM4_OP_SAMPLE = 0x45, + VKD3D_SM4_OP_SAMPLE_C = 0x46, + VKD3D_SM4_OP_SAMPLE_C_LZ = 0x47, + VKD3D_SM4_OP_SAMPLE_LOD = 0x48, + VKD3D_SM4_OP_SAMPLE_GRAD = 0x49, + VKD3D_SM4_OP_SAMPLE_B = 0x4a, + VKD3D_SM4_OP_SQRT = 0x4b, + VKD3D_SM4_OP_SWITCH = 0x4c, + VKD3D_SM4_OP_SINCOS = 0x4d, + VKD3D_SM4_OP_UDIV = 0x4e, + VKD3D_SM4_OP_ULT = 0x4f, + VKD3D_SM4_OP_UGE = 0x50, + VKD3D_SM4_OP_UMUL = 0x51, + VKD3D_SM4_OP_UMAX = 0x53, + VKD3D_SM4_OP_UMIN = 0x54, + VKD3D_SM4_OP_USHR = 0x55, + VKD3D_SM4_OP_UTOF = 0x56, + VKD3D_SM4_OP_XOR = 0x57, + VKD3D_SM4_OP_DCL_RESOURCE = 0x58, + VKD3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59, + VKD3D_SM4_OP_DCL_SAMPLER = 0x5a, + VKD3D_SM4_OP_DCL_INDEX_RANGE = 0x5b, + VKD3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c, + VKD3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d, + VKD3D_SM4_OP_DCL_VERTICES_OUT = 0x5e, + VKD3D_SM4_OP_DCL_INPUT = 0x5f, + VKD3D_SM4_OP_DCL_INPUT_SGV = 0x60, + VKD3D_SM4_OP_DCL_INPUT_SIV = 0x61, + VKD3D_SM4_OP_DCL_INPUT_PS = 0x62, + VKD3D_SM4_OP_DCL_INPUT_PS_SGV = 0x63, + VKD3D_SM4_OP_DCL_INPUT_PS_SIV = 0x64, + VKD3D_SM4_OP_DCL_OUTPUT = 0x65, + VKD3D_SM4_OP_DCL_OUTPUT_SIV = 0x67, + VKD3D_SM4_OP_DCL_TEMPS = 0x68, + VKD3D_SM4_OP_DCL_INDEXABLE_TEMP = 0x69, + VKD3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a, + VKD3D_SM4_OP_LOD = 0x6c, + VKD3D_SM4_OP_GATHER4 = 0x6d, + VKD3D_SM4_OP_SAMPLE_POS = 0x6e, + VKD3D_SM4_OP_SAMPLE_INFO = 0x6f, + VKD3D_SM5_OP_HS_DECLS = 0x71, + VKD3D_SM5_OP_HS_CONTROL_POINT_PHASE = 0x72, + VKD3D_SM5_OP_HS_FORK_PHASE = 0x73, + VKD3D_SM5_OP_HS_JOIN_PHASE = 0x74, + VKD3D_SM5_OP_EMIT_STREAM = 0x75, + VKD3D_SM5_OP_CUT_STREAM = 0x76, + VKD3D_SM5_OP_FCALL = 0x78, + VKD3D_SM5_OP_BUFINFO = 0x79, + VKD3D_SM5_OP_DERIV_RTX_COARSE = 0x7a, + VKD3D_SM5_OP_DERIV_RTX_FINE = 0x7b, + VKD3D_SM5_OP_DERIV_RTY_COARSE = 0x7c, + VKD3D_SM5_OP_DERIV_RTY_FINE = 0x7d, + VKD3D_SM5_OP_GATHER4_C = 0x7e, + VKD3D_SM5_OP_GATHER4_PO = 0x7f, + VKD3D_SM5_OP_GATHER4_PO_C = 0x80, + VKD3D_SM5_OP_RCP = 0x81, + VKD3D_SM5_OP_F32TOF16 = 0x82, + VKD3D_SM5_OP_F16TOF32 = 0x83, + VKD3D_SM5_OP_COUNTBITS = 0x86, + VKD3D_SM5_OP_FIRSTBIT_HI = 0x87, + VKD3D_SM5_OP_FIRSTBIT_LO = 0x88, + VKD3D_SM5_OP_FIRSTBIT_SHI = 0x89, + VKD3D_SM5_OP_UBFE = 0x8a, + VKD3D_SM5_OP_IBFE = 0x8b, + VKD3D_SM5_OP_BFI = 0x8c, + VKD3D_SM5_OP_BFREV = 0x8d, + VKD3D_SM5_OP_SWAPC = 0x8e, + VKD3D_SM5_OP_DCL_STREAM = 0x8f, + VKD3D_SM5_OP_DCL_FUNCTION_BODY = 0x90, + VKD3D_SM5_OP_DCL_FUNCTION_TABLE = 0x91, + VKD3D_SM5_OP_DCL_INTERFACE = 0x92, + VKD3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93, + VKD3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94, + VKD3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95, + VKD3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING = 0x96, + VKD3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97, + VKD3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98, + VKD3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99, + VKD3D_SM5_OP_DCL_HS_JOIN_PHASE_INSTANCE_COUNT = 0x9a, + VKD3D_SM5_OP_DCL_THREAD_GROUP = 0x9b, + VKD3D_SM5_OP_DCL_UAV_TYPED = 0x9c, + VKD3D_SM5_OP_DCL_UAV_RAW = 0x9d, + VKD3D_SM5_OP_DCL_UAV_STRUCTURED = 0x9e, + VKD3D_SM5_OP_DCL_TGSM_RAW = 0x9f, + VKD3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0, + VKD3D_SM5_OP_DCL_RESOURCE_RAW = 0xa1, + VKD3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2, + VKD3D_SM5_OP_LD_UAV_TYPED = 0xa3, + VKD3D_SM5_OP_STORE_UAV_TYPED = 0xa4, + VKD3D_SM5_OP_LD_RAW = 0xa5, + VKD3D_SM5_OP_STORE_RAW = 0xa6, + VKD3D_SM5_OP_LD_STRUCTURED = 0xa7, + VKD3D_SM5_OP_STORE_STRUCTURED = 0xa8, + VKD3D_SM5_OP_ATOMIC_AND = 0xa9, + VKD3D_SM5_OP_ATOMIC_OR = 0xaa, + VKD3D_SM5_OP_ATOMIC_XOR = 0xab, + VKD3D_SM5_OP_ATOMIC_CMP_STORE = 0xac, + VKD3D_SM5_OP_ATOMIC_IADD = 0xad, + VKD3D_SM5_OP_ATOMIC_IMAX = 0xae, + VKD3D_SM5_OP_ATOMIC_IMIN = 0xaf, + VKD3D_SM5_OP_ATOMIC_UMAX = 0xb0, + VKD3D_SM5_OP_ATOMIC_UMIN = 0xb1, + VKD3D_SM5_OP_IMM_ATOMIC_ALLOC = 0xb2, + VKD3D_SM5_OP_IMM_ATOMIC_CONSUME = 0xb3, + VKD3D_SM5_OP_IMM_ATOMIC_IADD = 0xb4, + VKD3D_SM5_OP_IMM_ATOMIC_AND = 0xb5, + VKD3D_SM5_OP_IMM_ATOMIC_OR = 0xb6, + VKD3D_SM5_OP_IMM_ATOMIC_XOR = 0xb7, + VKD3D_SM5_OP_IMM_ATOMIC_EXCH = 0xb8, + VKD3D_SM5_OP_IMM_ATOMIC_CMP_EXCH = 0xb9, + VKD3D_SM5_OP_IMM_ATOMIC_IMAX = 0xba, + VKD3D_SM5_OP_IMM_ATOMIC_IMIN = 0xbb, + VKD3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc, + VKD3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd, + VKD3D_SM5_OP_SYNC = 0xbe, + VKD3D_SM5_OP_DADD = 0xbf, + VKD3D_SM5_OP_DEQ = 0xc3, + VKD3D_SM5_OP_DMOV = 0xc7, + VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, + VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, + VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce, +}; + +enum vkd3d_sm4_instruction_modifier +{ + VKD3D_SM4_MODIFIER_AOFFIMMI = 0x1, + VKD3D_SM5_MODIFIER_RESOURCE_TYPE = 0x2, + VKD3D_SM5_MODIFIER_DATA_TYPE = 0x3, +}; + +enum vkd3d_sm4_register_type +{ + VKD3D_SM4_RT_TEMP = 0x00, + VKD3D_SM4_RT_INPUT = 0x01, + VKD3D_SM4_RT_OUTPUT = 0x02, + VKD3D_SM4_RT_INDEXABLE_TEMP = 0x03, + VKD3D_SM4_RT_IMMCONST = 0x04, + VKD3D_SM4_RT_IMMCONST64 = 0x05, + VKD3D_SM4_RT_SAMPLER = 0x06, + VKD3D_SM4_RT_RESOURCE = 0x07, + VKD3D_SM4_RT_CONSTBUFFER = 0x08, + VKD3D_SM4_RT_IMMCONSTBUFFER = 0x09, + VKD3D_SM4_RT_PRIMID = 0x0b, + VKD3D_SM4_RT_DEPTHOUT = 0x0c, + VKD3D_SM4_RT_NULL = 0x0d, + VKD3D_SM4_RT_RASTERIZER = 0x0e, + VKD3D_SM4_RT_OMASK = 0x0f, + VKD3D_SM5_RT_STREAM = 0x10, + VKD3D_SM5_RT_FUNCTION_BODY = 0x11, + VKD3D_SM5_RT_FUNCTION_POINTER = 0x13, + VKD3D_SM5_RT_OUTPUT_CONTROL_POINT_ID = 0x16, + VKD3D_SM5_RT_FORK_INSTANCE_ID = 0x17, + VKD3D_SM5_RT_JOIN_INSTANCE_ID = 0x18, + VKD3D_SM5_RT_INPUT_CONTROL_POINT = 0x19, + VKD3D_SM5_RT_OUTPUT_CONTROL_POINT = 0x1a, + VKD3D_SM5_RT_PATCH_CONSTANT_DATA = 0x1b, + VKD3D_SM5_RT_DOMAIN_LOCATION = 0x1c, + VKD3D_SM5_RT_UAV = 0x1e, + VKD3D_SM5_RT_SHARED_MEMORY = 0x1f, + VKD3D_SM5_RT_THREAD_ID = 0x20, + VKD3D_SM5_RT_THREAD_GROUP_ID = 0x21, + VKD3D_SM5_RT_LOCAL_THREAD_ID = 0x22, + VKD3D_SM5_RT_COVERAGE = 0x23, + VKD3D_SM5_RT_LOCAL_THREAD_INDEX = 0x24, + VKD3D_SM5_RT_GS_INSTANCE_ID = 0x25, + VKD3D_SM5_RT_DEPTHOUT_GREATER_EQUAL = 0x26, + VKD3D_SM5_RT_DEPTHOUT_LESS_EQUAL = 0x27, +}; + +enum vkd3d_sm4_register_modifier +{ + VKD3D_SM4_REGISTER_MODIFIER_NONE = 0x01, + VKD3D_SM4_REGISTER_MODIFIER_NEGATE = 0x41, + VKD3D_SM4_REGISTER_MODIFIER_ABS = 0x81, + VKD3D_SM4_REGISTER_MODIFIER_ABS_NEGATE = 0xc1, +}; + +enum vkd3d_sm4_output_primitive_type +{ + VKD3D_SM4_OUTPUT_PT_POINTLIST = 0x1, + VKD3D_SM4_OUTPUT_PT_LINESTRIP = 0x3, + VKD3D_SM4_OUTPUT_PT_TRIANGLESTRIP = 0x5, +}; + +enum vkd3d_sm4_input_primitive_type +{ + VKD3D_SM4_INPUT_PT_POINT = 0x01, + VKD3D_SM4_INPUT_PT_LINE = 0x02, + VKD3D_SM4_INPUT_PT_TRIANGLE = 0x03, + VKD3D_SM4_INPUT_PT_LINEADJ = 0x06, + VKD3D_SM4_INPUT_PT_TRIANGLEADJ = 0x07, + VKD3D_SM5_INPUT_PT_PATCH1 = 0x08, + VKD3D_SM5_INPUT_PT_PATCH2 = 0x09, + VKD3D_SM5_INPUT_PT_PATCH3 = 0x0a, + VKD3D_SM5_INPUT_PT_PATCH4 = 0x0b, + VKD3D_SM5_INPUT_PT_PATCH5 = 0x0c, + VKD3D_SM5_INPUT_PT_PATCH6 = 0x0d, + VKD3D_SM5_INPUT_PT_PATCH7 = 0x0e, + VKD3D_SM5_INPUT_PT_PATCH8 = 0x0f, + VKD3D_SM5_INPUT_PT_PATCH9 = 0x10, + VKD3D_SM5_INPUT_PT_PATCH10 = 0x11, + VKD3D_SM5_INPUT_PT_PATCH11 = 0x12, + VKD3D_SM5_INPUT_PT_PATCH12 = 0x13, + VKD3D_SM5_INPUT_PT_PATCH13 = 0x14, + VKD3D_SM5_INPUT_PT_PATCH14 = 0x15, + VKD3D_SM5_INPUT_PT_PATCH15 = 0x16, + VKD3D_SM5_INPUT_PT_PATCH16 = 0x17, + VKD3D_SM5_INPUT_PT_PATCH17 = 0x18, + VKD3D_SM5_INPUT_PT_PATCH18 = 0x19, + VKD3D_SM5_INPUT_PT_PATCH19 = 0x1a, + VKD3D_SM5_INPUT_PT_PATCH20 = 0x1b, + VKD3D_SM5_INPUT_PT_PATCH21 = 0x1c, + VKD3D_SM5_INPUT_PT_PATCH22 = 0x1d, + VKD3D_SM5_INPUT_PT_PATCH23 = 0x1e, + VKD3D_SM5_INPUT_PT_PATCH24 = 0x1f, + VKD3D_SM5_INPUT_PT_PATCH25 = 0x20, + VKD3D_SM5_INPUT_PT_PATCH26 = 0x21, + VKD3D_SM5_INPUT_PT_PATCH27 = 0x22, + VKD3D_SM5_INPUT_PT_PATCH28 = 0x23, + VKD3D_SM5_INPUT_PT_PATCH29 = 0x24, + VKD3D_SM5_INPUT_PT_PATCH30 = 0x25, + VKD3D_SM5_INPUT_PT_PATCH31 = 0x26, + VKD3D_SM5_INPUT_PT_PATCH32 = 0x27, +}; + +enum vkd3d_sm4_swizzle_type +{ + VKD3D_SM4_SWIZZLE_NONE = 0x0, + VKD3D_SM4_SWIZZLE_VEC4 = 0x1, + VKD3D_SM4_SWIZZLE_SCALAR = 0x2, +}; + +enum vkd3d_sm4_dimension +{ + VKD3D_SM4_DIMENSION_NONE = 0x0, + VKD3D_SM4_DIMENSION_SCALAR = 0x1, + VKD3D_SM4_DIMENSION_VEC4 = 0x2, +}; + +enum vkd3d_sm4_resource_type +{ + VKD3D_SM4_RESOURCE_BUFFER = 0x1, + VKD3D_SM4_RESOURCE_TEXTURE_1D = 0x2, + VKD3D_SM4_RESOURCE_TEXTURE_2D = 0x3, + VKD3D_SM4_RESOURCE_TEXTURE_2DMS = 0x4, + VKD3D_SM4_RESOURCE_TEXTURE_3D = 0x5, + VKD3D_SM4_RESOURCE_TEXTURE_CUBE = 0x6, + VKD3D_SM4_RESOURCE_TEXTURE_1DARRAY = 0x7, + VKD3D_SM4_RESOURCE_TEXTURE_2DARRAY = 0x8, + VKD3D_SM4_RESOURCE_TEXTURE_2DMSARRAY = 0x9, + VKD3D_SM4_RESOURCE_TEXTURE_CUBEARRAY = 0xa, + VKD3D_SM4_RESOURCE_RAW_BUFFER = 0xb, + VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER = 0xc, +}; + +enum vkd3d_sm4_data_type +{ + VKD3D_SM4_DATA_UNORM = 0x1, + VKD3D_SM4_DATA_SNORM = 0x2, + VKD3D_SM4_DATA_INT = 0x3, + VKD3D_SM4_DATA_UINT = 0x4, + VKD3D_SM4_DATA_FLOAT = 0x5, + VKD3D_SM4_DATA_MIXED = 0x6, + VKD3D_SM4_DATA_DOUBLE = 0x7, + VKD3D_SM4_DATA_CONTINUED = 0x8, + VKD3D_SM4_DATA_UNUSED = 0x9, +}; + +enum vkd3d_sm4_sampler_mode +{ + VKD3D_SM4_SAMPLER_DEFAULT = 0x0, + VKD3D_SM4_SAMPLER_COMPARISON = 0x1, +}; + +enum vkd3d_sm4_shader_data_type +{ + VKD3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER = 0x3, + VKD3D_SM4_SHADER_DATA_MESSAGE = 0x4, +}; + +#endif /* __VKD3D_SM4_H */ diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 23f2b232..bd142297 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -552,19 +552,6 @@ enum vkd3d_shader_conditional_op VKD3D_SHADER_CONDITIONAL_OP_Z = 1 };
-#define VKD3D_SM1_VS 0xfffeu -#define VKD3D_SM1_PS 0xffffu -#define VKD3D_SM4_PS 0x0000u -#define VKD3D_SM4_VS 0x0001u -#define VKD3D_SM4_GS 0x0002u -#define VKD3D_SM5_HS 0x0003u -#define VKD3D_SM5_DS 0x0004u -#define VKD3D_SM5_CS 0x0005u - -/* Shader version tokens, and shader end tokens */ -#define VKD3DPS_VERSION(major, minor) ((VKD3D_SM1_PS << 16) | ((major) << 8) | (minor)) -#define VKD3DVS_VERSION(major, minor) ((VKD3D_SM1_VS << 16) | ((major) << 8) | (minor)) - #define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE 4096 #define MAX_REG_OUTPUT 32
On Wed, 4 Aug 2021 at 05:52, Zebediah Figura zfigura@codeweavers.com wrote:
This is going to conflict with what other people are doing, sorry about that.
Yeah, this doesn't apply because of Conor's patches (which were first).
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- According to my reading of [1], and of the generated Makefile, this is the intended setup.
[1] https://www.gnu.org/software/automake/manual/html_node/Headers.html
Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am index 6aca401c..1946af37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -300,7 +300,7 @@ demos_triangle_CFLAGS = $(DEMOS_CFLAGS) demos_triangle_LDADD = $(DEMOS_LDADD) endif
-EXTRA_DIST += $(vkd3d_test_headers) $(vkd3d_demos_headers) +noinst_HEADERS = $(vkd3d_test_headers) $(vkd3d_demos_headers)
VKD3D_V_WIDL = $(vkd3d_v_widl_@AM_V@) vkd3d_v_widl_ = $(vkd3d_v_widl_@AM_DEFAULT_V@)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
We tag far fewer symbols this way.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- This is also going to conflict with what other people are doing; sorry about that.
configure.ac | 1 + include/private/vkd3d_blob.h | 2 +- include/private/vkd3d_common.h | 8 +- include/private/vkd3d_debug.h | 19 +- include/private/vkd3d_memory.h | 3 +- include/private/vkd3d_utf8.h | 2 +- include/vkd3d_windows.h | 17 +- libs/vkd3d-common/debug.c | 2 +- libs/vkd3d-shader/dxbc.c | 6 +- libs/vkd3d-shader/hlsl.h | 111 ++++++------ libs/vkd3d-shader/preproc.h | 12 +- libs/vkd3d-shader/vkd3d_shader_main.c | 26 +-- libs/vkd3d-shader/vkd3d_shader_private.h | 80 ++++----- libs/vkd3d-utils/vkd3d_utils_main.c | 30 ++-- libs/vkd3d/command.c | 6 +- libs/vkd3d/device.c | 16 +- libs/vkd3d/resource.c | 6 +- libs/vkd3d/utils.c | 4 +- libs/vkd3d/vkd3d_main.c | 10 +- libs/vkd3d/vkd3d_private.h | 216 +++++++++++------------ 20 files changed, 271 insertions(+), 306 deletions(-)
diff --git a/configure.ac b/configure.ac index 88d58e40..d296dfd4 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,7 @@ AC_SUBST([VKD3D_CFLAGS]) AS_IF([test "x${GCC}" = "xyes"], [VKD3D_CFLAGS="-Wall -pipe" VKD3D_CHECK_CFLAGS([-std=c99]) + VKD3D_CHECK_CFLAGS([-fvisibility=hidden]) VKD3D_CHECK_CFLAGS([-Wdeclaration-after-statement]) VKD3D_CHECK_CFLAGS([-Wimplicit-fallthrough]) VKD3D_CHECK_CFLAGS([-Winit-self]) diff --git a/include/private/vkd3d_blob.h b/include/private/vkd3d_blob.h index e78d3916..0f48e876 100644 --- a/include/private/vkd3d_blob.h +++ b/include/private/vkd3d_blob.h @@ -22,6 +22,6 @@ #include "vkd3d_windows.h" #include "vkd3d_d3dcommon.h"
-HRESULT vkd3d_blob_create(void *buffer, SIZE_T size, ID3D10Blob **blob) DECLSPEC_HIDDEN; +HRESULT vkd3d_blob_create(void *buffer, SIZE_T size, ID3D10Blob **blob);
#endif /* __VKD3D_BLOB_H */ diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index e25ee909..80855ac0 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -54,6 +54,12 @@ static inline size_t align(size_t addr, size_t alignment) # define VKD3D_UNUSED #endif /* __GNUC__ */
+#if defined(__GNUC__) && !defined(__MINGW32__) +# define VKD3D_API __attribute__((visibility("default"))) +#else +# define VKD3D_API +#endif + static inline unsigned int vkd3d_popcount(unsigned int v) { #ifdef _MSC_VER @@ -209,6 +215,6 @@ static inline void vkd3d_parse_version(const char *version, int *major, int *min *minor = atoi(version); }
-HRESULT hresult_from_vkd3d_result(int vkd3d_result) DECLSPEC_HIDDEN; +HRESULT hresult_from_vkd3d_result(int vkd3d_result);
#endif /* __VKD3D_COMMON_H */ diff --git a/include/private/vkd3d_debug.h b/include/private/vkd3d_debug.h index c37c841a..a206a92b 100644 --- a/include/private/vkd3d_debug.h +++ b/include/private/vkd3d_debug.h @@ -44,15 +44,14 @@ enum vkd3d_dbg_level VKD3D_DBG_LEVEL_TRACE, };
-enum vkd3d_dbg_level vkd3d_dbg_get_level(void) DECLSPEC_HIDDEN; +enum vkd3d_dbg_level vkd3d_dbg_get_level(void);
-void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, - const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN; +void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const char *fmt, ...) VKD3D_PRINTF_FUNC(3, 4);
-const char *vkd3d_dbg_sprintf(const char *fmt, ...) VKD3D_PRINTF_FUNC(1, 2) DECLSPEC_HIDDEN; -const char *vkd3d_dbg_vsprintf(const char *fmt, va_list args) DECLSPEC_HIDDEN; -const char *debugstr_a(const char *str) DECLSPEC_HIDDEN; -const char *debugstr_w(const WCHAR *wstr, size_t wchar_size) DECLSPEC_HIDDEN; +const char *vkd3d_dbg_sprintf(const char *fmt, ...) VKD3D_PRINTF_FUNC(1, 2); +const char *vkd3d_dbg_vsprintf(const char *fmt, va_list args); +const char *debugstr_a(const char *str); +const char *debugstr_w(const WCHAR *wstr, size_t wchar_size);
#define VKD3D_DBG_LOG(level) \ do { \ @@ -103,7 +102,7 @@ static inline const char *debugstr_guid(const GUID *guid) guid->Data4[5], guid->Data4[6], guid->Data4[7]); }
-unsigned int vkd3d_env_var_as_uint(const char *name, unsigned int default_value) DECLSPEC_HIDDEN; +unsigned int vkd3d_env_var_as_uint(const char *name, unsigned int default_value);
struct vkd3d_debug_option { @@ -111,8 +110,8 @@ struct vkd3d_debug_option uint64_t flag; };
-bool vkd3d_debug_list_has_member(const char *string, const char *member) DECLSPEC_HIDDEN; +bool vkd3d_debug_list_has_member(const char *string, const char *member); uint64_t vkd3d_parse_debug_options(const char *string, - const struct vkd3d_debug_option *options, unsigned int option_count) DECLSPEC_HIDDEN; + const struct vkd3d_debug_option *options, unsigned int option_count);
#endif /* __VKD3D_DEBUG_H */ diff --git a/include/private/vkd3d_memory.h b/include/private/vkd3d_memory.h index bd56d30a..f6846d66 100644 --- a/include/private/vkd3d_memory.h +++ b/include/private/vkd3d_memory.h @@ -65,7 +65,6 @@ static inline char *vkd3d_strdup(const char *string) return ptr; }
-bool vkd3d_array_reserve(void **elements, size_t *capacity, - size_t element_count, size_t element_size) DECLSPEC_HIDDEN; +bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size);
#endif /* __VKD3D_MEMORY_H */ diff --git a/include/private/vkd3d_utf8.h b/include/private/vkd3d_utf8.h index ab32884b..ccb9e17e 100644 --- a/include/private/vkd3d_utf8.h +++ b/include/private/vkd3d_utf8.h @@ -21,6 +21,6 @@
#include "vkd3d_common.h"
-char *vkd3d_strdup_w_utf8(const WCHAR *wstr, size_t wchar_size) DECLSPEC_HIDDEN; +char *vkd3d_strdup_w_utf8(const WCHAR *wstr, size_t wchar_size);
#endif /* __VKD3D_UTF8_H */ diff --git a/include/vkd3d_windows.h b/include/vkd3d_windows.h index 8398d403..c1aa9f27 100644 --- a/include/vkd3d_windows.h +++ b/include/vkd3d_windows.h @@ -127,18 +127,18 @@ typedef GUID IID; # ifdef INITGUID # ifndef __cplusplus # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - const GUID name DECLSPEC_HIDDEN; \ + const GUID name; \ const GUID name = \ { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 }} # else # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const GUID name DECLSPEC_HIDDEN; \ + EXTERN_C const GUID name; \ EXTERN_C const GUID name = \ { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 }} # endif # else # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const GUID name DECLSPEC_HIDDEN; + EXTERN_C const GUID name; # endif /* INITGUID */
/* __uuidof emulation */ @@ -239,17 +239,6 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; #endif /* _WIN32 */
-/* Define DECLSPEC_HIDDEN */ -#ifndef DECLSPEC_HIDDEN -# if defined(__MINGW32__) -# define DECLSPEC_HIDDEN -# elif defined(__GNUC__) -# define DECLSPEC_HIDDEN __attribute__((visibility("hidden"))) -# else -# define DECLSPEC_HIDDEN -# endif -#endif /* DECLSPEC_HIDDEN */ - /* Define min() & max() macros */ #ifndef NOMINMAX # ifndef min diff --git a/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index 5e49cf10..dcf53fa9 100644 --- a/libs/vkd3d-common/debug.c +++ b/libs/vkd3d-common/debug.c @@ -31,7 +31,7 @@ #define VKD3D_DEBUG_BUFFER_COUNT 64 #define VKD3D_DEBUG_BUFFER_SIZE 512
-extern const char *vkd3d_dbg_env_name DECLSPEC_HIDDEN; +extern const char *vkd3d_dbg_env_name;
static const char *debug_level_names[] = { diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index aba2d2cd..ae493391 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -2393,7 +2393,7 @@ static int rts0_handler(const char *data, DWORD data_size, DWORD tag, void *cont return shader_parse_root_signature(data, data_size, desc); }
-int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, +VKD3D_API int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_versioned_root_signature_desc *root_signature, char **messages) { struct vkd3d_shader_message_context message_context; @@ -2797,7 +2797,7 @@ static int validate_root_signature_desc(const struct vkd3d_shader_versioned_root return ret; }
-int vkd3d_shader_serialize_root_signature(const struct vkd3d_shader_versioned_root_signature_desc *root_signature, +VKD3D_API int vkd3d_shader_serialize_root_signature(const struct vkd3d_shader_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc, char **messages) { struct root_signature_writer_context context; @@ -3106,7 +3106,7 @@ fail: return ret; }
-int vkd3d_shader_convert_root_signature(struct vkd3d_shader_versioned_root_signature_desc *dst, +VKD3D_API int vkd3d_shader_convert_root_signature(struct vkd3d_shader_versioned_root_signature_desc *dst, enum vkd3d_shader_root_signature_version version, const struct vkd3d_shader_versioned_root_signature_desc *src) { int ret; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 54273ac6..aede3a55 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -601,91 +601,84 @@ static inline void hlsl_release_string_buffer(struct hlsl_ctx *ctx, struct vkd3d vkd3d_string_buffer_release(&ctx->string_buffers, buffer); }
-const char *debug_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type) DECLSPEC_HIDDEN; -const char *debug_hlsl_writemask(unsigned int writemask) DECLSPEC_HIDDEN; +const char *debug_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type); +const char *debug_hlsl_writemask(unsigned int writemask);
-struct vkd3d_string_buffer *hlsl_type_to_string(struct hlsl_ctx *ctx, const struct hlsl_type *type) DECLSPEC_HIDDEN; -struct vkd3d_string_buffer *hlsl_modifiers_to_string(struct hlsl_ctx *ctx, unsigned int modifiers) DECLSPEC_HIDDEN; -const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type) DECLSPEC_HIDDEN; +struct vkd3d_string_buffer *hlsl_type_to_string(struct hlsl_ctx *ctx, const struct hlsl_type *type); +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);
-void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function_decl *decl, - bool intrinsic) DECLSPEC_HIDDEN; -bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var) DECLSPEC_HIDDEN; +void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function_decl *decl, bool intrinsic); +bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var);
-void hlsl_dump_function(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *func) DECLSPEC_HIDDEN; +void hlsl_dump_function(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *func);
-int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, - struct vkd3d_shader_code *out) DECLSPEC_HIDDEN; +int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func, struct vkd3d_shader_code *out);
-void hlsl_free_instr(struct hlsl_ir_node *node) DECLSPEC_HIDDEN; -void hlsl_free_instr_list(struct list *list) DECLSPEC_HIDDEN; -void hlsl_free_type(struct hlsl_type *type) DECLSPEC_HIDDEN; -void hlsl_free_var(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN; +void hlsl_free_instr(struct hlsl_ir_node *node); +void hlsl_free_instr_list(struct list *list); +void hlsl_free_type(struct hlsl_type *type); +void hlsl_free_var(struct hlsl_ir_var *decl);
-bool hlsl_get_function(struct hlsl_ctx *ctx, const char *name) DECLSPEC_HIDDEN; -struct hlsl_ir_function_decl *hlsl_get_func_decl(struct hlsl_ctx *ctx, const char *name) DECLSPEC_HIDDEN; -struct hlsl_type *hlsl_get_type(struct hlsl_scope *scope, const char *name, bool recursive) DECLSPEC_HIDDEN; -struct hlsl_ir_var *hlsl_get_var(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN; +bool hlsl_get_function(struct hlsl_ctx *ctx, const char *name); +struct hlsl_ir_function_decl *hlsl_get_func_decl(struct hlsl_ctx *ctx, const char *name); +struct hlsl_type *hlsl_get_type(struct hlsl_scope *scope, const char *name, bool recursive); +struct hlsl_ir_var *hlsl_get_var(struct hlsl_scope *scope, const char *name);
-struct hlsl_type *hlsl_new_array_type(struct hlsl_ctx *ctx, struct hlsl_type *basic_type, - unsigned int array_size) DECLSPEC_HIDDEN; +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) DECLSPEC_HIDDEN; + struct hlsl_ir_node *arg2); struct hlsl_buffer *hlsl_new_buffer(struct hlsl_ctx *ctx, enum hlsl_buffer_type type, const char *name, - const struct hlsl_reg_reservation *reservation, struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + const struct hlsl_reg_reservation *reservation, struct vkd3d_shader_location loc); struct hlsl_ir_expr *hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type, - struct vkd3d_shader_location *loc) DECLSPEC_HIDDEN; -struct hlsl_ir_expr *hlsl_new_copy(struct hlsl_ctx *ctx, struct hlsl_ir_node *node) DECLSPEC_HIDDEN; + struct vkd3d_shader_location *loc); +struct hlsl_ir_expr *hlsl_new_copy(struct hlsl_ctx *ctx, struct hlsl_ir_node *node); struct hlsl_ir_function_decl *hlsl_new_func_decl(struct hlsl_ctx *ctx, struct hlsl_type *return_type, - struct list *parameters, const struct hlsl_semantic *semantic, - struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; -struct hlsl_ir_if *hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condition, - struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; -struct hlsl_ir_jump *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type type, - struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + struct list *parameters, const struct hlsl_semantic *semantic, 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_jump *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type type, struct vkd3d_shader_location loc); struct hlsl_ir_load *hlsl_new_load(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, struct hlsl_ir_node *offset, - struct hlsl_type *type, struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; -struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; -struct hlsl_ir_store *hlsl_new_simple_store(struct hlsl_ctx *ctx, struct hlsl_ir_var *lhs, - struct hlsl_ir_node *rhs) DECLSPEC_HIDDEN; + struct hlsl_type *type, struct vkd3d_shader_location loc); +struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, struct vkd3d_shader_location loc); +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(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, struct hlsl_ir_node *offset, - struct hlsl_ir_node *rhs, unsigned int writemask, struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; -struct hlsl_type *hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name, struct list *fields) DECLSPEC_HIDDEN; + struct hlsl_ir_node *rhs, unsigned int writemask, struct vkd3d_shader_location loc); +struct hlsl_type *hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name, struct list *fields); struct hlsl_ir_swizzle *hlsl_new_swizzle(struct hlsl_ctx *ctx, DWORD s, unsigned int components, - struct hlsl_ir_node *val, struct vkd3d_shader_location *loc) DECLSPEC_HIDDEN; + struct hlsl_ir_node *val, struct vkd3d_shader_location *loc); struct hlsl_ir_var *hlsl_new_synthetic_var(struct hlsl_ctx *ctx, const char *name, struct hlsl_type *type, - const struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + const struct vkd3d_shader_location loc); struct hlsl_type *hlsl_new_type(struct hlsl_ctx *ctx, const char *name, enum hlsl_type_class type_class, - enum hlsl_base_type base_type, unsigned dimx, unsigned dimy) DECLSPEC_HIDDEN; + enum hlsl_base_type base_type, unsigned dimx, unsigned dimy); struct hlsl_ir_constant *hlsl_new_uint_constant(struct hlsl_ctx *ctx, unsigned int n, - const struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + 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, - struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + 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 hlsl_reg_reservation *reg_reservation) DECLSPEC_HIDDEN; + const struct hlsl_reg_reservation *reg_reservation); struct hlsl_ir_load *hlsl_new_var_load(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, - const struct vkd3d_shader_location loc) DECLSPEC_HIDDEN; + const struct vkd3d_shader_location loc);
-void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, enum vkd3d_shader_error error, - const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN; -void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, enum vkd3d_shader_error error, - const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN; -void hlsl_note(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, enum vkd3d_shader_log_level level, - const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN; +void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, + enum vkd3d_shader_error error, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5); +void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, + enum vkd3d_shader_error error, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5); +void hlsl_note(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, + enum vkd3d_shader_log_level level, const char *fmt, ...) VKD3D_PRINTF_FUNC(4, 5);
-void hlsl_push_scope(struct hlsl_ctx *ctx) DECLSPEC_HIDDEN; -void hlsl_pop_scope(struct hlsl_ctx *ctx) DECLSPEC_HIDDEN; +void hlsl_push_scope(struct hlsl_ctx *ctx); +void hlsl_pop_scope(struct hlsl_ctx *ctx);
-bool hlsl_scope_add_type(struct hlsl_scope *scope, struct hlsl_type *type) DECLSPEC_HIDDEN; +bool hlsl_scope_add_type(struct hlsl_scope *scope, struct hlsl_type *type);
struct hlsl_type *hlsl_type_clone(struct hlsl_ctx *ctx, struct hlsl_type *old, - unsigned int default_majority, unsigned int modifiers) DECLSPEC_HIDDEN; -unsigned int hlsl_type_component_count(struct hlsl_type *type) DECLSPEC_HIDDEN; -unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int offset) DECLSPEC_HIDDEN; -bool hlsl_type_is_void(const struct hlsl_type *type) DECLSPEC_HIDDEN; -bool hlsl_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2) DECLSPEC_HIDDEN; + unsigned int default_majority, unsigned int modifiers); +unsigned int hlsl_type_component_count(struct hlsl_type *type); +unsigned int hlsl_type_get_sm4_offset(const struct hlsl_type *type, unsigned int offset); +bool hlsl_type_is_void(const struct hlsl_type *type); +bool hlsl_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2);
-int hlsl_lexer_compile(struct hlsl_ctx *ctx, const struct vkd3d_shader_code *hlsl) DECLSPEC_HIDDEN; +int hlsl_lexer_compile(struct hlsl_ctx *ctx, const struct vkd3d_shader_code *hlsl);
#endif diff --git a/libs/vkd3d-shader/preproc.h b/libs/vkd3d-shader/preproc.h index 15d173a4..e1cb75e1 100644 --- a/libs/vkd3d-shader/preproc.h +++ b/libs/vkd3d-shader/preproc.h @@ -131,13 +131,13 @@ struct preproc_ctx };
bool preproc_add_macro(struct preproc_ctx *ctx, const struct vkd3d_shader_location *loc, char *name, char **arg_names, - size_t arg_count, const struct vkd3d_shader_location *body_loc, struct vkd3d_string_buffer *body) DECLSPEC_HIDDEN; -void preproc_close_include(struct preproc_ctx *ctx, const struct vkd3d_shader_code *code) DECLSPEC_HIDDEN; -struct preproc_macro *preproc_find_macro(struct preproc_ctx *ctx, const char *name) DECLSPEC_HIDDEN; -void preproc_free_macro(struct preproc_macro *macro) DECLSPEC_HIDDEN; -bool preproc_push_include(struct preproc_ctx *ctx, char *filename, const struct vkd3d_shader_code *code) DECLSPEC_HIDDEN; + size_t arg_count, const struct vkd3d_shader_location *body_loc, struct vkd3d_string_buffer *body); +void preproc_close_include(struct preproc_ctx *ctx, const struct vkd3d_shader_code *code); +struct preproc_macro *preproc_find_macro(struct preproc_ctx *ctx, const char *name); +void preproc_free_macro(struct preproc_macro *macro); +bool preproc_push_include(struct preproc_ctx *ctx, char *filename, const struct vkd3d_shader_code *code); void preproc_warning(struct preproc_ctx *ctx, const struct vkd3d_shader_location *loc, - enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN; + enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5);
static inline struct preproc_file *preproc_get_top_file(struct preproc_ctx *ctx) { diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 78312a14..884794c7 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -432,7 +432,7 @@ static int vkd3d_shader_validate_compile_info(const struct vkd3d_shader_compile_ return VKD3D_OK; }
-void vkd3d_shader_free_messages(char *messages) +VKD3D_API void vkd3d_shader_free_messages(char *messages) { TRACE("messages %p.\n", messages);
@@ -974,7 +974,7 @@ done: return ret; }
-int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char **messages) +VKD3D_API int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char **messages) { struct vkd3d_shader_message_context message_context; int ret; @@ -1080,7 +1080,7 @@ static int compile_hlsl(const struct vkd3d_shader_compile_info *compile_info, return ret; }
-int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, +VKD3D_API int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages) { struct vkd3d_shader_message_context message_context; @@ -1117,14 +1117,14 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, return ret; }
-void vkd3d_shader_free_scan_descriptor_info(struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info) +VKD3D_API void vkd3d_shader_free_scan_descriptor_info(struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info) { TRACE("scan_descriptor_info %p.\n", scan_descriptor_info);
vkd3d_free(scan_descriptor_info->descriptors); }
-void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *shader_code) +VKD3D_API void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *shader_code) { TRACE("shader_code %p.\n", shader_code);
@@ -1165,7 +1165,7 @@ static void vkd3d_shader_free_root_signature_v_1_1(struct vkd3d_shader_root_sign memset(root_signature, 0, sizeof(*root_signature)); }
-void vkd3d_shader_free_root_signature(struct vkd3d_shader_versioned_root_signature_desc *desc) +VKD3D_API void vkd3d_shader_free_root_signature(struct vkd3d_shader_versioned_root_signature_desc *desc) { TRACE("desc %p.\n", desc);
@@ -1186,7 +1186,7 @@ void vkd3d_shader_free_root_signature(struct vkd3d_shader_versioned_root_signatu desc->version = 0; }
-int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc, +VKD3D_API int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_signature *signature, char **messages) { struct vkd3d_shader_message_context message_context; @@ -1208,7 +1208,7 @@ int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc, return ret; }
-struct vkd3d_shader_signature_element *vkd3d_shader_find_signature_element( +VKD3D_API struct vkd3d_shader_signature_element *vkd3d_shader_find_signature_element( const struct vkd3d_shader_signature *signature, const char *semantic_name, unsigned int semantic_index, unsigned int stream_index) { @@ -1230,7 +1230,7 @@ struct vkd3d_shader_signature_element *vkd3d_shader_find_signature_element( return NULL; }
-void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature) +VKD3D_API void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature) { TRACE("signature %p.\n", signature);
@@ -1238,7 +1238,7 @@ void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature signature->elements = NULL; }
-const char *vkd3d_shader_get_version(unsigned int *major, unsigned int *minor) +VKD3D_API const char *vkd3d_shader_get_version(unsigned int *major, unsigned int *minor) { int x, y;
@@ -1256,7 +1256,7 @@ const char *vkd3d_shader_get_version(unsigned int *major, unsigned int *minor) return "vkd3d-shader " PACKAGE_VERSION VKD3D_VCS_ID; }
-const enum vkd3d_shader_source_type *vkd3d_shader_get_supported_source_types(unsigned int *count) +VKD3D_API const enum vkd3d_shader_source_type *vkd3d_shader_get_supported_source_types(unsigned int *count) { static const enum vkd3d_shader_source_type types[] = { @@ -1270,7 +1270,7 @@ const enum vkd3d_shader_source_type *vkd3d_shader_get_supported_source_types(uns return types; }
-const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types( +VKD3D_API const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types( enum vkd3d_shader_source_type source_type, unsigned int *count) { static const enum vkd3d_shader_target_type dxbc_tpf_types[] = @@ -1305,7 +1305,7 @@ const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types( } }
-int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info, +VKD3D_API int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages) { struct vkd3d_shader_message_context message_context; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index bd142297..1e21d4dc 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -855,20 +855,20 @@ static inline bool vkd3d_shader_register_is_output(const struct vkd3d_shader_reg return reg->type == VKD3DSPR_OUTPUT || reg->type == VKD3DSPR_COLOROUT; }
-void vkd3d_shader_trace(void *data) DECLSPEC_HIDDEN; +void vkd3d_shader_trace(void *data);
-const char *shader_get_type_prefix(enum vkd3d_shader_type type) DECLSPEC_HIDDEN; +const char *shader_get_type_prefix(enum vkd3d_shader_type type);
struct vkd3d_shader_message_context;
void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, - const struct vkd3d_shader_signature *output_signature, struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN; -void shader_sm4_free(void *data) DECLSPEC_HIDDEN; + const struct vkd3d_shader_signature *output_signature, struct vkd3d_shader_message_context *message_context); +void shader_sm4_free(void *data); void shader_sm4_read_header(void *data, const DWORD **ptr, - struct vkd3d_shader_version *shader_version) DECLSPEC_HIDDEN; + struct vkd3d_shader_version *shader_version); void shader_sm4_read_instruction(void *data, const DWORD **ptr, - struct vkd3d_shader_instruction *ins) DECLSPEC_HIDDEN; -bool shader_sm4_is_end(void *data, const DWORD **ptr) DECLSPEC_HIDDEN; + struct vkd3d_shader_instruction *ins); +bool shader_sm4_is_end(void *data, const DWORD **ptr);
struct vkd3d_string_buffer { @@ -884,20 +884,18 @@ struct vkd3d_string_buffer_cache };
enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data, - const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out) DECLSPEC_HIDDEN; -void vkd3d_string_buffer_cleanup(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN; -struct vkd3d_string_buffer *vkd3d_string_buffer_get(struct vkd3d_string_buffer_cache *list) DECLSPEC_HIDDEN; -void vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN; -void vkd3d_string_buffer_cache_cleanup(struct vkd3d_string_buffer_cache *list) DECLSPEC_HIDDEN; -void vkd3d_string_buffer_cache_init(struct vkd3d_string_buffer_cache *list) DECLSPEC_HIDDEN; -int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, - const char *format, ...) VKD3D_PRINTF_FUNC(2, 3) DECLSPEC_HIDDEN; -void vkd3d_string_buffer_release(struct vkd3d_string_buffer_cache *list, - struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN; + const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out); +void vkd3d_string_buffer_cleanup(struct vkd3d_string_buffer *buffer); +struct vkd3d_string_buffer *vkd3d_string_buffer_get(struct vkd3d_string_buffer_cache *list); +void vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer); +void vkd3d_string_buffer_cache_cleanup(struct vkd3d_string_buffer_cache *list); +void vkd3d_string_buffer_cache_init(struct vkd3d_string_buffer_cache *list); +int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, const char *format, ...) VKD3D_PRINTF_FUNC(2, 3); +void vkd3d_string_buffer_release(struct vkd3d_string_buffer_cache *list, struct vkd3d_string_buffer *buffer); #define vkd3d_string_buffer_trace(buffer) \ vkd3d_string_buffer_trace_(buffer, __FUNCTION__) -void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function) DECLSPEC_HIDDEN; -int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args) DECLSPEC_HIDDEN; +void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function); +int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args);
struct vkd3d_bytecode_buffer { @@ -906,8 +904,8 @@ struct vkd3d_bytecode_buffer int status; };
-size_t bytecode_put_bytes(struct vkd3d_bytecode_buffer *buffer, const void *bytes, size_t size) DECLSPEC_HIDDEN; -void set_u32(struct vkd3d_bytecode_buffer *buffer, size_t offset, uint32_t value) DECLSPEC_HIDDEN; +size_t bytecode_put_bytes(struct vkd3d_bytecode_buffer *buffer, const void *bytes, size_t size); +void set_u32(struct vkd3d_bytecode_buffer *buffer, size_t offset, uint32_t value);
static inline size_t put_u32(struct vkd3d_bytecode_buffer *buffer, uint32_t value) { @@ -941,53 +939,51 @@ struct vkd3d_shader_message_context struct vkd3d_string_buffer messages; };
-void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *context) DECLSPEC_HIDDEN; -bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context, - char **out) DECLSPEC_HIDDEN; +void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *context); +bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context, char **out); void vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context, - enum vkd3d_shader_log_level log_level) DECLSPEC_HIDDEN; + enum vkd3d_shader_log_level log_level); void vkd3d_shader_message_context_trace_messages_(const struct vkd3d_shader_message_context *context, - const char *function) DECLSPEC_HIDDEN; + const char *function); #define vkd3d_shader_message_context_trace_messages(context) \ vkd3d_shader_message_context_trace_messages_(context, __FUNCTION__) void vkd3d_shader_error(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, - enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN; + enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5); void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, - enum vkd3d_shader_error error, const char *format, va_list args) DECLSPEC_HIDDEN; + enum vkd3d_shader_error error, const char *format, va_list args); void vkd3d_shader_vnote(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, - enum vkd3d_shader_log_level level, const char *format, va_list args) DECLSPEC_HIDDEN; + enum vkd3d_shader_log_level level, const char *format, va_list args); void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, - enum vkd3d_shader_error error, const char *format, va_list args) DECLSPEC_HIDDEN; + enum vkd3d_shader_error error, const char *format, va_list args);
-void vkd3d_shader_dump_shader(enum vkd3d_shader_type type, const struct vkd3d_shader_code *shader) DECLSPEC_HIDDEN; +void vkd3d_shader_dump_shader(enum vkd3d_shader_type type, const struct vkd3d_shader_code *shader);
int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length, - struct vkd3d_shader_message_context *message_context, const char *source_name, - struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN; -void free_shader_desc(struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN; + struct vkd3d_shader_message_context *message_context, const char *source_name, struct vkd3d_shader_desc *desc); +void free_shader_desc(struct vkd3d_shader_desc *desc);
int shader_parse_input_signature(const void *dxbc, size_t dxbc_length, - struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_signature *signature) DECLSPEC_HIDDEN; + struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_signature *signature);
struct vkd3d_dxbc_compiler;
struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader_version *shader_version, const struct vkd3d_shader_desc *shader_desc, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info, - struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN; + struct vkd3d_shader_message_context *message_context); int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_instruction *instruction) DECLSPEC_HIDDEN; + const struct vkd3d_shader_instruction *instruction); int vkd3d_dxbc_compiler_generate_spirv(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *spirv) DECLSPEC_HIDDEN; -void vkd3d_dxbc_compiler_destroy(struct vkd3d_dxbc_compiler *compiler) DECLSPEC_HIDDEN; + const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *spirv); +void vkd3d_dxbc_compiler_destroy(struct vkd3d_dxbc_compiler *compiler);
-void vkd3d_compute_dxbc_checksum(const void *dxbc, size_t size, uint32_t checksum[4]) DECLSPEC_HIDDEN; +void vkd3d_compute_dxbc_checksum(const void *dxbc, size_t size, uint32_t checksum[4]);
int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info, - struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN; + struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context);
int hlsl_compile_shader(const struct vkd3d_shader_code *hlsl, const struct vkd3d_shader_compile_info *compile_info, - struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN; + struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context);
static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_type( enum vkd3d_data_type data_type) diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index 9c968cc6..48d3aa2a 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -21,14 +21,14 @@
VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG");
-HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug) +VKD3D_API HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug) { FIXME("iid %s, debug %p stub!\n", debugstr_guid(iid), debug);
return E_NOTIMPL; }
-HRESULT WINAPI D3D12CreateDeviceVKD3D(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_feature_level, +VKD3D_API HRESULT WINAPI D3D12CreateDeviceVKD3D(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device, enum vkd3d_api_version api_version) { struct vkd3d_optional_instance_extensions_info optional_extensions_info; @@ -85,13 +85,13 @@ HRESULT WINAPI D3D12CreateDeviceVKD3D(IUnknown *adapter, D3D_FEATURE_LEVEL minim return vkd3d_create_device(&device_create_info, iid, device); }
-HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, +VKD3D_API HRESULT WINAPI D3D12CreateDevice(IUnknown *adapter, D3D_FEATURE_LEVEL minimum_feature_level, REFIID iid, void **device) { return D3D12CreateDeviceVKD3D(adapter, minimum_feature_level, iid, device, VKD3D_API_VERSION_1_0); }
-HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T data_size, +VKD3D_API HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T data_size, REFIID iid, void **deserializer) { TRACE("data %p, data_size %lu, iid %s, deserializer %p.\n", @@ -100,7 +100,7 @@ HRESULT WINAPI D3D12CreateRootSignatureDeserializer(const void *data, SIZE_T dat return vkd3d_create_root_signature_deserializer(data, data_size, iid, deserializer); }
-HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data, SIZE_T data_size, +VKD3D_API HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data, SIZE_T data_size, REFIID iid,void **deserializer) { TRACE("data %p, data_size %lu, iid %s, deserializer %p.\n", @@ -109,7 +109,7 @@ HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer(const void *data, S return vkd3d_create_versioned_root_signature_deserializer(data, data_size, iid, deserializer); }
-HRESULT WINAPI D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *desc, +VKD3D_API HRESULT WINAPI D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *desc, D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob) { TRACE("desc %p, version %#x, blob %p, error_blob %p.\n", desc, version, blob, error_blob); @@ -117,7 +117,7 @@ HRESULT WINAPI D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *desc return vkd3d_serialize_root_signature(desc, version, blob, error_blob); }
-HRESULT WINAPI D3D12SerializeVersionedRootSignature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc, +VKD3D_API HRESULT WINAPI D3D12SerializeVersionedRootSignature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc, ID3DBlob **blob, ID3DBlob **error_blob) { TRACE("desc %p, blob %p, error_blob %p.\n", desc, blob, error_blob); @@ -150,7 +150,7 @@ static void close_include(const struct vkd3d_shader_code *code, void *context) ID3DInclude_Close(iface, code->code); }
-HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, +VKD3D_API HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entry_point, const char *profile, UINT flags, UINT effect_flags, UINT secondary_flags, const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader_blob, @@ -244,7 +244,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen return hresult_from_vkd3d_result(ret); }
-HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, +VKD3D_API HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entrypoint, const char *profile, UINT flags, UINT effect_flags, ID3DBlob **shader, ID3DBlob **error_messages) { @@ -257,7 +257,7 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena effect_flags, 0, NULL, 0, shader, error_messages); }
-HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, +VKD3D_API HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *macros, ID3DInclude *include, ID3DBlob **preprocessed_blob, ID3DBlob **messages_blob) { @@ -327,7 +327,7 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename }
/* Events */ -HANDLE vkd3d_create_event(void) +VKD3D_API HANDLE vkd3d_create_event(void) { struct vkd3d_event *event; int rc; @@ -358,7 +358,7 @@ HANDLE vkd3d_create_event(void) return event; }
-unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) +VKD3D_API unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) { struct vkd3d_event *impl = event; int rc; @@ -401,7 +401,7 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) return VKD3D_WAIT_FAILED; }
-HRESULT vkd3d_signal_event(HANDLE event) +VKD3D_API HRESULT vkd3d_signal_event(HANDLE event) { struct vkd3d_event *impl = event; int rc; @@ -420,7 +420,7 @@ HRESULT vkd3d_signal_event(HANDLE event) return S_OK; }
-void vkd3d_destroy_event(HANDLE event) +VKD3D_API void vkd3d_destroy_event(HANDLE event) { struct vkd3d_event *impl = event; int rc; @@ -434,7 +434,7 @@ void vkd3d_destroy_event(HANDLE event) vkd3d_free(impl); }
-HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob) +VKD3D_API HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3D10Blob **blob) { HRESULT hr; void *data; diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index bf80a9d0..1eeaea16 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6249,21 +6249,21 @@ HRESULT d3d12_command_queue_create(struct d3d12_device *device, return S_OK; }
-uint32_t vkd3d_get_vk_queue_family_index(ID3D12CommandQueue *queue) +VKD3D_API uint32_t vkd3d_get_vk_queue_family_index(ID3D12CommandQueue *queue) { struct d3d12_command_queue *d3d12_queue = impl_from_ID3D12CommandQueue(queue);
return d3d12_queue->vkd3d_queue->vk_family_index; }
-VkQueue vkd3d_acquire_vk_queue(ID3D12CommandQueue *queue) +VKD3D_API VkQueue vkd3d_acquire_vk_queue(ID3D12CommandQueue *queue) { struct d3d12_command_queue *d3d12_queue = impl_from_ID3D12CommandQueue(queue);
return vkd3d_queue_acquire(d3d12_queue->vkd3d_queue); }
-void vkd3d_release_vk_queue(ID3D12CommandQueue *queue) +VKD3D_API void vkd3d_release_vk_queue(ID3D12CommandQueue *queue) { struct d3d12_command_queue *d3d12_queue = impl_from_ID3D12CommandQueue(queue);
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 0fadb521..476de1d0 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -589,7 +589,7 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance, return S_OK; }
-HRESULT vkd3d_create_instance(const struct vkd3d_instance_create_info *create_info, +VKD3D_API HRESULT vkd3d_create_instance(const struct vkd3d_instance_create_info *create_info, struct vkd3d_instance **instance) { struct vkd3d_instance *object; @@ -637,7 +637,7 @@ static void vkd3d_destroy_instance(struct vkd3d_instance *instance) vkd3d_free(instance); }
-ULONG vkd3d_instance_incref(struct vkd3d_instance *instance) +VKD3D_API ULONG vkd3d_instance_incref(struct vkd3d_instance *instance) { ULONG refcount = InterlockedIncrement(&instance->refcount);
@@ -646,7 +646,7 @@ ULONG vkd3d_instance_incref(struct vkd3d_instance *instance) return refcount; }
-ULONG vkd3d_instance_decref(struct vkd3d_instance *instance) +VKD3D_API ULONG vkd3d_instance_decref(struct vkd3d_instance *instance) { ULONG refcount = InterlockedDecrement(&instance->refcount);
@@ -658,7 +658,7 @@ ULONG vkd3d_instance_decref(struct vkd3d_instance *instance) return refcount; }
-VkInstance vkd3d_instance_get_vk_instance(struct vkd3d_instance *instance) +VKD3D_API VkInstance vkd3d_instance_get_vk_instance(struct vkd3d_instance *instance) { return instance->vk_instance; } @@ -3840,28 +3840,28 @@ HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_ha return hr; }
-IUnknown *vkd3d_get_device_parent(ID3D12Device *device) +VKD3D_API IUnknown *vkd3d_get_device_parent(ID3D12Device *device) { struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
return d3d12_device->parent; }
-VkDevice vkd3d_get_vk_device(ID3D12Device *device) +VKD3D_API VkDevice vkd3d_get_vk_device(ID3D12Device *device) { struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
return d3d12_device->vk_device; }
-VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device) +VKD3D_API VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device) { struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
return d3d12_device->vk_physical_device; }
-struct vkd3d_instance *vkd3d_instance_from_device(ID3D12Device *device) +VKD3D_API struct vkd3d_instance *vkd3d_instance_from_device(ID3D12Device *device) { struct d3d12_device *d3d12_device = impl_from_ID3D12Device(device);
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 1ca23a90..681bd878 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1996,7 +1996,7 @@ HRESULT d3d12_reserved_resource_create(struct d3d12_device *device, return S_OK; }
-HRESULT vkd3d_create_image_resource(ID3D12Device *device, +VKD3D_API HRESULT vkd3d_create_image_resource(ID3D12Device *device, const struct vkd3d_image_resource_create_info *create_info, ID3D12Resource **resource) { struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device(device); @@ -2048,13 +2048,13 @@ HRESULT vkd3d_create_image_resource(ID3D12Device *device, return S_OK; }
-ULONG vkd3d_resource_incref(ID3D12Resource *resource) +VKD3D_API ULONG vkd3d_resource_incref(ID3D12Resource *resource) { TRACE("resource %p.\n", resource); return d3d12_resource_incref(impl_from_ID3D12Resource(resource)); }
-ULONG vkd3d_resource_decref(ID3D12Resource *resource) +VKD3D_API ULONG vkd3d_resource_decref(ID3D12Resource *resource) { TRACE("resource %p.\n", resource); return d3d12_resource_decref(impl_from_ID3D12Resource(resource)); diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c index ec2b4b39..450afc14 100644 --- a/libs/vkd3d/utils.c +++ b/libs/vkd3d/utils.c @@ -506,7 +506,7 @@ void vkd3d_format_copy_data(const struct vkd3d_format *format, const uint8_t *sr } }
-VkFormat vkd3d_get_vk_format(DXGI_FORMAT format) +VKD3D_API VkFormat vkd3d_get_vk_format(DXGI_FORMAT format) { const struct vkd3d_format *vkd3d_format;
@@ -516,7 +516,7 @@ VkFormat vkd3d_get_vk_format(DXGI_FORMAT format) return vkd3d_format->vk_format; }
-DXGI_FORMAT vkd3d_get_dxgi_format(VkFormat format) +VKD3D_API DXGI_FORMAT vkd3d_get_dxgi_format(VkFormat format) { DXGI_FORMAT dxgi_format; VkFormat vk_format; diff --git a/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/vkd3d_main.c index 21d998bf..df32fd5f 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -20,7 +20,7 @@
VKD3D_DEBUG_ENV_NAME("VKD3D_DEBUG");
-HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info, +VKD3D_API HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info, REFIID iid, void **device) { struct vkd3d_instance *instance; @@ -215,7 +215,7 @@ static HRESULT d3d12_root_signature_deserializer_init(struct d3d12_root_signatur return S_OK; }
-HRESULT vkd3d_create_root_signature_deserializer(const void *data, SIZE_T data_size, +VKD3D_API HRESULT vkd3d_create_root_signature_deserializer(const void *data, SIZE_T data_size, REFIID iid, void **deserializer) { struct vkd3d_shader_code dxbc = {data, data_size}; @@ -399,7 +399,7 @@ static HRESULT d3d12_versioned_root_signature_deserializer_init(struct d3d12_ver return S_OK; }
-HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZE_T data_size, +VKD3D_API HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZE_T data_size, REFIID iid, void **deserializer) { struct d3d12_versioned_root_signature_deserializer *object; @@ -422,7 +422,7 @@ HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZ &IID_ID3D12VersionedRootSignatureDeserializer, iid, deserializer); }
-HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, +VKD3D_API HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob) { struct vkd3d_shader_versioned_root_signature_desc vkd3d_desc; @@ -470,7 +470,7 @@ HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, return hr; }
-HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc, +VKD3D_API HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *desc, ID3DBlob **blob, ID3DBlob **error_blob) { const struct vkd3d_shader_versioned_root_signature_desc *vkd3d_desc; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index deb8ee99..0fa51a2f 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -84,9 +84,9 @@ struct vkd3d_vk_device_procs }; #undef DECLARE_VK_PFN
-HRESULT hresult_from_errno(int rc) DECLSPEC_HIDDEN; -HRESULT hresult_from_vk_result(VkResult vr) DECLSPEC_HIDDEN; -HRESULT hresult_from_vkd3d_result(int vkd3d_result) DECLSPEC_HIDDEN; +HRESULT hresult_from_errno(int rc); +HRESULT hresult_from_vk_result(VkResult vr); +HRESULT hresult_from_vkd3d_result(int vkd3d_result);
struct vkd3d_vulkan_info { @@ -163,8 +163,8 @@ union vkd3d_thread_handle };
HRESULT vkd3d_create_thread(struct vkd3d_instance *instance, - PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN; -HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread) DECLSPEC_HIDDEN; + PFN_vkd3d_thread thread_main, void *data, union vkd3d_thread_handle *thread); +HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_handle *thread);
struct vkd3d_waiting_fence { @@ -200,10 +200,8 @@ struct vkd3d_fence_worker struct d3d12_device *device; };
-HRESULT vkd3d_fence_worker_start(struct vkd3d_fence_worker *worker, - struct d3d12_device *device) DECLSPEC_HIDDEN; -HRESULT vkd3d_fence_worker_stop(struct vkd3d_fence_worker *worker, - struct d3d12_device *device) DECLSPEC_HIDDEN; +HRESULT vkd3d_fence_worker_start(struct vkd3d_fence_worker *worker, struct d3d12_device *device); +HRESULT vkd3d_fence_worker_stop(struct vkd3d_fence_worker *worker, struct d3d12_device *device);
struct vkd3d_gpu_va_allocation { @@ -232,11 +230,9 @@ struct vkd3d_gpu_va_allocator };
D3D12_GPU_VIRTUAL_ADDRESS vkd3d_gpu_va_allocator_allocate(struct vkd3d_gpu_va_allocator *allocator, - size_t alignment, size_t size, void *ptr) DECLSPEC_HIDDEN; -void *vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, - D3D12_GPU_VIRTUAL_ADDRESS address) DECLSPEC_HIDDEN; -void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, - D3D12_GPU_VIRTUAL_ADDRESS address) DECLSPEC_HIDDEN; + size_t alignment, size_t size, void *ptr); +void *vkd3d_gpu_va_allocator_dereference(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address); +void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, D3D12_GPU_VIRTUAL_ADDRESS address);
struct vkd3d_render_pass_key { @@ -258,12 +254,10 @@ struct vkd3d_render_pass_cache size_t render_passes_size; };
-void vkd3d_render_pass_cache_cleanup(struct vkd3d_render_pass_cache *cache, - struct d3d12_device *device) DECLSPEC_HIDDEN; -HRESULT vkd3d_render_pass_cache_find(struct vkd3d_render_pass_cache *cache, - struct d3d12_device *device, const struct vkd3d_render_pass_key *key, - VkRenderPass *vk_render_pass) DECLSPEC_HIDDEN; -void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache) DECLSPEC_HIDDEN; +void vkd3d_render_pass_cache_cleanup(struct vkd3d_render_pass_cache *cache, struct d3d12_device *device); +HRESULT vkd3d_render_pass_cache_find(struct vkd3d_render_pass_cache *cache, struct d3d12_device *device, + const struct vkd3d_render_pass_key *key, VkRenderPass *vk_render_pass); +void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache);
struct vkd3d_private_store { @@ -318,12 +312,10 @@ static inline void vkd3d_private_store_destroy(struct vkd3d_private_store *store pthread_mutex_destroy(&store->mutex); }
-HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, - const GUID *tag, unsigned int *out_size, void *out) DECLSPEC_HIDDEN; +HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, const GUID *tag, unsigned int *out_size, void *out); HRESULT vkd3d_set_private_data(struct vkd3d_private_store *store, - const GUID *tag, unsigned int data_size, const void *data) DECLSPEC_HIDDEN; -HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store, - const GUID *tag, const IUnknown *object) DECLSPEC_HIDDEN; + const GUID *tag, unsigned int data_size, const void *data); +HRESULT vkd3d_set_private_data_interface(struct vkd3d_private_store *store, const GUID *tag, const IUnknown *object);
struct vkd3d_signaled_semaphore { @@ -363,8 +355,8 @@ struct d3d12_fence struct vkd3d_private_store private_store; };
-HRESULT d3d12_fence_create(struct d3d12_device *device, - uint64_t initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence) DECLSPEC_HIDDEN; +HRESULT d3d12_fence_create(struct d3d12_device *device, uint64_t initial_value, + D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence);
/* ID3D12Heap */ struct d3d12_heap @@ -388,8 +380,8 @@ struct d3d12_heap };
HRESULT d3d12_heap_create(struct d3d12_device *device, const D3D12_HEAP_DESC *desc, - const struct d3d12_resource *resource, struct d3d12_heap **heap) DECLSPEC_HIDDEN; -struct d3d12_heap *unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface) DECLSPEC_HIDDEN; + const struct d3d12_resource *resource, struct d3d12_heap **heap); +struct d3d12_heap *unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface);
#define VKD3D_RESOURCE_PUBLIC_FLAGS \ (VKD3D_RESOURCE_INITIAL_STATE_TRANSITION | VKD3D_RESOURCE_PRESENT_STATE_TRANSITION) @@ -437,29 +429,29 @@ static inline bool d3d12_resource_is_texture(const struct d3d12_resource *resour return resource->desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER; }
-bool d3d12_resource_is_cpu_accessible(const struct d3d12_resource *resource) DECLSPEC_HIDDEN; -HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d12_device *device) DECLSPEC_HIDDEN; +bool d3d12_resource_is_cpu_accessible(const struct d3d12_resource *resource); +HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d12_device *device);
HRESULT d3d12_committed_resource_create(struct d3d12_device *device, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, - const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource) DECLSPEC_HIDDEN; + const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource); HRESULT d3d12_placed_resource_create(struct d3d12_device *device, struct d3d12_heap *heap, uint64_t heap_offset, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, - const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource) DECLSPEC_HIDDEN; + const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource); HRESULT d3d12_reserved_resource_create(struct d3d12_device *device, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, - const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource) DECLSPEC_HIDDEN; -struct d3d12_resource *unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface) DECLSPEC_HIDDEN; + const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource); +struct d3d12_resource *unsafe_impl_from_ID3D12Resource(ID3D12Resource *iface);
HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_buffer, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, - VkDeviceMemory *vk_memory, uint32_t *vk_memory_type, VkDeviceSize *vk_memory_size) DECLSPEC_HIDDEN; + VkDeviceMemory *vk_memory, uint32_t *vk_memory_type, VkDeviceSize *vk_memory_size); HRESULT vkd3d_create_buffer(struct d3d12_device *device, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, - const D3D12_RESOURCE_DESC *desc, VkBuffer *vk_buffer) DECLSPEC_HIDDEN; + const D3D12_RESOURCE_DESC *desc, VkBuffer *vk_buffer); HRESULT vkd3d_get_image_allocation_info(struct d3d12_device *device, - const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_ALLOCATION_INFO *allocation_info) DECLSPEC_HIDDEN; + const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_ALLOCATION_INFO *allocation_info);
enum vkd3d_view_type { @@ -497,8 +489,8 @@ struct vkd3d_view } info; };
-void vkd3d_view_decref(struct vkd3d_view *view, struct d3d12_device *device) DECLSPEC_HIDDEN; -void vkd3d_view_incref(struct vkd3d_view *view) DECLSPEC_HIDDEN; +void vkd3d_view_decref(struct vkd3d_view *view, struct d3d12_device *device); +void vkd3d_view_incref(struct vkd3d_view *view);
struct vkd3d_texture_view_desc { @@ -513,9 +505,9 @@ struct vkd3d_texture_view_desc };
bool vkd3d_create_buffer_view(struct d3d12_device *device, VkBuffer vk_buffer, const struct vkd3d_format *format, - VkDeviceSize offset, VkDeviceSize size, struct vkd3d_view **view) DECLSPEC_HIDDEN; + VkDeviceSize offset, VkDeviceSize size, struct vkd3d_view **view); bool vkd3d_create_texture_view(struct d3d12_device *device, VkImage vk_image, - const struct vkd3d_texture_view_desc *desc, struct vkd3d_view **view) DECLSPEC_HIDDEN; + const struct vkd3d_texture_view_desc *desc, struct vkd3d_view **view);
struct d3d12_desc { @@ -538,25 +530,22 @@ static inline struct d3d12_desc *d3d12_desc_from_gpu_handle(D3D12_GPU_DESCRIPTOR return (struct d3d12_desc *)(intptr_t)gpu_handle.ptr; }
-void d3d12_desc_copy(struct d3d12_desc *dst, const struct d3d12_desc *src, - struct d3d12_device *device) DECLSPEC_HIDDEN; +void d3d12_desc_copy(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device); void d3d12_desc_create_cbv(struct d3d12_desc *descriptor, - struct d3d12_device *device, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc) DECLSPEC_HIDDEN; + struct d3d12_device *device, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc); void d3d12_desc_create_srv(struct d3d12_desc *descriptor, struct d3d12_device *device, struct d3d12_resource *resource, - const D3D12_SHADER_RESOURCE_VIEW_DESC *desc) DECLSPEC_HIDDEN; + const D3D12_SHADER_RESOURCE_VIEW_DESC *desc); void d3d12_desc_create_uav(struct d3d12_desc *descriptor, struct d3d12_device *device, struct d3d12_resource *resource, struct d3d12_resource *counter_resource, - const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc) DECLSPEC_HIDDEN; -void d3d12_desc_create_sampler(struct d3d12_desc *sampler, - struct d3d12_device *device, const D3D12_SAMPLER_DESC *desc) DECLSPEC_HIDDEN; -void d3d12_desc_write_atomic(struct d3d12_desc *dst, const struct d3d12_desc *src, - struct d3d12_device *device) DECLSPEC_HIDDEN; + const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc); +void d3d12_desc_create_sampler(struct d3d12_desc *sampler, struct d3d12_device *device, const D3D12_SAMPLER_DESC *desc); +void d3d12_desc_write_atomic(struct d3d12_desc *dst, const struct d3d12_desc *src, struct d3d12_device *device);
bool vkd3d_create_raw_buffer_view(struct d3d12_device *device, - D3D12_GPU_VIRTUAL_ADDRESS gpu_address, VkBufferView *vk_buffer_view) DECLSPEC_HIDDEN; + D3D12_GPU_VIRTUAL_ADDRESS gpu_address, VkBufferView *vk_buffer_view); HRESULT vkd3d_create_static_sampler(struct d3d12_device *device, - const D3D12_STATIC_SAMPLER_DESC *desc, VkSampler *vk_sampler) DECLSPEC_HIDDEN; + const D3D12_STATIC_SAMPLER_DESC *desc, VkSampler *vk_sampler);
struct d3d12_rtv_desc { @@ -576,7 +565,7 @@ static inline struct d3d12_rtv_desc *d3d12_rtv_desc_from_cpu_handle(D3D12_CPU_DE }
void d3d12_rtv_desc_create_rtv(struct d3d12_rtv_desc *rtv_desc, struct d3d12_device *device, - struct d3d12_resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc) DECLSPEC_HIDDEN; + struct d3d12_resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc);
struct d3d12_dsv_desc { @@ -596,7 +585,7 @@ static inline struct d3d12_dsv_desc *d3d12_dsv_desc_from_cpu_handle(D3D12_CPU_DE }
void d3d12_dsv_desc_create_dsv(struct d3d12_dsv_desc *dsv_desc, struct d3d12_device *device, - struct d3d12_resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc) DECLSPEC_HIDDEN; + struct d3d12_resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc);
/* ID3D12DescriptorHeap */ struct d3d12_descriptor_heap @@ -614,7 +603,7 @@ struct d3d12_descriptor_heap };
HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device, - const D3D12_DESCRIPTOR_HEAP_DESC *desc, struct d3d12_descriptor_heap **descriptor_heap) DECLSPEC_HIDDEN; + const D3D12_DESCRIPTOR_HEAP_DESC *desc, struct d3d12_descriptor_heap **descriptor_heap);
/* ID3D12QueryHeap */ struct d3d12_query_heap @@ -631,9 +620,9 @@ struct d3d12_query_heap uint64_t availability_mask[]; };
-HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_HEAP_DESC *desc, - struct d3d12_query_heap **heap) DECLSPEC_HIDDEN; -struct d3d12_query_heap *unsafe_impl_from_ID3D12QueryHeap(ID3D12QueryHeap *iface) DECLSPEC_HIDDEN; +HRESULT d3d12_query_heap_create(struct d3d12_device *device, + const D3D12_QUERY_HEAP_DESC *desc, struct d3d12_query_heap **heap); +struct d3d12_query_heap *unsafe_impl_from_ID3D12QueryHeap(ID3D12QueryHeap *iface);
/* A Vulkan query has to be issued at least one time before the result is * available. In D3D12 it is legal to get query reults for not issued queries. @@ -734,11 +723,11 @@ struct d3d12_root_signature };
HRESULT d3d12_root_signature_create(struct d3d12_device *device, const void *bytecode, - size_t bytecode_length, struct d3d12_root_signature **root_signature) DECLSPEC_HIDDEN; -struct d3d12_root_signature *unsafe_impl_from_ID3D12RootSignature(ID3D12RootSignature *iface) DECLSPEC_HIDDEN; + size_t bytecode_length, struct d3d12_root_signature **root_signature); +struct d3d12_root_signature *unsafe_impl_from_ID3D12RootSignature(ID3D12RootSignature *iface);
int vkd3d_parse_root_signature_v_1_0(const struct vkd3d_shader_code *dxbc, - struct vkd3d_shader_versioned_root_signature_desc *desc) DECLSPEC_HIDDEN; + struct vkd3d_shader_versioned_root_signature_desc *desc);
struct d3d12_graphics_pipeline_state { @@ -837,13 +826,12 @@ static inline bool d3d12_pipeline_state_has_unknown_dsv_format(struct d3d12_pipe }
HRESULT d3d12_pipeline_state_create_compute(struct d3d12_device *device, - const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state) DECLSPEC_HIDDEN; + const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state); HRESULT d3d12_pipeline_state_create_graphics(struct d3d12_device *device, - const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state) DECLSPEC_HIDDEN; + const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state); VkPipeline d3d12_pipeline_state_get_or_create_pipeline(struct d3d12_pipeline_state *state, - D3D12_PRIMITIVE_TOPOLOGY topology, const uint32_t *strides, VkFormat dsv_format, - VkRenderPass *vk_render_pass) DECLSPEC_HIDDEN; -struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface) DECLSPEC_HIDDEN; + D3D12_PRIMITIVE_TOPOLOGY topology, const uint32_t *strides, VkFormat dsv_format, VkRenderPass *vk_render_pass); +struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface);
struct vkd3d_buffer { @@ -903,7 +891,7 @@ struct d3d12_command_allocator };
HRESULT d3d12_command_allocator_create(struct d3d12_device *device, - D3D12_COMMAND_LIST_TYPE type, struct d3d12_command_allocator **allocator) DECLSPEC_HIDDEN; + D3D12_COMMAND_LIST_TYPE type, struct d3d12_command_allocator **allocator);
struct vkd3d_push_descriptor { @@ -995,7 +983,7 @@ struct d3d12_command_list
HRESULT d3d12_command_list_create(struct d3d12_device *device, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *allocator_iface, - ID3D12PipelineState *initial_pipeline_state, struct d3d12_command_list **list) DECLSPEC_HIDDEN; + ID3D12PipelineState *initial_pipeline_state, struct d3d12_command_list **list);
struct vkd3d_queue { @@ -1022,12 +1010,11 @@ struct vkd3d_queue VkSemaphore old_vk_semaphores[VKD3D_MAX_VK_SYNC_OBJECTS]; };
-VkQueue vkd3d_queue_acquire(struct vkd3d_queue *queue) DECLSPEC_HIDDEN; -HRESULT vkd3d_queue_create(struct d3d12_device *device, - uint32_t family_index, const VkQueueFamilyProperties *properties, - struct vkd3d_queue **queue) DECLSPEC_HIDDEN; -void vkd3d_queue_destroy(struct vkd3d_queue *queue, struct d3d12_device *device) DECLSPEC_HIDDEN; -void vkd3d_queue_release(struct vkd3d_queue *queue) DECLSPEC_HIDDEN; +VkQueue vkd3d_queue_acquire(struct vkd3d_queue *queue); +HRESULT vkd3d_queue_create(struct d3d12_device *device, uint32_t family_index, + const VkQueueFamilyProperties *properties, struct vkd3d_queue **queue); +void vkd3d_queue_destroy(struct vkd3d_queue *queue, struct d3d12_device *device); +void vkd3d_queue_release(struct vkd3d_queue *queue);
/* ID3D12CommandQueue */ struct d3d12_command_queue @@ -1048,7 +1035,7 @@ struct d3d12_command_queue };
HRESULT d3d12_command_queue_create(struct d3d12_device *device, - const D3D12_COMMAND_QUEUE_DESC *desc, struct d3d12_command_queue **queue) DECLSPEC_HIDDEN; + const D3D12_COMMAND_QUEUE_DESC *desc, struct d3d12_command_queue **queue);
/* ID3D12CommandSignature */ struct d3d12_command_signature @@ -1063,9 +1050,9 @@ struct d3d12_command_signature struct vkd3d_private_store private_store; };
-HRESULT d3d12_command_signature_create(struct d3d12_device *device, const D3D12_COMMAND_SIGNATURE_DESC *desc, - struct d3d12_command_signature **signature) DECLSPEC_HIDDEN; -struct d3d12_command_signature *unsafe_impl_from_ID3D12CommandSignature(ID3D12CommandSignature *iface) DECLSPEC_HIDDEN; +HRESULT d3d12_command_signature_create(struct d3d12_device *device, + const D3D12_COMMAND_SIGNATURE_DESC *desc, struct d3d12_command_signature **signature); +struct d3d12_command_signature *unsafe_impl_from_ID3D12CommandSignature(ID3D12CommandSignature *iface);
/* NULL resources */ struct vkd3d_null_resources @@ -1083,10 +1070,8 @@ struct vkd3d_null_resources VkDeviceMemory vk_2d_storage_image_memory; };
-HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources, - struct d3d12_device *device) DECLSPEC_HIDDEN; -void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, - struct d3d12_device *device) DECLSPEC_HIDDEN; +HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device); +void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, struct d3d12_device *device);
struct vkd3d_format_compatibility_list { @@ -1124,8 +1109,8 @@ struct vkd3d_uav_clear_state struct vkd3d_uav_clear_pipelines pipelines_uint; };
-HRESULT vkd3d_uav_clear_state_init(struct vkd3d_uav_clear_state *state, struct d3d12_device *device) DECLSPEC_HIDDEN; -void vkd3d_uav_clear_state_cleanup(struct vkd3d_uav_clear_state *state, struct d3d12_device *device) DECLSPEC_HIDDEN; +HRESULT vkd3d_uav_clear_state_init(struct vkd3d_uav_clear_state *state, struct d3d12_device *device); +void vkd3d_uav_clear_state_cleanup(struct vkd3d_uav_clear_state *state, struct d3d12_device *device);
/* ID3D12Device */ struct d3d12_device @@ -1181,13 +1166,12 @@ struct d3d12_device };
HRESULT d3d12_device_create(struct vkd3d_instance *instance, - const struct vkd3d_device_create_info *create_info, struct d3d12_device **device) DECLSPEC_HIDDEN; -struct vkd3d_queue *d3d12_device_get_vkd3d_queue(struct d3d12_device *device, - D3D12_COMMAND_LIST_TYPE type) DECLSPEC_HIDDEN; -bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent) DECLSPEC_HIDDEN; + const struct vkd3d_device_create_info *create_info, struct d3d12_device **device); +struct vkd3d_queue *d3d12_device_get_vkd3d_queue(struct d3d12_device *device, D3D12_COMMAND_LIST_TYPE type); +bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent); void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason, - const char *message, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN; -struct d3d12_device *unsafe_impl_from_ID3D12Device(ID3D12Device *iface) DECLSPEC_HIDDEN; + const char *message, ...) VKD3D_PRINTF_FUNC(3, 4); +struct d3d12_device *unsafe_impl_from_ID3D12Device(ID3D12Device *iface);
static inline HRESULT d3d12_device_query_interface(struct d3d12_device *device, REFIID iid, void **object) { @@ -1262,15 +1246,14 @@ static inline bool vkd3d_format_is_compressed(const struct vkd3d_format *format)
void vkd3d_format_copy_data(const struct vkd3d_format *format, const uint8_t *src, unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch, - unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d) DECLSPEC_HIDDEN; + unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d);
const struct vkd3d_format *vkd3d_get_format(const struct d3d12_device *device, - DXGI_FORMAT dxgi_format, bool depth_stencil) DECLSPEC_HIDDEN; -const struct vkd3d_format *vkd3d_find_uint_format(const struct d3d12_device *device, - DXGI_FORMAT dxgi_format) DECLSPEC_HIDDEN; + DXGI_FORMAT dxgi_format, bool depth_stencil); +const struct vkd3d_format *vkd3d_find_uint_format(const struct d3d12_device *device, DXGI_FORMAT dxgi_format);
-HRESULT vkd3d_init_format_info(struct d3d12_device *device) DECLSPEC_HIDDEN; -void vkd3d_cleanup_format_info(struct d3d12_device *device) DECLSPEC_HIDDEN; +HRESULT vkd3d_init_format_info(struct d3d12_device *device); +void vkd3d_cleanup_format_info(struct d3d12_device *device);
static inline const struct vkd3d_format *vkd3d_format_from_d3d12_resource_desc( const struct d3d12_device *device, const D3D12_RESOURCE_DESC *desc, DXGI_FORMAT view_format) @@ -1318,24 +1301,23 @@ static inline unsigned int vkd3d_compute_workgroup_count(unsigned int thread_cou return (thread_count + workgroup_size - 1) / workgroup_size; }
-VkCompareOp vk_compare_op_from_d3d12(D3D12_COMPARISON_FUNC op) DECLSPEC_HIDDEN; -VkSampleCountFlagBits vk_samples_from_dxgi_sample_desc(const DXGI_SAMPLE_DESC *desc) DECLSPEC_HIDDEN; -VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count) DECLSPEC_HIDDEN; +VkCompareOp vk_compare_op_from_d3d12(D3D12_COMPARISON_FUNC op); +VkSampleCountFlagBits vk_samples_from_dxgi_sample_desc(const DXGI_SAMPLE_DESC *desc); +VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count);
-bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level) DECLSPEC_HIDDEN; +bool is_valid_feature_level(D3D_FEATURE_LEVEL feature_level);
-bool is_valid_resource_state(D3D12_RESOURCE_STATES state) DECLSPEC_HIDDEN; -bool is_write_resource_state(D3D12_RESOURCE_STATES state) DECLSPEC_HIDDEN; +bool is_valid_resource_state(D3D12_RESOURCE_STATES state); +bool is_write_resource_state(D3D12_RESOURCE_STATES state);
-HRESULT return_interface(void *iface, REFIID iface_iid, - REFIID requested_iid, void **object) DECLSPEC_HIDDEN; +HRESULT return_interface(void *iface, REFIID iface_iid, REFIID requested_iid, void **object);
-const char *debug_d3d12_box(const D3D12_BOX *box) DECLSPEC_HIDDEN; -const char *debug_d3d12_shader_component_mapping(unsigned int mapping) DECLSPEC_HIDDEN; -const char *debug_vk_extent_3d(VkExtent3D extent) DECLSPEC_HIDDEN; -const char *debug_vk_memory_heap_flags(VkMemoryHeapFlags flags) DECLSPEC_HIDDEN; -const char *debug_vk_memory_property_flags(VkMemoryPropertyFlags flags) DECLSPEC_HIDDEN; -const char *debug_vk_queue_flags(VkQueueFlags flags) DECLSPEC_HIDDEN; +const char *debug_d3d12_box(const D3D12_BOX *box); +const char *debug_d3d12_shader_component_mapping(unsigned int mapping); +const char *debug_vk_extent_3d(VkExtent3D extent); +const char *debug_vk_memory_heap_flags(VkMemoryHeapFlags flags); +const char *debug_vk_memory_property_flags(VkMemoryPropertyFlags flags); +const char *debug_vk_queue_flags(VkQueueFlags flags);
static inline void debug_ignored_node_mask(unsigned int mask) { @@ -1344,15 +1326,15 @@ static inline void debug_ignored_node_mask(unsigned int mask) }
HRESULT vkd3d_load_vk_global_procs(struct vkd3d_vk_global_procs *procs, - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr) DECLSPEC_HIDDEN; + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr); HRESULT vkd3d_load_vk_instance_procs(struct vkd3d_vk_instance_procs *procs, - const struct vkd3d_vk_global_procs *global_procs, VkInstance instance) DECLSPEC_HIDDEN; + const struct vkd3d_vk_global_procs *global_procs, VkInstance instance); HRESULT vkd3d_load_vk_device_procs(struct vkd3d_vk_device_procs *procs, - const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device) DECLSPEC_HIDDEN; + const struct vkd3d_vk_instance_procs *parent_procs, VkDevice device);
extern const char vkd3d_build[];
-bool vkd3d_get_program_name(char program_name[PATH_MAX]) DECLSPEC_HIDDEN; +bool vkd3d_get_program_name(char program_name[PATH_MAX]);
static inline void vkd3d_set_thread_name(const char *name) { @@ -1364,9 +1346,9 @@ static inline void vkd3d_set_thread_name(const char *name) }
VkResult vkd3d_set_vk_object_name_utf8(struct d3d12_device *device, uint64_t vk_object, - VkDebugReportObjectTypeEXT vk_object_type, const char *name) DECLSPEC_HIDDEN; + VkDebugReportObjectTypeEXT vk_object_type, const char *name); HRESULT vkd3d_set_vk_object_name(struct d3d12_device *device, uint64_t vk_object, - VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name) DECLSPEC_HIDDEN; + VkDebugReportObjectTypeEXT vk_object_type, const WCHAR *name);
static inline void vk_prepend_struct(void *header, void *structure) {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=94948
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: configure.ac:54 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: configure.ac:54 Task: Patch failed to apply
On Wed, 4 Aug 2021 at 05:53, Zebediah Figura zfigura@codeweavers.com wrote:
+#if defined(__GNUC__) && !defined(__MINGW32__) +# define VKD3D_API __attribute__((visibility("default"))) +#else +# define VKD3D_API +#endif
Arguably this is more about _WIN32 than about __MINGW32__. On _WIN32 we'd want to add dllimport/dllexport instead, perhaps as a followup.
-int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, +VKD3D_API int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_versioned_root_signature_desc *root_signature, char **messages) { struct vkd3d_shader_message_context message_context; @@ -2797,7 +2797,7 @@ static int validate_root_signature_desc(const struct vkd3d_shader_versioned_root return ret; }
It seems more proper to add VKD3D_API to the public headers, in part because "dllimport" would need to be visible to users of those headers.
On 8/4/21 7:48 AM, Henri Verbeet wrote:
On Wed, 4 Aug 2021 at 05:53, Zebediah Figura zfigura@codeweavers.com wrote:
+#if defined(__GNUC__) && !defined(__MINGW32__) +# define VKD3D_API __attribute__((visibility("default"))) +#else +# define VKD3D_API +#endif
Arguably this is more about _WIN32 than about __MINGW32__. On _WIN32 we'd want to add dllimport/dllexport instead, perhaps as a followup.
I was following the current code here (so one could argue that s/__MINGW32__/_WIN32/ deserves a followup anyway).
That said, it's not obvious to me why this should be _WIN32. My understanding is that mingw doesn't support visibility attributes at all, hence the empty definition, but presumably we'd still want to mark visibility on ELF win32 targets (which I guess means winelib).
On Thu, 5 Aug 2021 at 03:01, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
On 8/4/21 7:48 AM, Henri Verbeet wrote:
On Wed, 4 Aug 2021 at 05:53, Zebediah Figura zfigura@codeweavers.com wrote:
+#if defined(__GNUC__) && !defined(__MINGW32__) +# define VKD3D_API __attribute__((visibility("default"))) +#else +# define VKD3D_API +#endif
Arguably this is more about _WIN32 than about __MINGW32__. On _WIN32 we'd want to add dllimport/dllexport instead, perhaps as a followup.
I was following the current code here (so one could argue that s/__MINGW32__/_WIN32/ deserves a followup anyway).
That said, it's not obvious to me why this should be _WIN32. My understanding is that mingw doesn't support visibility attributes at all, hence the empty definition, but presumably we'd still want to mark visibility on ELF win32 targets (which I guess means winelib).
True, it's perhaps more about the executable format than the platform, but I'd argue those are tied together a bit stronger than the compiler and the platform. E.g., in the hypothetical case of compiling with MSVC we'd want to use dllimport/dllexport there as well. In any case, the way I'd imagine this eventually looking for e.g. vkd3d-shader would be something like this:
#if defined(_WIN32) # if defined(LIBVKD3D_SHADER_SOURCE) # define VKD3D_API __declspec(dllexport) # else # define VKD3D_API __declspec(dllimport) # endif #elif defined(__GNUC__) # define VKD3D_API __attribute__((visibility("default"))) #else # define VKD3D_API #endif
It's certainly fine to keep using __MINGW32__ here if you prefer though; we don't really support compilers other than gcc (although Chip has been adding some Clang support lately), and this would hardly be the only place where we take __MINGW32__ and _WIN32 to essentially mean the same thing.