slang
slang copied to clipboard
Implement miscellaneous GLSL functions to match to how much HLSL side works
There are GLSL functions described in OpenGL Spec from a section 8.13 to 8.19. Some of them may not have a HLSL counter part but we will need to implement as many as we can.
This is also a part of the other umbrella task.
Following functions are in those sctions:
Section 8.13. Geometry Shader Functions void EmitStreamVertex(int stream) void EndStreamPrimitive(int stream) void EmitVertex() void EndPrimitive()
Section 8.14. Fragment Processing Functions genFType dFdx(genFType p) genFType dFdy(genFType p) genFType dFdxFine(genFType p) genFType dFdyFine(genFType p) genFType dFdxCoarse(genFType p) genFType dFdyCoarse(genFType p) genFType fwidth(genFType p) genFType fwidthFine(genFType p) genFType fwidthCoarse(genFType p) float interpolateAtCentroid(float interpolant) vec2 interpolateAtCentroid(vec2 interpolant) vec3 interpolateAtCentroid(vec3 interpolant) vec4 interpolateAtCentroid(vec4 interpolant) float interpolateAtSample(float interpolant, int sample) vec2 interpolateAtSample(vec2 interpolant, int sample) vec3 interpolateAtSample(vec3 interpolant, int sample) vec4 interpolateAtSample(vec4 interpolant, int sample) float interpolateAtOffset(float interpolant, vec2 offset) vec2 interpolateAtOffset(vec2 interpolant, vec2 offset) vec3 interpolateAtOffset(vec3 interpolant, vec2 offset) vec4 interpolateAtOffset(vec4 interpolant, vec2 offset)
Section 8.15. Noise Functions float noise1(genFType x) vec2 noise2(genFType x) vec3 noise3(genFType x) vec4 noise4(genFType x)
Section 8.16. Shader Invocation Control Functions void barrier()
Section 8.17. Shader Memory Control Functions void memoryBarrier() void memoryBarrierAtomicCounter() void memoryBarrierBuffer() void memoryBarrierShared() void memoryBarrierImage() void groupMemoryBarrier()
Section 8.18. Subpass-Input Functions gvec4 subpassLoad(gsubpassInput subpass) gvec4 subpassLoad(gsubpassInputMS subpass, int sample)
Section 8.19. Shader Invocation Group Functions bool anyInvocation(bool value) bool allInvocations(bool value) bool allInvocationsEqual(bool value)