Git Product home page Git Product logo

Comments (5)

jpbruyere avatar jpbruyere commented on June 16, 2024 1

where twice???????
For those kind of discussion, we can chat on https://gitter.im/CSharpRapidOpenWidgets , it doesn't seem to be a bug, you just seek for help understanding how to use vkvg and vkh, ask on gitter, I will be happy to help if I can.
Having your debug window in my mail, I see you are on windows, but I see also that you are in an example called 'drawRectsThread' from a method '_thrd_wrapper_function', this is not my code, so I may help you only if you give we the full sample you are running. Also note that I'm short in time, so try to be precise.

from vkvg.

jpbruyere avatar jpbruyere commented on June 16, 2024

I have no crash on that sample, queue submission is guarded only in VkvgDevice, not in vkh. If you want multithreading, you have to call vkvg_device_set_thread_aware (vkvgDev, true);

from vkvg.

173619070 avatar 173619070 commented on June 16, 2024

I have no crash on that sample, queue submission is guarded only in VkvgDevice, not in vkh. If you want multithreading, you have to call vkvg_device_set_thread_aware (vkvgDev, true);

I have set threadware to true, You mean the vkh_presenter_draw should not be called in the child thread?

from vkvg.

jpbruyere avatar jpbruyere commented on June 16, 2024

vkh library is not thread safe, and only the queue submission in vkvg is guarded.

from vkvg.

173619070 avatar 173619070 commented on June 16, 2024

I saw that `vkh_cmd_submit was called in two functions:

void _device_submit_cmd (VkvgDevice dev, VkCommandBuffer* cmd, VkFence fence) {
	LOCK_DEVICE
	vkh_cmd_submit (dev->gQueue, cmd, fence);/////->>>>>>
	UNLOCK_DEVICE
}

void vkh_cmd_submit(VkhQueue queue, VkCommandBuffer *pCmdBuff, VkFence fence){
	VkPipelineStageFlags stageFlags = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT;
	VkSubmitInfo submit_info = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
								 .pWaitDstStageMask = &stageFlags,
								 .commandBufferCount = 1,
								 .pCommandBuffers = pCmdBuff};
	VK_CHECK_RESULT(vkQueueSubmit(queue->queue, 1, &submit_info, fence));////here
}

bool vkh_presenter_draw (VkhPresenter r) {
	if (!vkh_presenter_acquireNextImage (r, VK_NULL_HANDLE, r->semaPresentEnd)){
		vkh_presenter_create_swapchain (r);
		return false;
	}

	VkPipelineStageFlags dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
	VkSubmitInfo submit_info = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
								 .commandBufferCount = 1,
								 .signalSemaphoreCount = 1,
								 .pSignalSemaphores = &r->semaDrawEnd,
								 .waitSemaphoreCount = 1,
								 .pWaitSemaphores = &r->semaPresentEnd,
								 .pWaitDstStageMask = &dstStageMask,
								 .pCommandBuffers = &r->cmdBuffs[r->currentScBufferIndex]};

	vkWaitForFences	(r->dev->dev, 1, &r->fenceDraw, VK_TRUE, FENCE_TIMEOUT);
	vkResetFences	(r->dev->dev, 1, &r->fenceDraw);
	
	VK_CHECK_RESULT(vkQueueSubmit (r->queue, 1, &submit_info, r->fenceDraw));/////here
......
}

Why is it called twice? aren't they the same?

should i use vkh_cmd_submit_with_semaphores instead of vkh_cmd_submit in the _device_submit_cmd fuction?

from vkvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.