HybridRenderer/HybridRenderer/RayTracingRenderer.cpp
/*
	Set up a storage image that the ray generation shader will be writing to
*/
Set up a storage image that the ray generation shader will be writing to
Set up a storage image that the ray generation shader will be writing to
void RayTracingRenderer::createStorageImage()
{
	storageImage.Create(deviceContext, window->width, window->height, swapChain->imageFormat,
		VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_STORAGE_BIT, 
		VK_SAMPLE_COUNT_1_BIT
	);
	storageImage.CreateImageView(VK_IMAGE_ASPECT_COLOR_BIT);
	VkCommandBuffer cmdBuffer = deviceContext->generateCommandBuffer();
	Utility::setImageLayout(cmdBuffer, storageImage.image,
		VK_IMAGE_LAYOUT_UNDEFINED,
		VK_IMAGE_LAYOUT_GENERAL,
		{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
	deviceContext->EndCommandBuffer(cmdBuffer);
}
void RayTracingRenderer :: createStorageImage ( ) { storageImage . Create ( deviceContext , window -> width , window -> height , swapChain -> imageFormat , VK_IMAGE_TILING_OPTIMAL , VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_STORAGE_BIT , VK_SAMPLE_COUNT_1_BIT ) ; storageImage . CreateImageView ( VK_IMAGE_ASPECT_COLOR_BIT ) ; VkCommandBuffer cmdBuffer = deviceContext -> generateCommandBuffer ( ) ; Utility :: setImageLayout ( cmdBuffer , storageImage . image , VK_IMAGE_LAYOUT_UNDEFINED , VK_IMAGE_LAYOUT_GENERAL , { VK_IMAGE_ASPECT_COLOR_BIT , 0 , 1 , 0 , 1 } ) ; deviceContext -> EndCommandBuffer ( cmdBuffer ) ; }
Set up a storage image that the ray generation shader will be writing to
Set up a storage image that the ray generation shader will be writing to