Skip to content

Commit 1a0bbb5

Browse files
authored
use nullptr' for IRStructKey with IRDerivativeMemberDecoration` (#4623)
1 parent 0b6d78f commit 1a0bbb5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

source/slang/slang-emit.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ void calcRequiredLoweringPassSet(RequiredLoweringPassSet& result, CodeGenContext
292292
case kIROp_BackwardDifferentiate:
293293
case kIROp_ForwardDifferentiate:
294294
case kIROp_MakeDifferentialPairUserCode:
295+
case kIROp_DerivativeMemberDecoration:
295296
result.autodiff = true;
296297
break;
297298
case kIROp_VerticesType:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// struct-default-init.slang
2+
//TEST:SIMPLE(filecheck=HLSL): -target hlsl -entry computeMain -stage compute
3+
//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry computeMain -stage compute
4+
//TEST:SIMPLE(filecheck=METAL): -target metal -entry computeMain -stage compute
5+
//TEST:SIMPLE(filecheck=CPP): -target cpp -entry computeMain -stage compute
6+
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry computeMain -stage compute
7+
8+
// HLSL: computeMain
9+
// GLSL: main
10+
// METAL: computeMain
11+
// CPP: computeMain
12+
// SPIRV: OpEntryPoint
13+
14+
struct PowActivationEx : IDifferentiable
15+
{
16+
float power;
17+
}
18+
RWStructuredBuffer<float> return_value;
19+
20+
[numthreads(256, 1, 1)]
21+
void computeMain()
22+
{
23+
PowActivationEx args;
24+
return_value[0] = args.power;
25+
}

0 commit comments

Comments
 (0)