@thi.ng/shader-ast
Version:
DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets
156 lines • 16.9 kB
TypeScript
import type { FnCall, Sym, Term } from "../api/nodes.js";
import type { FloatTerm, ISampler2DTerm, ISampler3DTerm, ISamplerCubeTerm, IVec2Term, IVec3Term, IntTerm, Sampler2DTerm, Sampler3DTerm, SamplerCubeTerm, USampler2DTerm, USampler3DTerm, USamplerCubeTerm, Vec2Term, Vec3Term, Vec4Term } from "../api/terms.js";
import { type Prim } from "../api/types.js";
export declare function textureSize(sampler: Sampler2DTerm, lod: IntTerm): FnCall<"ivec2">;
export declare function textureSize(sampler: Sampler3DTerm, lod: IntTerm): FnCall<"ivec3">;
export declare function textureSize(sampler: SamplerCubeTerm, lod: IntTerm): FnCall<"ivec2">;
export declare function textureSize(sampler: Term<"sampler2DShadow">, lod: IntTerm): FnCall<"ivec2">;
export declare function textureSize(sampler: Term<"samplerCubeShadow">, lod: IntTerm): FnCall<"ivec2">;
/**
* @param sampler -
* @param uv -
* @param bias - not allowed in vertex shader
*/
export declare function texture(sampler: Sampler2DTerm, uv: Vec2Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function texture(sampler: Sampler3DTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function texture(sampler: SamplerCubeTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function texture(sampler: ISampler2DTerm, uv: Vec2Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function texture(sampler: ISampler3DTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function texture(sampler: ISamplerCubeTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function texture(sampler: USampler2DTerm, uv: Vec2Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function texture(sampler: USampler3DTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function texture(sampler: USamplerCubeTerm, uvw: Vec3Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function texture(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, bias?: FloatTerm): FnCall<"float">;
export declare function texture(sampler: Term<"samplerCubeShadow">, uvw: Vec4Term, bias?: FloatTerm): FnCall<"float">;
/**
* @param sampler -
* @param uvw -
* @param bias - not allowed in vertex shader
*/
export declare function textureProj(sampler: Sampler2DTerm, uvw: Term<"vec3" | "vec4">, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureProj(sampler: Sampler3DTerm, uvw: Vec4Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureProj(sampler: ISampler2DTerm, uvw: Term<"vec3" | "vec4">, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureProj(sampler: ISampler3DTerm, uvw: Vec4Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureProj(sampler: USampler2DTerm, uvw: Term<"vec3" | "vec4">, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureProj(sampler: USampler3DTerm, uvw: Vec4Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureProj(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, bias?: FloatTerm): FnCall<"float">;
export declare function textureLod(sampler: Sampler2DTerm, uv: Vec2Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureLod(sampler: Sampler3DTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureLod(sampler: SamplerCubeTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureLod(sampler: ISampler2DTerm, uv: Vec2Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureLod(sampler: ISampler3DTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureLod(sampler: ISamplerCubeTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureLod(sampler: USampler2DTerm, uv: Vec2Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureLod(sampler: USampler3DTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureLod(sampler: USamplerCubeTerm, uvw: Vec3Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureLod(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, lod: FloatTerm): FnCall<"float">;
/**
* @param sampler -
* @param uvw -
* @param off -
* @param bias - not allowed in vertex shader
*/
export declare function textureOffset(sampler: Sampler2DTerm, uvw: Vec2Term, off: IVec2Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureOffset(sampler: Sampler3DTerm, uvw: Vec3Term, off: IVec3Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureOffset(sampler: ISampler2DTerm, uvw: Vec2Term, off: IVec2Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureOffset(sampler: ISampler3DTerm, uvw: Vec3Term, off: IVec3Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureOffset(sampler: USampler2DTerm, uvw: Vec2Term, off: IVec2Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureOffset(sampler: USampler3DTerm, uvw: Vec3Term, off: IVec3Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureOffset(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, off: IVec2Term, bias?: FloatTerm): FnCall<"float">;
export declare function texelFetch(sampler: Sampler2DTerm, uv: IVec2Term, lod: IntTerm): FnCall<"vec4">;
export declare function texelFetch(sampler: Sampler3DTerm, uvw: IVec3Term, lod: IntTerm): FnCall<"vec4">;
export declare function texelFetch(sampler: ISampler2DTerm, uv: IVec2Term, lod: IntTerm): FnCall<"ivec4">;
export declare function texelFetch(sampler: ISampler3DTerm, uvw: IVec3Term, lod: IntTerm): FnCall<"ivec4">;
export declare function texelFetch(sampler: USampler2DTerm, uv: IVec2Term, lod: IntTerm): FnCall<"uvec4">;
export declare function texelFetch(sampler: USampler3DTerm, uvw: IVec3Term, lod: IntTerm): FnCall<"uvec4">;
export declare function texelFetchOffset(sampler: Sampler2DTerm, uv: IVec2Term, lod: IntTerm, offset: IVec2Term): FnCall<"vec4">;
export declare function texelFetchOffset(sampler: Sampler3DTerm, uvw: IVec3Term, lod: IntTerm, offset: IVec3Term): FnCall<"vec4">;
export declare function texelFetchOffset(sampler: ISampler2DTerm, uv: IVec2Term, lod: IntTerm, offset: IVec2Term): FnCall<"ivec4">;
export declare function texelFetchOffset(sampler: ISampler3DTerm, uvw: IVec3Term, lod: IntTerm, offset: IVec3Term): FnCall<"ivec4">;
export declare function texelFetchOffset(sampler: USampler2DTerm, uv: IVec2Term, lod: IntTerm, offset: IVec2Term): FnCall<"uvec4">;
export declare function texelFetchOffset(sampler: USampler3DTerm, uvw: IVec3Term, lod: IntTerm, offset: IVec3Term): FnCall<"uvec4">;
/**
* @param sampler -
* @param uvw -
* @param off -
* @param bias - not allowed in vertex shader
*/
export declare function textureProjOffset(sampler: Sampler2DTerm, uvw: Vec3Term, off: IVec2Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureProjOffset(sampler: Sampler2DTerm, uvw: Vec4Term, off: IVec2Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureProjOffset(sampler: Sampler3DTerm, uvw: Vec4Term, off: IVec3Term, bias?: FloatTerm): FnCall<"vec4">;
export declare function textureProjOffset(sampler: ISampler2DTerm, uvw: Vec3Term, off: IVec2Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureProjOffset(sampler: ISampler2DTerm, uvw: Vec4Term, off: IVec2Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureProjOffset(sampler: ISampler3DTerm, uvw: Vec4Term, off: IVec3Term, bias?: FloatTerm): FnCall<"ivec4">;
export declare function textureProjOffset(sampler: USampler2DTerm, uvw: Vec3Term, off: IVec2Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureProjOffset(sampler: USampler2DTerm, uvw: Vec4Term, off: IVec2Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureProjOffset(sampler: USampler3DTerm, uvw: Vec4Term, off: IVec3Term, bias?: FloatTerm): FnCall<"uvec4">;
export declare function textureProjOffset(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, off: IVec2Term, bias?: FloatTerm): FnCall<"float">;
export declare function texelLodOffset(sampler: Sampler2DTerm, uv: Vec2Term, lod: FloatTerm, offset: IVec2Term): FnCall<"vec4">;
export declare function texelLodOffset(sampler: Sampler3DTerm, uvw: Vec3Term, lod: FloatTerm, offset: IVec3Term): FnCall<"vec4">;
export declare function texelLodOffset(sampler: ISampler2DTerm, uv: Vec2Term, lod: FloatTerm, offset: IVec2Term): FnCall<"ivec4">;
export declare function texelLodOffset(sampler: ISampler3DTerm, uvw: Vec3Term, lod: FloatTerm, offset: IVec3Term): FnCall<"ivec4">;
export declare function texelLodOffset(sampler: USampler2DTerm, uv: Vec2Term, lod: FloatTerm, offset: IVec2Term): FnCall<"uvec4">;
export declare function texelLodOffset(sampler: USampler3DTerm, uvw: Vec3Term, lod: FloatTerm, offset: IVec3Term): FnCall<"uvec4">;
export declare function texelLodOffset(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, lod: FloatTerm, offset: IVec2Term): FnCall<"float">;
export declare function textureProjLod(sampler: Sampler2DTerm, uv: Vec3Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureProjLod(sampler: Sampler2DTerm, uv: Vec4Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureProjLod(sampler: Sampler3DTerm, uvw: Vec4Term, lod: FloatTerm): FnCall<"vec4">;
export declare function textureProjLod(sampler: ISampler2DTerm, uv: Vec3Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureProjLod(sampler: ISampler2DTerm, uv: Vec4Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureProjLod(sampler: ISampler3DTerm, uvw: Vec4Term, lod: FloatTerm): FnCall<"ivec4">;
export declare function textureProjLod(sampler: USampler2DTerm, uv: Vec3Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureProjLod(sampler: USampler2DTerm, uv: Vec4Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureProjLod(sampler: USampler3DTerm, uvw: Vec4Term, lod: FloatTerm): FnCall<"uvec4">;
export declare function textureProjLod(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, lod: FloatTerm): FnCall<"float">;
export declare function texelProjLodOffset(sampler: Sampler2DTerm, uv: Vec3Term, lod: FloatTerm, offset: IVec2Term): FnCall<"vec4">;
export declare function texelProjLodOffset(sampler: Sampler2DTerm, uv: Vec4Term, lod: FloatTerm, offset: IVec2Term): FnCall<"vec4">;
export declare function texelProjLodOffset(sampler: Sampler3DTerm, uvw: Vec4Term, lod: FloatTerm, offset: IVec3Term): FnCall<"vec4">;
export declare function texelProjLodOffset(sampler: ISampler2DTerm, uv: Vec3Term, lod: FloatTerm, offset: IVec2Term): FnCall<"ivec4">;
export declare function texelProjLodOffset(sampler: ISampler2DTerm, uv: Vec4Term, lod: FloatTerm, offset: IVec2Term): FnCall<"ivec4">;
export declare function texelProjLodOffset(sampler: ISampler3DTerm, uvw: Vec4Term, lod: FloatTerm, offset: IVec3Term): FnCall<"ivec4">;
export declare function texelProjLodOffset(sampler: USampler2DTerm, uv: Vec3Term, lod: FloatTerm, offset: IVec2Term): FnCall<"uvec4">;
export declare function texelProjLodOffset(sampler: USampler2DTerm, uv: Vec4Term, lod: FloatTerm, offset: IVec2Term): FnCall<"uvec4">;
export declare function texelProjLodOffset(sampler: USampler3DTerm, uvw: Vec4Term, lod: FloatTerm, offset: IVec3Term): FnCall<"uvec4">;
export declare function texelProjLodOffset(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, lod: FloatTerm, offset: IVec2Term): FnCall<"float">;
export declare function textureGrad(sampler: Sampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term): FnCall<"vec4">;
export declare function textureGrad(sampler: Sampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"vec4">;
export declare function textureGrad(sampler: SamplerCubeTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"vec4">;
export declare function textureGrad(sampler: ISampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term): FnCall<"ivec4">;
export declare function textureGrad(sampler: ISampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"ivec4">;
export declare function textureGrad(sampler: ISamplerCubeTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"ivec4">;
export declare function textureGrad(sampler: USampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term): FnCall<"uvec4">;
export declare function textureGrad(sampler: USampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"uvec4">;
export declare function textureGrad(sampler: USamplerCubeTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"uvec4">;
export declare function textureGrad(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"float">;
export declare function textureGrad(sampler: Term<"samplerCubeShadow">, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"float">;
export declare function textureGradOffset(sampler: Sampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"vec4">;
export declare function textureGradOffset(sampler: Sampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"vec4">;
export declare function textureGradOffset(sampler: ISampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"ivec4">;
export declare function textureGradOffset(sampler: ISampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"ivec4">;
export declare function textureGradOffset(sampler: USampler2DTerm, uv: Vec2Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"uvec4">;
export declare function textureGradOffset(sampler: USampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"uvec4">;
export declare function textureGradOffset(sampler: Term<"sampler2DShadow">, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term, offset: IVec2Term): FnCall<"float">;
export declare function textureProjGrad(sampler: Sampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term): FnCall<"vec4">;
export declare function textureProjGrad(sampler: Sampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term): FnCall<"vec4">;
export declare function textureProjGrad(sampler: Sampler3DTerm, uvw: Vec3Term, dx: Vec3Term, dy: Vec3Term): FnCall<"vec4">;
export declare function textureProjGrad(sampler: ISampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term): FnCall<"ivec4">;
export declare function textureProjGrad(sampler: ISampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term): FnCall<"ivec4">;
export declare function textureProjGrad(sampler: ISampler3DTerm, uvw: Vec4Term, dx: Vec3Term, dy: Vec3Term): FnCall<"ivec4">;
export declare function textureProjGrad(sampler: USampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term): FnCall<"uvec4">;
export declare function textureProjGrad(sampler: USampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term): FnCall<"uvec4">;
export declare function textureProjGrad(sampler: USampler3DTerm, uvw: Vec4Term, dx: Vec3Term, dy: Vec3Term): FnCall<"uvec4">;
export declare function textureProjGrad(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, dx: Vec2Term, dy: Vec2Term): FnCall<"float">;
export declare function textureProjGradOffset(sampler: Sampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"vec4">;
export declare function textureProjGradOffset(sampler: Sampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"vec4">;
export declare function textureProjGradOffset(sampler: Sampler3DTerm, uvw: Vec4Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"vec4">;
export declare function textureProjGradOffset(sampler: ISampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"ivec4">;
export declare function textureProjGradOffset(sampler: ISampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"ivec4">;
export declare function textureProjGradOffset(sampler: ISampler3DTerm, uvw: Vec4Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"ivec4">;
export declare function textureProjGradOffset(sampler: USampler2DTerm, uv: Vec3Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"uvec4">;
export declare function textureProjGradOffset(sampler: USampler2DTerm, uv: Vec4Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"uvec4">;
export declare function textureProjGradOffset(sampler: USampler3DTerm, uvw: Vec4Term, dx: Vec3Term, dy: Vec3Term, offset: IVec3Term): FnCall<"uvec4">;
export declare function textureProjGradOffset(sampler: Term<"sampler2DShadow">, uvw: Vec4Term, dx: Vec2Term, dy: Vec2Term, offset: IVec2Term): FnCall<"float">;
export declare const dFdx: <T extends Prim>(sym: Sym<T>) => FnCall<T>;
export declare const dFdy: <T extends Prim>(sym: Sym<T>) => FnCall<T>;
export declare const fwidth: <T extends Prim>(sym: Sym<T>) => FnCall<T>;
//# sourceMappingURL=texture.d.ts.map