Module: vkd3d
Branch: master
Commit: 0bcb8ba3989604c40d47d93f30cb4d3283911376
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=0bcb8ba3989604c40d47d93…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Mon Sep 28 22:41:07 2020 -0500
vkd3d-compiler: Add the HLSL source type.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/vkd3d-compiler/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c
index 8480c4f..a5aff57 100644
--- a/programs/vkd3d-compiler/main.c
+++ b/programs/vkd3d-compiler/main.c
@@ -52,12 +52,17 @@ static const struct source_type_info
enum vkd3d_shader_source_type type;
const char *name;
const char *description;
+ bool is_binary;
}
source_type_info[] =
{
{VKD3D_SHADER_SOURCE_DXBC_TPF,
"dxbc-tpf", "A 'Tokenized Program Format' shader embedded in a DXBC container.\n"
- " This is the format used for Direct3D shader model 4 and 5 shaders.\n"},
+ " This is the format used for Direct3D shader model 4 and 5 shaders.\n",
+ true},
+ {VKD3D_SHADER_SOURCE_HLSL,
+ "hlsl", "High Level Shader Language source code.\n",
+ false},
};
static const struct target_type_info
@@ -594,7 +599,7 @@ int main(int argc, char **argv)
if (!(input = open_input(options.filename, &close_input)))
goto done;
- if (!options.filename && isatty(fileno(input)))
+ if (!options.filename && get_source_type_info(options.source_type)->is_binary && isatty(fileno(input)))
{
fprintf(stderr, "Input is a tty and input format is binary, exiting.\n"
"If this is really what you intended, specify the input explicitly.\n");
Module: vkd3d
Branch: master
Commit: ce58af9df818242e9f9d559400aa799eee34d9a5
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=ce58af9df818242e9f9d559…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Mon Sep 28 22:41:04 2020 -0500
vkd3d: Move hresult_from_vkd3d_result to vkd3d-common.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
Makefile.am | 1 +
include/private/vkd3d_common.h | 3 +++
libs/vkd3d-common/error.c | 43 ++++++++++++++++++++++++++++++++++++++++++
libs/vkd3d/utils.c | 23 ----------------------
4 files changed, 47 insertions(+), 23 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 07426fb..6f8af57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,6 +67,7 @@ libvkd3d_common_la_SOURCES = \
include/private/vkd3d_debug.h \
libs/vkd3d-common/blob.c \
libs/vkd3d-common/debug.c \
+ libs/vkd3d-common/error.c \
libs/vkd3d-common/memory.c \
libs/vkd3d-common/utf8.c
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h
index ac217e9..ed80f48 100644
--- a/include/private/vkd3d_common.h
+++ b/include/private/vkd3d_common.h
@@ -21,6 +21,7 @@
#include "config.h"
#include "vkd3d_windows.h"
+#include "vkd3d_types.h"
#include <ctype.h>
#include <limits.h>
@@ -183,4 +184,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;
+
#endif /* __VKD3D_COMMON_H */
diff --git a/libs/vkd3d-common/error.c b/libs/vkd3d-common/error.c
new file mode 100644
index 0000000..81c1fd9
--- /dev/null
+++ b/libs/vkd3d-common/error.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2018 Józef Kucia 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
+ */
+
+#include "vkd3d_common.h"
+#include "vkd3d_debug.h"
+
+HRESULT hresult_from_vkd3d_result(int vkd3d_result)
+{
+ switch (vkd3d_result)
+ {
+ case VKD3D_OK:
+ return S_OK;
+ case VKD3D_ERROR_INVALID_SHADER:
+ WARN("Invalid shader bytecode.\n");
+ /* fall-through */
+ case VKD3D_ERROR:
+ return E_FAIL;
+ case VKD3D_ERROR_OUT_OF_MEMORY:
+ return E_OUTOFMEMORY;
+ case VKD3D_ERROR_INVALID_ARGUMENT:
+ return E_INVALIDARG;
+ case VKD3D_ERROR_NOT_IMPLEMENTED:
+ return E_NOTIMPL;
+ default:
+ FIXME("Unhandled vkd3d result %d.\n", vkd3d_result);
+ return E_FAIL;
+ }
+}
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c
index f9f2663..08e6af9 100644
--- a/libs/vkd3d/utils.c
+++ b/libs/vkd3d/utils.c
@@ -770,29 +770,6 @@ HRESULT hresult_from_vk_result(VkResult vr)
}
}
-HRESULT hresult_from_vkd3d_result(int vkd3d_result)
-{
- switch (vkd3d_result)
- {
- case VKD3D_OK:
- return S_OK;
- case VKD3D_ERROR_INVALID_SHADER:
- WARN("Invalid shader bytecode.\n");
- /* fall-through */
- case VKD3D_ERROR:
- return E_FAIL;
- case VKD3D_ERROR_OUT_OF_MEMORY:
- return E_OUTOFMEMORY;
- case VKD3D_ERROR_INVALID_ARGUMENT:
- return E_INVALIDARG;
- case VKD3D_ERROR_NOT_IMPLEMENTED:
- return E_NOTIMPL;
- default:
- FIXME("Unhandled vkd3d result %d.\n", vkd3d_result);
- return E_FAIL;
- }
-}
-
#define LOAD_GLOBAL_PFN(name) \
if (!(procs->name = (void *)vkGetInstanceProcAddr(NULL, #name))) \
{ \