Files
filament/shaders/src/surface_getters.cs
Sungun Park 87bdf96449 Refactor: Rename shader snippets w/ new naming convention (see README.md) (#8402)
This commit renames all shader snippet files to conform to the newly
introduced naming convention outlined in README.md.

The new naming convention uses a `prefix_name.suffix` format to clearly
indicate the purpose and target shader stage of each snippet. This
improves the overall organization and readability of the shader code,
making it easier to understand how each snippet contributes to the
shader generation process.

No functional changes were made to the shader code itself or source
code. This is purely a refactoring for clarity and maintainability.
2025-01-31 00:02:53 +00:00

46 lines
1.0 KiB
C#

//------------------------------------------------------------------------------
// Compute builtin access
//------------------------------------------------------------------------------
/**
* @public-api
* Work group the thread belongs to.
*/
uvec3 getWorkGroupID() {
return gl_WorkGroupID;
}
/**
* @public-api
* Number of work groups in each dimensions
*/
uvec3 getWorkGroupCount() {
return gl_NumWorkGroups;
}
/**
* @public-api
* Within the work group, get a unique identifier for the thread.
*/
uvec3 getLocalInvocationID() {
return gl_LocalInvocationID;
}
/**
* @public-api
* Globally unique value across the entire compute dispatch.
* 1D version of getLocalInvocationID(). Provided for convenience.
*/
uint getLocalInvocationIndex() {
return gl_LocalInvocationIndex;
}
/**
* @public-api
* Globally unique value across the entire compute dispatch.
* Short-hand for getWorkGroupID() * getWorkGroupCount() + getLocalInvocationID()
*/
uvec3 getGlobalInvocationID() {
return gl_GlobalInvocationID;
}