import type { ColorScaleBias } from '@flighthq/adjustments/contract'; import type { Kind } from '@flighthq/entity/contract'; import type { BlendMode, Material, TintMaterialData } from '@flighthq/materials/contract'; import type { GlCompressedTextureDecoder } from '@flighthq/render-gl/compressed-texture-decoder-contract'; import type { RenderProxy2D, RenderRegistries, RenderState, RenderStateRuntime, ShapeRasterizer } from '@flighthq/render/contract'; import type { SamplerLike } from '@flighthq/texture/contract'; import type { GlCompressedTextureUploader } from './glCompressedTextureUploaderTypes.ts'; import type { GlContextRuntime } from './glContextRuntimeTypes.ts'; import type { GlContextState } from './glContextStateTypes.ts'; import type { GlCubeRenderTarget } from './glCubeRenderTargetTypes.ts'; import type { GlCustomMaterialShaderSource } from './glCustomMaterialShaderSourceTypes.ts'; import type { GlMeshMaterialRenderer } from './glMeshMaterialRendererTypes.ts'; import type { GlModifierSnippet } from './glModifierSnippetTypes.ts'; import type { GlBitmapShader, GlEffectRegistration, GlScene3DPass, GlShaderLocations, GlShapeMesh, GlVelocityWriter } from './glOwnerTypes.ts'; import type { GlPbrExtensionRegistration } from './glPbrExtensionRegistrationTypes.ts'; import type { GlQuadMaterialRenderer } from './glQuadMaterialRendererTypes.ts'; import type { GlRenderPass } from './glRenderPassTypes.ts'; import type { GlRenderTarget } from './glRenderTargetTypes.ts'; import type { GlRenderTextureGuard } from './glRenderTextureTypes.ts'; import type { GlTextureResolver } from './glTextureResolverTypes.ts'; import type { GlContext } from './types.ts'; export interface GlRenderState extends RenderState { applyBlendMode: ((state: GlRenderState, blendMode: BlendMode | null) => void) | null; readonly contextState: GlContextState; readonly gl: GlContext; readonly registries: Readonly; } export interface GlRenderRegistries extends RenderRegistries { blendRealizations: ReadonlyMap; colorAdjustmentFeature?: GlColorAdjustmentMaterialFeature | null; colorAdjustmentFeatureGuard?: GlColorAdjustmentMaterialFeatureGuard | null; compressedTextureDecoder: GlCompressedTextureDecoder | null; compressedTextureUpload: GlCompressedTextureUploader | null; customEffectShaders: ReadonlyMap; customMaterialShaders: ReadonlyMap; materialRenderers: ReadonlyMap; modifierSnippets: ReadonlyMap; pbrExtensions: ReadonlyMap; effects: ReadonlyMap; passes: readonly GlScene3DPass[] | null; shapeRasterizer: ShapeRasterizer | null; textureResolvers: ReadonlyMap; velocityWriters: ReadonlyMap; } export interface GlBlendRealization { readonly src: GlBlendFactor; readonly dst: GlBlendFactor; readonly equation?: GlBlendEquation; } export interface GlBlendSignature { readonly dst: number; readonly equation: number; readonly src: number; } export interface GlBoundShader { readonly locations: GlShaderLocations | null; readonly program: WebGLProgram; } export type GlBlendFactor = 'DST_COLOR' | 'ONE' | 'ONE_MINUS_SRC_ALPHA' | 'ONE_MINUS_SRC_COLOR' | 'ZERO'; export type GlBlendEquation = 'FUNC_ADD' | 'FUNC_REVERSE_SUBTRACT' | 'MAX' | 'MIN'; export interface GlColorAdjustmentMaterialFeature { readonly fragmentShaderChunk: string; readonly matrixFragmentShaderChunk: string; drawShapeMeshes(state: GlRenderState, renderProxy: RenderProxy2D, meshes: readonly GlShapeMesh[]): void; flush(state: GlRenderState, count: number): boolean; record(runtime: GlRenderStateRuntime, colorScaleBias: ColorScaleBias | TintMaterialData | Readonly | null | undefined, instanceIndex: number): void; } export type GlColorAdjustmentMaterialFeatureGuard = (state: GlRenderState, colorScaleBias: Readonly) => void; export interface GlRenderStateRuntime extends RenderStateRuntime { context: GlContextRuntime; registries: GlRenderRegistries; modifierSnippetRevision: number; pbrExtensionRevision: number; teardowns: ((state: GlRenderState) => void)[]; bindingCacheGuard: ((state: GlRenderState, expectedProgram: WebGLProgram) => void) | null; flushPendingDraws?: ((state: GlRenderState) => void) | null; defaultBitmapShader: GlBitmapShader | null; particleInstanceData?: Float32Array; materialBitmapShaderMap?: Map; webglShaderBindingResolver?: (renderProxy: RenderProxy2D) => GlBitmapShader | undefined; quadBatchWriterBlendMode: BlendMode | null; quadBatchWriterMaterial: Material | null; quadBatchWriterMaterialRenderer: GlQuadMaterialRenderer | null; quadBatchWriterMaterialFloats: number; quadBatchWriterMaterialData: Float32Array; quadBatchWriterCount: number; quadBatchWriterInstanceData: Float32Array; quadBatchWriterTexture: WebGLTexture | null; quadBatchWriterSampler: SamplerLike | null; quadBatchWriterStraightAlpha: boolean; quadBatchWriterSmoothing: boolean | null; quadBatchWriterColorScaleBiasMode?: number; quadBatchWriterUniformColorScaleBias?: ColorScaleBias | TintMaterialData | Readonly | null; quadBatchWriterColorScaleBiasData?: Float32Array; quadBatchWriterColorMatrixData?: Float32Array; quadBatchWriterColorTintData?: Uint32Array; clipForms: ('rect' | 'contour')[]; currentMaskDepth?: number; currentScissorRect?: GlScissorRect | null; currentFramebuffer: WebGLFramebuffer | null; currentPass: GlRenderPass | null; currentRenderTarget?: GlCubeRenderTarget | GlRenderTarget | null; renderTargetViewport: GlViewportRect | null; glRenderTextureGuard?: GlRenderTextureGuard | null; quadVertexData: Float32Array; matrixArray: Float32Array; scissorStack?: GlScissorRect[]; } export interface GlParticleShader { program: WebGLProgram; locCorner: number; locPos: number; locCosScale: number; locSinScale: number; locColor: number; locUvRect: number; locSize: number; locWorldMatrix: WebGLUniformLocation; locTexture: WebGLUniformLocation; locStraightTextureAlpha: WebGLUniformLocation; } export interface GlQuadBatchShader { program: WebGLProgram; locCorner: number; locMatAB: number; locMatCD: number; locMatTXTY: number; locUvOriginAxisU: number; locUvAxisV: number; locAlpha: number; locWorldMatrix: WebGLUniformLocation; locTexture: WebGLUniformLocation; locStraightTextureAlpha: WebGLUniformLocation; } export interface GlColorScaleBiasInstancedShader { program: WebGLProgram; locCorner: number; locWorldMatrix: WebGLUniformLocation; locTexture: WebGLUniformLocation; locStraightTextureAlpha: WebGLUniformLocation; } export interface GlUniformColorScaleBiasShader { program: WebGLProgram; locCorner: number; locWorldMatrix: WebGLUniformLocation; locTexture: WebGLUniformLocation; locStraightTextureAlpha: WebGLUniformLocation; locColorScale: WebGLUniformLocation; locColorBias: WebGLUniformLocation; } export interface GlShapeMeshColorScaleBiasShader { program: WebGLProgram; positionLocation: number; matrixLocation: WebGLUniformLocation | null; colorLocation: WebGLUniformLocation | null; colorScaleLocation: WebGLUniformLocation | null; colorBiasLocation: WebGLUniformLocation | null; colorMatrixLocations?: readonly (WebGLUniformLocation | null)[]; } export interface GlScissorRect { height: number; width: number; x: number; y: number; } export interface GlViewportRect { height: number; width: number; x: number; y: number; } //# sourceMappingURL=glRenderStateTypes.d.ts.map