We tag far fewer symbols this way.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- configure.ac | 1 + include/private/vkd3d_common.h | 6 + include/private/vkd3d_debug.h | 19 ++- include/private/vkd3d_memory.h | 3 +- include/private/vkd3d_utf8.h | 2 +- libs/vkd3d-common/debug.c | 2 +- libs/vkd3d-shader/dxbc.c | 6 +- libs/vkd3d-shader/vkd3d_shader_main.c | 24 +-- libs/vkd3d-shader/vkd3d_shader_private.h | 48 +++--- libs/vkd3d-utils/vkd3d_utils_main.c | 22 +-- 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 | 188 +++++++++++------------ 16 files changed, 184 insertions(+), 179 deletions(-)
diff --git a/configure.ac b/configure.ac index d5f6588..e9c135a 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,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([-Wmissing-prototypes]) diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index ac217e9..fd62ae8 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -53,6 +53,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 diff --git a/include/private/vkd3d_debug.h b/include/private/vkd3d_debug.h index c37c841..a206a92 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 df93abf..8bbc691 100644 --- a/include/private/vkd3d_memory.h +++ b/include/private/vkd3d_memory.h @@ -54,7 +54,6 @@ static inline void vkd3d_free(void *ptr) free(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 ab32884..ccb9e17 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/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index 33deed6..a4d5a3d 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 973a80d..231c48b 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -2726,7 +2726,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; @@ -3288,7 +3288,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; @@ -3592,7 +3592,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/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 16d895f..4d49eef 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -292,14 +292,14 @@ 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);
vkd3d_free(messages); }
-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_scan_descriptor_info scan_descriptor_info; @@ -837,7 +837,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte return VKD3D_OK; }
-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_scan_descriptor_info *scan_descriptor_info; struct vkd3d_shader_message_context *message_context; @@ -912,14 +912,14 @@ done: 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);
@@ -960,7 +960,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);
@@ -981,7 +981,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; @@ -1004,7 +1004,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) { @@ -1026,7 +1026,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);
@@ -1034,7 +1034,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;
@@ -1052,7 +1052,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[] = { @@ -1065,7 +1065,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[] = diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 1acb01f..1291148 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -809,18 +809,18 @@ 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);
void *shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, - const struct vkd3d_shader_signature *output_signature) DECLSPEC_HIDDEN; -void shader_sm4_free(void *data) DECLSPEC_HIDDEN; + const struct vkd3d_shader_signature *output_signature); +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 { @@ -829,9 +829,9 @@ struct vkd3d_string_buffer unsigned int content_size; };
-void vkd3d_string_buffer_cleanup(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN; -bool vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN; -int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args) DECLSPEC_HIDDEN; +void vkd3d_string_buffer_cleanup(struct vkd3d_string_buffer *buffer); +bool vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer); +int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args);
struct vkd3d_shader_message_context { @@ -841,39 +841,39 @@ struct vkd3d_shader_message_context struct vkd3d_string_buffer messages; };
-void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *context) DECLSPEC_HIDDEN; -char *vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context) DECLSPEC_HIDDEN; +void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *context); +char *vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context); bool vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context, - enum vkd3d_shader_log_level log_level, const char *source_name) DECLSPEC_HIDDEN; + enum vkd3d_shader_log_level log_level, const char *source_name); 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, enum vkd3d_shader_error error, - const char *format, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN; + const char *format, ...) VKD3D_PRINTF_FUNC(3, 4); void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, - enum vkd3d_shader_error error, const char *format, va_list args) DECLSPEC_HIDDEN; + enum vkd3d_shader_error error, const char *format, va_list args);
int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length, - struct vkd3d_shader_message_context *message_context, 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, 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]);
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 c19fe7f..b64693e 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); @@ -126,7 +126,7 @@ HRESULT WINAPI D3D12SerializeVersionedRootSignature(const D3D12_VERSIONED_ROOT_S }
/* Events */ -HANDLE vkd3d_create_event(void) +VKD3D_API HANDLE vkd3d_create_event(void) { struct vkd3d_event *event; int rc; @@ -157,7 +157,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; @@ -200,7 +200,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; @@ -219,7 +219,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; diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index e5c6791..4ff510a 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6251,21 +6251,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 bef6477..38d3d56 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; } @@ -3828,28 +3828,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 a9d4d46..a432806 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1983,7 +1983,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); @@ -2035,13 +2035,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 7abfd42..ea11f3a 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 327cdf8..4c0d6c5 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -21,7 +21,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; @@ -216,7 +216,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}; @@ -400,7 +400,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; @@ -537,7 +537,7 @@ static HRESULT d3d_blob_create(void *buffer, SIZE_T size, struct d3d_blob **blob return S_OK; }
-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; @@ -592,7 +592,7 @@ HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, return S_OK; }
-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 9f0982d..54077f9 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -82,9 +82,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 { @@ -161,8 +161,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 { @@ -199,9 +199,9 @@ struct vkd3d_fence_worker };
HRESULT vkd3d_fence_worker_start(struct vkd3d_fence_worker *worker, - struct d3d12_device *device) DECLSPEC_HIDDEN; + struct d3d12_device *device); HRESULT vkd3d_fence_worker_stop(struct vkd3d_fence_worker *worker, - struct d3d12_device *device) DECLSPEC_HIDDEN; + struct d3d12_device *device);
struct vkd3d_gpu_va_allocation { @@ -230,11 +230,11 @@ 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; + 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) DECLSPEC_HIDDEN; + D3D12_GPU_VIRTUAL_ADDRESS address); void vkd3d_gpu_va_allocator_free(struct vkd3d_gpu_va_allocator *allocator, - D3D12_GPU_VIRTUAL_ADDRESS address) DECLSPEC_HIDDEN; + D3D12_GPU_VIRTUAL_ADDRESS address);
struct vkd3d_render_pass_key { @@ -257,11 +257,11 @@ struct vkd3d_render_pass_cache };
void vkd3d_render_pass_cache_cleanup(struct vkd3d_render_pass_cache *cache, - struct d3d12_device *device) DECLSPEC_HIDDEN; + 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) DECLSPEC_HIDDEN; -void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache) DECLSPEC_HIDDEN; + VkRenderPass *vk_render_pass); +void vkd3d_render_pass_cache_init(struct vkd3d_render_pass_cache *cache);
struct vkd3d_private_store { @@ -317,11 +317,11 @@ static inline void vkd3d_private_store_destroy(struct vkd3d_private_store *store }
HRESULT vkd3d_get_private_data(struct vkd3d_private_store *store, - const GUID *tag, unsigned int *out_size, void *out) DECLSPEC_HIDDEN; + 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; + 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) DECLSPEC_HIDDEN; + const GUID *tag, const IUnknown *object);
struct vkd3d_signaled_semaphore { @@ -362,7 +362,7 @@ struct d3d12_fence };
HRESULT d3d12_fence_create(struct d3d12_device *device, - uint64_t initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence) DECLSPEC_HIDDEN; + uint64_t initial_value, D3D12_FENCE_FLAGS flags, struct d3d12_fence **fence);
/* ID3D12Heap */ struct d3d12_heap @@ -386,8 +386,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) @@ -435,29 +435,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 { @@ -495,8 +495,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 { @@ -511,9 +511,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 { @@ -537,24 +537,24 @@ static inline struct d3d12_desc *d3d12_desc_from_gpu_handle(D3D12_GPU_DESCRIPTOR }
void d3d12_desc_copy(struct d3d12_desc *dst, const struct d3d12_desc *src, - struct d3d12_device *device) DECLSPEC_HIDDEN; + 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; + 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) DECLSPEC_HIDDEN; + 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) DECLSPEC_HIDDEN; + 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 { @@ -574,7 +574,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 { @@ -594,7 +594,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 @@ -612,7 +612,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 @@ -630,8 +630,8 @@ struct d3d12_query_heap };
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; + 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. @@ -731,11 +731,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 { @@ -829,13 +829,13 @@ 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; + VkRenderPass *vk_render_pass); +struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface);
struct vkd3d_buffer { @@ -895,7 +895,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 { @@ -987,7 +987,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 { @@ -1014,12 +1014,12 @@ struct vkd3d_queue VkSemaphore old_vk_semaphores[VKD3D_MAX_VK_SYNC_OBJECTS]; };
-VkQueue vkd3d_queue_acquire(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) 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; + 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 @@ -1040,7 +1040,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 @@ -1056,8 +1056,8 @@ struct d3d12_command_signature };
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; + struct d3d12_command_signature **signature); +struct d3d12_command_signature *unsafe_impl_from_ID3D12CommandSignature(ID3D12CommandSignature *iface);
/* NULL resources */ struct vkd3d_null_resources @@ -1076,9 +1076,9 @@ struct vkd3d_null_resources };
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources, - struct d3d12_device *device) DECLSPEC_HIDDEN; + struct d3d12_device *device); void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources, - struct d3d12_device *device) DECLSPEC_HIDDEN; + struct d3d12_device *device);
struct vkd3d_format_compatibility_list { @@ -1116,8 +1116,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 @@ -1173,13 +1173,13 @@ 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; + 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) DECLSPEC_HIDDEN; -bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent) DECLSPEC_HIDDEN; + 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) { @@ -1254,15 +1254,15 @@ 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; + DXGI_FORMAT dxgi_format, bool depth_stencil); const struct vkd3d_format *vkd3d_find_uint_format(const struct d3d12_device *device, - DXGI_FORMAT dxgi_format) DECLSPEC_HIDDEN; + 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) @@ -1310,24 +1310,24 @@ 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; + 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) { @@ -1336,15 +1336,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) { @@ -1356,9 +1356,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=78594
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:47 Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:47 Task: Patch failed to apply
On Sat, 12 Sep 2020 at 21:26, Zebediah Figura zfigura@codeweavers.com wrote:
We tag far fewer symbols this way.
Using -fvisibility=hidden seems fine, but I'm not sure that's a compelling reason to switch. It's been a while, but IIRC we chose the current scheme to be consistent with Wine, and wined3d in particular.
On 9/14/20 10:47 AM, Henri Verbeet wrote:
On Sat, 12 Sep 2020 at 21:26, Zebediah Figura zfigura@codeweavers.com wrote:
We tag far fewer symbols this way.
Using -fvisibility=hidden seems fine, but I'm not sure that's a compelling reason to switch. It's been a while, but IIRC we chose the current scheme to be consistent with Wine, and wined3d in particular.
At the time I was willing to leave this alone, but every time since that I try to shuffle functions around or add internal helpers, I find myself missing this patch, and I'd like to argue for it a second time.
As far as I see it, the choice of default-hidden or default-visible makes the most sense as determined by comparing the number of visible symbols with the number of hidden symbols, and using whichever is lesser.
In the case of Wine, quite often there are at least as many visible symbols as hidden ones, either because most visible functions are stubs (or have relatively simple implementations) or because visible functions are sufficient as internal helpers such that we don't need to write our own. ntdll, kernelbase, rpcrt4, msvcrt, and most stub-only DLLs are good examples of this.
On the other hand, that's not true of all Wine modules, and wined3d is a good example of one that would benefit from default-visible—it has 290 exported symbols and 470 internal ones. And in general internal symbols are likely to see a lot more churn than exported ones, even in the case of wined3d where the external interface isn't stable.
And in the case of vkd3d, we're dealing with a library with well-defined and implemented entry points, and a lot of internal complexity. And as a result we currently have 188 internal symbols and 52 external ones (or, well, in the part of my worktree I measured we do), which is a far more significant disparity than anything currently in Wine. And because COM is integrated into vkd3d, we don't need wined3d's billion vkd3d_device_set_* entry points either.
I don't necessarily want to argue that we should change the default for wined3d—consistency with the rest of wine is nice after all—but I think that vkd3d is different enough from wine as a whole that it makes sense to treat it differently.
(I could also see an argument for switching to default-visible in Wine. In particular it might be reasonable to fold the ubiquitous "WINAPI DECLSPEC_HOTPATCH" into a single annotation in Wine, and then adding the visibility attribute into that, so that we essentially get visibility annotations for free. Food for thought.)
On Sat, 10 Jul 2021 at 23:02, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
On 9/14/20 10:47 AM, Henri Verbeet wrote:
On Sat, 12 Sep 2020 at 21:26, Zebediah Figura zfigura@codeweavers.com wrote:
We tag far fewer symbols this way.
Using -fvisibility=hidden seems fine, but I'm not sure that's a compelling reason to switch. It's been a while, but IIRC we chose the current scheme to be consistent with Wine, and wined3d in particular.
At the time I was willing to leave this alone, but every time since that I try to shuffle functions around or add internal helpers, I find myself missing this patch, and I'd like to argue for it a second time.
Personally, adding DECLSPEC_HIDDEN has never particularly bothered me, but in this particular case, if it bothers you that's probably sufficient reason. I would be curious about opinions from Matteo and Conor in particular as well though.
As far as I see it, the choice of default-hidden or default-visible makes the most sense as determined by comparing the number of visible symbols with the number of hidden symbols, and using whichever is lesser.
In the case of Wine, quite often there are at least as many visible symbols as hidden ones, either because most visible functions are stubs (or have relatively simple implementations) or because visible functions are sufficient as internal helpers such that we don't need to write our own. ntdll, kernelbase, rpcrt4, msvcrt, and most stub-only DLLs are good examples of this.
On the other hand, that's not true of all Wine modules, and wined3d is a good example of one that would benefit from default-visible—it has 290 exported symbols and 470 internal ones. And in general internal symbols are likely to see a lot more churn than exported ones, even in the case of wined3d where the external interface isn't stable.
And in the case of vkd3d, we're dealing with a library with well-defined and implemented entry points, and a lot of internal complexity. And as a result we currently have 188 internal symbols and 52 external ones (or, well, in the part of my worktree I measured we do), which is a far more significant disparity than anything currently in Wine. And because COM is integrated into vkd3d, we don't need wined3d's billion vkd3d_device_set_* entry points either.
Maybe. The way I see it, the main argument for default hidden visibility is that it prevents accidentally exporting internal symbols. For vkd3d we already use linker scripts though, so that point is somewhat moot.
I don't necessarily want to argue that we should change the default for wined3d—consistency with the rest of wine is nice after all—but I think that vkd3d is different enough from wine as a whole that it makes sense to treat it differently.
(I could also see an argument for switching to default-visible in Wine. In particular it might be reasonable to fold the ubiquitous "WINAPI DECLSPEC_HOTPATCH" into a single annotation in Wine, and then adding the visibility attribute into that, so that we essentially get visibility annotations for free. Food for thought.)
I wouldn't be opposed to changing the default for Wine either. With the proliferation of PE modules, there may actually be some (minor) advantage to having proper dllimport/dllexport attributes in our headers as well.
On Mon, Jul 12, 2021 at 9:43 PM Henri Verbeet hverbeet@gmail.com wrote:
Personally, adding DECLSPEC_HIDDEN has never particularly bothered me, but in this particular case, if it bothers you that's probably sufficient reason. I would be curious about opinions from Matteo and Conor in particular as well though.
I favour default-hidden. As Zeb said, visible symbols are added much less often than hidden ones, plus I think it would be easier on the eyes without all the DECLSPEC_HIDDEN decorations.
On 7/12/21 6:43 AM, Henri Verbeet wrote:
On Sat, 10 Jul 2021 at 23:02, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
On 9/14/20 10:47 AM, Henri Verbeet wrote:
On Sat, 12 Sep 2020 at 21:26, Zebediah Figura zfigura@codeweavers.com wrote:
We tag far fewer symbols this way.
Using -fvisibility=hidden seems fine, but I'm not sure that's a compelling reason to switch. It's been a while, but IIRC we chose the current scheme to be consistent with Wine, and wined3d in particular.
At the time I was willing to leave this alone, but every time since that I try to shuffle functions around or add internal helpers, I find myself missing this patch, and I'd like to argue for it a second time.
Personally, adding DECLSPEC_HIDDEN has never particularly bothered me, but in this particular case, if it bothers you that's probably sufficient reason. I would be curious about opinions from Matteo and Conor in particular as well though.
To be fair it's not a huge annoyance, certainly not enough to justify several paragraphs....