@flighthq/render-wgpu 0.5.1-next.973.788d3d7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/.tsbuildinfo.compressed-texture-decoder-contract +1 -0
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/compressed-texture-decoder-contract/WgpuCompressedTextureDecoder.d.ts +3 -0
- package/dist/compressed-texture-decoder-contract/WgpuCompressedTextureDecoder.d.ts.map +1 -0
- package/dist/compressed-texture-decoder-contract/WgpuCompressedTextureDecoder.js +2 -0
- package/dist/compressed-texture-decoder-contract/WgpuCompressedTextureDecoder.js.map +1 -0
- package/dist/compressed-texture-decoder-contract/compressedTextureDecoderContract.d.ts +2 -0
- package/dist/compressed-texture-decoder-contract/compressedTextureDecoderContract.d.ts.map +1 -0
- package/dist/compressed-texture-decoder-contract/compressedTextureDecoderContract.js +2 -0
- package/dist/compressed-texture-decoder-contract/compressedTextureDecoderContract.js.map +1 -0
- package/dist/contract.d.ts +32 -34
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +32 -34
- package/dist/contract.js.map +1 -1
- package/dist/contract.render-wgpu-types.d.ts +55 -0
- package/dist/contract.render-wgpu-types.d.ts.map +1 -0
- package/dist/contract.render-wgpu-types.js +5 -0
- package/dist/contract.render-wgpu-types.js.map +1 -0
- package/dist/enableWgpuTextureResolverGuards.d.ts +3 -2
- package/dist/enableWgpuTextureResolverGuards.d.ts.map +1 -1
- package/dist/enableWgpuTextureResolverGuards.js +12 -9
- package/dist/enableWgpuTextureResolverGuards.js.map +1 -1
- package/dist/explainWgpuTextureResolution.d.ts +2 -1
- package/dist/explainWgpuTextureResolution.d.ts.map +1 -1
- package/dist/explainWgpuTextureResolution.js +2 -5
- package/dist/explainWgpuTextureResolution.js.map +1 -1
- package/dist/explainWgpuUniformEndianness.d.ts +3 -0
- package/dist/explainWgpuUniformEndianness.d.ts.map +1 -0
- package/dist/explainWgpuUniformEndianness.js +25 -0
- package/dist/explainWgpuUniformEndianness.js.map +1 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/types/Host.d.ts +5 -0
- package/dist/types/Host.d.ts.map +1 -0
- package/dist/types/Host.js +2 -0
- package/dist/types/Host.js.map +1 -0
- package/dist/types/WgpuAdapter.d.ts +14 -0
- package/dist/types/WgpuAdapter.d.ts.map +1 -0
- package/dist/types/WgpuAdapter.js +2 -0
- package/dist/types/WgpuAdapter.js.map +1 -0
- package/dist/types/WgpuAdapterCapabilities.d.ts +7 -0
- package/dist/types/WgpuAdapterCapabilities.d.ts.map +1 -0
- package/dist/types/WgpuAdapterCapabilities.js +2 -0
- package/dist/types/WgpuAdapterCapabilities.js.map +1 -0
- package/dist/types/WgpuBindGroup.d.ts +23 -0
- package/dist/types/WgpuBindGroup.d.ts.map +1 -0
- package/dist/types/WgpuBindGroup.js +2 -0
- package/dist/types/WgpuBindGroup.js.map +1 -0
- package/dist/types/WgpuBindGroupLayout.d.ts +45 -0
- package/dist/types/WgpuBindGroupLayout.d.ts.map +1 -0
- package/dist/types/WgpuBindGroupLayout.js +7 -0
- package/dist/types/WgpuBindGroupLayout.js.map +1 -0
- package/dist/types/WgpuBuffer.d.ts +34 -0
- package/dist/types/WgpuBuffer.d.ts.map +1 -0
- package/dist/types/WgpuBuffer.js +19 -0
- package/dist/types/WgpuBuffer.js.map +1 -0
- package/dist/types/WgpuCanvasContext.d.ts +17 -0
- package/dist/types/WgpuCanvasContext.d.ts.map +1 -0
- package/dist/types/WgpuCanvasContext.js +2 -0
- package/dist/types/WgpuCanvasContext.js.map +1 -0
- package/dist/types/WgpuColorAdjustmentMaterialFeature.d.ts +14 -0
- package/dist/types/WgpuColorAdjustmentMaterialFeature.d.ts.map +1 -0
- package/dist/types/WgpuColorAdjustmentMaterialFeature.js +2 -0
- package/dist/types/WgpuColorAdjustmentMaterialFeature.js.map +1 -0
- package/dist/types/WgpuCommandBuffer.d.ts +5 -0
- package/dist/types/WgpuCommandBuffer.d.ts.map +1 -0
- package/dist/types/WgpuCommandBuffer.js +2 -0
- package/dist/types/WgpuCommandBuffer.js.map +1 -0
- package/dist/types/WgpuCommandEncoder.d.ts +12 -0
- package/dist/types/WgpuCommandEncoder.d.ts.map +1 -0
- package/dist/types/WgpuCommandEncoder.js +2 -0
- package/dist/types/WgpuCommandEncoder.js.map +1 -0
- package/dist/types/WgpuCompressedTextureSupport.d.ts +6 -0
- package/dist/types/WgpuCompressedTextureSupport.d.ts.map +1 -0
- package/dist/types/WgpuCompressedTextureSupport.js +2 -0
- package/dist/types/WgpuCompressedTextureSupport.js.map +1 -0
- package/dist/types/WgpuCompressedTextureUploader.d.ts +6 -0
- package/dist/types/WgpuCompressedTextureUploader.d.ts.map +1 -0
- package/dist/types/WgpuCompressedTextureUploader.js +2 -0
- package/dist/types/WgpuCompressedTextureUploader.js.map +1 -0
- package/dist/types/WgpuCustomMaterialShaderSource.d.ts +2 -0
- package/dist/types/WgpuCustomMaterialShaderSource.d.ts.map +1 -0
- package/dist/types/WgpuCustomMaterialShaderSource.js +2 -0
- package/dist/types/WgpuCustomMaterialShaderSource.js.map +1 -0
- package/dist/types/WgpuDevice.d.ts +76 -0
- package/dist/types/WgpuDevice.d.ts.map +1 -0
- package/dist/types/WgpuDevice.js +2 -0
- package/dist/types/WgpuDevice.js.map +1 -0
- package/dist/types/WgpuDeviceRuntime.d.ts +53 -0
- package/dist/types/WgpuDeviceRuntime.d.ts.map +1 -0
- package/dist/types/WgpuDeviceRuntime.js +2 -0
- package/dist/types/WgpuDeviceRuntime.js.map +1 -0
- package/dist/types/WgpuDeviceSignals.d.ts +6 -0
- package/dist/types/WgpuDeviceSignals.d.ts.map +1 -0
- package/dist/types/WgpuDeviceSignals.js +2 -0
- package/dist/types/WgpuDeviceSignals.js.map +1 -0
- package/dist/types/WgpuDeviceState.d.ts +7 -0
- package/dist/types/WgpuDeviceState.d.ts.map +1 -0
- package/dist/types/WgpuDeviceState.js +2 -0
- package/dist/types/WgpuDeviceState.js.map +1 -0
- package/dist/types/WgpuEffectState.d.ts +19 -0
- package/dist/types/WgpuEffectState.d.ts.map +1 -0
- package/dist/types/WgpuEffectState.js +2 -0
- package/dist/types/WgpuEffectState.js.map +1 -0
- package/dist/types/WgpuExternalImageSource.d.ts +18 -0
- package/dist/types/WgpuExternalImageSource.d.ts.map +1 -0
- package/dist/types/WgpuExternalImageSource.js +2 -0
- package/dist/types/WgpuExternalImageSource.js.map +1 -0
- package/dist/types/WgpuFullscreenPipeline.d.ts +14 -0
- package/dist/types/WgpuFullscreenPipeline.d.ts.map +1 -0
- package/dist/types/WgpuFullscreenPipeline.js +2 -0
- package/dist/types/WgpuFullscreenPipeline.js.map +1 -0
- package/dist/types/WgpuGpu.d.ts +7 -0
- package/dist/types/WgpuGpu.d.ts.map +1 -0
- package/dist/types/WgpuGpu.js +2 -0
- package/dist/types/WgpuGpu.js.map +1 -0
- package/dist/types/WgpuHost.d.ts +44 -0
- package/dist/types/WgpuHost.d.ts.map +1 -0
- package/dist/types/WgpuHost.js +2 -0
- package/dist/types/WgpuHost.js.map +1 -0
- package/dist/types/WgpuMeshMaterialRenderer.d.ts +11 -0
- package/dist/types/WgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/types/WgpuMeshMaterialRenderer.js +2 -0
- package/dist/types/WgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/types/WgpuModifierSnippet.d.ts +16 -0
- package/dist/types/WgpuModifierSnippet.d.ts.map +1 -0
- package/dist/types/WgpuModifierSnippet.js +2 -0
- package/dist/types/WgpuModifierSnippet.js.map +1 -0
- package/dist/types/WgpuParticleResources.d.ts +12 -0
- package/dist/types/WgpuParticleResources.d.ts.map +1 -0
- package/dist/types/WgpuParticleResources.js +2 -0
- package/dist/types/WgpuParticleResources.js.map +1 -0
- package/dist/types/WgpuPipelineLayout.d.ts +8 -0
- package/dist/types/WgpuPipelineLayout.d.ts.map +1 -0
- package/dist/types/WgpuPipelineLayout.js +2 -0
- package/dist/types/WgpuPipelineLayout.js.map +1 -0
- package/dist/types/WgpuQuadBatchResources.d.ts +12 -0
- package/dist/types/WgpuQuadBatchResources.d.ts.map +1 -0
- package/dist/types/WgpuQuadBatchResources.js +2 -0
- package/dist/types/WgpuQuadBatchResources.js.map +1 -0
- package/dist/types/WgpuQuadMaterialRenderer.d.ts +9 -0
- package/dist/types/WgpuQuadMaterialRenderer.d.ts.map +1 -0
- package/dist/types/WgpuQuadMaterialRenderer.js +2 -0
- package/dist/types/WgpuQuadMaterialRenderer.js.map +1 -0
- package/dist/types/WgpuQueue.d.ts +12 -0
- package/dist/types/WgpuQueue.d.ts.map +1 -0
- package/dist/types/WgpuQueue.js +2 -0
- package/dist/types/WgpuQueue.js.map +1 -0
- package/dist/types/WgpuRenderOptions.d.ts +14 -0
- package/dist/types/WgpuRenderOptions.d.ts.map +1 -0
- package/dist/types/WgpuRenderOptions.js +2 -0
- package/dist/types/WgpuRenderOptions.js.map +1 -0
- package/dist/types/WgpuRenderPass.d.ts +31 -0
- package/dist/types/WgpuRenderPass.d.ts.map +1 -0
- package/dist/types/WgpuRenderPass.js +2 -0
- package/dist/types/WgpuRenderPass.js.map +1 -0
- package/dist/types/WgpuRenderPassEncoder.d.ts +52 -0
- package/dist/types/WgpuRenderPassEncoder.d.ts.map +1 -0
- package/dist/types/WgpuRenderPassEncoder.js +2 -0
- package/dist/types/WgpuRenderPassEncoder.js.map +1 -0
- package/dist/types/WgpuRenderPipeline.d.ts +96 -0
- package/dist/types/WgpuRenderPipeline.d.ts.map +1 -0
- package/dist/types/WgpuRenderPipeline.js +9 -0
- package/dist/types/WgpuRenderPipeline.js.map +1 -0
- package/dist/types/WgpuRenderState.d.ts +249 -0
- package/dist/types/WgpuRenderState.d.ts.map +1 -0
- package/dist/types/WgpuRenderState.js +2 -0
- package/dist/types/WgpuRenderState.js.map +1 -0
- package/dist/types/WgpuRenderStateOptions.d.ts +31 -0
- package/dist/types/WgpuRenderStateOptions.d.ts.map +1 -0
- package/dist/types/WgpuRenderStateOptions.js +2 -0
- package/dist/types/WgpuRenderStateOptions.js.map +1 -0
- package/dist/types/WgpuRenderTarget.d.ts +62 -0
- package/dist/types/WgpuRenderTarget.d.ts.map +1 -0
- package/dist/types/WgpuRenderTarget.js +2 -0
- package/dist/types/WgpuRenderTarget.js.map +1 -0
- package/dist/types/WgpuRenderTexture.d.ts +25 -0
- package/dist/types/WgpuRenderTexture.d.ts.map +1 -0
- package/dist/types/WgpuRenderTexture.js +2 -0
- package/dist/types/WgpuRenderTexture.js.map +1 -0
- package/dist/types/WgpuSampler.d.ts +19 -0
- package/dist/types/WgpuSampler.d.ts.map +1 -0
- package/dist/types/WgpuSampler.js +2 -0
- package/dist/types/WgpuSampler.js.map +1 -0
- package/dist/types/WgpuScene3DRuntime.d.ts +6 -0
- package/dist/types/WgpuScene3DRuntime.d.ts.map +1 -0
- package/dist/types/WgpuScene3DRuntime.js +2 -0
- package/dist/types/WgpuScene3DRuntime.js.map +1 -0
- package/dist/types/WgpuShaderModule.d.ts +6 -0
- package/dist/types/WgpuShaderModule.d.ts.map +1 -0
- package/dist/types/WgpuShaderModule.js +2 -0
- package/dist/types/WgpuShaderModule.js.map +1 -0
- package/dist/types/WgpuShapeMesh.d.ts +7 -0
- package/dist/types/WgpuShapeMesh.d.ts.map +1 -0
- package/dist/types/WgpuShapeMesh.js +2 -0
- package/dist/types/WgpuShapeMesh.js.map +1 -0
- package/dist/types/WgpuSkinningAdapter.d.ts +18 -0
- package/dist/types/WgpuSkinningAdapter.d.ts.map +1 -0
- package/dist/types/WgpuSkinningAdapter.js +2 -0
- package/dist/types/WgpuSkinningAdapter.js.map +1 -0
- package/dist/types/WgpuSurface.d.ts +5 -0
- package/dist/types/WgpuSurface.d.ts.map +1 -0
- package/dist/types/WgpuSurface.js +2 -0
- package/dist/types/WgpuSurface.js.map +1 -0
- package/dist/types/WgpuTexture.d.ts +58 -0
- package/dist/types/WgpuTexture.d.ts.map +1 -0
- package/dist/types/WgpuTexture.js +9 -0
- package/dist/types/WgpuTexture.js.map +1 -0
- package/dist/types/WgpuTextureFormat.d.ts +2 -0
- package/dist/types/WgpuTextureFormat.d.ts.map +1 -0
- package/dist/types/WgpuTextureFormat.js +2 -0
- package/dist/types/WgpuTextureFormat.js.map +1 -0
- package/dist/types/WgpuTextureResolver.d.ts +4 -0
- package/dist/types/WgpuTextureResolver.d.ts.map +1 -0
- package/dist/types/WgpuTextureResolver.js +2 -0
- package/dist/types/WgpuTextureResolver.js.map +1 -0
- package/dist/types/WgpuTextureView.d.ts +16 -0
- package/dist/types/WgpuTextureView.d.ts.map +1 -0
- package/dist/types/WgpuTextureView.js +2 -0
- package/dist/types/WgpuTextureView.js.map +1 -0
- package/dist/types/WgpuUniformEndianness.d.ts +7 -0
- package/dist/types/WgpuUniformEndianness.d.ts.map +1 -0
- package/dist/types/WgpuUniformEndianness.js +2 -0
- package/dist/types/WgpuUniformEndianness.js.map +1 -0
- package/dist/types/WgpuVelocityWriter.d.ts +11 -0
- package/dist/types/WgpuVelocityWriter.d.ts.map +1 -0
- package/dist/types/WgpuVelocityWriter.js +2 -0
- package/dist/types/WgpuVelocityWriter.js.map +1 -0
- package/dist/wgpuAdapterCapabilities.d.ts +2 -2
- package/dist/wgpuAdapterCapabilities.d.ts.map +1 -1
- package/dist/wgpuAdapterCapabilities.js.map +1 -1
- package/dist/wgpuCompressedTexture.d.ts +7 -5
- package/dist/wgpuCompressedTexture.d.ts.map +1 -1
- package/dist/wgpuCompressedTexture.js +10 -18
- package/dist/wgpuCompressedTexture.js.map +1 -1
- package/dist/wgpuDeviceLoss.d.ts +2 -2
- package/dist/wgpuDeviceLoss.d.ts.map +1 -1
- package/dist/wgpuDeviceLoss.js +1 -1
- package/dist/wgpuDeviceLoss.js.map +1 -1
- package/dist/wgpuDraw.d.ts +11 -5
- package/dist/wgpuDraw.d.ts.map +1 -1
- package/dist/wgpuDraw.js +21 -20
- package/dist/wgpuDraw.js.map +1 -1
- package/dist/wgpuExternalImageSource.d.ts +3 -2
- package/dist/wgpuExternalImageSource.d.ts.map +1 -1
- package/dist/wgpuExternalImageSource.js.map +1 -1
- package/dist/wgpuExternalTexture.d.ts +7 -3
- package/dist/wgpuExternalTexture.d.ts.map +1 -1
- package/dist/wgpuExternalTexture.js +5 -5
- package/dist/wgpuExternalTexture.js.map +1 -1
- package/dist/wgpuFrame.d.ts +23 -0
- package/dist/wgpuFrame.d.ts.map +1 -0
- package/dist/{wgpuBackground.js → wgpuFrame.js} +67 -122
- package/dist/wgpuFrame.js.map +1 -0
- package/dist/wgpuFullscreenPass.d.ts +5 -4
- package/dist/wgpuFullscreenPass.d.ts.map +1 -1
- package/dist/wgpuFullscreenPass.js +22 -8
- package/dist/wgpuFullscreenPass.js.map +1 -1
- package/dist/wgpuHost.d.ts +4 -7
- package/dist/wgpuHost.d.ts.map +1 -1
- package/dist/wgpuHost.js +81 -70
- package/dist/wgpuHost.js.map +1 -1
- package/dist/wgpuMipmap.d.ts +2 -2
- package/dist/wgpuMipmap.d.ts.map +1 -1
- package/dist/wgpuMipmap.js +4 -3
- package/dist/wgpuMipmap.js.map +1 -1
- package/dist/wgpuQuadMaterialRegistry.d.ts +7 -0
- package/dist/wgpuQuadMaterialRegistry.d.ts.map +1 -0
- package/dist/wgpuQuadMaterialRegistry.js +33 -0
- package/dist/wgpuQuadMaterialRegistry.js.map +1 -0
- package/dist/wgpuRenderPass.d.ts +9 -0
- package/dist/wgpuRenderPass.d.ts.map +1 -0
- package/dist/wgpuRenderPass.js +210 -0
- package/dist/wgpuRenderPass.js.map +1 -0
- package/dist/wgpuRenderState.d.ts +16 -12
- package/dist/wgpuRenderState.d.ts.map +1 -1
- package/dist/wgpuRenderState.js +104 -149
- package/dist/wgpuRenderState.js.map +1 -1
- package/dist/wgpuRenderTarget.d.ts +13 -29
- package/dist/wgpuRenderTarget.d.ts.map +1 -1
- package/dist/wgpuRenderTarget.js +20 -253
- package/dist/wgpuRenderTarget.js.map +1 -1
- package/dist/wgpuRenderTargetPool.d.ts +8 -6
- package/dist/wgpuRenderTargetPool.d.ts.map +1 -1
- package/dist/wgpuRenderTargetPool.js +9 -9
- package/dist/wgpuRenderTargetPool.js.map +1 -1
- package/dist/wgpuRenderTexture.d.ts +7 -4
- package/dist/wgpuRenderTexture.d.ts.map +1 -1
- package/dist/wgpuRenderTexture.js +15 -17
- package/dist/wgpuRenderTexture.js.map +1 -1
- package/dist/wgpuRenderTexturePool.d.ts +3 -1
- package/dist/wgpuRenderTexturePool.d.ts.map +1 -1
- package/dist/wgpuRenderTexturePool.js +5 -7
- package/dist/wgpuRenderTexturePool.js.map +1 -1
- package/dist/wgpuScissor.d.ts +3 -3
- package/dist/wgpuScissor.d.ts.map +1 -1
- package/dist/wgpuScissor.js +8 -5
- package/dist/wgpuScissor.js.map +1 -1
- package/dist/wgpuScreenAntialias.d.ts +3 -0
- package/dist/wgpuScreenAntialias.d.ts.map +1 -0
- package/dist/wgpuScreenAntialias.js +120 -0
- package/dist/wgpuScreenAntialias.js.map +1 -0
- package/dist/wgpuScreenCapture.d.ts +6 -0
- package/dist/wgpuScreenCapture.d.ts.map +1 -0
- package/dist/wgpuScreenCapture.js +138 -0
- package/dist/wgpuScreenCapture.js.map +1 -0
- package/dist/wgpuScreenRenderTarget.d.ts +11 -0
- package/dist/wgpuScreenRenderTarget.d.ts.map +1 -0
- package/dist/wgpuScreenRenderTarget.js +121 -0
- package/dist/wgpuScreenRenderTarget.js.map +1 -0
- package/dist/wgpuShader.d.ts +11 -8
- package/dist/wgpuShader.d.ts.map +1 -1
- package/dist/wgpuShader.js +11 -10
- package/dist/wgpuShader.js.map +1 -1
- package/dist/wgpuShaderBinding.d.ts +3 -1
- package/dist/wgpuShaderBinding.d.ts.map +1 -1
- package/dist/wgpuShaderBinding.js +1 -1
- package/dist/wgpuShaderBinding.js.map +1 -1
- package/dist/wgpuShaderRegistry.d.ts +1 -1
- package/dist/wgpuShaderRegistry.d.ts.map +1 -1
- package/dist/wgpuShaderRegistry.js +1 -1
- package/dist/wgpuShaderRegistry.js.map +1 -1
- package/dist/wgpuTestHelper.d.ts +11 -2
- package/dist/wgpuTestHelper.d.ts.map +1 -1
- package/dist/wgpuTestHelper.js +50 -38
- package/dist/wgpuTestHelper.js.map +1 -1
- package/dist/wgpuTextureRenderTarget.d.ts +22 -0
- package/dist/wgpuTextureRenderTarget.d.ts.map +1 -0
- package/dist/wgpuTextureRenderTarget.js +123 -0
- package/dist/wgpuTextureRenderTarget.js.map +1 -0
- package/dist/wgpuTextureResolver.d.ts +5 -1
- package/dist/wgpuTextureResolver.d.ts.map +1 -1
- package/dist/wgpuTextureResolver.js +13 -12
- package/dist/wgpuTextureResolver.js.map +1 -1
- package/dist/wgpuTextureUpload.d.ts +5 -4
- package/dist/wgpuTextureUpload.d.ts.map +1 -1
- package/dist/wgpuTextureUpload.js +1 -1
- package/dist/wgpuTextureUpload.js.map +1 -1
- package/package.json +33 -13
- package/src/enableWgpuTextureResolverGuards.test.ts +40 -19
- package/src/explainWgpuTextureResolution.test.ts +6 -6
- package/src/explainWgpuUniformEndianness.test.ts +11 -0
- package/src/types/WgpuBindGroupLayout.test.ts +9 -0
- package/src/types/WgpuBuffer.test.ts +26 -0
- package/src/types/WgpuGpu.test.ts +56 -0
- package/src/types/WgpuRenderPipeline.test.ts +12 -0
- package/src/types/WgpuTexture.test.ts +15 -0
- package/src/wgpuAdapterCapabilities.test.ts +5 -4
- package/src/wgpuCompressedTexture.test.ts +31 -37
- package/src/wgpuDeviceLoss.test.ts +31 -24
- package/src/wgpuDraw.test.ts +21 -24
- package/src/wgpuExternalImageSource.test.ts +12 -11
- package/src/wgpuExternalTexture.test.ts +7 -6
- package/src/{wgpuBackground.test.ts → wgpuFrame.test.ts} +47 -29
- package/src/wgpuFullscreenPass.test.ts +8 -8
- package/src/wgpuHost.test.ts +57 -186
- package/src/wgpuMipmap.test.ts +15 -9
- package/src/wgpuQuadMaterialRegistry.test.ts +132 -0
- package/src/wgpuRenderPass.test.ts +239 -0
- package/src/wgpuRenderState.test.ts +215 -550
- package/src/wgpuRenderTarget.test.ts +44 -220
- package/src/wgpuRenderTargetPool.test.ts +23 -23
- package/src/wgpuRenderTexture.test.ts +21 -18
- package/src/wgpuRenderTexturePool.test.ts +3 -3
- package/src/wgpuScissor.test.ts +50 -19
- package/src/wgpuScreenAntialias.test.ts +65 -0
- package/src/wgpuScreenCapture.test.ts +165 -0
- package/src/wgpuScreenRenderTarget.test.ts +172 -0
- package/src/wgpuShader.test.ts +12 -11
- package/src/wgpuShaderBinding.test.ts +4 -4
- package/src/wgpuShaderRegistry.test.ts +4 -5
- package/src/wgpuTestHelper.test.ts +8 -7
- package/src/wgpuTextureRenderTarget.test.ts +129 -0
- package/src/wgpuTextureResolver.test.ts +25 -14
- package/src/wgpuTextureUpload.test.ts +15 -10
- package/dist/wgpuAntialias.d.ts +0 -14
- package/dist/wgpuAntialias.d.ts.map +0 -1
- package/dist/wgpuAntialias.js +0 -155
- package/dist/wgpuAntialias.js.map +0 -1
- package/dist/wgpuBackground.d.ts +0 -20
- package/dist/wgpuBackground.d.ts.map +0 -1
- package/dist/wgpuBackground.js.map +0 -1
- package/dist/wgpuElement.d.ts +0 -7
- package/dist/wgpuElement.d.ts.map +0 -1
- package/dist/wgpuElement.js +0 -20
- package/dist/wgpuElement.js.map +0 -1
- package/dist/wgpuMaterialRegistry.d.ts +0 -5
- package/dist/wgpuMaterialRegistry.d.ts.map +0 -1
- package/dist/wgpuMaterialRegistry.js +0 -32
- package/dist/wgpuMaterialRegistry.js.map +0 -1
- package/dist/wgpuPipeline.d.ts +0 -6
- package/dist/wgpuPipeline.d.ts.map +0 -1
- package/dist/wgpuPipeline.js +0 -33
- package/dist/wgpuPipeline.js.map +0 -1
- package/dist/wgpuSurface.d.ts +0 -6
- package/dist/wgpuSurface.d.ts.map +0 -1
- package/dist/wgpuSurface.js +0 -155
- package/dist/wgpuSurface.js.map +0 -1
- package/src/wgpuAntialias.test.ts +0 -239
- package/src/wgpuElement.test.ts +0 -145
- package/src/wgpuMaterialRegistry.test.ts +0 -100
- package/src/wgpuPipeline.test.ts +0 -62
- package/src/wgpuSurface.test.ts +0 -141
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { createMatrix } from '@flighthq/geometry/contract';
|
|
2
|
+
|
|
3
|
+
import type { WgpuColorDict } from './contract.render-wgpu-types.ts';
|
|
4
|
+
import { beginWgpuFrame, submitWgpuFrame } from './wgpuFrame.ts';
|
|
5
|
+
import {
|
|
6
|
+
beginWgpuRenderPass,
|
|
7
|
+
endWgpuRenderPass,
|
|
8
|
+
getWgpuActiveRenderPass,
|
|
9
|
+
getWgpuRenderPassViewport,
|
|
10
|
+
resumeWgpuRenderPass,
|
|
11
|
+
suspendWgpuRenderPass,
|
|
12
|
+
} from './wgpuRenderPass.ts';
|
|
13
|
+
import { getWgpuRenderStateRuntime } from './wgpuRenderState.ts';
|
|
14
|
+
import {
|
|
15
|
+
beginWgpuScreenRenderPassForTest,
|
|
16
|
+
createWgpuRenderStateForTest,
|
|
17
|
+
createWgpuScreenRenderTargetForTest,
|
|
18
|
+
installWgpuMock,
|
|
19
|
+
} from './wgpuTestHelper.ts';
|
|
20
|
+
import { createWgpuTextureRenderTarget } from './wgpuTextureRenderTarget.ts';
|
|
21
|
+
|
|
22
|
+
beforeAll(() => {
|
|
23
|
+
installWgpuMock();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('beginWgpuRenderPass', () => {
|
|
27
|
+
it('reports the target extent as the pass viewport', async () => {
|
|
28
|
+
const state = await createWgpuRenderStateForTest();
|
|
29
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
30
|
+
const pass = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 64, 64));
|
|
31
|
+
|
|
32
|
+
expect(pass.viewport.width).toBe(64);
|
|
33
|
+
expect(getWgpuRenderStateRuntime(state).renderTargetViewport?.width).toBe(64);
|
|
34
|
+
|
|
35
|
+
endWgpuRenderPass(pass);
|
|
36
|
+
endWgpuRenderPass(outer);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// The viewport is LOGICAL, not the storage extent. A supersampled target is allocated at 2x per axis,
|
|
40
|
+
// and a projection that divided by that physical width would map logical x = 800 to NDC 0 — the scene
|
|
41
|
+
// filling a quarter of its own target, which is exactly the defect the derived scale exists to prevent.
|
|
42
|
+
it('reports the logical extent for a supersampled target, not its physical storage', async () => {
|
|
43
|
+
const state = await createWgpuRenderStateForTest();
|
|
44
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
45
|
+
const target = createWgpuTextureRenderTarget(state, 400, 300, state.format, 'srgb', 4);
|
|
46
|
+
const pass = beginWgpuRenderPass(state, target);
|
|
47
|
+
|
|
48
|
+
expect(target.width).toBe(800);
|
|
49
|
+
expect(pass.viewport).toEqual({ height: 300, width: 400 });
|
|
50
|
+
|
|
51
|
+
endWgpuRenderPass(pass);
|
|
52
|
+
endWgpuRenderPass(outer);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('passes float RGBA clear values through to the GPU color attachment', async () => {
|
|
56
|
+
const state = await createWgpuRenderStateForTest();
|
|
57
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
58
|
+
const beginRenderPass = vi.spyOn(getWgpuRenderStateRuntime(state).commandEncoder!, 'beginRenderPass');
|
|
59
|
+
const target = createWgpuTextureRenderTarget(state, 32, 32, state.format, 'linear');
|
|
60
|
+
|
|
61
|
+
const pass = beginWgpuRenderPass(state, target, { color: [0.25, 0.5, 0.75, 1.0] });
|
|
62
|
+
|
|
63
|
+
const attachment = Array.from(beginRenderPass.mock.calls.at(-1)![0].colorAttachments)[0]!;
|
|
64
|
+
const clearValue = attachment.clearValue as WgpuColorDict;
|
|
65
|
+
expect([clearValue.r, clearValue.g, clearValue.b, clearValue.a]).toEqual([0.25, 0.5, 0.75, 1.0]);
|
|
66
|
+
expect(attachment.loadOp).toBe('clear');
|
|
67
|
+
|
|
68
|
+
endWgpuRenderPass(pass);
|
|
69
|
+
endWgpuRenderPass(outer);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('preserves the target when no clear is given', async () => {
|
|
73
|
+
const state = await createWgpuRenderStateForTest();
|
|
74
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
75
|
+
const beginRenderPass = vi.spyOn(getWgpuRenderStateRuntime(state).commandEncoder!, 'beginRenderPass');
|
|
76
|
+
|
|
77
|
+
const pass = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 32, 32));
|
|
78
|
+
|
|
79
|
+
const attachment = Array.from(beginRenderPass.mock.calls.at(-1)![0].colorAttachments)[0]!;
|
|
80
|
+
expect(attachment.loadOp).toBe('load');
|
|
81
|
+
|
|
82
|
+
endWgpuRenderPass(pass);
|
|
83
|
+
endWgpuRenderPass(outer);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('opens the frame when none is open, and leaves an explicitly opened frame to its owner', async () => {
|
|
87
|
+
const state = await createWgpuRenderStateForTest();
|
|
88
|
+
const owning = beginWgpuScreenRenderPassForTest(state);
|
|
89
|
+
expect(owning.ownsFrame).toBe(true);
|
|
90
|
+
endWgpuRenderPass(owning);
|
|
91
|
+
expect(getWgpuRenderStateRuntime(state).commandEncoder).toBeNull();
|
|
92
|
+
|
|
93
|
+
beginWgpuFrame(state);
|
|
94
|
+
const borrowed = beginWgpuScreenRenderPassForTest(state);
|
|
95
|
+
expect(borrowed.ownsFrame).toBe(false);
|
|
96
|
+
endWgpuRenderPass(borrowed);
|
|
97
|
+
// The frame outlives the pass, which is what lets a shadow pass and a screen pass share one submit.
|
|
98
|
+
expect(getWgpuRenderStateRuntime(state).commandEncoder).not.toBeNull();
|
|
99
|
+
submitWgpuFrame(state);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe('endWgpuRenderPass', () => {
|
|
104
|
+
it('restores the enclosing target, viewport, and clip state', async () => {
|
|
105
|
+
const state = await createWgpuRenderStateForTest();
|
|
106
|
+
const screen = createWgpuScreenRenderTargetForTest(state);
|
|
107
|
+
const outer = beginWgpuRenderPass(state, screen, { color: [0, 0, 0, 0] });
|
|
108
|
+
const runtime = getWgpuRenderStateRuntime(state);
|
|
109
|
+
runtime.currentScissorRect = { height: 10, width: 10, x: 0, y: 0 };
|
|
110
|
+
|
|
111
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 32, 32));
|
|
112
|
+
expect(runtime.currentScissorRect).toBeNull();
|
|
113
|
+
endWgpuRenderPass(inner);
|
|
114
|
+
|
|
115
|
+
expect(runtime.currentRenderTarget).toBe(screen);
|
|
116
|
+
expect(runtime.renderTargetViewport).toEqual({ height: 600, width: 800 });
|
|
117
|
+
expect(runtime.currentScissorRect).toEqual({ height: 10, width: 10, x: 0, y: 0 });
|
|
118
|
+
|
|
119
|
+
endWgpuRenderPass(outer);
|
|
120
|
+
expect(runtime.currentRenderTarget).toBeNull();
|
|
121
|
+
expect(runtime.renderTargetViewport).toBeNull();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('resumes the enclosing pass with a fresh encoder that preserves its pixels', async () => {
|
|
125
|
+
// A WebGPU pass encoder cannot be reopened, so the enclosing pass is re-recorded — and it must load
|
|
126
|
+
// rather than clear, or every nested offscreen pass would wipe the frame that surrounds it.
|
|
127
|
+
const state = await createWgpuRenderStateForTest();
|
|
128
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
129
|
+
const runtime = getWgpuRenderStateRuntime(state);
|
|
130
|
+
const suspendedEncoder = outer.encoder;
|
|
131
|
+
|
|
132
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 32, 32));
|
|
133
|
+
expect(outer.encoder).toBeNull();
|
|
134
|
+
const beginRenderPass = vi.spyOn(runtime.commandEncoder!, 'beginRenderPass');
|
|
135
|
+
endWgpuRenderPass(inner);
|
|
136
|
+
|
|
137
|
+
expect(outer.encoder).not.toBeNull();
|
|
138
|
+
expect(outer.encoder).not.toBe(suspendedEncoder);
|
|
139
|
+
expect(runtime.renderPass).toBe(outer.encoder);
|
|
140
|
+
expect(Array.from(beginRenderPass.mock.calls.at(-1)![0].colorAttachments)[0]!.loadOp).toBe('load');
|
|
141
|
+
|
|
142
|
+
endWgpuRenderPass(outer);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('submits the frame it opened, and only that frame', async () => {
|
|
146
|
+
const state = await createWgpuRenderStateForTest();
|
|
147
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
148
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 16, 16));
|
|
149
|
+
|
|
150
|
+
endWgpuRenderPass(inner);
|
|
151
|
+
expect(getWgpuRenderStateRuntime(state).commandEncoder).not.toBeNull();
|
|
152
|
+
|
|
153
|
+
endWgpuRenderPass(outer);
|
|
154
|
+
expect(getWgpuRenderStateRuntime(state).commandEncoder).toBeNull();
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('refuses a pass that is not the innermost open one', async () => {
|
|
158
|
+
const state = await createWgpuRenderStateForTest();
|
|
159
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
160
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 16, 16));
|
|
161
|
+
|
|
162
|
+
expect(() => endWgpuRenderPass(outer)).toThrow(/innermost open pass/);
|
|
163
|
+
|
|
164
|
+
endWgpuRenderPass(inner);
|
|
165
|
+
endWgpuRenderPass(outer);
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('getWgpuActiveRenderPass', () => {
|
|
170
|
+
it('names the innermost open pass and nothing outside a bracket', async () => {
|
|
171
|
+
const state = await createWgpuRenderStateForTest();
|
|
172
|
+
expect(getWgpuActiveRenderPass(state)).toBeNull();
|
|
173
|
+
|
|
174
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
175
|
+
expect(getWgpuActiveRenderPass(state)).toBe(outer);
|
|
176
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 16, 16));
|
|
177
|
+
expect(getWgpuActiveRenderPass(state)).toBe(inner);
|
|
178
|
+
|
|
179
|
+
endWgpuRenderPass(inner);
|
|
180
|
+
expect(getWgpuActiveRenderPass(state)).toBe(outer);
|
|
181
|
+
endWgpuRenderPass(outer);
|
|
182
|
+
expect(getWgpuActiveRenderPass(state)).toBeNull();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
describe('getWgpuRenderPassViewport', () => {
|
|
187
|
+
it('throws outside a pass rather than inventing a canvas-sized default', async () => {
|
|
188
|
+
// A draw with no target bound is API misuse; a default extent would hide it until the picture came
|
|
189
|
+
// out the wrong size, with nothing in the failure naming the missing begin.
|
|
190
|
+
const state = await createWgpuRenderStateForTest();
|
|
191
|
+
expect(() => getWgpuRenderPassViewport(state)).toThrow(/beginWgpuRenderPass/);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it('reports the innermost pass extent', async () => {
|
|
195
|
+
const state = await createWgpuRenderStateForTest();
|
|
196
|
+
const outer = beginWgpuScreenRenderPassForTest(state);
|
|
197
|
+
expect(getWgpuRenderPassViewport(state)).toEqual({ height: 600, width: 800 });
|
|
198
|
+
|
|
199
|
+
const inner = beginWgpuRenderPass(state, createWgpuTextureRenderTarget(state, 40, 20));
|
|
200
|
+
expect(getWgpuRenderPassViewport(state)).toEqual({ height: 20, width: 40 });
|
|
201
|
+
|
|
202
|
+
endWgpuRenderPass(inner);
|
|
203
|
+
endWgpuRenderPass(outer);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe('resumeWgpuRenderPass', () => {
|
|
208
|
+
it('reopens a suspended pass over the same target', async () => {
|
|
209
|
+
const state = await createWgpuRenderStateForTest();
|
|
210
|
+
const pass = beginWgpuScreenRenderPassForTest(state);
|
|
211
|
+
const target = pass.target;
|
|
212
|
+
suspendWgpuRenderPass(pass);
|
|
213
|
+
|
|
214
|
+
resumeWgpuRenderPass(pass);
|
|
215
|
+
|
|
216
|
+
expect(pass.encoder).not.toBeNull();
|
|
217
|
+
expect(pass.target).toBe(target);
|
|
218
|
+
expect(getWgpuRenderStateRuntime(state).renderPass).toBe(pass.encoder);
|
|
219
|
+
endWgpuRenderPass(pass);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
describe('suspendWgpuRenderPass', () => {
|
|
224
|
+
it('closes the encoder while leaving the pass open', async () => {
|
|
225
|
+
// The effect pipeline records its own fullscreen passes into the frame, which it can only do while
|
|
226
|
+
// no other pass encoder is recording.
|
|
227
|
+
const state = await createWgpuRenderStateForTest();
|
|
228
|
+
const pass = beginWgpuScreenRenderPassForTest(state);
|
|
229
|
+
|
|
230
|
+
suspendWgpuRenderPass(pass);
|
|
231
|
+
|
|
232
|
+
expect(pass.encoder).toBeNull();
|
|
233
|
+
expect(getWgpuRenderStateRuntime(state).renderPass).toBeNull();
|
|
234
|
+
expect(getWgpuActiveRenderPass(state)).toBe(pass);
|
|
235
|
+
|
|
236
|
+
resumeWgpuRenderPass(pass);
|
|
237
|
+
endWgpuRenderPass(pass);
|
|
238
|
+
});
|
|
239
|
+
});
|