virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
	{
		if (overlay->header("Scene")) {
			overlay->text("Quad type");
			if (overlay->comboBox("##quadtype", &quadType, { "VK (y negative)", "GL (y positive)" })) {
				buildCommandBuffers();
			}
		}

		if (overlay->header("Viewport")) {
			if (overlay->checkBox("Negative viewport height", &negativeViewport)) {
				buildCommandBuffers();
			}
			if (overlay->sliderInt("offfset x", &offsetx, -(int32_t)width, (int32_t)width)) {
				buildCommandBuffers();
			}
			if (overlay->sliderInt("offfset y", &offsety, -(int32_t)height, (int32_t)height)) {
				buildCommandBuffers();
			}
		}
		if (overlay->header("Pipeline")) {
			overlay->text("Winding order");
			if (overlay->comboBox("##windingorder", &windingOrder, { "clock wise", "counter clock wise" })) {
				preparePipelines();
			}
			overlay->text("Cull mode");
			if (overlay->comboBox("##cullmode", &cullMode, { "none", "front face", "back face" })) {
				preparePipelines();
			}
		}
	}
Beispiel #2
0
	void initVulkan()
	{
		VulkanAndroidExampleBase::initVulkan();

		loadTexture(
			"textures/android_robot.ktx", 
			VK_FORMAT_R8G8B8A8_UNORM, 
			&texture,
			false);

		createCommandBuffers();

		// Compute stuff
		getComputeQueue();
		createComputeCommandBuffer();
		prepareStorageBuffers();

		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();

		prepareCompute();

		buildCommandBuffers();
		buildComputeCommandBuffer();

		state.zoom = -5.0f;
		state.rotation = glm::vec3();

		prepared = true;
	}
	virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
	{
		if (overlay->header("Settings")) {
			if (overlay->comboBox("Object type", &models.objectIndex, models.names)) {
				updateUniformBuffers();
				buildCommandBuffers();
			}
			if (overlay->sliderInt("Grid size", &gridSize, 1, 10)) {
				buildCommandBuffers();
			}
			std::vector<std::string> cullModeNames = { "None", "Front", "Back", "Back and front" };
			if (overlay->comboBox("Cull mode", &cullMode, cullModeNames)) {
				preparePipelines();
				buildCommandBuffers();
			}
			if (overlay->checkBox("Blending", &blending)) {
				preparePipelines();
				buildCommandBuffers();
			}
			if (deviceFeatures.fillModeNonSolid) {
				if (overlay->checkBox("Wireframe", &wireframe)) {
					preparePipelines();
					buildCommandBuffers();
				}
			}
			if (deviceFeatures.tessellationShader) {
				if (overlay->checkBox("Tessellation", &tessellation)) {
					preparePipelines();
					buildCommandBuffers();
				}
			}
			if (overlay->checkBox("Discard", &discard)) {
				preparePipelines();
				buildCommandBuffers();
			}
		}
		if (!pipelineStats.empty()) {
			if (overlay->header("Pipeline statistics")) {
				for (auto i = 0; i < pipelineStats.size(); i++) {
					std::string caption = pipelineStatNames[i] + ": %d";
					overlay->text(caption.c_str(), pipelineStats[i]);
				}
			}
		}
	}
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadAssets();
		setupDescriptors();
		preparePipelines();
		buildCommandBuffers();
		prepared = true;
	}
Beispiel #5
0
	void prepare()
	{
		gl_base::prepare();
		prepareSynchronizationPrimitives();
		prepareVertices(USE_STAGING);
		prepareUniformBuffers();
		preparePipelines();
		prepared = true;
	}
Beispiel #6
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadAssets();
		prepareConditionalRendering();
		prepareUniformBuffers();
		setupDescriptorSets();
		preparePipelines();
		buildCommandBuffers();
		prepared = true;
	}
Beispiel #7
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadAssets();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();
		buildCommandBuffers();
		prepared = true;
	}
	void prepare()
	{
		VulkanExampleBase::prepare();
		generateCube();
		setupVertexDescriptions();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();
		buildCommandBuffers();
		prepared = true;
	}
	void prepare()
	{
		VulkanExampleBase::prepare();
		// Create a fence for synchronization
		VkFenceCreateInfo fenceCreateInfo = vkTools::initializers::fenceCreateInfo(VK_FLAGS_NONE);
		vkCreateFence(device, &fenceCreateInfo, NULL, &renderFence);
		loadMeshes();
		setupVertexDescriptions();
		setupPipelineLayout();
		preparePipelines();
		prepareMultiThreadedRenderer();
		updateMatrices();
		prepared = true;
	}
Beispiel #10
0
	void prepare()
	{
        sampleCount = getMaxUsableSampleCount();
		VulkanExampleBase::prepare();
		loadAssets();
		setupVertexDescriptions();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();
		buildCommandBuffers();
		prepared = true;
	}
Beispiel #11
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadTextures();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		buildCommandBuffers();
		prepared = true;
	}
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadTextures();
		getComputeQueue();
		prepareStorageBuffers();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();
		prepareCompute();
		buildCommandBuffers();
		prepared = true;
	}
Beispiel #13
0
			VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
			VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
	}

	void prepare()
	{
		VulkanExampleBase::prepare();
		generateQuad();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		prepareTextureTarget(TEX_DIM, TEX_DIM, DEPTH_FORMAT);
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		prepareOffscreenFramebuffer();
Beispiel #14
0
	void prepare()
	{
		VulkanExampleBase::prepare();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		loadTexture(
			"./../data/textures/cubemap_yokohama.ktx",
			VK_FORMAT_BC3_UNORM_BLOCK,
			false);
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSets();
		buildCommandBuffers();
		prepared = true;
	}
Beispiel #15
0
    void initVulkan()
    {
        VulkanAndroidExampleBase::initVulkan();

        prepareVertices();
        prepareUniformBuffers();
        setupDescriptorSetLayout();
        preparePipelines();
        setupDescriptorPool();
        setupDescriptorSet();

        buildCommandBuffers();

        state.zoom = -5.0f;
        state.rotation = glm::vec3();

        prepared = true;
    }
Beispiel #16
0
	void prepare()
	{
		// Check if device supports tessellation shaders
		if (!deviceFeatures.tessellationShader)
		{
			vkTools::exitFatal("Selected GPU does not support tessellation shaders!", "Feature not supported");
		}

		VulkanExampleBase::prepare();
		loadTextures();
		loadMeshes();
		setupVertexDescriptions();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();
		buildCommandBuffers(); 
		prepared = true;
	}
Beispiel #17
0
	void initVulkan()
	{
		VulkanAndroidExampleBase::initVulkan();

		loadTexture(
			"textures/vulkan_android_robot.ktx", 
			VK_FORMAT_R8G8B8A8_UNORM, 
			false);

		prepareVertices();
		prepareUniformBuffers();
		setupDescriptorSetLayout();
		preparePipelines();
		setupDescriptorPool();
		setupDescriptorSet();

		buildCommandBuffers();

		state.zoom = -5.0f;
		state.rotation = glm::vec3();

		prepared = true;
	}