auto-detect VULKAN_SDK path on windows

This commit is contained in:
Ivan 'provod' Avdeev 2021-02-21 23:28:33 -08:00
parent 5e3f1e52d6
commit ded8442993
2 changed files with 12 additions and 1 deletions

View File

@ -275,7 +275,7 @@ static vk_buffer_alloc_t renderBufferAlloc( uint32_t unit_size, uint32_t count )
}
ret.buffer_offset_in_units = offset / unit_size;
ret.ptr = g_render.buffer.mapped + offset;
ret.ptr = ((byte*)g_render.buffer.mapped) + offset;
g_render.stat.align_holes_size += offset - g_render.buffer_free_offset;
g_render.buffer_free_offset = offset + alloc_size;

View File

@ -17,6 +17,14 @@ def configure(conf):
conf.define('REF_DLL', 1)
if conf.env.DEST_OS == 'win32':
conf.start_msg('Vulkan SDK available?')
if not 'VULKAN_SDK' in conf.environ:
Logs.warn('VULKAN_SDK environment variable is not available, ref_vk will not be built')
conf.end_msg('no')
conf.env.VULKAN_SDK = conf.environ['VULKAN_SDK']
conf.end_msg('found at ' + conf.env.VULKAN_SDK)
def build(bld):
libs = [ 'public', 'M' ]
@ -31,6 +39,9 @@ def build(bld):
'../common',
'../pm_shared' ]
if bld.env.DEST_OS == 'win32':
includes.append(bld.env.VULKAN_SDK + '\\Include')
bld.shlib(
source = source,
target = 'ref_vk',