[PATCH 08/10] winevulkan/winex11: Implement vkCreateInstance.
Roderick Colenbrander
thunderbird2k at gmail.com
Wed Feb 21 13:33:20 CST 2018
On Wed, Feb 21, 2018 at 4:22 AM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 20 February 2018 at 09:59, Roderick Colenbrander
> <thunderbird2k at gmail.com> wrote:
>> @@ -80,6 +80,7 @@ AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner
>> AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF]))
>> AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug and play support)]))
>> AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)]))
>> +AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use vulkan]))
> [do not use Vulkan], I suppose.
>
>> + [libvulkan ${notice_platform}development files not found, vulkan won't be supported.])
> "Vulkan"
>
>> +static void *wine_vk_alloc_dispatchable_object(size_t size)
>> +{
>> + struct wine_vk_dispatchable_object *object = heap_alloc(size);
>> +
>> + if (!object)
>> + return NULL;
>> +
>> + /* Set special header for ICD loader. */
>> + ((struct wine_vk_base*)object)->loader_magic = VULKAN_ICD_MAGIC_VALUE;
>> +
>> + return object;
>> +}
> struct wine_vk_dispatchable_object doesn't seem to add a lot. I.e.:
>
> struct wine_vk_base *object;
>
> if (!(object = heap_alloc(size)))
> return NULL;
>
> object->loader_magic = VULKAN_ICD_MAGIC_VALUE;
>
> return object;
>
It is simple right now. Long-term will become more involved (and may
add wine_vk_alloc too) when adding VkAllocationCallbacks. Need to
track more state like VkSystemAllocationScope, pointers back to user
callbacks and a user object.
>> static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
>> VkInstance *pInstance)
>> {
>> - TRACE("%p %p %p\n", pCreateInfo, pAllocator, pInstance);
>> - return vk_funcs->p_vkCreateInstance(pCreateInfo, pAllocator, pInstance);
>> + VkInstance instance = NULL;
> I think "struct VkInstance_T *instance;" may be clearer, but perhaps
> it doesn't matter all that much.
Thanks for catching I intended to use _T when I need to look inside
the object, but skipped this.
More information about the wine-devel
mailing list