Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
vkDeviceWaitIdle();
vkDestroySwapchainKHR();
vkCreateSwapchainKHR();
for () {
vkDestroyImageView();
vkDestroyFramebuffer()...
// Create image
imageCreateInfo.samples = VK_SAMPLE_COUNT_4_BIT;
// Create render target
renderPassCreateInfo.attachmentDe...
samplerCreateInfo.anisotropyEnable = VK_TRUE;
samplerCreateInfo.maxAnisotropy = 1.0f – 16.0f;
•
•
•
•
•
•
•
•
•
•
•
•
0,0
10,0
20,0
30,0
40,0
50,0
60,0
70,0
80,0
Nexus 5X Galaxy S7 Google Pixel XL
OpenGL ES 3 Vulkan
vkDeviceWaitIdle() vkQueueWaitIdle()
VK_IMAGE_TILING_OPTIMAL
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
// 1. Setup
vkCreateQueryPool(...);
// 2. At beginning of command buffer
vkCmdResetQueryPool(commadBuffer, queryPool, firs...
// Uniforms:
vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, firstSet, 1,
&uniformSet, 1, ...
// Enable extension on vkCreateDevice()
VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME
// Use it for an allocation
VkDedicatedA...
×
1000
60
≈
•
•
•
•
•
•
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Turn your frame rate up to 60 with Vulkan on the Nintendo Switch
Upcoming SlideShare
Loading in …5
×

of

Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 1 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 2 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 3 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 4 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 5 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 6 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 7 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 8 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 9 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 10 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 11 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 12 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 13 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 14 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 15 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 16 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 17 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 18 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 19 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 20 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 21 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 22 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 23 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 24 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 25 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 26 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 27 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 28 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 29 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 30 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 31 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 32 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 33 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 34 Turn your frame rate up to 60 with Vulkan on the Nintendo Switch Slide 35
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Turn your frame rate up to 60 with Vulkan on the Nintendo Switch

Download to read offline

This talk is about how we brought the latest Galaxy on Fire to the Nintendo Switch using the Vulkan graphics API. It shows how we adapted the renderer for this unique platform and how we improved the visual quality using a few easy techniques. It then goes
into detail on how we achieved a constant 60 frames per second highlighting CPU and GPU optimization approaches as well as improving parallelization - all of this in light of rendering with Vulkan.

Given at Reboot Develop Blue 2019 in Dubrovnik, Croatia.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Turn your frame rate up to 60 with Vulkan on the Nintendo Switch

  1. 1. vkDeviceWaitIdle(); vkDestroySwapchainKHR(); vkCreateSwapchainKHR(); for () { vkDestroyImageView(); vkDestroyFramebuffer(); } for () { vkCreateImageView(); vkCreateFramebuffer(); }
  2. 2. // Create image imageCreateInfo.samples = VK_SAMPLE_COUNT_4_BIT; // Create render target renderPassCreateInfo.attachmentDescription.samples = VK_SAMPLE_COUNT_4_BIT; // Pipeline creation pipelineMultisampleStateCreateInfo.rasterizationSamples = VK_SAMPLE_COUNT_4_BIT; // Have to resolve at some point vkCmdResolveImage(); // Or via subpassDescription.pResolveAttachments = ...; // Sample shading pipelineMultisampleStateCreateInfo.sampleShadingEnable = VK_TRUE; pipelineMultisampleStateCreateInfo.minSampleShading = 0.0f - 1.0f;
  3. 3. samplerCreateInfo.anisotropyEnable = VK_TRUE; samplerCreateInfo.maxAnisotropy = 1.0f – 16.0f;
  4. 4. • • • •
  5. 5.
  6. 6. • • • • • • •
  7. 7. 0,0 10,0 20,0 30,0 40,0 50,0 60,0 70,0 80,0 Nexus 5X Galaxy S7 Google Pixel XL OpenGL ES 3 Vulkan
  8. 8. vkDeviceWaitIdle() vkQueueWaitIdle() VK_IMAGE_TILING_OPTIMAL VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
  9. 9. // 1. Setup vkCreateQueryPool(...); // 2. At beginning of command buffer vkCmdResetQueryPool(commadBuffer, queryPool, firstQuery, 2); vkCmdWriteTimestamp(commadBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, queryPool, query); // 3. At end of command buffer vkCmdWriteTimestamp(commadBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, queryPool, query + 1); // 4. Get results uint64_t timestamps[2]; res = vkGetQueryPoolResults(device, queryPool, firstQuery, 2, sizeof(uint64_t) * 2, timestamps, sizeof(uint64_t), VK_QUERY_RESULT_64_BIT); // in ms float timeInMs = (timestamps[1] - timestamps[0])/ 1000.0f;
  10. 10. // Uniforms: vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, firstSet, 1, &uniformSet, 1, &dynamicOffset); struct DescriptorSetCacheEntry { VkDescriptorSet set; uint32_t lastFrameUsed; }; HashMap<Hasher::Value, DescriptorSetCacheEntry> descriptorSetCache_; // If found in cache: vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, firstSet, 1, &textureSet, 0, nullptr); // If not found in cache: vkAllocateDescriptorSets(device, &allocateInfo, &textureSet); vkUpdateDescriptorSets(device, writeCount, writeTextures, 0, nullptr); vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, firstSet, 1, &textureSet, 0, nullptr);
  11. 11. // Enable extension on vkCreateDevice() VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME // Use it for an allocation VkDedicatedAllocationMemoryAllocateInfoNV dedicatedInfo = {}; dedicatedInfo.sType = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV; dedicatedInfo.pNext = nullptr; dedicatedInfo.image = image; dedicatedInfo.buffer = VK_NULL_HANDLE; VkMemoryAllocateInfo allocateInfo = {}; allocateInfo.pNext = &dedicatedInfo;
  12. 12. × 1000 60 ≈
  13. 13. • • • • • •

This talk is about how we brought the latest Galaxy on Fire to the Nintendo Switch using the Vulkan graphics API. It shows how we adapted the renderer for this unique platform and how we improved the visual quality using a few easy techniques. It then goes into detail on how we achieved a constant 60 frames per second highlighting CPU and GPU optimization approaches as well as improving parallelization - all of this in light of rendering with Vulkan. Given at Reboot Develop Blue 2019 in Dubrovnik, Croatia.

Views

Total views

364

On Slideshare

0

From embeds

0

Number of embeds

0

Actions

Downloads

4

Shares

0

Comments

0

Likes

0

×