mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2024-11-28 10:24:15 +01:00
loader work pt2
This commit is contained in:
parent
16d5fc7502
commit
643a8c6775
@ -7,5 +7,5 @@ file(GLOB asmSrc
|
||||
"qpu_assembler.c"
|
||||
)
|
||||
|
||||
add_library(QPUassembler SHARED ${asmSrc})
|
||||
add_library(QPUassembler OBJECT ${asmSrc})
|
||||
target_compile_options(QPUassembler PRIVATE -Wall -Werror=implicit-function-declaration -std=c11)
|
||||
|
@ -22,7 +22,7 @@ else(CMD_ERROR2 STREQUAL "")
|
||||
message(FATAL_ERROR ${CMD_ERROR2})
|
||||
endif(CMD_ERROR2 STREQUAL "")
|
||||
|
||||
add_library(brcm SHARED ${brcmSrc})
|
||||
add_library(brcm OBJECT ${brcmSrc})
|
||||
target_compile_options(brcm PRIVATE -Wall -std=c99)
|
||||
target_link_libraries(brcm expat z)
|
||||
#target_link_libraries(brcm expat z)
|
||||
target_compile_definitions(brcm PRIVATE V3D_VERSION=21)
|
||||
|
@ -6,4 +6,4 @@ file(GLOB driverSrc
|
||||
add_library(rpi-vk-driver SHARED ${driverSrc})
|
||||
target_compile_options(rpi-vk-driver PRIVATE -Wall -Werror=implicit-function-declaration -std=c11)
|
||||
|
||||
target_link_libraries(rpi-vk-driver drm pthread brcm QPUassembler)
|
||||
target_link_libraries(rpi-vk-driver drm pthread expat z $<TARGET_OBJECTS:brcm> $<TARGET_OBJECTS:QPUassembler>)
|
||||
|
@ -692,5 +692,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDeviceMask(
|
||||
VkCommandBuffer commandBuffer,
|
||||
uint32_t deviceMask)
|
||||
{
|
||||
UNSUPPORTED(vkCmdSetDeviceMask);
|
||||
UNSUPPORTED(rpi_vkCmdSetDeviceMask);
|
||||
}
|
||||
|
@ -911,7 +911,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalBufferProperties(
|
||||
const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
|
||||
VkExternalBufferProperties* pExternalBufferProperties)
|
||||
{
|
||||
UNSUPPORTED(vkGetPhysicalDeviceExternalBufferProperties);
|
||||
UNSUPPORTED(rpi_vkGetPhysicalDeviceExternalBufferProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties(
|
||||
@ -919,7 +919,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties(
|
||||
const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
|
||||
VkExternalFenceProperties* pExternalFenceProperties)
|
||||
{
|
||||
UNSUPPORTED(vkGetPhysicalDeviceExternalFenceProperties);
|
||||
UNSUPPORTED(rpi_vkGetPhysicalDeviceExternalFenceProperties);
|
||||
}
|
||||
|
||||
|
||||
@ -928,7 +928,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalSemaphoreProperties(
|
||||
const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
|
||||
VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
|
||||
{
|
||||
UNSUPPORTED(vkGetPhysicalDeviceExternalSemaphoreProperties);
|
||||
UNSUPPORTED(rpi_vkGetPhysicalDeviceExternalSemaphoreProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceGroupPeerMemoryFeatures(
|
||||
@ -938,5 +938,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceGroupPeerMemoryFeatures(
|
||||
uint32_t remoteDeviceIndex,
|
||||
VkPeerMemoryFeatureFlags* pPeerMemoryFeatures)
|
||||
{
|
||||
UNSUPPORTED(vkGetDeviceGroupPeerMemoryFeatures);
|
||||
UNSUPPORTED(rpi_vkGetDeviceGroupPeerMemoryFeatures);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/vc4_drm.h>
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vk_icd.h>
|
||||
#include "vkExt.h"
|
||||
|
@ -11,7 +11,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateComputePipelines(
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkPipeline* pPipelines)
|
||||
{
|
||||
UNSUPPORTED(vkCreateComputePipelines);
|
||||
UNSUPPORTED(rpi_vkCreateComputePipelines);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchIndirect(
|
||||
VkBuffer buffer,
|
||||
VkDeviceSize offset)
|
||||
{
|
||||
UNSUPPORTED(vkCmdDispatchIndirect);
|
||||
UNSUPPORTED(rpi_vkCmdDispatchIndirect);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatch(
|
||||
@ -29,7 +29,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatch(
|
||||
uint32_t groupCountY,
|
||||
uint32_t groupCountZ)
|
||||
{
|
||||
UNSUPPORTED(vkCmdDispatch);
|
||||
UNSUPPORTED(rpi_vkCmdDispatch);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchBase(
|
||||
@ -41,5 +41,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchBase(
|
||||
uint32_t groupCountY,
|
||||
uint32_t groupCountZ)
|
||||
{
|
||||
UNSUPPORTED(vkCmdDispatchBase);
|
||||
UNSUPPORTED(rpi_vkCmdDispatchBase);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "declarations.h"
|
||||
|
||||
/*
|
||||
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#devsandqueues-physical-device-enumeration
|
||||
* If pPhysicalDevices is NULL, then the number of physical devices available is returned in pPhysicalDeviceCount. Otherwise, pPhysicalDeviceCount must point to a
|
||||
@ -310,7 +312,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2(
|
||||
|
||||
//TODO handle pNext
|
||||
|
||||
vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue);
|
||||
rpi_vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -422,7 +424,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties2(
|
||||
{
|
||||
assert(physicalDevice);
|
||||
assert(pProperties);
|
||||
vkGetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
|
||||
rpi_vkGetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
|
||||
|
||||
if(pProperties->pNext)
|
||||
{
|
||||
@ -518,7 +520,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties2(
|
||||
{
|
||||
assert(physicalDevice);
|
||||
assert(pFormatProperties);
|
||||
vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &pFormatProperties->formatProperties);
|
||||
rpi_vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &pFormatProperties->formatProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
|
||||
@ -653,7 +655,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2(
|
||||
|
||||
//TODO handle pNext
|
||||
|
||||
return vkGetPhysicalDeviceImageFormatProperties(physicalDevice,
|
||||
return rpi_vkGetPhysicalDeviceImageFormatProperties(physicalDevice,
|
||||
pImageFormatInfo->format,
|
||||
pImageFormatInfo->type,
|
||||
pImageFormatInfo->tiling,
|
||||
@ -668,7 +670,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceLayerProperties(
|
||||
VkLayerProperties* pProperties)
|
||||
{
|
||||
//deprecated, just return instance layers
|
||||
return vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties);
|
||||
return rpi_vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures2(
|
||||
@ -677,7 +679,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures2(
|
||||
{
|
||||
assert(physicalDevice);
|
||||
assert(pFeatures);
|
||||
vkGetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
|
||||
rpi_vkGetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties2(
|
||||
@ -686,5 +688,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties2(
|
||||
VkQueueFamilyProperties2* pQueueFamilyProperties)
|
||||
{
|
||||
assert(physicalDevice);
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
|
||||
rpi_vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexedIndirect(
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
{
|
||||
UNSUPPORTED(vkCmdDrawIndexedIndirect);
|
||||
UNSUPPORTED(rpi_vkCmdDrawIndexedIndirect);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndirect(
|
||||
@ -490,5 +490,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndirect(
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
{
|
||||
UNSUPPORTED(vkCmdDrawIndirect);
|
||||
UNSUPPORTED(rpi_vkCmdDrawIndirect);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <vulkan/vk_icd.h>
|
||||
|
||||
#include "declarations.h"
|
||||
#include "vkExt.h"
|
||||
|
||||
#define RETFUNC(f) if(!strcmp(pName, #f)) return rpi_##f
|
||||
|
||||
@ -18,64 +19,23 @@ VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t
|
||||
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName)
|
||||
{
|
||||
fprintf(stderr, "-----------------vk_icdGetInstanceProcAddr: %s\n", pName);
|
||||
|
||||
if(loaderVersion == -1)
|
||||
{
|
||||
//dealing with legacy ICD loader, as vk_icdNegotiateLoaderICDInterfaceVersion has not been called
|
||||
loaderVersion = 1;
|
||||
}
|
||||
|
||||
RETFUNC(vkCreateInstance);
|
||||
RETFUNC(vkEnumerateInstanceExtensionProperties);
|
||||
RETFUNC(vkEnumerateInstanceVersion);
|
||||
RETFUNC(vkDestroyInstance);
|
||||
RETFUNC(vkEnumeratePhysicalDevices);
|
||||
RETFUNC(vkGetInstanceProcAddr);
|
||||
RETFUNC(vkEnumeratePhysicalDeviceGroups);
|
||||
RETFUNC(vkDestroySurfaceKHR);
|
||||
RETFUNC(vkGetPhysicalDeviceFeatures);
|
||||
RETFUNC(vkGetPhysicalDeviceFeatures2);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceFormatProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceFormatProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceImageFormatProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceImageFormatProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceQueueFamilyProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceQueueFamilyProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceMemoryProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceMemoryProperties2);
|
||||
RETFUNC(vkCreateDevice);
|
||||
RETFUNC(vkDestroyDevice);
|
||||
RETFUNC(vkEnumerateDeviceExtensionProperties);
|
||||
RETFUNC(vkEnumerateDeviceLayerProperties);
|
||||
|
||||
return 0;
|
||||
return rpi_vkGetInstanceProcAddr(instance, pName);
|
||||
}
|
||||
|
||||
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance instance,
|
||||
const char* pName)
|
||||
{
|
||||
RETFUNC(vkEnumeratePhysicalDevices);
|
||||
RETFUNC(vkEnumeratePhysicalDeviceGroups);
|
||||
RETFUNC(vkGetPhysicalDeviceFeatures);
|
||||
RETFUNC(vkGetPhysicalDeviceFeatures2);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceFormatProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceFormatProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceImageFormatProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceImageFormatProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceQueueFamilyProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceQueueFamilyProperties2);
|
||||
RETFUNC(vkGetPhysicalDeviceMemoryProperties);
|
||||
RETFUNC(vkGetPhysicalDeviceMemoryProperties2);
|
||||
RETFUNC(vkCreateDevice);
|
||||
RETFUNC(vkEnumerateDeviceExtensionProperties);
|
||||
RETFUNC(vkEnumerateDeviceLayerProperties);
|
||||
fprintf(stderr, "-----------------vk_icdGetPhysicalDeviceProcAddr: %s\n", pName);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -235,6 +195,8 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
|
||||
VkInstance instance,
|
||||
const char* pName)
|
||||
{
|
||||
fprintf(stderr, "-----------------rpi_vkGetInstanceProcAddr: %s\n", pName);
|
||||
|
||||
//TODO take instance into consideration
|
||||
//eg only return extension functions that are enabled?
|
||||
|
||||
@ -414,6 +376,8 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
|
||||
RETFUNC(vkGetDescriptorSetLayoutSupport);
|
||||
RETFUNC(vkBindBufferMemory2);
|
||||
|
||||
RETFUNC(vkCreateRpiSurfaceEXT);
|
||||
RETFUNC(vkCreateShaderModuleFromRpiAssemblyEXT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceMemoryProperties2(
|
||||
VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
|
||||
{
|
||||
assert(physicalDevice);
|
||||
vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
|
||||
rpi_vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceMemoryCommitment(
|
||||
|
@ -328,7 +328,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches(
|
||||
uint32_t srcCacheCount,
|
||||
const VkPipelineCache* pSrcCaches)
|
||||
{
|
||||
UNSUPPORTED(vkMergePipelineCaches);
|
||||
UNSUPPORTED(rpi_vkMergePipelineCaches);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData(
|
||||
size_t* pDataSize,
|
||||
void* pData)
|
||||
{
|
||||
UNSUPPORTED(vkGetPipelineCacheData);
|
||||
UNSUPPORTED(rpi_vkGetPipelineCacheData);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache(
|
||||
VkPipelineCache pipelineCache,
|
||||
const VkAllocationCallbacks* pAllocator)
|
||||
{
|
||||
UNSUPPORTED(vkDestroyPipelineCache);
|
||||
UNSUPPORTED(rpi_vkDestroyPipelineCache);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
|
||||
@ -413,6 +413,6 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineCache(
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkPipelineCache* pPipelineCache)
|
||||
{
|
||||
UNSUPPORTED(vkCreatePipelineCache);
|
||||
UNSUPPORTED(rpi_vkCreatePipelineCache);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetBufferMemoryRequirements2(
|
||||
assert(pInfo);
|
||||
assert(pMemoryRequirements);
|
||||
|
||||
vkGetBufferMemoryRequirements(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements);
|
||||
rpi_vkGetBufferMemoryRequirements(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -339,7 +339,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2(
|
||||
|
||||
for(uint32_t c = 0; c < bindInfoCount; ++c)
|
||||
{
|
||||
VkResult res = vkBindBufferMemory(device, pBindInfos[c].buffer, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
|
||||
VkResult res = rpi_vkBindBufferMemory(device, pBindInfos[c].buffer, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
|
||||
if(res != VK_SUCCESS)
|
||||
{
|
||||
ret = res;
|
||||
@ -357,7 +357,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements2(
|
||||
assert(device);
|
||||
assert(pInfo);
|
||||
assert(pMemoryRequirements);
|
||||
vkGetImageMemoryRequirements(device, pInfo->image, pMemoryRequirements);
|
||||
rpi_vkGetImageMemoryRequirements(device, pInfo->image, pMemoryRequirements);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2(
|
||||
@ -372,7 +372,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2(
|
||||
|
||||
for(uint32_t c = 0; c < bindInfoCount; ++c)
|
||||
{
|
||||
VkResult res = vkBindImageMemory(device, pBindInfos[c].image, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
|
||||
VkResult res = rpi_vkBindImageMemory(device, pBindInfos[c].image, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
|
||||
if(res != VK_SUCCESS)
|
||||
{
|
||||
ret = res;
|
||||
|
@ -116,7 +116,7 @@ VkResult rpi_vkCreateShaderModuleFromRpiAssemblyEXT(VkDevice device, VkRpiShader
|
||||
*/
|
||||
VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule)
|
||||
{
|
||||
UNSUPPORTED(vkCreateShaderModule);
|
||||
UNSUPPORTED(rpi_vkCreateShaderModule);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties(
|
||||
uint32_t* pPropertyCount,
|
||||
VkSparseImageFormatProperties* pProperties)
|
||||
{
|
||||
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties);
|
||||
UNSUPPORTED(rpi_vkGetPhysicalDeviceSparseImageFormatProperties);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements(
|
||||
@ -19,7 +19,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements(
|
||||
uint32_t* pSparseMemoryRequirementCount,
|
||||
VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
|
||||
{
|
||||
UNSUPPORTED(vkGetImageSparseMemoryRequirements);
|
||||
UNSUPPORTED(rpi_vkGetImageSparseMemoryRequirements);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse(
|
||||
@ -28,7 +28,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse(
|
||||
const VkBindSparseInfo* pBindInfo,
|
||||
VkFence fence)
|
||||
{
|
||||
UNSUPPORTED(vkQueueBindSparse);
|
||||
UNSUPPORTED(rpi_vkQueueBindSparse);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2(
|
||||
uint32_t* pPropertyCount,
|
||||
VkSparseImageFormatProperties2* pProperties)
|
||||
{
|
||||
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties2);
|
||||
UNSUPPORTED(rpi_vkGetPhysicalDeviceSparseImageFormatProperties2);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements2(
|
||||
@ -47,5 +47,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements2(
|
||||
uint32_t* pSparseMemoryRequirementCount,
|
||||
VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
|
||||
{
|
||||
UNSUPPORTED(vkGetImageSparseMemoryRequirements2);
|
||||
UNSUPPORTED(rpi_vkGetImageSparseMemoryRequirements2);
|
||||
}
|
||||
|
@ -436,14 +436,14 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents(
|
||||
uint32_t imageMemoryBarrierCount,
|
||||
const VkImageMemoryBarrier* pImageMemoryBarriers)
|
||||
{
|
||||
UNSUPPORTED(vkCmdWaitEvents);
|
||||
UNSUPPORTED(rpi_vkCmdWaitEvents);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus(
|
||||
VkDevice device,
|
||||
VkEvent event)
|
||||
{
|
||||
UNSUPPORTED(vkGetEventStatus);
|
||||
UNSUPPORTED(rpi_vkGetEventStatus);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent(
|
||||
VkEvent event,
|
||||
const VkAllocationCallbacks* pAllocator)
|
||||
{
|
||||
UNSUPPORTED(vkDestroyEvent);
|
||||
UNSUPPORTED(rpi_vkDestroyEvent);
|
||||
}
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent(
|
||||
@ -460,7 +460,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent(
|
||||
VkEvent event,
|
||||
VkPipelineStageFlags stageMask)
|
||||
{
|
||||
UNSUPPORTED(vkCmdResetEvent);
|
||||
UNSUPPORTED(rpi_vkCmdResetEvent);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent(
|
||||
@ -469,7 +469,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent(
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkEvent* pEvent)
|
||||
{
|
||||
UNSUPPORTED(vkCreateEvent);
|
||||
UNSUPPORTED(rpi_vkCreateEvent);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -477,7 +477,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent(
|
||||
VkDevice device,
|
||||
VkEvent event)
|
||||
{
|
||||
UNSUPPORTED(vkResetEvent);
|
||||
UNSUPPORTED(rpi_vkResetEvent);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent(
|
||||
VkDevice device,
|
||||
VkEvent event)
|
||||
{
|
||||
UNSUPPORTED(vkSetEvent);
|
||||
UNSUPPORTED(rpi_vkSetEvent);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
@ -494,5 +494,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetEvent(
|
||||
VkEvent event,
|
||||
VkPipelineStageFlags stageMask)
|
||||
{
|
||||
UNSUPPORTED(vkCmdSetEvent);
|
||||
UNSUPPORTED(rpi_vkCmdSetEvent);
|
||||
}
|
||||
|
@ -76,14 +76,14 @@ typedef struct VkRpiShaderModuleAssemblyCreateInfoEXT {
|
||||
|
||||
//extension name something like: VK_KHR_rpi_surface
|
||||
//extension that allows developers to create a surface to render to on Raspbian Stretch Lite
|
||||
VkResult vkCreateRpiSurfaceEXT(
|
||||
VkResult rpi_vkCreateRpiSurfaceEXT(
|
||||
VkInstance instance,
|
||||
const VkRpiSurfaceCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
//extension that allows developers to submit QPU assembly directly and thus hand optimise code
|
||||
VkResult vkCreateShaderModuleFromRpiAssemblyEXT(
|
||||
VkResult rpi_vkCreateShaderModuleFromRpiAssemblyEXT(
|
||||
VkDevice device,
|
||||
VkRpiShaderModuleAssemblyCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
|
10
driver/wsi.c
10
driver/wsi.c
@ -3,6 +3,8 @@
|
||||
|
||||
#include "kernel/vc4_packet.h"
|
||||
|
||||
#include "declarations.h"
|
||||
|
||||
/*
|
||||
* Implementation of our RPI specific "extension"
|
||||
*/
|
||||
@ -234,7 +236,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
|
||||
|
||||
|
||||
VkMemoryRequirements mr;
|
||||
vkGetImageMemoryRequirements(device, &s->images[c], &mr);
|
||||
rpi_vkGetImageMemoryRequirements(device, &s->images[c], &mr);
|
||||
|
||||
//TODO is this the right place to do this?
|
||||
s->images[c].tiling = VC4_TILING_FORMAT_T;
|
||||
@ -253,9 +255,9 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
|
||||
}
|
||||
|
||||
VkDeviceMemory mem;
|
||||
vkAllocateMemory(device, &ai, 0, &mem);
|
||||
rpi_vkAllocateMemory(device, &ai, 0, &mem);
|
||||
|
||||
vkBindImageMemory(device, &s->images[c], mem, 0);
|
||||
rpi_vkBindImageMemory(device, &s->images[c], mem, 0);
|
||||
|
||||
//set tiling to T if size > 4KB
|
||||
if(s->images[c].tiling == VC4_TILING_FORMAT_T)
|
||||
@ -408,7 +410,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
|
||||
{
|
||||
for(int c = 0; c < s->numImages; ++c)
|
||||
{
|
||||
vkFreeMemory(device, s->images[c].boundMem, 0);
|
||||
rpi_vkFreeMemory(device, s->images[c].boundMem, 0);
|
||||
modeset_destroy_fb(controlFd, &s->images[c]);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,5 @@
|
||||
|
||||
mkdir -p $HOME/.rpi-vk-driver/
|
||||
cp librpi-vk-driver.so $HOME/.rpi-vk-driver/
|
||||
cp libQPUassembler.so $HOME/.rpi-vk-driver/
|
||||
cp libbrcm.so $HOME/.rpi-vk-driver/
|
||||
mkdir -p $HOME/.local/share/vulkan/icd.d/
|
||||
cp rpi-vk-driver.json $HOME/.local/share/vulkan/icd.d/
|
@ -158,6 +158,42 @@ void mainLoop() {
|
||||
}
|
||||
}
|
||||
|
||||
VkBool32 debugCallback(
|
||||
VkDebugReportFlagsEXT flags,
|
||||
VkDebugReportObjectTypeEXT objectType,
|
||||
uint64_t object,
|
||||
size_t location,
|
||||
int32_t messageCode,
|
||||
const char* pLayerPrefix,
|
||||
const char* pMessage,
|
||||
void* pUserData)
|
||||
{
|
||||
std::cerr << "Debug callback: ";
|
||||
if(flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT)
|
||||
std::cerr << "info ";
|
||||
|
||||
if(flags & VK_DEBUG_REPORT_WARNING_BIT_EXT)
|
||||
std::cerr << "warn ";
|
||||
if(flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT)
|
||||
std::cerr << "perf ";
|
||||
|
||||
if(flags & VK_DEBUG_REPORT_ERROR_BIT_EXT)
|
||||
std::cerr << "error ";
|
||||
|
||||
if(flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT)
|
||||
std::cerr << "debug ";
|
||||
|
||||
std::cerr << std::endl
|
||||
<< "object type: " << objectType
|
||||
<< " object: " << object
|
||||
<< " location: " << location
|
||||
<< " message code: " << messageCode << std::endl
|
||||
<< " layer prefix: " << pLayerPrefix << std::endl
|
||||
<< " message: " << pMessage
|
||||
<< std::endl;
|
||||
|
||||
}
|
||||
|
||||
void createInstance() {
|
||||
VkApplicationInfo appInfo = {};
|
||||
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||
@ -190,8 +226,14 @@ void createInstance() {
|
||||
std::cout << "\t" << extension.extensionName << std::endl;
|
||||
}
|
||||
|
||||
VkDebugReportCallbackCreateInfoEXT debugCallbackInfo = {};
|
||||
debugCallbackInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
|
||||
debugCallbackInfo.flags = 0xffffffff;
|
||||
debugCallbackInfo.pfnCallback = (PFN_vkDebugReportCallbackEXT)debugCallback;
|
||||
|
||||
VkInstanceCreateInfo createInfo = {};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
createInfo.pNext = &debugCallbackInfo;
|
||||
createInfo.pApplicationInfo = &appInfo;
|
||||
//createInfo.enabledExtensionCount = glfwExtensionCount;
|
||||
createInfo.enabledExtensionCount = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user