-
Notifications
You must be signed in to change notification settings - Fork 427
Open
Description
Issue Description
When a struct implementing an interface contains an Atomic<int> field, the compiler crashes with "Unimplemented type packing" (error 99999) instead of producing a user-facing diagnostic. Other unsupported field types (opaque resources, CoopVec, CoopMat, String, class instances) correctly emit error 41014 ("type cannot be packed for dynamic dispatch").
Reproducer Code
interface IFoo { int get(); }
export struct Impl : IFoo {
Atomic<int> counter;
int get() { return 1; }
}
export struct GoodImpl : IFoo {
int v;
int get() { return v; }
}
RWStructuredBuffer<int> out;
[numthreads(1,1,1)]
void computeMain() {
IFoo f = createDynamicObject<IFoo>(0, 0);
out[0] = f.get();
}Command:
slangc -target spirv test.slangExpected Behavior
Error 41014: "type 'Impl' contains fields that cannot be packed into ordinary bytes for dynamic dispatch."
Actual Behavior
error[E99999]: Slang compilation aborted due to an exception of N5Slang13InternalErrorE unimplemented: Unimplemented type packing
Test to Enable
When fixed, enable the DISABLED test tests/language-feature/dynamic-dispatch/diagnose-atomic-in-impl.slang.
Reactions are currently unavailable