Skip to content

Instantly share code, notes, and snippets.

View qytek's full-sized avatar

Jerry Xiong qytek

  • Tencent games
  • USA
View GitHub Profile
@qytek
qytek / NegativeViewportHeight.cpp
Created March 16, 2023 09:35 — forked from gwihlidal/NegativeViewportHeight.cpp
Example of Vulkan negative viewport height extension
// With the VK_KHR_maintenance1 extension, you can specify negative viewport height.
// This allows negative height to be specified in the height field to perform a
// y-inversion of the clip-space to framebuffer-space transform. This allows you
// to avoid having to use gl_Position.y = -gl_Position.y, and makes porting to other
// APIs like DirectX12 much easier.
// You negate the height *and* move the "origin" to the bottom left.
// Unlike the original AMD extension which just negated height.
VkViewport viewport = {};