bool HookGui::HGWidgetShader::Initialize(VulkanWrapper::Context* _graphicContext)
{
	// Get the model manager
	VulkanWrapper::ModelManager* modelManager = _graphicContext->GetModelManager();

	// Request our widget model object
	modelManager->RequestObject(&m_WidgetModel, "square");

	// Create the instance buffer
	CreateInstanceBuffer(_graphicContext);

	// Create the uniform buffer
	CreateUniformBuffer(_graphicContext);

	// Create the descriptor set
	CreateDescriptorSet(_graphicContext);

	// Create our render pass
	CreateRenderPass(_graphicContext);

	// Create the graphic pipeline
	CreateGraphicsPipeline(_graphicContext);

	// Create the frame buffers
	CreateFramebuffers(_graphicContext->GetGraphicInstance(), _graphicContext->GetSwapChain(), m_Framebuffers, m_RenderPass);

	// Create the command buffer
	m_CommandBuffer = VWShaderBase::CreateCommandBuffer(_graphicContext, VK_COMMAND_BUFFER_LEVEL_PRIMARY, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);

	return true;
}
Esempio n. 2
0
    Example_ComputeShader() :
        ExampleBase { L"LLGL Example: Compute Shader", { 800, 800 } }
    {
        // Check if samplers are supported
        const auto& renderCaps = renderer->GetRenderingCaps();

        if (!renderCaps.features.hasComputeShaders)
            throw std::runtime_error("compute shaders are not supported by this renderer");

        // Create all graphics objects
        CreateBuffers();
        CreateComputePipeline();
        CreateGraphicsPipeline();
    }