mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
shader: bind dispatch spans while keeping GPU record counts native
Co-authored-by: TheCruZ <thecruzwtf@gmail.com>
This commit is contained in:
@@ -506,7 +506,15 @@ void StoreLocalFlat(ValueEmitContext& ctx, const IR::Inst& inst) {
|
||||
void StoreWordPrepared(ValueEmitContext& ctx, const IR::Inst& inst, const IR::MemoryInfo& mem,
|
||||
const MemoryResourceAccess& resource, uint32_t data) {
|
||||
const auto index = EmitMemoryElementIndex(ctx.state, resource, DwordIndex(ctx, inst, mem));
|
||||
EmitIfCondition(ctx.state, EmitMemoryElementInBounds(ctx.state, resource, index), [&]() {
|
||||
auto in_bounds = EmitMemoryElementInBounds(ctx.state, resource, index);
|
||||
if (mem.kind == IR::ResourceKind::Buffer &&
|
||||
ctx.state.program.info.buffers[mem.resource].dispatch_stride != 0u) {
|
||||
const auto& handle = *inst.Arg(0).ResolveInstruction();
|
||||
in_bounds = AndCondition(
|
||||
ctx.state, in_bounds,
|
||||
Binary(ctx.state, spv::OpULessThan, TypeBool(ctx.state), ctx.Arg(inst, 1), ctx.Arg(handle, 2)));
|
||||
}
|
||||
EmitIfCondition(ctx.state, in_bounds, [&]() {
|
||||
StoreWordInBounds(ctx, resource, index, data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user