-static int _rnd_count = 10000;
-static int _cur_rnd = 0;
+static int _rnd_count = 9999;
static float _rnd[] = { 0.39540747,
0.841546, 0.52073574, 0.80399257, 0.95868486, 0.46164507, 0.5644759, 0.50258803, 0.1953517, 0.40522006, 0.7953865,
0.7795385, 0.6009604, 0.03921096, 0.56872225, 0.93369347, 0.7019503, 0.5392296, 0.2671585, 0.87286836, 0.28110227,
0.4205718, 0.2910258, 0.67623764, 0.69533557, 0.33236894, 0.17955771, 0.25711736, 0.5261945, 0.48835787};
float rndf() {
+ static int _cur_rnd = 0;
if (_cur_rnd > _rnd_count)
_cur_rnd = 0;
- return _rnd[_cur_rnd++];
+ return _rnd[_cur_rnd++];
}
-float rndf_reset() {
- _cur_rnd = 0;
-}
\ No newline at end of file
float rndf();
-float rndf_reset();
\ No newline at end of file
printf("\t-y height:\tOutput surface height.\n");
printf("\t-S num samples:\tOutput surface filter, default is 1.\n");
printf("\t-g gpu_type:\tSet prefered GPU type:\n");
- printf("\t\t\t\t- 0: Other\n");
- printf("\t\t\t\t- 1: Integrated\n");
- printf("\t\t\t\t- 2: Discrete\n");
- printf("\t\t\t\t- 3: Virtual\n");
- printf("\t\t\t\t- 4: Cpu\n");
+ printf("\t\t\t - 0: Other\n");
+ printf("\t\t\t - 1: Integrated (second choice)\n");
+ printf("\t\t\t - 2: Discrete (first choice)\n");
+ printf("\t\t\t - 3: Virtual\n");
+ printf("\t\t\t - 4: Cpu\n");
printf("\t-n index:\tRun only a single test, zero based index.\n");
- printf("\t-q:\t\tQuiet, don't print measures table head row, usefull for batch tests\n");
- printf("\t-p:\t\tPrint test details and exit without performing test, usefull to print details in logs\n");
- printf("\t-vsync:\t\tEnable VSync, disabled by default\n");
- printf("\t-h:\t\t\tthis help message.\n");
+ printf("\t-q:\t\tQuiet, don't print measures table head row, usefull for batch tests.\n");
+ printf("\t-p:\t\tPrint test details and exit without performing test, usefull to print details in logs.\n");
+ printf("\t-vsync:\t\tEnable VSync, disabled by default.\n");
+ printf("\t-h:\t\tThis help message.\n");
printf("\n");
exit(-1);
}
bool deferredResolve = false;
VkhPhyInfo* phys = vkh_app_get_phyinfos (app, &phyCount, VK_NULL_HANDLE);
VkhPhyInfo pi = 0;
- for (uint32_t i=0; i<phyCount; i++){
- pi = phys[i];
- if (pi->properties.deviceType == preferedPhysicalDeviceType)
- break;
- }
+ if (!vkengine_try_get_phyinfo(phys, phyCount, preferedPhysicalDeviceType, &pi))
+ if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, &pi))
+ if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
+ pi = phys[0];
uint32_t qCount = 0;
float qPriorities[] = {0.0};
vkQueuePresentKHR(r->queue, &present);
}
#else
- if (!paused)
- testfunc();
+ if (paused)
+ continue;
+
+ testfunc();
if (deferredResolve)
vkvg_multisample_surface_resolve(surf);
}
#endif
- if (paused)
- continue;
-
stop_time = get_tick();
run_time = stop_time - start_time;
run_time_values[i] = run_time;
float dashes[] = {20.0f, 10.0f};
uint32_t dashes_count= 0;
float dash_offset = 0;
-float line_width = 10.f;
+float line_width = 2.f;
VkvgContext _initCtx() {
VkvgContext ctx = vkvg_create(surf);
printf("-----------------\n\n");
free (availableLayers);
}
-
+bool vkengine_try_get_phyinfo (VkhPhyInfo* phys, uint32_t phyCount, VkPhysicalDeviceType gpuType, VkhPhyInfo* phy) {
+ for (uint32_t i=0; i<phyCount; i++){
+ if (phys[i]->properties.deviceType == gpuType) {
+ *phy = phys[i];
+ return true;
+ }
+ }
+ return false;
+}
vk_engine_t* vkengine_create (VkPhysicalDeviceType preferedGPU, VkPresentModeKHR presentMode, uint32_t width, uint32_t height) {
vk_engine_t* e = (vk_engine_t*)calloc(1,sizeof(vk_engine_t));
const char* enabledLayers[] = {"VK_LAYER_KHRONOS_validation"};
#else
const uint32_t enabledLayersCount = 0;
- const char* enabledLayers[] = {NULL};
+ const char** enabledLayers = NULL;
#endif
#if defined(DEBUG) && defined (VKVG_DBG_UTILS)
enabledExts[enabledExtsCount] = "VK_EXT_debug_utils";
VkhPhyInfo* phys = vkh_app_get_phyinfos (e->app, &phyCount, surf);
VkhPhyInfo pi = 0;
- for (uint32_t i=0; i<phyCount; i++){
- pi = phys[i];
- if (pi->properties.deviceType == preferedGPU)
- break;
- }
+ if (!vkengine_try_get_phyinfo(phys, phyCount, preferedGPU, &pi))
+ if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, &pi))
+ if (!vkengine_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
+ pi = phys[0];
if (pi) {
e->memory_properties = pi->memProps;
vk_engine_t* vkengine_create (VkPhysicalDeviceType preferedGPU, VkPresentModeKHR presentMode, uint32_t width, uint32_t height);
void vkengine_dump_available_layers ();
+bool vkengine_try_get_phyinfo (VkhPhyInfo* phys, uint32_t phyCount, VkPhysicalDeviceType gpuType, VkhPhyInfo* phy);
void vkengine_destroy (VkEngine e);
bool vkengine_should_close (VkEngine e);
void vkengine_close (VkEngine e);
-Subproject commit ffa9619b5368639c1c765152509d5c7e97876c63
+Subproject commit 97cdc0fb23b33356cc1d4c1be8973891d7661ac5