//META: generated=true
//META: model=claude-opus-5[1m]
//META: generated_at=2026-08-04T00:00:00+00:00
//META: source_commit=7e725f15572c6589ee6d738a8856fb3348f11617
//META: doc_ref=docs/generated/design/pipeline/05-ir-passes.md#target-specific-lowering
//META: doc_section_digest=557b5025d6a79f84b833cef681013d91b8a66b0574857ec5bf62d3232bf54ca2
//META: purpose=Expansion: cuda-immutable-load wraps reads of a struct-field uniform — `Settings.factor` is read via `__ldg(&...)` on CUDA. Struct-field axis alongside the scalar uniform case.
//META: intent=expansion
//META: pipeline_stage=ir-pass
//META: warning=Auto-generated. May drift from source. Do not edit by hand.

// Uniform read shape variation on cuda-immutable-load. The uniform
// is a struct field, not a scalar. CUDA still wraps the read in
// `__ldg(&...)`.

//TEST:SIMPLE(filecheck=CUDA):-target cuda -stage compute -entry main

struct Settings { int factor; int bias; }

uniform Settings cfg;
uniform RWStructuredBuffer<int> buf;

[numthreads(1, 1, 1)]
void main(uint3 tid : SV_DispatchThreadID)
{
    buf[0] = cfg.factor * int(tid.x) + cfg.bias;
}

// CUDA: __ldg
