[RFC PATCH 1/2] winevulkan: Generate and install JSON manifest and registry entry used by official Vulkan loader.
Zhiyi Zhang
zzhang at codeweavers.com
Fri Mar 13 20:21:47 CDT 2020
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47109
On 3/14/20 1:10 AM, Brendan Shanks wrote:
> Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
> ---
>
> This patch has make_vulkan generate a 'loader/winevulkan.json.in' manifest file,
> it gets processed to 'loader/winevulkan.json', then installed by
> wine.inf to c:\windows\system32.
>
> - winevulkan.json doesn't need any pre-processing, but '.in' was the
> only way I found to have it built/installed. Is there a better way?
>
> - Is 'loader' the best place to generate the file? I feel like
> 'dlls/winevulkan' would be preferable, but that puts the file in a
> different place relative to wine.inf when running from the build tree
> or installed.
>
> configure.ac | 1 +
> dlls/winevulkan/make_vulkan | 13 +++++++++++++
> loader/Makefile.in | 3 ++-
> loader/wine.inf.in | 32 ++++++++++++++++++++++----------
> loader/winevulkan.json.in | 7 +++++++
> 5 files changed, 45 insertions(+), 11 deletions(-)
> create mode 100644 loader/winevulkan.json.in
>
> diff --git a/configure.ac b/configure.ac
> index 7c3c6d2b67..5135a60a62 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -4099,6 +4099,7 @@ fonts \
> loader/wine.inf \
> loader/winebus.inf \
> loader/winehid.inf \
> +loader/winevulkan.json \
> nls \
> programs/msidb/msidb \
> programs/msiexec/msiexec \
> diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
> index 3593410041..66543dceaf 100755
> --- a/dlls/winevulkan/make_vulkan
> +++ b/dlls/winevulkan/make_vulkan
> @@ -71,6 +71,7 @@ WINE_VK_VERSION = (1, 1)
> WINE_VULKAN_H = "../../include/wine/vulkan.h"
> WINE_VULKAN_DRIVER_H = "../../include/wine/vulkan_driver.h"
> WINE_VULKAN_LOADER_SPEC = "../vulkan-1/vulkan-1.spec"
> +WINE_VULKAN_JSON = "../../loader/winevulkan.json.in"
> WINE_VULKAN_SPEC = "winevulkan.spec"
> WINE_VULKAN_THUNKS_C = "vulkan_thunks.c"
> WINE_VULKAN_THUNKS_H = "vulkan_thunks.h"
> @@ -3000,6 +3001,15 @@ def download_vk_xml(filename):
> if not os.path.isfile(filename):
> urllib.request.urlretrieve(url, filename)
>
> +def generate_vulkan_json(f):
> + f.write("{\n")
> + f.write(" \"file_format_version\": \"1.0.0\",\n")
> + f.write(" \"ICD\": {\n")
> + f.write(" \"library_path\": \"winevulkan.dll\",\n")
> + f.write(" \"api_version\": \"{0}\"\n".format(VK_XML_VERSION))
> + f.write(" }\n")
> + f.write("}\n")
> +
> def main():
> parser = argparse.ArgumentParser()
> parser.add_argument("-v", "--verbose", action="count", default=0, help="increase output verbosity")
> @@ -3031,6 +3041,9 @@ def main():
> with open(WINE_VULKAN_THUNKS_C, "w") as f:
> generator.generate_thunks_c(f, "wine_")
>
> + with open(WINE_VULKAN_JSON, "w") as f:
> + generate_vulkan_json(f)
> +
> with open(WINE_VULKAN_SPEC, "w") as f:
> generator.generate_vulkan_spec(f)
>
> diff --git a/loader/Makefile.in b/loader/Makefile.in
> index f9b2fa9293..f3638fa4e0 100644
> --- a/loader/Makefile.in
> +++ b/loader/Makefile.in
> @@ -10,7 +10,8 @@ SOURCES = \
> wine.pl.UTF-8.man.in \
> wine_info.plist.in \
> winebus.inf.in \
> - winehid.inf.in
> + winehid.inf.in \
> + winevulkan.json.in
>
> PROGRAMS = $(WINELOADER_PROGRAMS)
> INSTALL_LIB = $(WINELOADER_PROGRAMS)
> diff --git a/loader/wine.inf.in b/loader/wine.inf.in
> index 8267ef34dc..3ae4273671 100644
> --- a/loader/wine.inf.in
> +++ b/loader/wine.inf.in
> @@ -30,7 +30,7 @@ signature="$CHICAGO$"
> RegisterDlls=RegisterDllsSection
> WineFakeDlls=FakeDllsWin32,FakeDlls
> UpdateInis=SystemIni
> -CopyFiles=InfFiles,NlsFiles
> +CopyFiles=InfFiles,NlsFiles,VulkanFiles
> AddReg=\
> Classes,\
> ContentIndex,\
> @@ -48,13 +48,14 @@ AddReg=\
> SessionMgr,\
> Tapi,\
> Timezones,\
> - LicenseInformation
> + LicenseInformation,\
> + Vulkan
>
> [DefaultInstall.NT]
> RegisterDlls=RegisterDllsSection
> WineFakeDlls=FakeDllsWin32,FakeDlls
> UpdateInis=SystemIni
> -CopyFiles=InfFiles,NlsFiles
> +CopyFiles=InfFiles,NlsFiles,VulkanFiles
> AddReg=\
> Classes,\
> ContentIndex,\
> @@ -73,14 +74,15 @@ AddReg=\
> Tapi,\
> Timezones,\
> VersionInfo,\
> - LicenseInformation
> + LicenseInformation,\
> + Vulkan
>
> [DefaultInstall.ntamd64]
> RegisterDlls=RegisterDllsSection
> WineFakeDlls=FakeDllsWin64,FakeDlls
> WinePreInstall=Wow64
> UpdateInis=SystemIni
> -CopyFiles=InfFiles,NlsFiles
> +CopyFiles=InfFiles,NlsFiles,VulkanFiles
> AddReg=\
> Classes,\
> ContentIndex,\
> @@ -100,14 +102,15 @@ AddReg=\
> Tapi,\
> Timezones,\
> VersionInfo.ntamd64,\
> - LicenseInformation
> + LicenseInformation,\
> + Vulkan
>
> [DefaultInstall.ntarm64]
> RegisterDlls=RegisterDllsSection
> WineFakeDlls=FakeDllsWin64,FakeDlls
> WinePreInstall=Wow64
> UpdateInis=SystemIni
> -CopyFiles=InfFiles,NlsFiles
> +CopyFiles=InfFiles,NlsFiles,VulkanFiles
> AddReg=\
> Classes,\
> ContentIndex,\
> @@ -127,12 +130,13 @@ AddReg=\
> Tapi,\
> Timezones,\
> VersionInfo.ntamd64,\
> - LicenseInformation
> + LicenseInformation,\
> + Vulkan
>
> [Wow64Install]
> RegisterDlls=RegisterDllsSection
> WineFakeDlls=FakeDllsWin32,FakeDllsWow64
> -CopyFiles=NlsFiles
> +CopyFiles=NlsFiles,VulkanFiles
> AddReg=\
> CurrentVersion,\
> CurrentVersionWow64,\
> @@ -142,7 +146,8 @@ AddReg=\
> Misc,\
> Tapi,\
> VersionInfo.ntamd64,\
> - LicenseInformation
> + LicenseInformation,\
> + Vulkan
>
> [Wow64Install.ntarm64]
> WineFakeDlls=FakeDllsWin32
> @@ -3888,6 +3893,9 @@ HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-Solitaire-EnableGame",0x
> HKLM,Software\Wine\LicenseInformation,"Shell-InBoxGames-SpiderSolitaire-EnableGame",0x10001,0x00000001
> HKLM,Software\Wine\LicenseInformation,"Shell-PremiumInBoxGames-Chess-EnableGame",0x10001,0x00000001
>
> +[Vulkan]
> +HKLM,Software\Khronos\Vulkan\Drivers,"%11%\winevulkan.json",0x10001,0
> +
> [InfFiles]
> winebus.inf
> winehid.inf
> @@ -3965,9 +3973,13 @@ normnfd.nls
> normnfkc.nls
> normnfkd.nls
>
> +[VulkanFiles]
> +winevulkan.json
> +
> [WineSourceDirs]
> NlsFiles=nls
>
> [DestinationDirs]
> InfFiles = 17
> NlsFiles = 11
> +VulkanFiles = 11
> diff --git a/loader/winevulkan.json.in b/loader/winevulkan.json.in
> new file mode 100644
> index 0000000000..be1b278ddb
> --- /dev/null
> +++ b/loader/winevulkan.json.in
> @@ -0,0 +1,7 @@
> +{
> + "file_format_version": "1.0.0",
> + "ICD": {
> + "library_path": "winevulkan.dll",
> + "api_version": "1.1.130"
> + }
> +}
More information about the wine-devel
mailing list