From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d/command.c | 8 ++++---- libs/vkd3d/device.c | 12 ++++++------ libs/vkd3d/vkd3d_private.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 3b7d2ee4f086..4273a665e800 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3390,7 +3390,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12Graphi list->fb_height = 0; for (i = 0; i < render_target_descriptor_count; ++i) { - const struct d3d12_rtv_desc *rtv_desc = (const struct d3d12_rtv_desc *)render_target_descriptors[i].ptr; + const struct d3d12_rtv_desc *rtv_desc = d3d12_rtv_desc_from_cpu_handle(render_target_descriptors[i]);
d3d12_command_list_track_resource_usage(list, rtv_desc->resource);
@@ -3403,7 +3403,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12Graphi
if (depth_stencil_descriptor) { - const struct d3d12_dsv_desc *dsv_desc = (const struct d3d12_dsv_desc *)depth_stencil_descriptor->ptr; + const struct d3d12_dsv_desc *dsv_desc = d3d12_dsv_desc_from_cpu_handle(*depth_stencil_descriptor);
d3d12_command_list_track_resource_usage(list, dsv_desc->resource);
@@ -3523,7 +3523,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12Gra { const union VkClearValue clear_value = {.depthStencil = {depth, stencil}}; struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface); - struct d3d12_dsv_desc *dsv_desc = (struct d3d12_dsv_desc *)dsv.ptr; + const struct d3d12_dsv_desc *dsv_desc = d3d12_dsv_desc_from_cpu_handle(dsv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference ds_reference;
@@ -3570,7 +3570,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12Gra { const union VkClearValue clear_value = {{{color[0], color[1], color[2], color[3]}}}; struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface); - struct d3d12_rtv_desc *rtv_desc = (struct d3d12_rtv_desc *)rtv.ptr; + const struct d3d12_rtv_desc *rtv_desc = d3d12_rtv_desc_from_cpu_handle(rtv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference color_reference;
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 31fee8affb22..54b3d0e43077 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1605,7 +1605,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device { TRACE("iface %p, desc %p, descriptor %#lx.\n", iface, desc, descriptor.ptr);
- d3d12_desc_create_cbv((struct d3d12_desc *)descriptor.ptr, + d3d12_desc_create_cbv(d3d12_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), desc); }
@@ -1616,7 +1616,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n", iface, resource, desc, descriptor.ptr);
- d3d12_desc_create_srv((struct d3d12_desc *)descriptor.ptr, + d3d12_desc_create_srv(d3d12_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), unsafe_impl_from_ID3D12Resource(resource), desc); }
@@ -1627,7 +1627,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Devic TRACE("iface %p, resource %p, counter_resource %p, desc %p, descriptor %#lx.\n", iface, resource, counter_resource, desc, descriptor.ptr);
- d3d12_desc_create_uav((struct d3d12_desc *)descriptor.ptr, + d3d12_desc_create_uav(d3d12_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), unsafe_impl_from_ID3D12Resource(resource), unsafe_impl_from_ID3D12Resource(counter_resource), desc); } @@ -1639,7 +1639,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device * TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n", iface, resource, desc, descriptor.ptr);
- d3d12_rtv_desc_create_rtv((struct d3d12_rtv_desc *)descriptor.ptr, + d3d12_rtv_desc_create_rtv(d3d12_rtv_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), unsafe_impl_from_ID3D12Resource(resource), desc); }
@@ -1650,7 +1650,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device * TRACE("iface %p, resource %p, desc %p, descriptor %#lx.\n", iface, resource, desc, descriptor.ptr);
- d3d12_dsv_desc_create_dsv((struct d3d12_dsv_desc *)descriptor.ptr, + d3d12_dsv_desc_create_dsv(d3d12_dsv_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), unsafe_impl_from_ID3D12Resource(resource), desc); }
@@ -1659,7 +1659,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device *iface, { TRACE("iface %p, desc %p, descriptor %#lx.\n", iface, desc, descriptor.ptr);
- d3d12_desc_create_sampler((struct d3d12_desc *)descriptor.ptr, + d3d12_desc_create_sampler(d3d12_desc_from_cpu_handle(descriptor), impl_from_ID3D12Device(iface), desc); }
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index f22287121be3..89e4f23680c8 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -286,6 +286,11 @@ struct d3d12_rtv_desc struct d3d12_resource *resource; };
+static inline struct d3d12_rtv_desc *d3d12_rtv_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle) +{ + return (struct d3d12_rtv_desc *)cpu_handle.ptr; +} + 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;
@@ -299,6 +304,11 @@ struct d3d12_dsv_desc struct d3d12_resource *resource; };
+static inline struct d3d12_dsv_desc *d3d12_dsv_desc_from_cpu_handle(D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle) +{ + return (struct d3d12_dsv_desc *)cpu_handle.ptr; +} + 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;
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com ---
Mainly some stylistic changes before importing d3d12.idl to Wine.
--- Makefile.am | 3 + include/vkd3d_d3d12.idl | 154 +++++++++++++++++++++++++++++++------------- include/vkd3d_d3dcommon.idl | 49 ++++++++++++++ 3 files changed, 163 insertions(+), 43 deletions(-) create mode 100644 include/vkd3d_d3dcommon.idl
diff --git a/Makefile.am b/Makefile.am index d8212b7ca80d..aeb66ebe207a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/dummy -I$(srcdir)/include/
widl_headers = \ include/vkd3d_d3d12.h \ + include/vkd3d_d3dcommon.h \ include/vkd3d_dxgi.h \ include/vkd3d_dxgi1_2.h \ include/vkd3d_dxgi1_3.h \ @@ -17,6 +18,7 @@ vkd3d_public_headers = \ include/dummy/rpcndr.h \ include/vkd3d.h \ include/vkd3d_d3d12.h \ + include/vkd3d_d3dcommon.h \ include/vkd3d_dxgibase.h \ include/vkd3d_dxgiformat.h \ include/vkd3d_utils.h \ @@ -79,6 +81,7 @@ libvkd3d_la_SOURCES = \ include/private/vkd3d_memory.h \ include/private/vkd3d_test.h \ include/vkd3d_d3d12.idl \ + include/vkd3d_d3dcommon.idl \ include/vkd3d_unknown.idl \ libs/vkd3d/command.c \ libs/vkd3d/device.c \ diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index 3e8d9cb85133..2ccfa22d344f 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -20,7 +20,10 @@ import "vkd3d_windows.h";
import "vkd3d_dxgibase.idl";
-#include "vkd3d_unknown.idl" +import "vkd3d_d3dcommon.idl"; + +cpp_quote("#ifndef _D3D12_CONSTANTS") +cpp_quote("#define _D3D12_CONSTANTS")
const UINT D3D12_CS_TGSM_REGISTER_COUNT = 8192; const UINT D3D12_MAX_ROOT_COST = 64; @@ -48,10 +51,6 @@ const UINT D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384; const UINT D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION = 2048; const UINT D3D12_REQ_TEXTURECUBE_DIMENSION = 16384; const UINT D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES = 0xffffffff; -const UINT D3D12_SHADER_COMPONENT_MAPPING_MASK = 0x7; -const UINT D3D12_SHADER_COMPONENT_MAPPING_SHIFT = 3; -const UINT D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES - = 1 << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4); const UINT D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; const UINT D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT = 256; const UINT D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT = 65536; @@ -60,15 +59,12 @@ const UINT D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT = 512; const UINT D3D12_VS_INPUT_REGISTER_COUNT = 32; const UINT D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16;
-[uuid(8BA5FB08-5195-40E2-AC58-0D989C3A0102), object, local, pointer_default(unique)] -interface ID3D10Blob : IUnknown -{ - void *GetBufferPointer(); - SIZE_T GetBufferSize(); -} +cpp_quote("#endif")
-typedef ID3D10Blob ID3DBlob; -cpp_quote("#define IID_ID3DBlob IID_ID3D10Blob") +const UINT D3D12_SHADER_COMPONENT_MAPPING_MASK = 0x7; +const UINT D3D12_SHADER_COMPONENT_MAPPING_SHIFT = 3; +const UINT D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES + = 1 << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4);
typedef enum D3D_PRIMITIVE_TOPOLOGY { @@ -80,19 +76,6 @@ typedef enum D3D_PRIMITIVE_TOPOLOGY D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, } D3D_PRIMITIVE_TOPOLOGY;
-typedef enum D3D_FEATURE_LEVEL -{ - D3D_FEATURE_LEVEL_9_1 = 0x9100, - D3D_FEATURE_LEVEL_9_2 = 0x9200, - D3D_FEATURE_LEVEL_9_3 = 0x9300, - D3D_FEATURE_LEVEL_10_0 = 0xa000, - D3D_FEATURE_LEVEL_10_1 = 0xa100, - D3D_FEATURE_LEVEL_11_0 = 0xb000, - D3D_FEATURE_LEVEL_11_1 = 0xb100, - D3D_FEATURE_LEVEL_12_0 = 0xc000, - D3D_FEATURE_LEVEL_12_1 = 0xc100, -} D3D_FEATURE_LEVEL; - typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT { D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0x0, @@ -1567,7 +1550,12 @@ typedef struct D3D12_SUBRESOURCE_DATA LONG_PTR SlicePitch; } D3D12_SUBRESOURCE_DATA;
-[uuid(C4FEC28F-7966-4E95-9F94-F431CB56C3B8), object, local, pointer_default(unique)] +[ + uuid(c4fec28f-7966-4e95-9f94-f431cb56c3b8), + object, + local, + pointer_default(unique) +] interface ID3D12Object : IUnknown { HRESULT GetPrivateData(REFGUID guid, UINT *data_size, void *data); @@ -1576,18 +1564,33 @@ interface ID3D12Object : IUnknown HRESULT SetName(const WCHAR *name); }
-[uuid(905DB94B-A00C-4140-9DF5-2B64CA9EA357), object, local, pointer_default(unique)] +[ + uuid(905db94b-a00c-4140-9df5-2b64ca9ea357), + object, + local, + pointer_default(unique) +] interface ID3D12DeviceChild : ID3D12Object { HRESULT GetDevice(REFIID riid, void **device); }
-[uuid(63EE58FB-1268-4835-86DA-F008CE62F0D6), object, local, pointer_default(unique)] +[ + uuid(63ee58fb-1268-4835-86da-f008ce62f0d6), + object, + local, + pointer_default(unique) +] interface ID3D12Pageable : ID3D12DeviceChild { }
-[uuid(696442BE-A72E-4059-BC79-5B5C98040FAD), object, local, pointer_default(unique)] +[ + uuid(696442be-a72e-4059-bc79-5b5c98040fad), + object, + local, + pointer_default(unique) +] interface ID3D12Resource : ID3D12Pageable { HRESULT Map(UINT sub_resource, const D3D12_RANGE *read_range, void **data); @@ -1605,7 +1608,12 @@ interface ID3D12Resource : ID3D12Pageable HRESULT GetHeapProperties(D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS *flags); }
-[uuid(7116D91C-E7E4-47CE-B8C6-EC8168F437E5), object, local, pointer_default(unique)] +[ + uuid(7116d91c-e7e4-47ce-b8c6-ec8168f437e5), + object, + local, + pointer_default(unique) +] interface ID3D12CommandList : ID3D12DeviceChild { D3D12_COMMAND_LIST_TYPE GetType(); @@ -1688,7 +1696,12 @@ typedef enum D3D12_PREDICATION_OP D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, } D3D12_PREDICATION_OP;
-[uuid(8EFB471D-616C-4F49-90F7-127BB763FA51), object, local, pointer_default(unique)] +[ + uuid(8efb471d-616c-4f49-90f7-127bb763fa51), + object, + local, + pointer_default(unique) +] interface ID3D12DescriptorHeap : ID3D12Pageable { D3D12_DESCRIPTOR_HEAP_DESC GetDesc(); @@ -1697,17 +1710,32 @@ interface ID3D12DescriptorHeap : ID3D12Pageable D3D12_GPU_DESCRIPTOR_HANDLE GetGPUDescriptorHandleForHeapStart(); }
-[uuid(0d9658ae-ed45-469e-a61d-970ec583cab4), object, local, pointer_default(unique)] +[ + uuid(0d9658ae-ed45-469e-a61d-970ec583cab4), + object, + local, + pointer_default(unique) +] interface ID3D12QueryHeap : ID3D12Pageable { }
-[uuid(c36a797c-ec80-4f0a-8985-a7b2475082d1), object, local, pointer_default(unique)] +[ + uuid(c36a797c-ec80-4f0a-8985-a7b2475082d1), + object, + local, + pointer_default(unique) +] interface ID3D12CommandSignature : ID3D12Pageable { }
-[uuid(5B160D0F-AC1B-4185-8BA8-B3AE42A5A455), object, local, pointer_default(unique)] +[ + uuid(5b160d0f-ac1b-4185-8ba8-b3ae42a5a455), + object, + local, + pointer_default(unique) +] interface ID3D12GraphicsCommandList : ID3D12CommandList { HRESULT Close(); @@ -1835,7 +1863,12 @@ typedef enum D3D12_TILE_MAPPING_FLAGS D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1, } D3D12_TILE_MAPPING_FLAGS;
-[uuid(0EC870A6-5D7E-4C22-8CFC-5BAAE07616ED), object, local, pointer_default(unique)] +[ + uuid(0ec870a6-5d7e-4c22-8cfc-5baae07616ed), + object, + local, + pointer_default(unique) +] interface ID3D12CommandQueue : ID3D12Pageable { void UpdateTileMappings(ID3D12Resource *resource, UINT region_count, @@ -1943,18 +1976,33 @@ typedef struct D3D12_COMMAND_SIGNATURE_DESC UINT NodeMask; } D3D12_COMMAND_SIGNATURE_DESC;
-[uuid(C54A6B66-72DF-4EE8-8BE5-A946A1429214), object, local, pointer_default(unique)] +[ + uuid(c54a6b66-72df-4ee8-8be5-a946a1429214), + object, + local, + pointer_default(unique) +] interface ID3D12RootSignature : ID3D12DeviceChild { }
-[uuid(765A30F3-F624-4C6F-A828-ACE948622445), object, local, pointer_default(unique)] +[ + uuid(765a30f3-f624-4c6f-a828-ace948622445), + object, + local, + pointer_default(unique) +] interface ID3D12PipelineState : ID3D12Pageable { HRESULT GetCachedBlob(ID3DBlob **blob); }
-[uuid(0A753DCF-C4D8-4B91-ADF6-BE5A60D95A76), object, local, pointer_default(unique)] +[ + uuid(0a753dcf-c4d8-4b91-adf6-be5a60d95a76), + object, + local, + pointer_default(unique) +] interface ID3D12Fence : ID3D12Pageable { UINT64 GetCompletedValue(); @@ -1962,13 +2010,23 @@ interface ID3D12Fence : ID3D12Pageable HRESULT Signal(UINT64 value); }
-[uuid(6102DEE4-AF59-4B09-B999-B44D73F09B24), object, local, pointer_default(unique)] +[ + uuid(6102dee4-af59-4b09-b999-b44d73f09b24), + object, + local, + pointer_default(unique) +] interface ID3D12CommandAllocator : ID3D12Pageable { HRESULT Reset(); }
-[uuid(189819F1-1DB6-4B57-BE54-1821339B85F7), object, local, pointer_default(unique)] +[ + uuid(189819f1-1db6-4b57-be54-1821339b85f7), + object, + local, + pointer_default(unique) +] interface ID3D12Device : ID3D12Object { UINT GetNodeCount(); @@ -2091,13 +2149,23 @@ interface ID3D12Device : ID3D12Object LUID GetAdapterLuid(); }
-[uuid(344488B7-6846-474B-B989-F027448245E0), object, local, pointer_default(unique)] +[ + uuid(344488b7-6846-474b-b989-f027448245e0), + object, + local, + pointer_default(unique) +] interface ID3D12Debug : IUnknown { void EnableDebugLayer(); }
-[uuid(34ab647b-3cc8-46ac-841b-c0965645c046), object, local, pointer_default(unique)] +[ + uuid(34ab647b-3cc8-46ac-841b-c0965645c046), + object, + local, + pointer_default(unique) +] interface ID3D12RootSignatureDeserializer : IUnknown { const D3D12_ROOT_SIGNATURE_DESC *GetRootSignatureDesc(); diff --git a/include/vkd3d_d3dcommon.idl b/include/vkd3d_d3dcommon.idl new file mode 100644 index 000000000000..1ddfce3c3d34 --- /dev/null +++ b/include/vkd3d_d3dcommon.idl @@ -0,0 +1,49 @@ +/* + * Copyright 2016 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 + */ + +import "vkd3d_windows.h"; + +#include "vkd3d_unknown.idl" + +typedef enum D3D_FEATURE_LEVEL +{ + D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000, + D3D_FEATURE_LEVEL_11_1 = 0xb100, + D3D_FEATURE_LEVEL_12_0 = 0xc000, + D3D_FEATURE_LEVEL_12_1 = 0xc100, +} D3D_FEATURE_LEVEL; + +[ + uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102), + object, + local, + pointer_default(unique) +] +interface ID3D10Blob : IUnknown +{ + void *GetBufferPointer(); + SIZE_T GetBufferSize(); +} + +typedef ID3D10Blob ID3DBlob; +cpp_quote("#define IID_ID3DBlob IID_ID3D10Blob")
On 7 February 2018 at 23:57, Józef Kucia joseph.kucia@gmail.com wrote:
widl_headers = \ include/vkd3d_d3d12.h \
include/vkd3d_d3dcommon.h \ include/vkd3d_dxgi.h \ include/vkd3d_dxgi1_2.h \ include/vkd3d_dxgi1_3.h \
@@ -17,6 +18,7 @@ vkd3d_public_headers = \ include/dummy/rpcndr.h \ include/vkd3d.h \ include/vkd3d_d3d12.h \
include/vkd3d_d3dcommon.h \ include/vkd3d_dxgibase.h \ include/vkd3d_dxgiformat.h \ include/vkd3d_utils.h \
Please add vkd3d_d3dcommon.h to .gitignore as well.
From: Józef Kucia jkucia@codeweavers.com
SPIRV-Tools are now also built as a shared library.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- Makefile.am | 1 + configure.ac | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am index aeb66ebe207a..260641bc8194 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ libvkd3d_shader_la_SOURCES = \ libs/vkd3d-shader/vkd3d_shader.map \ libs/vkd3d-shader/vkd3d_shader_main.c \ libs/vkd3d-shader/vkd3d_shader_private.h +libvkd3d_shader_la_CFLAGS = @SPIRV_TOOLS_CFLAGS@ libvkd3d_shader_la_LIBADD = @SPIRV_TOOLS_LIBS@ if HAVE_LD_VERSION_SCRIPT libvkd3d_shader_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map diff --git a/configure.ac b/configure.ac index 8a39fef7d2b9..f9616e31f60e 100644 --- a/configure.ac +++ b/configure.ac @@ -54,9 +54,6 @@ AS_IF([test "x$ac_cv_header_vulkan_vulkan_h" != "xyes"], [AC_MSG_ERROR([vulkan.h AS_IF([test "x$ac_cv_header_spirv_1_0_spirv_h" != "xyes"], [AC_MSG_ERROR([spirv.h not found.])]) AS_IF([test "x$ac_cv_header_spirv_1_0_GLSL_std_450_h" != "xyes"], [AC_MSG_ERROR([GLSL.std.450.h not found.])])
-AS_IF([test "x$with_spirv_tools" = "xyes"], - [AC_CHECK_HEADERS([spirv-tools/libspirv.h], [], [AC_MSG_ERROR([spirv-tools/libspirv.h not found.])])]) - dnl Check for libraries m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config autoconf macros not found.])])
@@ -77,11 +74,11 @@ AC_CHECK_LIB([vulkan], [vkGetInstanceProcAddr], [VULKAN_LIBS="-lvulkan"], [AC_MSG_ERROR([libvulkan not found.])])
-AC_SUBST([SPIRV_TOOLS_LIBS]) +HAVE_SPIRV_TOOLS=no AS_IF([test "x$with_spirv_tools" = "xyes"], - [AC_CHECK_LIB([SPIRV-Tools], [spvTextToBinary], - [SPIRV_TOOLS_LIBS="-lstdc++ -lSPIRV-Tools"], - [AC_MSG_ERROR([libSPIRV-Tools not found.])], [-lstdc++])]) + [PKG_CHECK_MODULES([SPIRV_TOOLS], [SPIRV-Tools-shared], + [AC_DEFINE([HAVE_SPIRV_TOOLS], [1], [Define to 1 if you have SPIRV-Tools.]) + HAVE_SPIRV_TOOLS=yes])])
PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms])
@@ -94,11 +91,6 @@ VKD3D_CHECK_FUNC([HAVE_SYNC_SUB_AND_FETCH], [__sync_sub_and_fetch], [__sync_sub_ AM_CONDITIONAL([HAS_CROSSTARGET32], [test "x$CROSSTARGET32" != "xno"]) AM_CONDITIONAL([HAS_CROSSTARGET64], [test "x$CROSSTARGET64" != "xno"])
-AS_IF([test "x$ac_cv_header_spirv_tools_libspirv_h" = "xyes" -a "x$ac_cv_lib_SPIRV_Tools_spvTextToBinary" = "xyes"], - [AC_DEFINE([HAVE_SPIRV_TOOLS], [1], [Define to 1 if you have SPIRV-Tools.]) - HAVE_SPIRV_TOOLS=yes], - [HAVE_SPIRV_TOOLS=no]) - AC_CONFIG_FILES([Makefile]) AC_OUTPUT
On 7 February 2018 at 23:57, Józef Kucia joseph.kucia@gmail.com wrote:
From: Józef Kucia jkucia@codeweavers.com
SPIRV-Tools are now also built as a shared library.
Unfortunately it doesn't quite work, SPIRV-Tools-shared.pc.in has a hardcoded "/lib64" in libdir, where it should probably use @CMAKE_INSTALL_LIBDIR@.
On Thu, Feb 8, 2018 at 5:28 PM, Henri Verbeet hverbeet@gmail.com wrote:
On 7 February 2018 at 23:57, Józef Kucia joseph.kucia@gmail.com wrote:
From: Józef Kucia jkucia@codeweavers.com
SPIRV-Tools are now also built as a shared library.
Unfortunately it doesn't quite work, SPIRV-Tools-shared.pc.in has a hardcoded "/lib64" in libdir, where it should probably use @CMAKE_INSTALL_LIBDIR@.
It's fixed in SPIRV-Tools now.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com