{"id":19817169,"url":"https://github.com/nvpro-samples/vk_inherited_viewport","last_synced_at":"2026-05-31T23:31:02.623Z","repository":{"id":48515237,"uuid":"369325687","full_name":"nvpro-samples/vk_inherited_viewport","owner":"nvpro-samples","description":"VK_NV_inherited_viewport_scissor and secondary subpass command buffer re-use","archived":false,"fork":false,"pushed_at":"2024-03-04T13:53:00.000Z","size":399,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-18T00:37:53.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvpro-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-20T20:05:50.000Z","updated_at":"2023-11-26T18:16:10.000Z","dependencies_parsed_at":"2023-11-18T03:25:18.744Z","dependency_job_id":"2b22aefa-bbe4-4a1b-9a51-3327b606b169","html_url":"https://github.com/nvpro-samples/vk_inherited_viewport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nvpro-samples/vk_inherited_viewport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_inherited_viewport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_inherited_viewport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_inherited_viewport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_inherited_viewport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvpro-samples","download_url":"https://codeload.github.com/nvpro-samples/vk_inherited_viewport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvpro-samples%2Fvk_inherited_viewport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33753923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:11:54.821Z","updated_at":"2026-05-31T23:31:02.604Z","avatar_url":"https://github.com/nvpro-samples.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VK_NV_inherited_viewport_scissor Sample\n\n2020's take on the classic \"fountain of exploding objects\" demo;\nobjects are spawned at the origin with a random velocity and fall down\nto their doom.\n\nThe primary purpose of this sample is to demonstrate how to integrate\n[`VK_NV_inherited_viewport_scissor`](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_inherited_viewport_scissor)\nas an \u003ci\u003eoptional\u003c/i\u003e extension. This extension enables subpass\nsecondary command buffers to inherit viewport/scissor state from the\ncalling primary command buffer (or another secondary command buffer).\n\nThe sample draws the same scene to four viewports on screen, with the\nactual drawing done by secondary command buffers re-used across\nframes. This is made possible by indirect draw commands, which allow\nthe secondary command buffers to adapt to dynamically-changing object\ncounts and positions. With the extension enabled, the sample is able\nto use the same secondary command buffer for all 4 viewports, and\nskip re-recording them even when the window or viewports are resized.\n\nFor a simple renderer like this, the CPU time saved by not\nre-recording the command buffer is likely negligible, but the\ntechniques can be extended to more complicated renderers, where the\nsavings can be substantial.\n\n[TUTORIAL LINK](https://nvpro-samples.github.io/vk_inherited_viewport/docs/inherited.md.html)\n\n## Dependencies\n\nThe optional\n[`VK_NV_inherited_viewport_scissor`](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_inherited_viewport_scissor)\nextension is available in new [NVIDIA Vulkan\nDrivers](https://developer.nvidia.com/vulkan-driver) for Windows 10 or\nLinux. The header file for the extension is included in this\nrepository, so you do not need to update your Vulkan SDK.\n\nHowever, validation layer support for the extension requires at least\n[v1.2.178](https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/tag/v1.2.178).\nAs of 2021-07-05, this is included in the latest [official Vulkan SDK\nPackage](https://vulkan.lunarg.com/sdk/home).\n\u003c!-- Tested on Ubuntu 18.04 with Vulkan SDK 1.2.182.0 --\u003e\n\n## Build and Run\n\nClone https://github.com/nvpro-samples/nvpro_core.git\nnext to this repository (or pull latest `master` if you already have it)\n\n`mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. # Or use CMake GUI`\n\nIf there are missing dependencies (e.g. glfw), run `git submodule\nupdate --init --recursive --checkout --force` in the `nvpro_core`\nrepository.\n\nThen start the generated `.sln` in VS or run `make -j`.\n\nRun `vk_inherited_viewport` or `../../bin_x64/Release/vk_inherited_viewport.exe`\n\nYou are advised not to run the debug build unless you have the\nrequired validation layers.\n\n## LICENSE\n\nCopyright 2021 NVIDIA CORPORATION. Released under Apache License,\nVersion 2.0. See \"LICENSE\" file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fvk_inherited_viewport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvpro-samples%2Fvk_inherited_viewport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvpro-samples%2Fvk_inherited_viewport/lists"}