diff --git a/Makefile.am b/Makefile.am index dc8df82a..a7f12021 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,6 +16,7 @@ vkd3d_public_headers = \ include/dummy/rpcndr.h \ include/dxgibase.h \ include/vkd3d.h \ + include/vkd3d_shader.h \ include/vkd3d_utils.h \ include/vkd3d_windows.h @@ -55,7 +56,17 @@ libvkd3d_common_la_SOURCES = \ include/private/vkd3d_debug.h \ libs/vkd3d-common/debug.c -lib_LTLIBRARIES = libvkd3d.la libvkd3d-utils.la +lib_LTLIBRARIES = libvkd3d-shader.la libvkd3d.la libvkd3d-utils.la + +libvkd3d_shader_la_SOURCES = \ + include/private/list.h \ + include/private/rbtree.h \ + include/private/vkd3d_common.h \ + include/private/vkd3d_debug.h \ + include/private/vkd3d_memory.h \ + libs/vkd3d-shader/vkd3d_shader_main.c \ + libs/vkd3d-shader/vkd3d_shader_private.h +libvkd3d_shader_la_LIBADD = libvkd3d-common.la libvkd3d_la_SOURCES = \ include/d3d12.idl \ diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h new file mode 100644 index 00000000..2837b18e --- /dev/null +++ b/include/vkd3d_shader.h @@ -0,0 +1,49 @@ +/* + * Copyright 2017 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 + */ + +#ifndef __VKD3D_SHADER_H +#define __VKD3D_SHADER_H + +#include "vkd3d.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +enum vkd3d_shader_compiler_option +{ + VKD3D_SHADER_FLIP_Y = 0x00000001, + + VKD3D_SHADER_COMPILER_OPTIONS_FORCE_32_BIT = 0x7fffffff, +}; + +struct vkd3d_shader_code +{ + const void *code; + size_t size; +}; + +HRESULT vkd3d_shader_compile_dxbc(const struct vkd3d_shader_code *dxbc, + struct vkd3d_shader_code *spirv, uint32_t compiler_options); +void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __VKD3D_SHADER_H */ diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c new file mode 100644 index 00000000..52defccd --- /dev/null +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -0,0 +1,35 @@ +/* + * Copyright 2017 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_shader_private.h" + +HRESULT vkd3d_shader_compile_dxbc(const struct vkd3d_shader_code *dxbc, + struct vkd3d_shader_code *spirv, uint32_t compiler_options) +{ + FIXME("Not implemented!\n"); + + return E_NOTIMPL; +} + +void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *shader_code) +{ + if (!shader_code) + return; + + vkd3d_free((void *)shader_code->code); +} diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h new file mode 100644 index 00000000..88682d29 --- /dev/null +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -0,0 +1,34 @@ +/* + * Copyright 2017 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 + */ + +#ifndef __VKD3D_SHADER_PRIVATE_H +#define __VKD3D_SHADER_PRIVATE_H + +#include "vkd3d_common.h" +#include "vkd3d_memory.h" +#include "vkd3d_shader.h" +#include "list.h" + +#include +#include +#include +#include + +#define VKD3D_VEC4_SIZE 4 + +#endif /* __VKD3D_SHADER_PRIVATE_H */