Skip to content

Commit

Permalink
feat(airconv): support integer (bitcast) depth output register
Browse files Browse the repository at this point in the history
  • Loading branch information
3Shain committed Jan 28, 2025
1 parent cbbb31f commit 22ff44b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/airconv/dxbc_converter_basicblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,23 @@ store_dst<DstOperandOutputDepth, true>(DstOperandOutputDepth, IRValue &&value) {
);
};

template <>
IREffect
store_dst<DstOperandOutputDepth, false>(DstOperandOutputDepth, IRValue &&value) {
return make_effect_bind(
[value = std::move(value)](context ctx) mutable -> IREffect {
// FIXME: extend_to_vec4 is kinda silly
pvalue depth = co_yield (std::move(value) >>= extend_to_vec4) >>=
extract_element(0);
auto ptr = ctx.builder.CreateConstGEP1_32(
ctx.types._float, ctx.resource.depth_output_reg, 0
);
ctx.builder.CreateStore(ctx.builder.CreateBitCast(depth, ctx.types._float), ptr);
co_return {};
}
);
};

template <>
IREffect store_dst<DstOperandOutputCoverageMask, false>(
DstOperandOutputCoverageMask, IRValue &&value
Expand Down

0 comments on commit 22ff44b

Please sign in to comment.