Skip to content

[SPIR-V] assigning default value to an external global silently fails without warning #3950

@EeroMutka

Description

@EeroMutka

The following compiles successfully when generating spirv, but groupshared uint testing = 0; will NOT be always initialized to zero. If I switch the compile mode to DXIL, I will get the warning: Initializer of external global will be ignored

http://shader-playground.timjones.io/46e4c2aa215eef693bea5e82cc6c3f8a

groupshared uint testing = 0;

[numthreads(1, 1, 1)]
void cs_main(uint local_thread_id_flat : SV_GroupIndex) {
    if (testing > 0) {
        printf("aaa");
    }
}

Metadata

Metadata

Assignees

Labels

spirvWork related to SPIR-V

Type

No type

Projects

Status

Done

Status

Triaged

Relationships

None yet

Development

No branches or pull requests

Issue actions