| ... | ... | @@ -47,6 +47,17 @@ pub fn vertexIndex(comptime ptr: *addrspace(.input) u32) void { |
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | /// Will make `ptr` contain the index of the instance that is |
| 51 | /// being processed by the current vertex shader invocation. |
| 52 | /// `ptr` must be a reference to variable or struct field. |
| 53 | pub fn instanceIndex(comptime ptr: *addrspace(.input) u32) void { |
| 54 | asm volatile ( |
| 55 | \\OpDecorate %ptr BuiltIn InstanceIndex |
| 56 | : |
| 57 | : [ptr] "" (ptr), |
| 58 | ); |
| 59 | } |
| 60 | |
| 50 | 61 | /// Output fragment depth from a `Fragment` entrypoint |
| 51 | 62 | /// `ptr` must be a reference to variable or struct field. |
| 52 | 63 | pub fn fragmentCoord(comptime ptr: *addrspace(.input) @Vector(4, f32)) void { |