규칙 11.12
이 페이지에서

규칙 11.12

11장, 대상과 오라클 테스트

An integer division, remainder and shift, and a float’s conversion to an integer, must give WGSL’s answer on GLSL ES 3.00 for every input WGSL settles: the GLSL writer spells each through a helper that settles the inputs GLSL ES 3.00 leaves undefined, and uses the bare operator only where the operands cannot reach one.

규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

근거

GLSL ES 3.00 gives a zero divisor, the least int over -1, a negative operand of %, a shift amount past the width and a float the integer cannot hold no result (its §5.9, §4.1.3 and §5.4.1), and a WebGL2 driver answers otherwise than WGSL on all but the shift (#382); the oracle follows WGSL (Rule 11.5), so without the helpers a program means one thing on WebGPU and on the CPU tier and another on WebGL2, a kernel function’s WebGL2 tier included.

출처

검증 방식

테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.

컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.

src/core/backends/glsl-int.ts, which the GLSL writer’s intBinop and floatToInt spellings call; pinned by src/core/backends/glsl-int-answers.test.ts on both halves; the compile gate for every example’s GLSL; and the WebGL2 arm of scripts/gpu-differential.ts, which holds these operations to the oracle over generated programs and requires the corpus to reach the inputs GLSL leaves undefined.

커밋 c66579bf에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.

설명하는 절

커밋 c66579bf의 표면 문서에서 이 규칙을 설명하는 절입니다.

함께 보기

소스

커밋 c66579bf의 규칙 원문:

이 페이지 편집 문제 보고