1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-01-18 10:52:14 +01:00

trying to fix the weird trampoline crash

This commit is contained in:
yours3lf 2020-05-18 21:58:34 +01:00
parent a444f2e379
commit 0301ceedfa
28 changed files with 89 additions and 35 deletions

View File

@ -24,8 +24,7 @@ endif(CMD_ERROR2 STREQUAL "")
add_library(brcm OBJECT ${brcmSrc})
target_compile_options(brcm PRIVATE -Wall -std=c99
-march=${RPI_ARCH}
-fPIC
-march=${RPI_ARCH} -fPIC
)
#target_link_libraries(brcm expat z)
target_compile_definitions(brcm PRIVATE V3D_VERSION=21)

View File

@ -5,7 +5,7 @@ file(GLOB driverSrc
add_library(rpi-vk-driver SHARED ${driverSrc})
target_compile_options(rpi-vk-driver PRIVATE -Wall -Wextra -Wpacked -Wcast-align -std=c11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(rpi-vk-driver drm pthread expat z $<TARGET_OBJECTS:brcm> $<TARGET_OBJECTS:QPUassembler>)

View File

@ -37,8 +37,8 @@
#include "vkCaps.h"
#define PROFILESTART(x)// startMeasure((&x), (#x))
#define PROFILEEND(x) endMeasure((&x))
#define PROFILESTART(x)// startMeasure((&\x), (#x))
#define PROFILEEND(x) endMeasure((x))
/**
//scope

View File

@ -4,12 +4,11 @@ extern "C" {
#include "profiler.h"
/*
/**
#define _POSIX_C_SOURCE 199309L
#include <time.h>
#include <unistd.h>
*/
#include <stdlib.h>
#include <string.h>
@ -37,7 +36,6 @@ void initProfiler()
void startMeasure(void* func, const char* funcName)
{
/**
initProfiler();
while(globalProfilerGuard);
@ -67,10 +65,11 @@ void startMeasure(void* func, const char* funcName)
globalProfilerGuard = 0;
}
/**/
}
void endMeasure(uint32_t func)
/**/
void endMeasure(unsigned func)
{
/**
struct timespec end;
@ -96,6 +95,7 @@ void endMeasure(uint32_t func)
}
/**
double getTimeSpent(void* func)
{
assert(globalProfiler);
@ -174,6 +174,7 @@ void profilePrintResults()
}
}
}
/**/
#if defined (__cplusplus)
}

View File

@ -2,6 +2,7 @@
extern "C" {
#endif
/**
#include "map.h"
#define MILLION 1000000.0
@ -24,13 +25,13 @@ typedef struct
void initProfiler();
void startMeasure(void* func, const char* funcName);
void endMeasure(uint32_t func);
/**/
void endMeasure(unsigned func);
/**
double getTimeSpent(void* func);
void profilePrintResults();
/**/
#if defined (__cplusplus)
}
#endif

View File

@ -669,7 +669,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
PROFILEEND(rpi_vkDestroySwapchainKHR);
profilePrintResults();
//profilePrintResults();
}
/*

View File

@ -16,4 +16,5 @@ add_subdirectory(CPAtest)
add_subdirectory(cubemapping)
add_subdirectory(attribTest)
add_subdirectory(clearTest)
add_subdirectory(inputTest)
add_subdirectory(inputTest)
add_subdirectory(mintest)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(CPAtest ${testSrc})
target_compile_options(CPAtest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(CPAtest rpi-vk-driver)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(ETC ${testSrc} )
target_compile_options(ETC PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(ETC vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(HDR ${testSrc} )
target_compile_options(HDR PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(HDR vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(MSAA ${testSrc} )
target_compile_options(MSAA PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(MSAA vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(attribTest ${testSrc} )
target_compile_options(attribTest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(attribTest vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(blending ${testSrc} )
target_compile_options(blending PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(blending vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(clear ${testSrc})
target_compile_options(clear PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(clear vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(clearTest ${testSrc} )
target_compile_options(clearTest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(clearTest vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(cubemapping ${testSrc} )
target_compile_options(cubemapping PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(cubemapping vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(depthTest ${testSrc} )
target_compile_options(depthTest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(depthTest vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(depthTex ${testSrc} )
target_compile_options(depthTex PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(depthTex vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(indexedTriangle ${testSrc} )
target_compile_options(indexedTriangle PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(indexedTriangle vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(inputTest ${testSrc})
target_compile_options(inputTest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(inputTest mtdev evdev udev input)

View File

@ -0,0 +1,11 @@
file(GLOB testSrc
"*.h"
"*.cpp"
)
add_executable(mintest ${testSrc})
target_compile_options(mintest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(mintest vulkan $<TARGET_OBJECTS:QPUassembler>)

41
test/mintest/mintest.cpp Normal file
View File

@ -0,0 +1,41 @@
#include <stdlib.h>
#include <vulkan/vulkan.h>
int main() {
VkInstance instance;
VkSurfaceKHR windowSurface;
VkPhysicalDevice physicalDevice;
const char* enabledExtensions[] = {
"VK_KHR_surface",
"VK_KHR_display",
};
VkInstanceCreateInfo createInfo = {};
createInfo.enabledExtensionCount = sizeof(enabledExtensions) / sizeof(const char*);
createInfo.ppEnabledExtensionNames = enabledExtensions;
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
vkCreateInstance(&createInfo, nullptr, &instance);
uint32_t deviceCount = 1;
vkEnumeratePhysicalDevices(instance, &deviceCount, &physicalDevice);
uint32_t displayCount;
vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, &displayCount, 0);
VkDisplayPropertiesKHR* displayProperties = (VkDisplayPropertiesKHR*)malloc(sizeof(VkDisplayPropertiesKHR)*displayCount);
vkGetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, &displayCount, displayProperties);
uint32_t modeCount;
vkGetDisplayModePropertiesKHR(physicalDevice, displayProperties[0].display, &modeCount, 0);
VkDisplayModePropertiesKHR* displayModeProperties = (VkDisplayModePropertiesKHR*)malloc(sizeof(VkDisplayModePropertiesKHR)*modeCount);
vkGetDisplayModePropertiesKHR(physicalDevice, displayProperties[0].display, &modeCount, displayModeProperties);
VkDisplaySurfaceCreateInfoKHR dsci = {};
dsci.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR;
vkCreateDisplayPlaneSurfaceKHR(instance, &dsci, 0, &windowSurface);
return 0;
}

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(mipmapping ${testSrc} )
target_compile_options(mipmapping PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(mipmapping vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(query ${testSrc} )
target_compile_options(query PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(query vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(stencilTest ${testSrc} )
target_compile_options(stencilTest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(stencilTest vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(texturing ${testSrc} )
target_compile_options(texturing PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(texturing vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(triangle ${testSrc} )
target_compile_options(triangle PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(triangle vulkan $<TARGET_OBJECTS:QPUassembler>)

View File

@ -5,7 +5,7 @@ file(GLOB testSrc
add_executable(varyings ${testSrc} )
target_compile_options(varyings PRIVATE -Wall -std=c++11
-march=${RPI_ARCH}
-march=${RPI_ARCH} -fPIC
)
target_link_libraries(varyings vulkan $<TARGET_OBJECTS:QPUassembler>)