Skip to content

Commit 7820b14

Browse files
committed
amdilc: decode and handle SAMPLE_C op
1 parent 77952c3 commit 7820b14

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/amdilc/amdilc_compiler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,10 @@ static void emitSample(
26142614
IlcSpvId lodId = loadSource(compiler, &instr->srcs[1], COMP_MASK_XYZW, compiler->float4Id);
26152615
operandIds[0] = emitVectorTrim(compiler, lodId, compiler->float4Id, COMP_INDEX_X, 1);
26162616
operandIdCount++;
2617+
} else if (instr->opcode == IL_OP_SAMPLE_C) {
2618+
sampleOp = SpvOpImageSampleDrefImplicitLod;
2619+
drefId = loadSource(compiler, &instr->srcs[1], COMP_MASK_XYZW, compiler->float4Id);
2620+
drefId = emitVectorTrim(compiler, drefId, compiler->float4Id, COMP_INDEX_X, 1);
26172621
} else if (instr->opcode == IL_OP_SAMPLE_C_LZ) {
26182622
sampleOp = SpvOpImageSampleDrefExplicitLod;
26192623
drefId = loadSource(compiler, &instr->srcs[1], COMP_MASK_XYZW, compiler->float4Id);
@@ -3502,6 +3506,7 @@ static void emitInstr(
35023506
case IL_OP_SAMPLE_B:
35033507
case IL_OP_SAMPLE_G:
35043508
case IL_OP_SAMPLE_L:
3509+
case IL_OP_SAMPLE_C:
35053510
case IL_OP_SAMPLE_C_LZ:
35063511
emitSample(compiler, instr);
35073512
break;

src/amdilc/amdilc_decoder.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static const OpcodeInfo mOpcodeInfos[IL_OP_LAST] = {
5959
[IL_OP_SAMPLE_B] = { IL_OP_SAMPLE_B, 1, 2, 0 },
6060
[IL_OP_SAMPLE_G] = { IL_OP_SAMPLE_G, 1, 3, 0 },
6161
[IL_OP_SAMPLE_L] = { IL_OP_SAMPLE_L, 1, 2, 0 },
62+
[IL_OP_SAMPLE_C] = { IL_OP_SAMPLE_C, 1, 2, 0 },
6263
[IL_OP_SAMPLE_C_LZ] = { IL_OP_SAMPLE_C_LZ, 1, 2, 0 },
6364
[IL_OP_I_NOT] = { IL_OP_I_NOT, 1, 1, 0 },
6465
[IL_OP_I_OR] = { IL_OP_I_OR, 1, 2, 0 },

0 commit comments

Comments
 (0)