From 3df7e9502d8bd790ed289392f03698717182e648 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Sun, 6 Sep 2020 10:06:57 +0530 Subject: [PATCH] At this stage after adding few more stubs driver fails at libresoc_CreateGraphicsPipelines(). --- .../vulkan/libresoc_descriptor_set.c | 43 +++++++++++++++++++ src/libre-soc/vulkan/libresoc_device.c | 21 +++++++++ src/libre-soc/vulkan/libresoc_image.c | 37 ++++++++++++++++ src/libre-soc/vulkan/libresoc_pass.c | 40 +++++++++++++++++ src/libre-soc/vulkan/meson.build | 2 + 5 files changed, 143 insertions(+) create mode 100644 src/libre-soc/vulkan/libresoc_descriptor_set.c create mode 100644 src/libre-soc/vulkan/libresoc_pass.c diff --git a/src/libre-soc/vulkan/libresoc_descriptor_set.c b/src/libre-soc/vulkan/libresoc_descriptor_set.c new file mode 100644 index 00000000000..5c0b5a5e3ba --- /dev/null +++ b/src/libre-soc/vulkan/libresoc_descriptor_set.c @@ -0,0 +1,43 @@ +/* + * Copyright © 2016 Red Hat. + * Copyright © 2016 Bas Nieuwenhuizen + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ +#include "libresoc_private.h" + +VkResult libresoc_CreatePipelineLayout( + VkDevice _device, + const VkPipelineLayoutCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPipelineLayout* pPipelineLayout) +{ + //TODO: stub + return VK_SUCCESS; +} + +void libresoc_DestroyPipelineLayout( + VkDevice _device, + VkPipelineLayout _pipelineLayout, + const VkAllocationCallbacks* pAllocator) +{ + + //TODO: stub +} diff --git a/src/libre-soc/vulkan/libresoc_device.c b/src/libre-soc/vulkan/libresoc_device.c index 92a901657e9..0aadfe769a4 100644 --- a/src/libre-soc/vulkan/libresoc_device.c +++ b/src/libre-soc/vulkan/libresoc_device.c @@ -1727,3 +1727,24 @@ VkResult libresoc_ResetFences(VkDevice _device, //TODO: stub return VK_SUCCESS; } + +VkResult libresoc_CreateFramebuffer( + VkDevice _device, + const VkFramebufferCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkFramebuffer* pFramebuffer) +{ + //TODO: stub + return VK_SUCCESS; +} +void libresoc_DestroyBuffer( + VkDevice _device, + VkBuffer _buffer, + const VkAllocationCallbacks* pAllocator) +{} + +void libresoc_DestroyFence( + VkDevice _device, + VkFence _fence, + const VkAllocationCallbacks* pAllocator) +{} diff --git a/src/libre-soc/vulkan/libresoc_image.c b/src/libre-soc/vulkan/libresoc_image.c index 46b9acb200e..4778d4cd471 100644 --- a/src/libre-soc/vulkan/libresoc_image.c +++ b/src/libre-soc/vulkan/libresoc_image.c @@ -157,3 +157,40 @@ void libresoc_GetImageSubresourceLayout( { //TODO: stub } + +VkResult +libresoc_CreateImageView(VkDevice _device, + const VkImageViewCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkImageView *pView) +{ + //TODO: stub + return VK_SUCCESS; + // LIBRESOC_FROM_HANDLE(libresoc_device, device, _device); + // struct libresoc_image_view *view; + + // view = vk_alloc2(&device->vk.alloc, pAllocator, sizeof(*view), 8, + // VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + // if (view == NULL) + // return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY); + + // vk_object_base_init(&device->vk, &view->base, + // VK_OBJECT_TYPE_IMAGE_VIEW); + + // libresoc_image_view_init(view, device, pCreateInfo, NULL); + + // *pView = libresoc_image_view_to_handle(view); + + // return VK_SUCCESS; +} +void +libresoc_DestroyImage(VkDevice _device, VkImage _image, + const VkAllocationCallbacks *pAllocator) +{ + +} + +void +libresoc_DestroyImageView(VkDevice _device, VkImageView _iview, + const VkAllocationCallbacks *pAllocator) +{} diff --git a/src/libre-soc/vulkan/libresoc_pass.c b/src/libre-soc/vulkan/libresoc_pass.c new file mode 100644 index 00000000000..c05f60f6634 --- /dev/null +++ b/src/libre-soc/vulkan/libresoc_pass.c @@ -0,0 +1,40 @@ + +/* + * Copyright © 2016 Red Hat. + * Copyright © 2016 Bas Nieuwenhuizen + * + * based in part on anv driver which is: + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ +#include "libresoc_private.h" + +#include "vk_util.h" + +VkResult libresoc_CreateRenderPass( + VkDevice _device, + const VkRenderPassCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkRenderPass* pRenderPass) +{ + //TODO: stub + return VK_SUCCESS; +} diff --git a/src/libre-soc/vulkan/meson.build b/src/libre-soc/vulkan/meson.build index d5e6f9baaeb..ee6541c79cc 100644 --- a/src/libre-soc/vulkan/meson.build +++ b/src/libre-soc/vulkan/meson.build @@ -63,6 +63,8 @@ libresoc_vk_format_table_c = custom_target( liblibresoc_files = files( 'libresoc_device.c', + 'libresoc_descriptor_set.c', + 'libresoc_pass.c', 'libresoc_meta_clear.c', 'libresoc_image.c', 'libresoc_cmd_buffer.c', -- 2.30.2