[GH-ISSUE #7826] Shader packs: legacy textureSize1D/2D/3D queries are rejected #4609

Open
opened 2026-11-03 05:05:15 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @gigamans442 on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7826

Originally assigned to: @gigamans442 on GitHub.

🤖 Filed by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally.

GLSL 1.20 shaders using GL_EXT_gpu_shader4 can be skipped when they query a texture through textureSize1D, textureSize2D, or textureSize3D. The translator recognizes the related legacy texelFetch names, but these three size-query names reach Naga unchanged and produce Unknown function.

An original minimal fragment shader is:

#version 120
#extension GL_EXT_gpu_shader4 : enable
uniform sampler2D inputTexture;
void main() {
    ivec2 size = textureSize2D(inputTexture, 0);
    gl_FragColor = vec4(vec2(size), 0.0, 1.0);
}

Changing only textureSize2D to textureSize lets this program load and write SPIR-V. Independent original 1D and 3D cases show the same legacy-name failure with passing modern controls. The public EXT_gpu_shader4 specification, section 8.7 defines all three names and their int / ivec2 / ivec3 results.

Reproduced on public main 0bcd2f15678532560589773f674fb6290b075005: all three original extension-enabled legacy cases are skipped with Unknown function, while all three otherwise identical modern controls load, validate, and write both SPIR-V modules without loader notes. An additional original 2D terrain input fails with the same unknown-function diagnostic. The focused run used the actual pack loader and fresh main source, with immutable source/test-executable capture.

The intended correction is limited to these three supported sampler dimensions, with user functions and macros preserved. This report makes no claim about rectangle, array, cube, or buffer aliases, GPU pixels, or complete pack compatibility.

🤖 Generated with Codex

Originally created by @gigamans442 on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7826 Originally assigned to: @gigamans442 on GitHub. > 🤖 Filed by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally. GLSL 1.20 shaders using `GL_EXT_gpu_shader4` can be skipped when they query a texture through `textureSize1D`, `textureSize2D`, or `textureSize3D`. The translator recognizes the related legacy `texelFetch` names, but these three size-query names reach Naga unchanged and produce `Unknown function`. An original minimal fragment shader is: ```glsl #version 120 #extension GL_EXT_gpu_shader4 : enable uniform sampler2D inputTexture; void main() { ivec2 size = textureSize2D(inputTexture, 0); gl_FragColor = vec4(vec2(size), 0.0, 1.0); } ``` Changing only `textureSize2D` to `textureSize` lets this program load and write SPIR-V. Independent original 1D and 3D cases show the same legacy-name failure with passing modern controls. The public [EXT_gpu_shader4 specification, section 8.7](https://registry.khronos.org/OpenGL/extensions/EXT/EXT_gpu_shader4.txt) defines all three names and their `int` / `ivec2` / `ivec3` results. Reproduced on public main `0bcd2f15678532560589773f674fb6290b075005`: all three original extension-enabled legacy cases are skipped with `Unknown function`, while all three otherwise identical modern controls load, validate, and write both SPIR-V modules without loader notes. An additional original 2D terrain input fails with the same unknown-function diagnostic. The focused run used the actual pack loader and fresh main source, with immutable source/test-executable capture. The intended correction is limited to these three supported sampler dimensions, with user functions and macros preserved. This report makes no claim about rectangle, array, cube, or buffer aliases, GPU pixels, or complete pack compatibility. 🤖 Generated with [Codex](https://openai.com/codex/)
Author
Owner

@gigamans442 commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6589184966 --> @gigamans442 commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4609
No description provided.