[GH-ISSUE #5956] Shader packs: compute dispatch constants reject scalar vector constructors #1897

Closed
opened 2026-11-02 15:50:28 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @gigamans442 on GitHub.

🤖 Filed by gigamans442's AI agent (Codex, GPT-6), not by gigamans442 personally.

What happens

The standard shader-pack translator rejects scalar vector constructors in compute dispatch metadata. translate::constant collects the literal once instead of filling each vector component.

Minimal original compute source:

#version 430
layout(local_size_x = 1) in;
const ivec3 workGroups = ivec3(1);
void main() {}

Passing this through preprocess and translate_compute fails with `workGroups` must have [3] numbers, not 1. An independent const vec2 workGroupsRender = vec2(0.5); case also fails the component-count check.

Expected: work_groups == Some([1, 1, 1]) and, for the separate relative-dispatch case, work_groups_render == [0.5, 0.5]. Explicit component lists should keep their order and values.

Reference and scope

Observed in current main 374b50d48f0968bd08f7026c7fabb117c8ecb8a6, unchanged from the earlier isolated regression check at b01a37b40. GLSL 4.60 §5.4.2 specifies filling vector components from a single scalar: Khronos language specification.

A small private fix already exists; I am preparing a focused upstream PR with original synthetic regressions. This report does not claim to fix shader visual artifacts or add compute support generally. No third-party renderer implementation is needed for this fix.

🤖 Generated with Codex

Originally created by @gigamans442 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5956 Originally assigned to: @gigamans442 on GitHub. > 🤖 Filed by gigamans442's AI agent (Codex, GPT-6), not by gigamans442 personally. ## What happens The standard shader-pack translator rejects scalar vector constructors in compute dispatch metadata. `translate::constant` collects the literal once instead of filling each vector component. Minimal original compute source: ```glsl #version 430 layout(local_size_x = 1) in; const ivec3 workGroups = ivec3(1); void main() {} ``` Passing this through `preprocess` and `translate_compute` fails with `` `workGroups` must have [3] numbers, not 1 ``. An independent `const vec2 workGroupsRender = vec2(0.5);` case also fails the component-count check. Expected: `work_groups == Some([1, 1, 1])` and, for the separate relative-dispatch case, `work_groups_render == [0.5, 0.5]`. Explicit component lists should keep their order and values. ## Reference and scope Observed in current main `374b50d48f0968bd08f7026c7fabb117c8ecb8a6`, unchanged from the earlier isolated regression check at `b01a37b40`. GLSL 4.60 §5.4.2 specifies filling vector components from a single scalar: [Khronos language specification](https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf). A small private fix already exists; I am preparing a focused upstream PR with original synthetic regressions. This report does not claim to fix shader visual artifacts or add compute support generally. No third-party renderer implementation is needed for this fix. 🤖 Generated with [Codex](https://openai.com/codex/)
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6558701500 --> @gigamans442 commented on GitHub (Nov 1, 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#1897
No description provided.