mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-05 10:13:15 +00:00
* video_core: Small fixes * renderer_vulkan: Add fallback path for pipelines with more than 32 bindings * vk_resource_pool: Rewrite desc heap * work
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
|
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
|
|
|
namespace Shader::Backend::SPIRV {
|
|
|
|
Id SubgroupScope(EmitContext& ctx) {
|
|
return ctx.ConstU32(static_cast<u32>(spv::Scope::Subgroup));
|
|
}
|
|
|
|
Id EmitWarpId(EmitContext& ctx) {
|
|
UNREACHABLE();
|
|
}
|
|
|
|
Id EmitLaneId(EmitContext& ctx) {
|
|
return ctx.OpLoad(ctx.U32[1], ctx.subgroup_local_invocation_id);
|
|
}
|
|
|
|
Id EmitQuadShuffle(EmitContext& ctx, Id value, Id index) {
|
|
return ctx.OpGroupNonUniformQuadBroadcast(ctx.U32[1], SubgroupScope(ctx), value, index);
|
|
}
|
|
|
|
Id EmitReadFirstLane(EmitContext& ctx, Id value) {
|
|
return ctx.OpGroupNonUniformBroadcastFirst(ctx.U32[1], SubgroupScope(ctx), value);
|
|
}
|
|
|
|
Id EmitReadLane(EmitContext& ctx, Id value, u32 lane) {
|
|
return ctx.OpGroupNonUniformBroadcast(ctx.U32[1], SubgroupScope(ctx), value,
|
|
ctx.ConstU32(lane));
|
|
}
|
|
|
|
Id EmitWriteLane(EmitContext& ctx, Id value, Id write_value, u32 lane) {
|
|
return ctx.u32_zero_value;
|
|
}
|
|
|
|
} // namespace Shader::Backend::SPIRV
|