ORACLE_GPU_STUB_NAMES
이 페이지에서

ORACLE_GPU_STUB_NAMES

상수, CPU 오라클 분류

The names of every GPU-only intrinsic the CPU backends cannot genuinely evaluate, as a read-only set: textureSample, textureSampleLevel, textureSampleBias, textureSampleGrad, textureLoad, their 2d-array forms, the depth comparisons, textureDimensions, textureNumLayers, and the derivatives fwidth, dpdx and dpdy.

import { ORACLE_GPU_STUB_NAMES } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const ORACLE_GPU_STUB_NAMES: ReadonlySet<string>

설명

A texture read needs the GPU’s sampler and texture memory, and a derivative needs neighbouring fragments; a CPU run of a single invocation has neither. Calling one of these from a module compiled with compileModule or compileModuleJs throws, unless the module was compiled with { gpuStubs: true }; then it returns a placeholder: [0, 0, 0, 1] for a texture read, [1, 1] for textureDimensions, 1 for textureNumLayers and 0 for a derivative. Meant for tests: the union of this set and ORACLE_BUILTIN_NAMES should cover every intrinsic in INTRINSICS and PORTABLE_INTRINSICS, so a test can assert that each intrinsic a shader can emit has either a CPU implementation or a documented placeholder.

관련 가이드

함께 보기

소스

src/core/cpu-runtime.ts, 1095행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고