org.lwjgl.vulkan.NVShaderImageFootprint Maven / Gradle / Ivy
Show all versions of lwjgl-vulkan Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
/**
* This extension adds Vulkan support for the {@code SPV_NV_shader_image_footprint} SPIR-V extension. That SPIR-V extension provides a new instruction {@code OpImageSampleFootprintNV} allowing shaders to determine the set of texels that would be accessed by an equivalent filtered texture lookup.
*
* Instead of returning a filtered texture value, the instruction returns a structure that can be interpreted by shader code to determine the footprint of a filtered texture lookup. This structure includes integer values that identify a small neighborhood of texels in the image being accessed and a bitfield that indicates which texels in that neighborhood would be used. The structure also includes a bitfield where each bit identifies whether any texel in a small aligned block of texels would be fetched by the texture lookup. The size of each block is specified by an access granularity provided by the shader. The minimum granularity supported by this extension is 2x2 (for 2D textures) and 2x2x2 (for 3D textures); the maximum granularity is 256x256 (for 2D textures) or 64x32x32 (for 3D textures). Each footprint query returns the footprint from a single texture level. When using minification filters that combine accesses from multiple mipmap levels, shaders must perform separate queries for the two levels accessed (“{@code fine}” and “{@code coarse}”). The footprint query also returns a flag indicating if the texture lookup would access texels from only one mipmap level or from two neighboring levels.
*
* This extension should be useful for multi-pass rendering operations that do an initial expensive rendering pass to produce a first image that is then used as a texture for a second pass. If the second pass ends up accessing only portions of the first image (e.g., due to visbility), the work spent rendering the non-accessed portion of the first image was wasted. With this feature, an application can limit this waste using an initial pass over the geometry in the second image that performs a footprint query for each visible pixel to determine the set of pixels that it needs from the first image. This pass would accumulate an aggregate footprint of all visible pixels into a separate “{@code footprint image}” using shader atomics. Then, when rendering the first image, the application can kill all shading work for pixels not in this aggregate footprint.
*
* This extension has a number of limitations. The {@code OpImageSampleFootprintNV} instruction only supports for two- and three-dimensional textures. Footprint evaluation only supports the CLAMP_TO_EDGE wrap mode; results are undefined for all other wrap modes. Only a limited set of granularity values and that set does not support separate coverage information for each texel in the original image.
*
* When using SPIR-V generated from the OpenGL Shading Language, the new instruction will be generated from code using the new {@code textureFootprint*NV} built-in functions from the {@code GL_NV_shader_texture_footprint} shading language extension.
*
* Examples
*
* TBD
*
* VK_NV_shader_image_footprint
*
*
* - Name String
* - {@code VK_NV_shader_image_footprint}
* - Extension Type
* - Device extension
* - Registered Extension Number
* - 205
* - Revision
* - 2
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRGetPhysicalDeviceProperties2 VK_KHR_get_physical_device_properties2}
*
* - Contact
*
* - Pat Brown nvpbrown
*
*
*
* Other Extension Metadata
*
*
* - Last Modified Date
* - 2018-09-13
* - IP Status
* - No known IP claims.
* - Interactions and External Dependencies
*
* - This extension requires {@code SPV_NV_shader_image_footprint}
* - This extension provides API support for {@code GL_NV_shader_texture_footprint}
*
* - Contributors
*
* - Pat Brown, NVIDIA
* - Chris Lentini, NVIDIA
* - Daniel Koch, NVIDIA
* - Jeff Bolz, NVIDIA
*
*
*/
public final class NVShaderImageFootprint {
/** The extension specification version. */
public static final int VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION = 2;
/** The extension name. */
public static final String VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME = "VK_NV_shader_image_footprint";
/** Extends {@code VkStructureType}. */
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000;
private NVShaderImageFootprint() {}
}