From 399a725343db2c8b07de94ec95789025bc91dd5c Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Mon, 14 Jul 2025 00:32:02 +0300 Subject: [PATCH 01/21] shader_recompiler: Replace buffer pulling with attribute divisor for instance step rates (#3238) * shader_recompiler: Replace buffer pulling with attribute divisor for instance step rates * flatten_extended_userdata: Remove special step rate buffer handling * Review comments * spirv_emit_context: Name all instance rate attribs properly * spirv: Merge ReadConstBuffer again template function only has 1 user now * attribute: Add missing attributes * translate: Reimplement step rate instance id * Resolve validation warnings * shader_recompiler: Separate vertex inputs from LS stage, cleanup tess --- .../spirv/emit_spirv_context_get_set.cpp | 128 +++++++----------- .../backend/spirv/emit_spirv_instructions.h | 2 +- .../backend/spirv/spirv_emit_context.cpp | 74 ++++------ .../backend/spirv/spirv_emit_context.h | 1 - src/shader_recompiler/frontend/fetch_shader.h | 12 -- .../frontend/translate/translate.cpp | 63 +++++---- src/shader_recompiler/info.h | 14 +- src/shader_recompiler/ir/attribute.cpp | 22 ++- src/shader_recompiler/ir/attribute.h | 2 - src/shader_recompiler/ir/ir_emitter.cpp | 4 +- src/shader_recompiler/ir/ir_emitter.h | 3 +- .../passes/flatten_extended_userdata_pass.cpp | 24 +--- .../ir/passes/ring_access_elimination.cpp | 11 +- src/shader_recompiler/ir/passes/srt.h | 13 +- src/shader_recompiler/runtime_info.h | 6 +- src/shader_recompiler/specialization.h | 20 ++- src/video_core/buffer_cache/buffer_cache.cpp | 5 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 46 +++++-- .../renderer_vulkan/vk_graphics_pipeline.h | 4 +- .../renderer_vulkan/vk_instance.cpp | 4 + .../renderer_vulkan/vk_pipeline_cache.cpp | 19 +-- .../renderer_vulkan/vk_rasterizer.cpp | 5 +- 22 files changed, 208 insertions(+), 274 deletions(-) diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index f3a8c518c..40f8d307c 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -52,7 +52,7 @@ Id VsOutputAttrPointer(EmitContext& ctx, VsOutput output) { Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr, u32 element) { if (IR::IsParam(attr)) { const u32 attr_index{u32(attr) - u32(IR::Attribute::Param0)}; - if (ctx.stage == Stage::Local && ctx.runtime_info.ls_info.links_with_tcs) { + if (ctx.stage == Stage::Local) { const auto component_ptr = ctx.TypePointer(spv::StorageClass::Output, ctx.F32[1]); return ctx.OpAccessChain(component_ptr, ctx.output_attr_array, ctx.ConstU32(attr_index), ctx.ConstU32(element)); @@ -94,13 +94,9 @@ Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr, u32 element) { std::pair OutputAttrComponentType(EmitContext& ctx, IR::Attribute attr) { if (IR::IsParam(attr)) { - if (ctx.stage == Stage::Local && ctx.runtime_info.ls_info.links_with_tcs) { - return {ctx.F32[1], false}; - } else { - const u32 index{u32(attr) - u32(IR::Attribute::Param0)}; - const auto& info{ctx.output_params.at(index)}; - return {info.component_type, info.is_integer}; - } + const u32 index{u32(attr) - u32(IR::Attribute::Param0)}; + const auto& info{ctx.output_params.at(index)}; + return {info.component_type, info.is_integer}; } if (IR::IsMrt(attr)) { const u32 index{u32(attr) - u32(IR::Attribute::RenderTarget0)}; @@ -120,6 +116,9 @@ std::pair OutputAttrComponentType(EmitContext& ctx, IR::Attribute attr } } // Anonymous namespace +using PointerType = EmitContext::PointerType; +using PointerSize = EmitContext::PointerSize; + Id EmitGetUserData(EmitContext& ctx, IR::ScalarReg reg) { const u32 index = ctx.binding.user_data + ctx.info.ud_mask.Index(reg); const u32 half = PushData::UdRegsIndex + (index >> 2); @@ -131,41 +130,6 @@ Id EmitGetUserData(EmitContext& ctx, IR::ScalarReg reg) { return ud_reg; } -void EmitGetThreadBitScalarReg(EmitContext& ctx) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitSetThreadBitScalarReg(EmitContext& ctx) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitGetScalarRegister(EmitContext&) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitSetScalarRegister(EmitContext&) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitGetVectorRegister(EmitContext& ctx) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitSetVectorRegister(EmitContext& ctx) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitSetGotoVariable(EmitContext&) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -void EmitGetGotoVariable(EmitContext&) { - UNREACHABLE_MSG("Unreachable instruction"); -} - -using PointerType = EmitContext::PointerType; -using PointerSize = EmitContext::PointerSize; - Id EmitReadConst(EmitContext& ctx, IR::Inst* inst, Id addr, Id offset) { const u32 flatbuf_off_dw = inst->Flags(); if (!Config::directMemoryAccess()) { @@ -180,39 +144,27 @@ Id EmitReadConst(EmitContext& ctx, IR::Inst* inst, Id addr, Id offset) { } } -template -Id ReadConstBuffer(EmitContext& ctx, u32 handle, Id index) { +Id EmitReadConstBuffer(EmitContext& ctx, u32 handle, Id index) { const auto& buffer = ctx.buffers[handle]; if (const Id offset = buffer.Offset(PointerSize::B32); Sirit::ValidId(offset)) { index = ctx.OpIAdd(ctx.U32[1], index, offset); } - const auto [id, pointer_type] = buffer.Alias(type); - const auto value_type = type == PointerType::U32 ? ctx.U32[1] : ctx.F32[1]; + const auto [id, pointer_type] = buffer.Alias(PointerType::U32); const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index)}; - const Id result{ctx.OpLoad(value_type, ptr)}; + const Id result{ctx.OpLoad(ctx.U32[1], ptr)}; if (const Id size = buffer.Size(PointerSize::B32); Sirit::ValidId(size)) { const Id in_bounds = ctx.OpULessThan(ctx.U1[1], index, size); - return ctx.OpSelect(value_type, in_bounds, result, ctx.u32_zero_value); + return ctx.OpSelect(ctx.U32[1], in_bounds, result, ctx.u32_zero_value); } return result; } -Id EmitReadConstBuffer(EmitContext& ctx, u32 handle, Id index) { - return ReadConstBuffer(ctx, handle, index); -} - -Id EmitReadStepRate(EmitContext& ctx, int rate_idx) { - const auto index{rate_idx == 0 ? PushData::Step0Index : PushData::Step1Index}; - return ctx.OpLoad( - ctx.U32[1], ctx.OpAccessChain(ctx.TypePointer(spv::StorageClass::PushConstant, ctx.U32[1]), - ctx.push_data_block, ctx.ConstU32(index))); -} - -static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) { +static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index) { if (IR::IsPosition(attr)) { ASSERT(attr == IR::Attribute::Position0); const auto position_arr_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[4]); - const auto pointer{ctx.OpAccessChain(position_arr_ptr, ctx.gl_in, index, ctx.ConstU32(0u))}; + const auto pointer{ + ctx.OpAccessChain(position_arr_ptr, ctx.gl_in, ctx.ConstU32(index), ctx.ConstU32(0u))}; const auto position_comp_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]); return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(position_comp_ptr, pointer, ctx.ConstU32(comp))); @@ -222,7 +174,7 @@ static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 const u32 param_id{u32(attr) - u32(IR::Attribute::Param0)}; const auto param = ctx.input_params.at(param_id).id; const auto param_arr_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[4]); - const auto pointer{ctx.OpAccessChain(param_arr_ptr, param, index)}; + const auto pointer{ctx.OpAccessChain(param_arr_ptr, param, ctx.ConstU32(index))}; const auto position_comp_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]); return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(position_comp_ptr, pointer, ctx.ConstU32(comp))); @@ -230,7 +182,7 @@ static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 UNREACHABLE(); } -Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) { +Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index) { if (ctx.info.l_stage == LogicalStage::Geometry) { return EmitGetAttributeForGeometry(ctx, attr, comp, index); } else if (ctx.info.l_stage == LogicalStage::TessellationControl || @@ -248,18 +200,6 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) { if (IR::IsParam(attr)) { const u32 param_index{u32(attr) - u32(IR::Attribute::Param0)}; const auto& param{ctx.input_params.at(param_index)}; - if (param.buffer_handle >= 0) { - const auto step_rate = EmitReadStepRate(ctx, param.id.value); - const auto offset = ctx.OpIAdd( - ctx.U32[1], - ctx.OpIMul( - ctx.U32[1], - ctx.OpUDiv(ctx.U32[1], ctx.OpLoad(ctx.U32[1], ctx.instance_id), step_rate), - ctx.ConstU32(param.num_components)), - ctx.ConstU32(comp)); - return ReadConstBuffer(ctx, param.buffer_handle, offset); - } - Id result; if (param.is_loaded) { // Attribute is either default or manually interpolated. The id points to an already @@ -305,10 +245,6 @@ Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, u32 comp) { return ctx.OpLoad(ctx.U32[1], ctx.vertex_index); case IR::Attribute::InstanceId: return ctx.OpLoad(ctx.U32[1], ctx.instance_id); - case IR::Attribute::InstanceId0: - return EmitReadStepRate(ctx, 0); - case IR::Attribute::InstanceId1: - return EmitReadStepRate(ctx, 1); case IR::Attribute::WorkgroupIndex: return ctx.workgroup_index_id; case IR::Attribute::WorkgroupId: @@ -640,4 +576,36 @@ void EmitStoreBufferFormatF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id a UNREACHABLE_MSG("SPIR-V instruction"); } +void EmitGetThreadBitScalarReg(EmitContext& ctx) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitSetThreadBitScalarReg(EmitContext& ctx) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitGetScalarRegister(EmitContext&) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitSetScalarRegister(EmitContext&) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitGetVectorRegister(EmitContext& ctx) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitSetVectorRegister(EmitContext& ctx) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitSetGotoVariable(EmitContext&) { + UNREACHABLE_MSG("Unreachable instruction"); +} + +void EmitGetGotoVariable(EmitContext&) { + UNREACHABLE_MSG("Unreachable instruction"); +} + } // namespace Shader::Backend::SPIRV diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 74c94754d..37d5d84c9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h @@ -108,7 +108,7 @@ Id EmitBufferAtomicXor32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id addres Id EmitBufferAtomicSwap32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); Id EmitBufferAtomicCmpSwap32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value, Id cmp_value); -Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index); +Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index); Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, u32 comp); void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, Id value, u32 comp); Id EmitGetTessGenericAttribute(EmitContext& ctx, Id vertex_index, Id attr_index, Id comp_index); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 6a731d05c..e16bba755 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -377,35 +377,13 @@ void EmitContext::DefineInputs() { ASSERT(attrib.semantic < IR::NumParams); const auto sharp = attrib.GetSharp(info); const Id type{GetAttributeType(*this, sharp.GetNumberFmt())[4]}; - if (attrib.UsesStepRates()) { - const u32 rate_idx = - attrib.GetStepRate() == Gcn::VertexAttribute::InstanceIdType::OverStepRate0 ? 0 - : 1; - const u32 num_components = AmdGpu::NumComponents(sharp.GetDataFmt()); - const auto buffer = - std::ranges::find_if(info.buffers, [&attrib](const auto& buffer) { - return buffer.instance_attrib == attrib.semantic; - }); - // Note that we pass index rather than Id - input_params[attrib.semantic] = SpirvAttribute{ - .id = {rate_idx}, - .pointer_type = input_u32, - .component_type = U32[1], - .num_components = std::min(attrib.num_elements, num_components), - .is_integer = true, - .is_loaded = false, - .buffer_handle = int(buffer - info.buffers.begin()), - }; + Id id{DefineInput(type, attrib.semantic)}; + if (attrib.GetStepRate() != Gcn::VertexAttribute::InstanceIdType::None) { + Name(id, fmt::format("vs_instance_attr{}", attrib.semantic)); } else { - Id id{DefineInput(type, attrib.semantic)}; - if (attrib.GetStepRate() == Gcn::VertexAttribute::InstanceIdType::Plain) { - Name(id, fmt::format("vs_instance_attr{}", attrib.semantic)); - } else { - Name(id, fmt::format("vs_in_attr{}", attrib.semantic)); - } - input_params[attrib.semantic] = - GetAttributeInfo(sharp.GetNumberFmt(), id, 4, false); + Name(id, fmt::format("vs_in_attr{}", attrib.semantic)); } + input_params[attrib.semantic] = GetAttributeInfo(sharp.GetNumberFmt(), id, 4, false); } break; } @@ -573,7 +551,7 @@ void EmitContext::DefineOutputs() { cull_distances = DefineVariable(type, spv::BuiltIn::CullDistance, spv::StorageClass::Output); } - if (stage == Shader::Stage::Local && runtime_info.ls_info.links_with_tcs) { + if (stage == Stage::Local) { const u32 num_attrs = Common::AlignUp(runtime_info.ls_info.ls_stride, 16) >> 4; if (num_attrs > 0) { const Id type{TypeArray(F32[4], ConstU32(num_attrs))}; @@ -700,12 +678,10 @@ void EmitContext::DefineOutputs() { void EmitContext::DefinePushDataBlock() { // Create push constants block for instance steps rates - const Id struct_type{Name(TypeStruct(U32[1], U32[1], F32[1], F32[1], F32[1], F32[1], U32[4], - U32[4], U32[4], U32[4], U32[4], U32[4], U32[2]), + const Id struct_type{Name(TypeStruct(F32[1], F32[1], F32[1], F32[1], U32[4], U32[4], U32[4], + U32[4], U32[4], U32[4], U32[2]), "AuxData")}; Decorate(struct_type, spv::Decoration::Block); - MemberName(struct_type, PushData::Step0Index, "sr0"); - MemberName(struct_type, PushData::Step1Index, "sr1"); MemberName(struct_type, PushData::XOffsetIndex, "xoffset"); MemberName(struct_type, PushData::YOffsetIndex, "yoffset"); MemberName(struct_type, PushData::XScaleIndex, "xscale"); @@ -717,19 +693,17 @@ void EmitContext::DefinePushDataBlock() { MemberName(struct_type, PushData::BufOffsetIndex + 0, "buf_offsets0"); MemberName(struct_type, PushData::BufOffsetIndex + 1, "buf_offsets1"); MemberName(struct_type, PushData::BufOffsetIndex + 2, "buf_offsets2"); - MemberDecorate(struct_type, PushData::Step0Index, spv::Decoration::Offset, 0U); - MemberDecorate(struct_type, PushData::Step1Index, spv::Decoration::Offset, 4U); - MemberDecorate(struct_type, PushData::XOffsetIndex, spv::Decoration::Offset, 8U); - MemberDecorate(struct_type, PushData::YOffsetIndex, spv::Decoration::Offset, 12U); - MemberDecorate(struct_type, PushData::XScaleIndex, spv::Decoration::Offset, 16U); - MemberDecorate(struct_type, PushData::YScaleIndex, spv::Decoration::Offset, 20U); - MemberDecorate(struct_type, PushData::UdRegsIndex + 0, spv::Decoration::Offset, 24U); - MemberDecorate(struct_type, PushData::UdRegsIndex + 1, spv::Decoration::Offset, 40U); - MemberDecorate(struct_type, PushData::UdRegsIndex + 2, spv::Decoration::Offset, 56U); - MemberDecorate(struct_type, PushData::UdRegsIndex + 3, spv::Decoration::Offset, 72U); - MemberDecorate(struct_type, PushData::BufOffsetIndex + 0, spv::Decoration::Offset, 88U); - MemberDecorate(struct_type, PushData::BufOffsetIndex + 1, spv::Decoration::Offset, 104U); - MemberDecorate(struct_type, PushData::BufOffsetIndex + 2, spv::Decoration::Offset, 120U); + MemberDecorate(struct_type, PushData::XOffsetIndex, spv::Decoration::Offset, 0U); + MemberDecorate(struct_type, PushData::YOffsetIndex, spv::Decoration::Offset, 4U); + MemberDecorate(struct_type, PushData::XScaleIndex, spv::Decoration::Offset, 8U); + MemberDecorate(struct_type, PushData::YScaleIndex, spv::Decoration::Offset, 12U); + MemberDecorate(struct_type, PushData::UdRegsIndex + 0, spv::Decoration::Offset, 16U); + MemberDecorate(struct_type, PushData::UdRegsIndex + 1, spv::Decoration::Offset, 32U); + MemberDecorate(struct_type, PushData::UdRegsIndex + 2, spv::Decoration::Offset, 48U); + MemberDecorate(struct_type, PushData::UdRegsIndex + 3, spv::Decoration::Offset, 64U); + MemberDecorate(struct_type, PushData::BufOffsetIndex + 0, spv::Decoration::Offset, 80U); + MemberDecorate(struct_type, PushData::BufOffsetIndex + 1, spv::Decoration::Offset, 96U); + MemberDecorate(struct_type, PushData::BufOffsetIndex + 2, spv::Decoration::Offset, 112U); push_data_block = DefineVar(struct_type, spv::StorageClass::PushConstant); Name(push_data_block, "push_data"); interfaces.push_back(push_data_block); @@ -763,19 +737,19 @@ EmitContext::BufferSpv EmitContext::DefineBuffer(bool is_storage, bool is_writte Decorate(id, spv::Decoration::NonWritable); } switch (buffer_type) { - case Shader::BufferType::GdsBuffer: + case BufferType::GdsBuffer: Name(id, "gds_buffer"); break; - case Shader::BufferType::Flatbuf: + case BufferType::Flatbuf: Name(id, "srt_flatbuf"); break; - case Shader::BufferType::BdaPagetable: + case BufferType::BdaPagetable: Name(id, "bda_pagetable"); break; - case Shader::BufferType::FaultBuffer: + case BufferType::FaultBuffer: Name(id, "fault_buffer"); break; - case Shader::BufferType::SharedMemory: + case BufferType::SharedMemory: Name(id, "ssbo_shmem"); break; default: diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 28e9099d8..186925706 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -361,7 +361,6 @@ public: u32 num_components; bool is_integer{}; bool is_loaded{}; - s32 buffer_handle{-1}; }; Id input_attr_array; Id output_attr_array; diff --git a/src/shader_recompiler/frontend/fetch_shader.h b/src/shader_recompiler/frontend/fetch_shader.h index 837caafa0..e77925232 100644 --- a/src/shader_recompiler/frontend/fetch_shader.h +++ b/src/shader_recompiler/frontend/fetch_shader.h @@ -3,7 +3,6 @@ #pragma once -#include #include #include "common/types.h" #include "shader_recompiler/info.h" @@ -29,11 +28,6 @@ struct VertexAttribute { return static_cast(instance_data); } - [[nodiscard]] bool UsesStepRates() const { - const auto step_rate = GetStepRate(); - return step_rate == OverStepRate0 || step_rate == OverStepRate1; - } - [[nodiscard]] constexpr AmdGpu::Buffer GetSharp(const Shader::Info& info) const noexcept { return info.ReadUdReg(sgpr_base, dword_offset); } @@ -52,12 +46,6 @@ struct FetchShaderData { s8 vertex_offset_sgpr = -1; ///< SGPR of vertex offset from VADDR s8 instance_offset_sgpr = -1; ///< SGPR of instance offset from VADDR - [[nodiscard]] bool UsesStepRates() const { - return std::ranges::find_if(attributes, [](const VertexAttribute& attribute) { - return attribute.UsesStepRates(); - }) != attributes.end(); - } - bool operator==(const FetchShaderData& other) const { return attributes == other.attributes && vertex_offset_sgpr == other.vertex_offset_sgpr && instance_offset_sgpr == other.instance_offset_sgpr; diff --git a/src/shader_recompiler/frontend/translate/translate.cpp b/src/shader_recompiler/frontend/translate/translate.cpp index 5853f3e72..310ac9156 100644 --- a/src/shader_recompiler/frontend/translate/translate.cpp +++ b/src/shader_recompiler/frontend/translate/translate.cpp @@ -90,17 +90,40 @@ void Translator::EmitPrologue(IR::Block* first_block) { case LogicalStage::Vertex: // v0: vertex ID, always present ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::VertexId)); - // v1: instance ID, step rate 0 - if (runtime_info.num_input_vgprs > 0) { - ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::InstanceId0)); - } - // v2: instance ID, step rate 1 - if (runtime_info.num_input_vgprs > 1) { - ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::InstanceId1)); - } - // v3: instance ID, plain - if (runtime_info.num_input_vgprs > 2) { - ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::InstanceId)); + if (info.stage == Stage::Local) { + // v1: rel patch ID + if (runtime_info.num_input_vgprs > 0) { + ir.SetVectorReg(dst_vreg++, ir.Imm32(0)); + } + // v2: instance ID + if (runtime_info.num_input_vgprs > 1) { + ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::InstanceId)); + } + } else { + // v1: instance ID, step rate 0 + if (runtime_info.num_input_vgprs > 0) { + if (runtime_info.vs_info.step_rate_0 != 0) { + ir.SetVectorReg(dst_vreg++, + ir.IDiv(ir.GetAttributeU32(IR::Attribute::InstanceId), + ir.Imm32(runtime_info.vs_info.step_rate_0))); + } else { + ir.SetVectorReg(dst_vreg++, ir.Imm32(0)); + } + } + // v2: instance ID, step rate 1 + if (runtime_info.num_input_vgprs > 1) { + if (runtime_info.vs_info.step_rate_1 != 0) { + ir.SetVectorReg(dst_vreg++, + ir.IDiv(ir.GetAttributeU32(IR::Attribute::InstanceId), + ir.Imm32(runtime_info.vs_info.step_rate_1))); + } else { + ir.SetVectorReg(dst_vreg++, ir.Imm32(0)); + } + } + // v3: instance ID, plain + if (runtime_info.num_input_vgprs > 2) { + ir.SetVectorReg(dst_vreg++, ir.GetAttributeU32(IR::Attribute::InstanceId)); + } } break; case LogicalStage::Fragment: @@ -183,10 +206,8 @@ void Translator::EmitPrologue(IR::Block* first_block) { switch (runtime_info.gs_info.out_primitive[0]) { case AmdGpu::GsOutputPrimitiveType::TriangleStrip: ir.SetVectorReg(IR::VectorReg::V3, ir.Imm32(2u)); // vertex 2 - [[fallthrough]]; case AmdGpu::GsOutputPrimitiveType::LineStrip: ir.SetVectorReg(IR::VectorReg::V1, ir.Imm32(1u)); // vertex 1 - [[fallthrough]]; default: ir.SetVectorReg(IR::VectorReg::V0, ir.Imm32(0u)); // vertex 0 break; @@ -481,11 +502,11 @@ void Translator::SetDst64(const InstOperand& operand, const IR::U64F64& value_ra } void Translator::EmitFetch(const GcnInst& inst) { - // Read the pointer to the fetch shader assembly. const auto code_sgpr_base = inst.src[0].code; + + // The fetch shader must be inlined to access as regular buffers, so that + // bounds checks can be emitted to emulate robust buffer access. if (!profile.supports_robust_buffer_access) { - // The fetch shader must be inlined to access as regular buffers, so that - // bounds checks can be emitted to emulate robust buffer access. const auto* code = GetFetchShaderCode(info, code_sgpr_base); GcnCodeSlice slice(code, code + std::numeric_limits::max()); GcnDecodeContext decoder; @@ -535,16 +556,6 @@ void Translator::EmitFetch(const GcnInst& inst) { for (u32 i = 0; i < 4; i++) { ir.SetVectorReg(dst_reg++, IR::F32{ir.CompositeExtract(swizzled, i)}); } - - // In case of programmable step rates we need to fallback to instance data pulling in - // shader, so VBs should be bound as regular data buffers - if (attrib.UsesStepRates()) { - info.buffers.push_back({ - .sharp_idx = info.srt_info.ReserveSharp(attrib.sgpr_base, attrib.dword_offset, 4), - .used_types = IR::Type::F32, - .instance_attrib = attrib.semantic, - }); - } } } diff --git a/src/shader_recompiler/info.h b/src/shader_recompiler/info.h index 9703643e8..6e12c6816 100644 --- a/src/shader_recompiler/info.h +++ b/src/shader_recompiler/info.h @@ -113,17 +113,13 @@ struct FMaskResource { using FMaskResourceList = boost::container::small_vector; struct PushData { - static constexpr u32 Step0Index = 0; - static constexpr u32 Step1Index = 1; - static constexpr u32 XOffsetIndex = 2; - static constexpr u32 YOffsetIndex = 3; - static constexpr u32 XScaleIndex = 4; - static constexpr u32 YScaleIndex = 5; - static constexpr u32 UdRegsIndex = 6; + static constexpr u32 XOffsetIndex = 0; + static constexpr u32 YOffsetIndex = 1; + static constexpr u32 XScaleIndex = 2; + static constexpr u32 YScaleIndex = 3; + static constexpr u32 UdRegsIndex = 4; static constexpr u32 BufOffsetIndex = UdRegsIndex + NumUserDataRegs / 4; - u32 step0; - u32 step1; float xoffset; float yoffset; float xscale; diff --git a/src/shader_recompiler/ir/attribute.cpp b/src/shader_recompiler/ir/attribute.cpp index 6a267e21b..b2f11d141 100644 --- a/src/shader_recompiler/ir/attribute.cpp +++ b/src/shader_recompiler/ir/attribute.cpp @@ -100,22 +100,36 @@ std::string NameOf(Attribute attribute) { return "Param30"; case Attribute::Param31: return "Param31"; + case Attribute::ClipDistance: + return "ClipDistanace"; + case Attribute::CullDistance: + return "CullDistance"; + case Attribute::RenderTargetId: + return "RenderTargetId"; + case Attribute::ViewportId: + return "ViewportId"; case Attribute::VertexId: return "VertexId"; - case Attribute::InstanceId: - return "InstanceId"; case Attribute::PrimitiveId: return "PrimitiveId"; - case Attribute::FragCoord: - return "FragCoord"; + case Attribute::InstanceId: + return "InstanceId"; case Attribute::IsFrontFace: return "IsFrontFace"; + case Attribute::SampleIndex: + return "SampleIndex"; + case Attribute::GlobalInvocationId: + return "GlobalInvocationId"; case Attribute::WorkgroupId: return "WorkgroupId"; + case Attribute::WorkgroupIndex: + return "WorkgroupIndex"; case Attribute::LocalInvocationId: return "LocalInvocationId"; case Attribute::LocalInvocationIndex: return "LocalInvocationIndex"; + case Attribute::FragCoord: + return "FragCoord"; case Attribute::InvocationId: return "InvocationId"; case Attribute::PatchVertices: diff --git a/src/shader_recompiler/ir/attribute.h b/src/shader_recompiler/ir/attribute.h index 68472f052..b6b1c8b59 100644 --- a/src/shader_recompiler/ir/attribute.h +++ b/src/shader_recompiler/ir/attribute.h @@ -73,8 +73,6 @@ enum class Attribute : u64 { LocalInvocationId = 76, LocalInvocationIndex = 77, FragCoord = 78, - InstanceId0 = 79, // step rate 0 - InstanceId1 = 80, // step rate 1 InvocationId = 81, // TCS id in output patch and instanced geometry shader id PatchVertices = 82, TessellationEvaluationPointU = 83, diff --git a/src/shader_recompiler/ir/ir_emitter.cpp b/src/shader_recompiler/ir/ir_emitter.cpp index 4997145d7..6ca86b2c0 100644 --- a/src/shader_recompiler/ir/ir_emitter.cpp +++ b/src/shader_recompiler/ir/ir_emitter.cpp @@ -255,8 +255,8 @@ void IREmitter::SetM0(const U32& value) { Inst(Opcode::SetM0, value); } -F32 IREmitter::GetAttribute(IR::Attribute attribute, u32 comp, IR::Value index) { - return Inst(Opcode::GetAttribute, attribute, Imm32(comp), index); +F32 IREmitter::GetAttribute(IR::Attribute attribute, u32 comp, u32 index) { + return Inst(Opcode::GetAttribute, attribute, Imm32(comp), Imm32(index)); } U32 IREmitter::GetAttributeU32(IR::Attribute attribute, u32 comp) { diff --git a/src/shader_recompiler/ir/ir_emitter.h b/src/shader_recompiler/ir/ir_emitter.h index 6055df565..a105b042d 100644 --- a/src/shader_recompiler/ir/ir_emitter.h +++ b/src/shader_recompiler/ir/ir_emitter.h @@ -81,8 +81,7 @@ public: [[nodiscard]] U1 Condition(IR::Condition cond); - [[nodiscard]] F32 GetAttribute(Attribute attribute, u32 comp = 0, - IR::Value index = IR::Value(u32(0u))); + [[nodiscard]] F32 GetAttribute(Attribute attribute, u32 comp = 0, u32 index = 0); [[nodiscard]] U32 GetAttributeU32(Attribute attribute, u32 comp = 0); void SetAttribute(Attribute attribute, const F32& value, u32 comp = 0); diff --git a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp index 7253e18c1..e0c99655d 100644 --- a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp +++ b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp @@ -191,7 +191,7 @@ static void VisitPointer(u32 off_dw, IR::Inst* subtree, PassInfo& pass_info, static void GenerateSrtProgram(Info& info, PassInfo& pass_info) { Xbyak::CodeGenerator& c = g_srt_codegen; - if (info.srt_info.srt_reservations.empty() && pass_info.srt_roots.empty()) { + if (pass_info.srt_roots.empty()) { return; } @@ -205,29 +205,7 @@ static void GenerateSrtProgram(Info& info, PassInfo& pass_info) { } info.srt_info.walker_func = c.getCurr(); - pass_info.dst_off_dw = NumUserDataRegs; - - // Special case for V# step rate buffers in fetch shader - for (const auto [sgpr_base, dword_offset, num_dwords] : info.srt_info.srt_reservations) { - // get pointer to V# - if (sgpr_base != IR::NumScalarRegs) { - PushPtr(c, sgpr_base); - } - u32 src_off = dword_offset << 2; - - for (auto j = 0; j < num_dwords; j++) { - c.mov(r11d, ptr[rdi + src_off]); - c.mov(ptr[rsi + (pass_info.dst_off_dw << 2)], r11d); - - src_off += 4; - ++pass_info.dst_off_dw; - } - if (sgpr_base != IR::NumScalarRegs) { - PopPtr(c); - } - } - ASSERT(pass_info.dst_off_dw == info.srt_info.flattened_bufsize_dw); for (const auto& [sgpr_base, root] : pass_info.srt_roots) { diff --git a/src/shader_recompiler/ir/passes/ring_access_elimination.cpp b/src/shader_recompiler/ir/passes/ring_access_elimination.cpp index b292b41b9..e1e5d762c 100644 --- a/src/shader_recompiler/ir/passes/ring_access_elimination.cpp +++ b/src/shader_recompiler/ir/passes/ring_access_elimination.cpp @@ -33,12 +33,9 @@ void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtim bool is_composite = opcode == IR::Opcode::WriteSharedU64; u32 num_components = opcode == IR::Opcode::WriteSharedU32 ? 1 : 2; - u32 offset = 0; - const auto* addr = inst.Arg(0).InstRecursive(); - if (addr->GetOpcode() == IR::Opcode::IAdd32) { - ASSERT(addr->Arg(1).IsImmediate()); - offset = addr->Arg(1).U32(); - } + ASSERT(inst.Arg(0).IsImmediate()); + + u32 offset = inst.Arg(0).U32(); IR::Value data = is_composite ? ir.UnpackUint2x32(IR::U64{inst.Arg(1).Resolve()}) : inst.Arg(1).Resolve(); for (s32 i = 0; i < num_components; i++) { @@ -116,7 +113,7 @@ void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtim } const auto shl_inst = inst.Arg(1).TryInstRecursive(); - const auto vertex_id = ir.Imm32(shl_inst->Arg(0).Resolve().U32() >> 2); + const auto vertex_id = shl_inst->Arg(0).Resolve().U32() >> 2; const auto offset = inst.Arg(1).TryInstRecursive()->Arg(1); const auto bucket = offset.Resolve().U32() / 256u; const auto attrib = bucket < 4 ? IR::Attribute::Position0 diff --git a/src/shader_recompiler/ir/passes/srt.h b/src/shader_recompiler/ir/passes/srt.h index 0ddc15ea6..4dce38674 100644 --- a/src/shader_recompiler/ir/passes/srt.h +++ b/src/shader_recompiler/ir/passes/srt.h @@ -20,18 +20,7 @@ struct PersistentSrtInfo { }; PFN_SrtWalker walker_func{}; - boost::container::small_vector srt_reservations; u32 flattened_bufsize_dw = 16; // NumUserDataRegs - - // Special case for fetch shaders because we don't generate IR to read from step rate buffers, - // so we won't see usage with GetUserData/ReadConst. - // Reserve space in the flattened buffer for a sharp ahead of time - u32 ReserveSharp(u32 sgpr_base, u32 dword_offset, u32 num_dwords) { - u32 rv = flattened_bufsize_dw; - srt_reservations.emplace_back(sgpr_base, dword_offset, num_dwords); - flattened_bufsize_dw += num_dwords; - return rv; - } }; -} // namespace Shader \ No newline at end of file +} // namespace Shader diff --git a/src/shader_recompiler/runtime_info.h b/src/shader_recompiler/runtime_info.h index 5a0408e2c..6cede44a8 100644 --- a/src/shader_recompiler/runtime_info.h +++ b/src/shader_recompiler/runtime_info.h @@ -42,7 +42,6 @@ constexpr u32 MaxStageTypes = static_cast(LogicalStage::NumLogicalStages); struct LocalRuntimeInfo { u32 ls_stride; - bool links_with_tcs; auto operator<=>(const LocalRuntimeInfo&) const noexcept = default; }; @@ -85,6 +84,8 @@ struct VertexRuntimeInfo { std::array outputs; bool emulate_depth_negative_one_to_one{}; bool clip_disable{}; + u32 step_rate_0; + u32 step_rate_1; // Domain AmdGpu::TessellationType tess_type; AmdGpu::TessellationTopology tess_topology; @@ -96,7 +97,8 @@ struct VertexRuntimeInfo { clip_disable == other.clip_disable && tess_type == other.tess_type && tess_topology == other.tess_topology && tess_partitioning == other.tess_partitioning && - hs_output_cp_stride == other.hs_output_cp_stride; + hs_output_cp_stride == other.hs_output_cp_stride && + step_rate_0 == other.step_rate_0 && step_rate_1 == other.step_rate_1; } void InitFromTessConstants(Shader::TessellationDataConstantBuffer& tess_constants) { diff --git a/src/shader_recompiler/specialization.h b/src/shader_recompiler/specialization.h index e40309aaf..d3e671c58 100644 --- a/src/shader_recompiler/specialization.h +++ b/src/shader_recompiler/specialization.h @@ -13,7 +13,7 @@ namespace Shader { struct VsAttribSpecialization { - s32 num_components{}; + u32 divisor{}; AmdGpu::NumberClass num_class{}; AmdGpu::CompMapping dst_select{}; @@ -74,13 +74,13 @@ struct SamplerSpecialization { * after the first compilation of a module. */ struct StageSpecialization { - static constexpr size_t MaxStageResources = 64; + static constexpr size_t MaxStageResources = 128; const Shader::Info* info; RuntimeInfo runtime_info; + std::bitset bitset{}; std::optional fetch_shader_data{}; boost::container::small_vector vs_attribs; - std::bitset bitset{}; boost::container::small_vector buffers; boost::container::small_vector images; boost::container::small_vector fmasks; @@ -94,10 +94,16 @@ struct StageSpecialization { if (info_.stage == Stage::Vertex && fetch_shader_data) { // Specialize shader on VS input number types to follow spec. ForEachSharp(vs_attribs, fetch_shader_data->attributes, - [&profile_](auto& spec, const auto& desc, AmdGpu::Buffer sharp) { - spec.num_components = desc.UsesStepRates() - ? AmdGpu::NumComponents(sharp.GetDataFmt()) - : 0; + [&profile_, this](auto& spec, const auto& desc, AmdGpu::Buffer sharp) { + using InstanceIdType = Shader::Gcn::VertexAttribute::InstanceIdType; + if (const auto step_rate = desc.GetStepRate(); + step_rate != InstanceIdType::None) { + spec.divisor = step_rate == InstanceIdType::OverStepRate0 + ? runtime_info.vs_info.step_rate_0 + : (step_rate == InstanceIdType::OverStepRate1 + ? runtime_info.vs_info.step_rate_1 + : 1); + } spec.num_class = profile_.support_legacy_vertex_attributes ? AmdGpu::NumberClass{} : AmdGpu::GetNumberClass(sharp.GetNumberFmt()); diff --git a/src/video_core/buffer_cache/buffer_cache.cpp b/src/video_core/buffer_cache/buffer_cache.cpp index 28444ac60..42e3c61a5 100644 --- a/src/video_core/buffer_cache/buffer_cache.cpp +++ b/src/video_core/buffer_cache/buffer_cache.cpp @@ -198,10 +198,13 @@ void BufferCache::DownloadBufferMemory(Buffer& buffer, VAddr device_addr, u64 si } void BufferCache::BindVertexBuffers(const Vulkan::GraphicsPipeline& pipeline) { + const auto& regs = liverpool->regs; Vulkan::VertexInputs attributes; Vulkan::VertexInputs bindings; + Vulkan::VertexInputs divisors; Vulkan::VertexInputs guest_buffers; - pipeline.GetVertexInputs(attributes, bindings, guest_buffers); + pipeline.GetVertexInputs(attributes, bindings, divisors, guest_buffers, + regs.vgt_instance_step_rate_0, regs.vgt_instance_step_rate_1); if (instance.IsVertexInputDynamicState()) { // Update current vertex inputs. diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 7c020a012..3596bb041 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -72,12 +72,21 @@ GraphicsPipeline::GraphicsPipeline( VertexInputs vertex_attributes; VertexInputs vertex_bindings; + VertexInputs divisors; VertexInputs guest_buffers; if (!instance.IsVertexInputDynamicState()) { - GetVertexInputs(vertex_attributes, vertex_bindings, guest_buffers); + const auto& vs_info = runtime_infos[u32(Shader::LogicalStage::Vertex)].vs_info; + GetVertexInputs(vertex_attributes, vertex_bindings, divisors, guest_buffers, + vs_info.step_rate_0, vs_info.step_rate_1); } + const vk::PipelineVertexInputDivisorStateCreateInfo divisor_state = { + .vertexBindingDivisorCount = static_cast(divisors.size()), + .pVertexBindingDivisors = divisors.data(), + }; + const vk::PipelineVertexInputStateCreateInfo vertex_input_info = { + .pNext = divisors.empty() ? nullptr : &divisor_state, .vertexBindingDescriptionCount = static_cast(vertex_bindings.size()), .pVertexBindingDescriptions = vertex_bindings.data(), .vertexAttributeDescriptionCount = static_cast(vertex_attributes.size()), @@ -304,19 +313,17 @@ GraphicsPipeline::GraphicsPipeline( GraphicsPipeline::~GraphicsPipeline() = default; template -void GraphicsPipeline::GetVertexInputs(VertexInputs& attributes, - VertexInputs& bindings, - VertexInputs& guest_buffers) const { +void GraphicsPipeline::GetVertexInputs( + VertexInputs& attributes, VertexInputs& bindings, + VertexInputs& divisors, + VertexInputs& guest_buffers, u32 step_rate_0, u32 step_rate_1) const { + using InstanceIdType = Shader::Gcn::VertexAttribute::InstanceIdType; if (!fetch_shader || fetch_shader->attributes.empty()) { return; } const auto& vs_info = GetStage(Shader::LogicalStage::Vertex); for (const auto& attrib : fetch_shader->attributes) { - if (attrib.UsesStepRates()) { - // Skip attribute binding as the data will be pulled by shader. - continue; - } - + const auto step_rate = attrib.GetStepRate(); const auto& buffer = attrib.GetSharp(vs_info); attributes.push_back(Attribute{ .location = attrib.semantic, @@ -327,12 +334,19 @@ void GraphicsPipeline::GetVertexInputs(VertexInputs& attributes, bindings.push_back(Binding{ .binding = attrib.semantic, .stride = buffer.GetStride(), - .inputRate = attrib.GetStepRate() == Shader::Gcn::VertexAttribute::InstanceIdType::None - ? vk::VertexInputRate::eVertex - : vk::VertexInputRate::eInstance, + .inputRate = step_rate == InstanceIdType::None ? vk::VertexInputRate::eVertex + : vk::VertexInputRate::eInstance, }); + const u32 divisor = step_rate == InstanceIdType::OverStepRate0 + ? step_rate_0 + : (step_rate == InstanceIdType::OverStepRate1 ? step_rate_1 : 1); if constexpr (std::is_same_v) { - bindings.back().divisor = 1; + bindings.back().divisor = divisor; + } else if (step_rate != InstanceIdType::None) { + divisors.push_back(vk::VertexInputBindingDivisorDescriptionEXT{ + .binding = attrib.semantic, + .divisor = divisor, + }); } guest_buffers.emplace_back(buffer); } @@ -342,11 +356,13 @@ void GraphicsPipeline::GetVertexInputs(VertexInputs& attributes, template void GraphicsPipeline::GetVertexInputs( VertexInputs& attributes, VertexInputs& bindings, - VertexInputs& guest_buffers) const; + VertexInputs& divisors, + VertexInputs& guest_buffers, u32 step_rate_0, u32 step_rate_1) const; template void GraphicsPipeline::GetVertexInputs( VertexInputs& attributes, VertexInputs& bindings, - VertexInputs& guest_buffers) const; + VertexInputs& divisors, + VertexInputs& guest_buffers, u32 step_rate_0, u32 step_rate_1) const; void GraphicsPipeline::BuildDescSetLayout() { boost::container::small_vector bindings; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 59230ae46..ab67a52b4 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -81,7 +81,9 @@ public: /// Gets the attributes and bindings for vertex inputs. template void GetVertexInputs(VertexInputs& attributes, VertexInputs& bindings, - VertexInputs& guest_buffers) const; + VertexInputs& divisors, + VertexInputs& guest_buffers, u32 step_rate_0, + u32 step_rate_1) const; private: void BuildDescSetLayout(); diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index 237fa202d..85fc993a9 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -248,6 +248,7 @@ bool Instance::CreateDevice() { // Required ASSERT(add_extension(VK_KHR_SWAPCHAIN_EXTENSION_NAME)); ASSERT(add_extension(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME)); + ASSERT(add_extension(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)); // Optional depth_range_unrestricted = add_extension(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME); @@ -436,6 +437,9 @@ bool Instance::CreateDevice() { vk::PhysicalDeviceLegacyVertexAttributesFeaturesEXT{ .legacyVertexAttributes = true, }, + vk::PhysicalDeviceVertexAttributeDivisorFeatures{ + .vertexAttributeInstanceRateDivisor = true, + }, vk::PhysicalDeviceShaderAtomicFloat2FeaturesEXT{ .shaderBufferFloat32AtomicMinMax = shader_atomic_float2_features.shaderBufferFloat32AtomicMinMax, diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 7dd468f9a..8d12b74f3 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -94,15 +94,10 @@ const Shader::RuntimeInfo& PipelineCache::BuildRuntimeInfo(Stage stage, LogicalS switch (stage) { case Stage::Local: { BuildCommon(regs.ls_program); - if (regs.stage_enable.IsStageEnabled(static_cast(Stage::Hull))) { - info.ls_info.links_with_tcs = true; - Shader::TessellationDataConstantBuffer tess_constants; - const auto* pgm = regs.ProgramForStage(static_cast(Stage::Hull)); - const auto params = Liverpool::GetParams(*pgm); - const auto& hull_info = program_cache.at(params.hash)->info; - hull_info.ReadTessConstantBuffer(tess_constants); - info.ls_info.ls_stride = tess_constants.ls_stride; - } + Shader::TessellationDataConstantBuffer tess_constants; + const auto* hull_info = infos[u32(Shader::LogicalStage::TessellationControl)]; + hull_info->ReadTessConstantBuffer(tess_constants); + info.ls_info.ls_stride = tess_constants.ls_stride; break; } case Stage::Hull: { @@ -122,6 +117,8 @@ const Shader::RuntimeInfo& PipelineCache::BuildRuntimeInfo(Stage stage, LogicalS case Stage::Vertex: { BuildCommon(regs.vs_program); GatherVertexOutputs(info.vs_info, regs.vs_output_control); + info.vs_info.step_rate_0 = regs.vgt_instance_step_rate_0; + info.vs_info.step_rate_1 = regs.vgt_instance_step_rate_1; info.vs_info.emulate_depth_negative_one_to_one = !instance.IsDepthClipControlSupported() && regs.clipper_control.clip_space == Liverpool::ClipSpace::MinusWToW; @@ -460,10 +457,6 @@ bool PipelineCache::RefreshGraphicsKey() { // Stride will still be handled outside the pipeline using dynamic state. u32 vertex_binding = 0; for (const auto& attrib : fetch_shader->attributes) { - if (attrib.UsesStepRates()) { - // Skip attribute binding as the data will be pulled by shader. - continue; - } const auto& buffer = attrib.GetSharp(*vs_info); ASSERT(vertex_binding < MaxVertexBufferCount); key.vertex_buffer_formats[vertex_binding++] = diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 5d0a14ce3..2a645f338 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -20,12 +20,9 @@ namespace Vulkan { static Shader::PushData MakeUserData(const AmdGpu::Liverpool::Regs& regs) { - Shader::PushData push_data{}; - push_data.step0 = regs.vgt_instance_step_rate_0; - push_data.step1 = regs.vgt_instance_step_rate_1; - // TODO(roamic): Add support for multiple viewports and geometry shaders when ViewportIndex // is encountered and implemented in the recompiler. + Shader::PushData push_data{}; push_data.xoffset = regs.viewport_control.xoffset_enable ? regs.viewports[0].xoffset : 0.f; push_data.xscale = regs.viewport_control.xscale_enable ? regs.viewports[0].xscale : 1.f; push_data.yoffset = regs.viewport_control.yoffset_enable ? regs.viewports[0].yoffset : 0.f; From 00f4eeddaf080ec65c9ac6d63141577c81819449 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Mon, 14 Jul 2025 21:23:18 +0300 Subject: [PATCH 02/21] renderer_vulkan: Handle more miscellaneous GPU settings (#3241) * renderer_vulkan: Respect provoking vertex setting * renderer_vulkan: Handle rasterization discard * renderer_vulkan: Implement logic ops * renderer_vulkan: Properly implement depth clamp and clip * renderer_vulkan: Handle line width * Fix build * vk_pipeline_cache: Don't check depth clamp without a depth buffer * liverpool: Fix line control offset * vk_pipeline_cache: Don't run search if depth clamp is disabled * vk_pipeline_cache: Allow using viewport range when it's more restrictive then depth clamp * liverpool: Disable depth clip when near and far planes have different setting * vk_graphics_pipeline: Move warning to pipeline * vk_pipeline_cache: Revert viewport check and remove log * vk_graphics_pipeline: Enable depth clamp when depth clip is disabled and extension is not supported Without the depth clip extension depth clipping is controlled by depth clamping --- src/video_core/amdgpu/liverpool.h | 51 ++++++++--- .../renderer_vulkan/liverpool_to_vk.cpp | 40 +++++++++ .../renderer_vulkan/liverpool_to_vk.h | 2 + .../renderer_vulkan/vk_graphics_pipeline.cpp | 79 +++++++++++++---- .../renderer_vulkan/vk_graphics_pipeline.h | 32 ++++--- .../renderer_vulkan/vk_instance.cpp | 23 +++++ src/video_core/renderer_vulkan/vk_instance.h | 23 +++++ .../renderer_vulkan/vk_pipeline_cache.cpp | 85 +++++++++++++++---- .../renderer_vulkan/vk_pipeline_cache.h | 2 + .../renderer_vulkan/vk_rasterizer.cpp | 16 ++-- .../renderer_vulkan/vk_rasterizer.h | 1 + .../renderer_vulkan/vk_scheduler.cpp | 10 ++- src/video_core/renderer_vulkan/vk_scheduler.h | 26 +++++- 13 files changed, 323 insertions(+), 67 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index c07e9f63a..c517285fb 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -304,6 +304,14 @@ struct Liverpool { } }; + struct LineControl { + u32 width_fixed_point; + + float Width() const { + return static_cast(width_fixed_point) / 8.0; + } + }; + struct ModeControl { s32 msaa_enable : 1; s32 vport_scissor_enable : 1; @@ -513,9 +521,16 @@ struct Liverpool { BitField<19, 1, ClipSpace> clip_space; BitField<21, 1, PrimKillCond> vtx_kill_or; BitField<22, 1, u32> dx_rasterization_kill; - BitField<23, 1, u32> dx_linear_attr_clip_enable; + BitField<24, 1, u32> dx_linear_attr_clip_enable; BitField<26, 1, u32> zclip_near_disable; - BitField<26, 1, u32> zclip_far_disable; + BitField<27, 1, u32> zclip_far_disable; + + bool ZclipEnable() const { + if (zclip_near_disable != zclip_far_disable) { + return false; + } + return !zclip_near_disable; + } }; enum class PolygonMode : u32 { @@ -738,12 +753,7 @@ struct Liverpool { u32 data_w; }; - struct BlendConstants { - float red; - float green; - float blue; - float alpha; - }; + using BlendConstants = std::array; union BlendControl { enum class BlendFactor : u32 { @@ -796,11 +806,29 @@ struct Liverpool { Err = 4u, FmaskDecompress = 5u, }; + enum class LogicOp : u32 { + Clear = 0x00, + Nor = 0x11, + AndInverted = 0x22, + CopyInverted = 0x33, + AndReverse = 0x44, + Invert = 0x55, + Xor = 0x66, + Nand = 0x77, + And = 0x88, + Equiv = 0x99, + Noop = 0xAA, + OrInverted = 0xBB, + Copy = 0xCC, + OrReverse = 0xDD, + Or = 0xEE, + Set = 0xFF, + }; BitField<0, 1, u32> disable_dual_quad; BitField<3, 1, u32> degamma_enable; BitField<4, 3, OperationMode> mode; - BitField<16, 8, u32> rop3; + BitField<16, 8, LogicOp> rop3; }; struct ColorBuffer { @@ -1369,7 +1397,9 @@ struct Liverpool { PolygonControl polygon_control; ViewportControl viewport_control; VsOutputControl vs_output_control; - INSERT_PADDING_WORDS(0xA287 - 0xA207 - 1); + INSERT_PADDING_WORDS(0xA287 - 0xA207 - 6); + LineControl line_control; + INSERT_PADDING_WORDS(4); HsTessFactorClamp hs_clamp; INSERT_PADDING_WORDS(0xA290 - 0xA287 - 2); GsMode vgt_gs_mode; @@ -1695,6 +1725,7 @@ static_assert(GFX6_3D_REG_INDEX(color_control) == 0xA202); static_assert(GFX6_3D_REG_INDEX(clipper_control) == 0xA204); static_assert(GFX6_3D_REG_INDEX(viewport_control) == 0xA206); static_assert(GFX6_3D_REG_INDEX(vs_output_control) == 0xA207); +static_assert(GFX6_3D_REG_INDEX(line_control) == 0xA282); static_assert(GFX6_3D_REG_INDEX(hs_clamp) == 0xA287); static_assert(GFX6_3D_REG_INDEX(vgt_gs_mode) == 0xA290); static_assert(GFX6_3D_REG_INDEX(mode_control) == 0xA292); diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index 5972296c0..fd1a91260 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -245,6 +245,46 @@ vk::BlendOp BlendOp(Liverpool::BlendControl::BlendFunc func) { } } +vk::LogicOp LogicOp(Liverpool::ColorControl::LogicOp logic_op) { + using LogicOp = Liverpool::ColorControl::LogicOp; + switch (logic_op) { + case LogicOp::Clear: + return vk::LogicOp::eClear; + case LogicOp::Nor: + return vk::LogicOp::eNor; + case LogicOp::AndInverted: + return vk::LogicOp::eAndInverted; + case LogicOp::CopyInverted: + return vk::LogicOp::eCopyInverted; + case LogicOp::AndReverse: + return vk::LogicOp::eAndReverse; + case LogicOp::Invert: + return vk::LogicOp::eInvert; + case LogicOp::Xor: + return vk::LogicOp::eXor; + case LogicOp::Nand: + return vk::LogicOp::eNand; + case LogicOp::And: + return vk::LogicOp::eAnd; + case LogicOp::Equiv: + return vk::LogicOp::eEquivalent; + case LogicOp::Noop: + return vk::LogicOp::eNoOp; + case LogicOp::OrInverted: + return vk::LogicOp::eOrInverted; + case LogicOp::Copy: + return vk::LogicOp::eCopy; + case LogicOp::OrReverse: + return vk::LogicOp::eOrReverse; + case LogicOp::Or: + return vk::LogicOp::eOr; + case LogicOp::Set: + return vk::LogicOp::eSet; + default: + UNREACHABLE_MSG("Unknown logic op {}", u32(logic_op)); + } +} + // https://github.com/chaotic-cx/mesa-mirror/blob/0954afff5/src/amd/vulkan/radv_sampler.c#L21 vk::SamplerAddressMode ClampMode(AmdGpu::ClampMode mode) { switch (mode) { diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.h b/src/video_core/renderer_vulkan/liverpool_to_vk.h index 61fd4a8c1..61b7ea0a9 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.h +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.h @@ -34,6 +34,8 @@ bool IsDualSourceBlendFactor(Liverpool::BlendControl::BlendFactor factor); vk::BlendOp BlendOp(Liverpool::BlendControl::BlendFunc func); +vk::LogicOp LogicOp(Liverpool::ColorControl::LogicOp logic_op); + vk::SamplerAddressMode ClampMode(AmdGpu::ClampMode mode); vk::CompareOp DepthCompare(AmdGpu::DepthCompare comp); diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 3596bb041..10e5bed5f 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -109,28 +109,63 @@ GraphicsPipeline::GraphicsPipeline( .patchControlPoints = is_rect_list ? 3U : (is_quad_list ? 4U : key.patch_control_points), }; - const vk::PipelineRasterizationStateCreateInfo raster_state = { - .depthClampEnable = false, - .rasterizerDiscardEnable = false, - .polygonMode = LiverpoolToVK::PolygonMode(key.polygon_mode), - .lineWidth = 1.0f, + vk::StructureChain raster_chain = { + vk::PipelineRasterizationStateCreateInfo{ + .depthClampEnable = key.depth_clamp_enable || + (!key.depth_clip_enable && !instance.IsDepthClipEnableSupported()), + .rasterizerDiscardEnable = false, + .polygonMode = LiverpoolToVK::PolygonMode(key.polygon_mode), + .lineWidth = 1.0f, + }, + vk::PipelineRasterizationProvokingVertexStateCreateInfoEXT{ + .provokingVertexMode = key.provoking_vtx_last == Liverpool::ProvokingVtxLast::First + ? vk::ProvokingVertexModeEXT::eFirstVertex + : vk::ProvokingVertexModeEXT::eLastVertex, + }, + vk::PipelineRasterizationDepthClipStateCreateInfoEXT{ + .depthClipEnable = key.depth_clip_enable, + }, }; + if (!instance.IsProvokingVertexSupported()) { + raster_chain.unlink(); + } + if (!instance.IsDepthClipEnableSupported()) { + raster_chain.unlink(); + } + const vk::PipelineMultisampleStateCreateInfo multisampling = { .rasterizationSamples = LiverpoolToVK::NumSamples(key.num_samples, instance.GetFramebufferSampleCounts()), .sampleShadingEnable = false, }; - const vk::PipelineViewportDepthClipControlCreateInfoEXT clip_control = { - .negativeOneToOne = key.clip_space == Liverpool::ClipSpace::MinusWToW, + const vk::DepthClampRangeEXT depth_clamp_range = { + .minDepthClamp = key.min_depth_clamp, + .maxDepthClamp = key.max_depth_clamp, }; - const vk::PipelineViewportStateCreateInfo viewport_info = { - .pNext = instance.IsDepthClipControlSupported() ? &clip_control : nullptr, + vk::StructureChain viewport_chain = { + vk::PipelineViewportStateCreateInfo{}, + vk::PipelineViewportDepthClipControlCreateInfoEXT{ + .negativeOneToOne = key.clip_space == Liverpool::ClipSpace::MinusWToW, + }, + vk::PipelineViewportDepthClampControlCreateInfoEXT{ + .depthClampMode = key.depth_clamp_user_defined_range + ? vk::DepthClampModeEXT::eUserDefinedRange + : vk::DepthClampModeEXT::eViewportRange, + .pDepthClampRange = &depth_clamp_range, + }, }; - boost::container::static_vector dynamic_states = { + if (!instance.IsDepthClampControlSupported()) { + viewport_chain.unlink(); + } + if (!instance.IsDepthClipControlSupported()) { + viewport_chain.unlink(); + } + + boost::container::static_vector dynamic_states = { vk::DynamicState::eViewportWithCount, vk::DynamicState::eScissorWithCount, vk::DynamicState::eBlendConstants, vk::DynamicState::eDepthTestEnable, vk::DynamicState::eDepthWriteEnable, vk::DynamicState::eDepthCompareOp, @@ -138,7 +173,8 @@ GraphicsPipeline::GraphicsPipeline( vk::DynamicState::eStencilTestEnable, vk::DynamicState::eStencilReference, vk::DynamicState::eStencilCompareMask, vk::DynamicState::eStencilWriteMask, vk::DynamicState::eStencilOp, vk::DynamicState::eCullMode, - vk::DynamicState::eFrontFace, + vk::DynamicState::eFrontFace, vk::DynamicState::eRasterizerDiscardEnable, + vk::DynamicState::eLineWidth, }; if (instance.IsPrimitiveRestartDisableSupported()) { @@ -221,11 +257,19 @@ GraphicsPipeline::GraphicsPipeline( }); } + const auto depth_format = + instance.GetSupportedFormat(LiverpoolToVK::DepthFormat(key.z_format, key.stencil_format), + vk::FormatFeatureFlagBits2::eDepthStencilAttachment); const vk::PipelineRenderingCreateInfo pipeline_rendering_ci = { .colorAttachmentCount = key.num_color_attachments, .pColorAttachmentFormats = key.color_formats.data(), - .depthAttachmentFormat = key.depth_format, - .stencilAttachmentFormat = key.stencil_format, + .depthAttachmentFormat = key.z_format != Liverpool::DepthBuffer::ZFormat::Invalid + ? depth_format + : vk::Format::eUndefined, + .stencilAttachmentFormat = + key.stencil_format != Liverpool::DepthBuffer::StencilFormat::Invalid + ? depth_format + : vk::Format::eUndefined, }; std::array attachments; @@ -280,8 +324,9 @@ GraphicsPipeline::GraphicsPipeline( } const vk::PipelineColorBlendStateCreateInfo color_blending = { - .logicOpEnable = false, - .logicOp = vk::LogicOp::eCopy, + .logicOpEnable = + instance.IsLogicOpSupported() && key.logic_op != Liverpool::ColorControl::LogicOp::Copy, + .logicOp = LiverpoolToVK::LogicOp(key.logic_op), .attachmentCount = key.num_color_attachments, .pAttachments = attachments.data(), .blendConstants = std::array{1.0f, 1.0f, 1.0f, 1.0f}, @@ -294,8 +339,8 @@ GraphicsPipeline::GraphicsPipeline( .pVertexInputState = !instance.IsVertexInputDynamicState() ? &vertex_input_info : nullptr, .pInputAssemblyState = &input_assembly, .pTessellationState = &tessellation_state, - .pViewportState = &viewport_info, - .pRasterizationState = &raster_state, + .pViewportState = &viewport_chain.get(), + .pRasterizationState = &raster_chain.get(), .pMultisampleState = &multisampling, .pColorBlendState = &color_blending, .pDynamicState = &dynamic_info, diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index ab67a52b4..1ecfa6b42 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -33,22 +33,32 @@ using VertexInputs = boost::container::static_vector; struct GraphicsPipelineKey { std::array stage_hashes; + std::array vertex_buffer_formats; + u32 patch_control_points; u32 num_color_attachments; std::array color_formats; std::array color_buffers; - vk::Format depth_format; - vk::Format stencil_format; - - u32 num_samples; - u32 mrt_mask; - AmdGpu::PrimitiveType prim_type; - Liverpool::PolygonMode polygon_mode; - Liverpool::ClipSpace clip_space; - Liverpool::ColorBufferMask cb_shader_mask; std::array blend_controls; std::array write_masks; - std::array vertex_buffer_formats; - u32 patch_control_points; + Liverpool::ColorBufferMask cb_shader_mask; + Liverpool::ColorControl::LogicOp logic_op; + u32 num_samples; + u32 mrt_mask; + struct { + Liverpool::DepthBuffer::ZFormat z_format : 2; + Liverpool::DepthBuffer::StencilFormat stencil_format : 1; + u32 depth_clamp_enable : 1; + u32 depth_clamp_user_defined_range : 1; + float min_depth_clamp; + float max_depth_clamp; + }; + struct { + AmdGpu::PrimitiveType prim_type : 5; + Liverpool::PolygonMode polygon_mode : 2; + Liverpool::ClipSpace clip_space : 1; + Liverpool::ProvokingVtxLast provoking_vtx_last : 1; + u32 depth_clip_enable : 1; + }; bool operator==(const GraphicsPipelineKey& key) const noexcept { return std::memcmp(this, &key, sizeof(key)) == 0; diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index 85fc993a9..3a461b321 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -270,10 +270,13 @@ bool Instance::CreateDevice() { } custom_border_color = add_extension(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); depth_clip_control = add_extension(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME); + depth_clip_enable = add_extension(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME); + depth_clamp_control = add_extension(VK_EXT_DEPTH_CLAMP_CONTROL_EXTENSION_NAME); vertex_input_dynamic_state = add_extension(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); list_restart = add_extension(VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME); fragment_shader_barycentric = add_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); legacy_vertex_attributes = add_extension(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME); + provoking_vertex = add_extension(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME); shader_stencil_export = add_extension(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME); image_load_store_lod = add_extension(VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME); amd_gcn_shader = add_extension(VK_AMD_GCN_SHADER_EXTENSION_NAME); @@ -362,9 +365,11 @@ bool Instance::CreateDevice() { .dualSrcBlend = features.dualSrcBlend, .logicOp = features.logicOp, .multiDrawIndirect = features.multiDrawIndirect, + .depthClamp = features.depthClamp, .depthBiasClamp = features.depthBiasClamp, .fillModeNonSolid = features.fillModeNonSolid, .depthBounds = features.depthBounds, + .wideLines = features.wideLines, .multiViewport = features.multiViewport, .samplerAnisotropy = features.samplerAnisotropy, .vertexPipelineStoresAndAtomics = features.vertexPipelineStoresAndAtomics, @@ -418,6 +423,12 @@ bool Instance::CreateDevice() { vk::PhysicalDeviceDepthClipControlFeaturesEXT{ .depthClipControl = true, }, + vk::PhysicalDeviceDepthClipEnableFeaturesEXT{ + .depthClipEnable = true, + }, + vk::PhysicalDeviceDepthClampControlFeaturesEXT{ + .depthClampControl = true, + }, vk::PhysicalDeviceRobustness2FeaturesEXT{ .robustBufferAccess2 = robustness2_features.robustBufferAccess2, .robustImageAccess2 = robustness2_features.robustImageAccess2, @@ -437,6 +448,9 @@ bool Instance::CreateDevice() { vk::PhysicalDeviceLegacyVertexAttributesFeaturesEXT{ .legacyVertexAttributes = true, }, + vk::PhysicalDeviceProvokingVertexFeaturesEXT{ + .provokingVertexLast = true, + }, vk::PhysicalDeviceVertexAttributeDivisorFeatures{ .vertexAttributeInstanceRateDivisor = true, }, @@ -487,6 +501,12 @@ bool Instance::CreateDevice() { if (!depth_clip_control) { device_chain.unlink(); } + if (!depth_clip_enable) { + device_chain.unlink(); + } + if (!depth_clamp_control) { + device_chain.unlink(); + } if (!robustness2) { device_chain.unlink(); } @@ -502,6 +522,9 @@ bool Instance::CreateDevice() { if (!legacy_vertex_attributes) { device_chain.unlink(); } + if (!provoking_vertex) { + device_chain.unlink(); + } if (!shader_atomic_float2) { device_chain.unlink(); } diff --git a/src/video_core/renderer_vulkan/vk_instance.h b/src/video_core/renderer_vulkan/vk_instance.h index 830b1d5c2..67dcc183a 100644 --- a/src/video_core/renderer_vulkan/vk_instance.h +++ b/src/video_core/renderer_vulkan/vk_instance.h @@ -109,6 +109,16 @@ public: return depth_clip_control; } + /// Returns true when VK_EXT_depth_clip_enable is supported + bool IsDepthClipEnableSupported() const { + return depth_clip_enable; + } + + /// Returns true when VK_EXT_depth_clamp_control is supported + bool IsDepthClampControlSupported() const { + return depth_clamp_control; + } + /// Returns true when VK_EXT_depth_range_unrestricted is supported bool IsDepthRangeUnrestrictedSupported() const { return depth_range_unrestricted; @@ -150,6 +160,11 @@ public: return legacy_vertex_attributes; } + /// Returns true when VK_EXT_provoking_vertex is supported. + bool IsProvokingVertexSupported() const { + return provoking_vertex; + } + /// Returns true when VK_AMD_shader_image_load_store_lod is supported. bool IsImageLoadStoreLodSupported() const { return image_load_store_lod; @@ -351,6 +366,11 @@ public: return driver_id != vk::DriverId::eMoltenvk; } + /// Returns true if logic ops are supported by the device. + bool IsLogicOpSupported() const { + return features.logicOp; + } + /// Determines if a format is supported for a set of feature flags. [[nodiscard]] bool IsFormatSupported(vk::Format format, vk::FormatFeatureFlags2 flags) const; @@ -399,12 +419,15 @@ private: bool custom_border_color{}; bool fragment_shader_barycentric{}; bool depth_clip_control{}; + bool depth_clip_enable{}; + bool depth_clamp_control{}; bool depth_range_unrestricted{}; bool dynamic_state_3{}; bool vertex_input_dynamic_state{}; bool robustness2{}; bool list_restart{}; bool legacy_vertex_attributes{}; + bool provoking_vertex{}; bool shader_stencil_export{}; bool image_load_store_lod{}; bool amd_gcn_shader{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 8d12b74f3..d9e01091e 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -285,26 +285,21 @@ bool PipelineCache::RefreshGraphicsKey() { auto& regs = liverpool->regs; auto& key = graphics_key; - const auto depth_format = instance.GetSupportedFormat( - LiverpoolToVK::DepthFormat(regs.depth_buffer.z_info.format, - regs.depth_buffer.stencil_info.format), - vk::FormatFeatureFlagBits2::eDepthStencilAttachment); - if (regs.depth_buffer.DepthValid()) { - key.depth_format = depth_format; - } else { - key.depth_format = vk::Format::eUndefined; - } - if (regs.depth_buffer.StencilValid()) { - key.stencil_format = depth_format; - } else { - key.stencil_format = vk::Format::eUndefined; - } - + key.z_format = regs.depth_buffer.DepthValid() ? regs.depth_buffer.z_info.format.Value() + : Liverpool::DepthBuffer::ZFormat::Invalid; + key.stencil_format = regs.depth_buffer.StencilValid() + ? regs.depth_buffer.stencil_info.format.Value() + : Liverpool::DepthBuffer::StencilFormat::Invalid; + key.depth_clip_enable = regs.clipper_control.ZclipEnable(); + key.clip_space = regs.clipper_control.clip_space; + key.provoking_vtx_last = regs.polygon_control.provoking_vtx_last; key.prim_type = regs.primitive_type; key.polygon_mode = regs.polygon_control.PolyMode(); - key.clip_space = regs.clipper_control.clip_space; + key.logic_op = regs.color_control.rop3; key.num_samples = regs.NumSamples(); + RefreshDepthClampRange(); + const bool skip_cb_binding = regs.color_control.mode == AmdGpu::Liverpool::ColorControl::OperationMode::Disable; @@ -491,7 +486,63 @@ bool PipelineCache::RefreshGraphicsKey() { } return true; -} // namespace Vulkan +} + +void PipelineCache::RefreshDepthClampRange() { + auto& regs = liverpool->regs; + auto& key = graphics_key; + + key.depth_clamp_enable = !regs.depth_render_override.disable_viewport_clamp; + if (key.z_format == Liverpool::DepthBuffer::ZFormat::Invalid || !key.depth_clamp_enable) { + return; + } + + bool depth_clamp_can_use_viewport_range = true; + bool depth_clamp_is_same_on_all_viewports = true; + float zmin = std::numeric_limits::max(); + float zmax = std::numeric_limits::max(); + const auto& vp_ctl = regs.viewport_control; + for (u32 i = 0; i < Liverpool::NumViewports; i++) { + const auto& vp = regs.viewports[i]; + const auto& vp_d = regs.viewport_depths[i]; + if (vp.xscale == 0) { + continue; + } + const auto zoffset = vp_ctl.zoffset_enable ? vp.zoffset : 0.f; + const auto zscale = vp_ctl.zscale_enable ? vp.zscale : 1.f; + + float min_depth; + float max_depth; + if (regs.clipper_control.clip_space == AmdGpu::Liverpool::ClipSpace::MinusWToW) { + min_depth = zoffset - zscale; + max_depth = zoffset + zscale; + } else { + min_depth = zoffset; + max_depth = zoffset + zscale; + } + if (zmin == std::numeric_limits::max()) { + zmin = vp_d.zmin; + zmax = vp_d.zmax; + } + depth_clamp_is_same_on_all_viewports &= (zmin == vp_d.zmin && zmax == vp_d.zmax); + depth_clamp_can_use_viewport_range &= (min_depth == vp_d.zmin && max_depth == vp_d.zmax); + } + + if (zmin == std::numeric_limits::max()) { + return; + } + + if (!depth_clamp_can_use_viewport_range && !depth_clamp_is_same_on_all_viewports) { + LOG_ERROR(Render_Vulkan, + "Viewport depth clamping configuration cannot be accurately emulated"); + } + + key.depth_clamp_user_defined_range = !depth_clamp_can_use_viewport_range; + if (key.depth_clamp_user_defined_range) { + key.min_depth_clamp = zmin; + key.max_depth_clamp = zmax; + } +} bool PipelineCache::RefreshComputeKey() { Shader::Backend::Bindings binding{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index ba3407b48..405275439 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h @@ -76,6 +76,8 @@ private: bool RefreshGraphicsKey(); bool RefreshComputeKey(); + void RefreshDepthClampRange(); + void DumpShader(std::span code, u64 hash, Shader::Stage stage, size_t perm_idx, std::string_view ext); std::optional> GetShaderPatch(u64 hash, Shader::Stage stage, size_t perm_idx, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 2a645f338..b6130e873 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1014,9 +1014,10 @@ void Rasterizer::UpdateDynamicState(const GraphicsPipeline& pipeline) const { UpdateViewportScissorState(); UpdateDepthStencilState(); UpdatePrimitiveState(); + UpdateRasterizationState(); auto& dynamic_state = scheduler.GetDynamicState(); - dynamic_state.SetBlendConstants(&liverpool->regs.blend_constants.red); + dynamic_state.SetBlendConstants(liverpool->regs.blend_constants); dynamic_state.SetColorWriteMasks(pipeline.GetWriteMasks()); // Commit new dynamic state to the command buffer. @@ -1086,12 +1087,6 @@ void Rasterizer::UpdateViewportScissorState() const { viewport.maxDepth = zoffset + zscale; } - if (!regs.depth_render_override.disable_viewport_clamp) { - // Apply depth clamp. - viewport.minDepth = std::max(viewport.minDepth, vp_d.zmin); - viewport.maxDepth = std::min(viewport.maxDepth, vp_d.zmax); - } - if (!instance.IsDepthRangeUnrestrictedSupported()) { // Unrestricted depth range not supported by device. Restrict to valid range. viewport.minDepth = std::max(viewport.minDepth, 0.f); @@ -1231,10 +1226,17 @@ void Rasterizer::UpdatePrimitiveState() const { const auto front_face = LiverpoolToVK::FrontFace(regs.polygon_control.front_face); dynamic_state.SetPrimitiveRestartEnabled(prim_restart); + dynamic_state.SetRasterizerDiscardEnabled(regs.clipper_control.dx_rasterization_kill); dynamic_state.SetCullMode(cull_mode); dynamic_state.SetFrontFace(front_face); } +void Rasterizer::UpdateRasterizationState() const { + const auto& regs = liverpool->regs; + auto& dynamic_state = scheduler.GetDynamicState(); + dynamic_state.SetLineWidth(regs.line_control.Width()); +} + void Rasterizer::ScopeMarkerBegin(const std::string_view& str, bool from_guest) { if ((from_guest && !Config::getVkGuestMarkersEnabled()) || (!from_guest && !Config::getVkHostMarkersEnabled())) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 1e1680258..79e7722b8 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -94,6 +94,7 @@ private: void UpdateViewportScissorState() const; void UpdateDepthStencilState() const; void UpdatePrimitiveState() const; + void UpdateRasterizationState() const; bool FilterDraw(); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index ac645c9ce..7c3429297 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -308,6 +308,10 @@ void DynamicState::Commit(const Instance& instance, const vk::CommandBuffer& cmd cmdbuf.setPrimitiveRestartEnable(primitive_restart_enable); } } + if (dirty_state.rasterizer_discard_enable) { + dirty_state.rasterizer_discard_enable = false; + cmdbuf.setRasterizerDiscardEnable(rasterizer_discard_enable); + } if (dirty_state.cull_mode) { dirty_state.cull_mode = false; cmdbuf.setCullMode(cull_mode); @@ -318,7 +322,7 @@ void DynamicState::Commit(const Instance& instance, const vk::CommandBuffer& cmd } if (dirty_state.blend_constants) { dirty_state.blend_constants = false; - cmdbuf.setBlendConstants(blend_constants); + cmdbuf.setBlendConstants(blend_constants.data()); } if (dirty_state.color_write_masks) { dirty_state.color_write_masks = false; @@ -326,6 +330,10 @@ void DynamicState::Commit(const Instance& instance, const vk::CommandBuffer& cmd cmdbuf.setColorWriteMaskEXT(0, color_write_masks); } } + if (dirty_state.line_width) { + dirty_state.line_width = false; + cmdbuf.setLineWidth(line_width); + } } } // namespace Vulkan diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index b5678edbc..3616d8478 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -96,11 +96,13 @@ struct DynamicState { bool stencil_back_compare_mask : 1; bool primitive_restart_enable : 1; + bool rasterizer_discard_enable : 1; bool cull_mode : 1; bool front_face : 1; bool blend_constants : 1; bool color_write_masks : 1; + bool line_width : 1; } dirty_state{}; Viewports viewports{}; @@ -130,11 +132,13 @@ struct DynamicState { u32 stencil_back_compare_mask{}; bool primitive_restart_enable{}; + bool rasterizer_discard_enable{}; vk::CullModeFlags cull_mode{}; vk::FrontFace front_face{}; - float blend_constants[4]{}; + std::array blend_constants{}; ColorWriteMasks color_write_masks{}; + float line_width{}; /// Commits the dynamic state to the provided command buffer. void Commit(const Instance& instance, const vk::CommandBuffer& cmdbuf); @@ -283,19 +287,33 @@ struct DynamicState { } } - void SetBlendConstants(const float blend_constants_[4]) { - if (!std::equal(blend_constants, std::end(blend_constants), blend_constants_)) { - std::memcpy(blend_constants, blend_constants_, sizeof(blend_constants)); + void SetBlendConstants(const std::array blend_constants_) { + if (blend_constants != blend_constants_) { + blend_constants = blend_constants_; dirty_state.blend_constants = true; } } + void SetRasterizerDiscardEnabled(const bool enabled) { + if (rasterizer_discard_enable != enabled) { + rasterizer_discard_enable = enabled; + dirty_state.rasterizer_discard_enable = true; + } + } + void SetColorWriteMasks(const ColorWriteMasks& color_write_masks_) { if (!std::ranges::equal(color_write_masks, color_write_masks_)) { color_write_masks = color_write_masks_; dirty_state.color_write_masks = true; } } + + void SetLineWidth(const float width) { + if (line_width != width) { + line_width = width; + dirty_state.line_width = true; + } + } }; class Scheduler { From b68ca43166be4bcb985f442db465b3fcc7d5e4ab Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Mon, 14 Jul 2025 22:44:13 +0200 Subject: [PATCH 03/21] Implement sceKernelGetSystemSwVersion (#3243) * Implement sceKernelGetSystemSwVersion * Set the reported firmware version to that of the game executable --- src/core/libraries/kernel/kernel.cpp | 15 +++++++++++++++ src/core/libraries/kernel/kernel.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/src/core/libraries/kernel/kernel.cpp b/src/core/libraries/kernel/kernel.cpp index 61d2e2f2b..a4d3accac 100644 --- a/src/core/libraries/kernel/kernel.cpp +++ b/src/core/libraries/kernel/kernel.cpp @@ -6,6 +6,7 @@ #include "common/assert.h" #include "common/debug.h" +#include "common/elf_info.h" #include "common/logging/log.h" #include "common/polyfill_thread.h" #include "common/thread.h" @@ -243,6 +244,19 @@ s32 PS4_SYSV_ABI sceKernelSetGPO() { return ORBIS_OK; } +s32 PS4_SYSV_ABI sceKernelGetSystemSwVersion(SwVersionStruct* ret) { + if (ret == nullptr) { + return ORBIS_OK; // but why? + } + ASSERT(ret->struct_size == 40); + u32 fake_fw = Common::ElfInfo::Instance().RawFirmwareVer(); + ret->hex_representation = fake_fw; + std::snprintf(ret->text_representation, 28, "%2x.%03x.%03x", fake_fw >> 0x18, + fake_fw >> 0xc & 0xfff, fake_fw & 0xfff); // why %2x? + LOG_INFO(Lib_Kernel, "called, returned sw version: {}", ret->text_representation); + return ORBIS_OK; +} + void RegisterKernel(Core::Loader::SymbolsResolver* sym) { service_thread = std::jthread{KernelServiceThread}; @@ -258,6 +272,7 @@ void RegisterKernel(Core::Loader::SymbolsResolver* sym) { Libraries::Kernel::RegisterDebug(sym); LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &g_stack_chk_guard); + LIB_FUNCTION("Mv1zUObHvXI", "libkernel", 1, "libkernel", 1, 1, sceKernelGetSystemSwVersion); LIB_FUNCTION("PfccT7qURYE", "libkernel", 1, "libkernel", 1, 1, kernel_ioctl); LIB_FUNCTION("JGfTMBOdUJo", "libkernel", 1, "libkernel", 1, 1, sceKernelGetFsSandboxRandomWord); LIB_FUNCTION("6xVpy0Fdq+I", "libkernel", 1, "libkernel", 1, 1, _sigprocmask); diff --git a/src/core/libraries/kernel/kernel.h b/src/core/libraries/kernel/kernel.h index 0529c06d5..018759e14 100644 --- a/src/core/libraries/kernel/kernel.h +++ b/src/core/libraries/kernel/kernel.h @@ -35,6 +35,12 @@ struct OrbisWrapperImpl { s32* PS4_SYSV_ABI __Error(); +struct SwVersionStruct { + u64 struct_size; + char text_representation[0x1c]; + u32 hex_representation; +}; + void RegisterKernel(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Kernel From 97daee836a05c18da655bf7f19d4b39bb024bfb8 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Tue, 15 Jul 2025 06:11:56 -0500 Subject: [PATCH 04/21] Core: Fix read-only file unmaps on Windows (#3246) * Fix read-only file unmaps Fixes Genshin Impact (CUSA23681) * Slight cleanup Don't need `post_merge_it` anymore. --- src/core/memory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 3d9bf58a7..12099ea73 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -537,6 +537,7 @@ u64 MemoryManager::UnmapBytesFromEntry(VAddr virtual_addr, VirtualMemoryArea vma vma_base_size - start_in_vma < size ? vma_base_size - start_in_vma : size; const bool has_backing = type == VMAType::Direct || type == VMAType::File; const auto prot = vma_base.prot; + const bool readonly_file = prot == MemoryProt::CpuRead && type == VMAType::File; if (type == VMAType::Free) { return adjusted_size; @@ -554,9 +555,8 @@ u64 MemoryManager::UnmapBytesFromEntry(VAddr virtual_addr, VirtualMemoryArea vma vma.phys_base = 0; vma.disallow_merge = false; vma.name = ""; - const auto post_merge_it = MergeAdjacent(vma_map, new_it); - auto& post_merge_vma = post_merge_it->second; - bool readonly_file = post_merge_vma.prot == MemoryProt::CpuRead && type == VMAType::File; + MergeAdjacent(vma_map, new_it); + if (type != VMAType::Reserved && type != VMAType::PoolReserved) { // If this mapping has GPU access, unmap from GPU. if (IsValidGpuMapping(virtual_addr, size)) { From bf623d4f855e4d04a8596ac43370045caded7546 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Tue, 15 Jul 2025 07:48:05 -0500 Subject: [PATCH 05/21] Libraries: Implement sceAudio3dTerminate (#3247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sceAudio3dTerminate My First Gran Turismo® (CUSA49696) uses this while initializing it's audio system. Without it, the game spams errored sceAudio3dInitialize calls. * Properly close AudioOut handle Based on library decompilation. --- src/core/libraries/audio3d/audio3d.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/libraries/audio3d/audio3d.cpp b/src/core/libraries/audio3d/audio3d.cpp index 646c28949..81befc5bf 100644 --- a/src/core/libraries/audio3d/audio3d.cpp +++ b/src/core/libraries/audio3d/audio3d.cpp @@ -526,7 +526,14 @@ s32 PS4_SYSV_ABI sceAudio3dStrError() { } s32 PS4_SYSV_ABI sceAudio3dTerminate() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); + LOG_INFO(Lib_Audio3d, "called"); + if (!state) { + return ORBIS_AUDIO3D_ERROR_NOT_READY; + } + + AudioOut::sceAudioOutOutput(state->audio_out_handle, nullptr); + AudioOut::sceAudioOutClose(state->audio_out_handle); + state.release(); return ORBIS_OK; } From 87f6cce7b1ed286b35dc4312adfc5d584a7b4b4f Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Tue, 15 Jul 2025 18:36:13 +0300 Subject: [PATCH 06/21] vk_instance: Remove usage of depth clamp control (#3248) --- .../renderer_vulkan/vk_graphics_pipeline.cpp | 27 ++------- .../renderer_vulkan/vk_graphics_pipeline.h | 3 - .../renderer_vulkan/vk_instance.cpp | 7 --- src/video_core/renderer_vulkan/vk_instance.h | 6 -- .../renderer_vulkan/vk_pipeline_cache.cpp | 59 +------------------ .../renderer_vulkan/vk_pipeline_cache.h | 2 - 6 files changed, 6 insertions(+), 98 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 10e5bed5f..3c8332c10 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -140,31 +140,14 @@ GraphicsPipeline::GraphicsPipeline( .sampleShadingEnable = false, }; - const vk::DepthClampRangeEXT depth_clamp_range = { - .minDepthClamp = key.min_depth_clamp, - .maxDepthClamp = key.max_depth_clamp, + const vk::PipelineViewportDepthClipControlCreateInfoEXT clip_control = { + .negativeOneToOne = key.clip_space == Liverpool::ClipSpace::MinusWToW, }; - vk::StructureChain viewport_chain = { - vk::PipelineViewportStateCreateInfo{}, - vk::PipelineViewportDepthClipControlCreateInfoEXT{ - .negativeOneToOne = key.clip_space == Liverpool::ClipSpace::MinusWToW, - }, - vk::PipelineViewportDepthClampControlCreateInfoEXT{ - .depthClampMode = key.depth_clamp_user_defined_range - ? vk::DepthClampModeEXT::eUserDefinedRange - : vk::DepthClampModeEXT::eViewportRange, - .pDepthClampRange = &depth_clamp_range, - }, + const vk::PipelineViewportStateCreateInfo viewport_info = { + .pNext = instance.IsDepthClipControlSupported() ? &clip_control : nullptr, }; - if (!instance.IsDepthClampControlSupported()) { - viewport_chain.unlink(); - } - if (!instance.IsDepthClipControlSupported()) { - viewport_chain.unlink(); - } - boost::container::static_vector dynamic_states = { vk::DynamicState::eViewportWithCount, vk::DynamicState::eScissorWithCount, vk::DynamicState::eBlendConstants, vk::DynamicState::eDepthTestEnable, @@ -339,7 +322,7 @@ GraphicsPipeline::GraphicsPipeline( .pVertexInputState = !instance.IsVertexInputDynamicState() ? &vertex_input_info : nullptr, .pInputAssemblyState = &input_assembly, .pTessellationState = &tessellation_state, - .pViewportState = &viewport_chain.get(), + .pViewportState = &viewport_info, .pRasterizationState = &raster_chain.get(), .pMultisampleState = &multisampling, .pColorBlendState = &color_blending, diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 1ecfa6b42..75b8c8c73 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -48,9 +48,6 @@ struct GraphicsPipelineKey { Liverpool::DepthBuffer::ZFormat z_format : 2; Liverpool::DepthBuffer::StencilFormat stencil_format : 1; u32 depth_clamp_enable : 1; - u32 depth_clamp_user_defined_range : 1; - float min_depth_clamp; - float max_depth_clamp; }; struct { AmdGpu::PrimitiveType prim_type : 5; diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index 3a461b321..c0b138fad 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -271,7 +271,6 @@ bool Instance::CreateDevice() { custom_border_color = add_extension(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); depth_clip_control = add_extension(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME); depth_clip_enable = add_extension(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME); - depth_clamp_control = add_extension(VK_EXT_DEPTH_CLAMP_CONTROL_EXTENSION_NAME); vertex_input_dynamic_state = add_extension(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); list_restart = add_extension(VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME); fragment_shader_barycentric = add_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); @@ -426,9 +425,6 @@ bool Instance::CreateDevice() { vk::PhysicalDeviceDepthClipEnableFeaturesEXT{ .depthClipEnable = true, }, - vk::PhysicalDeviceDepthClampControlFeaturesEXT{ - .depthClampControl = true, - }, vk::PhysicalDeviceRobustness2FeaturesEXT{ .robustBufferAccess2 = robustness2_features.robustBufferAccess2, .robustImageAccess2 = robustness2_features.robustImageAccess2, @@ -504,9 +500,6 @@ bool Instance::CreateDevice() { if (!depth_clip_enable) { device_chain.unlink(); } - if (!depth_clamp_control) { - device_chain.unlink(); - } if (!robustness2) { device_chain.unlink(); } diff --git a/src/video_core/renderer_vulkan/vk_instance.h b/src/video_core/renderer_vulkan/vk_instance.h index 67dcc183a..d96abfabe 100644 --- a/src/video_core/renderer_vulkan/vk_instance.h +++ b/src/video_core/renderer_vulkan/vk_instance.h @@ -114,11 +114,6 @@ public: return depth_clip_enable; } - /// Returns true when VK_EXT_depth_clamp_control is supported - bool IsDepthClampControlSupported() const { - return depth_clamp_control; - } - /// Returns true when VK_EXT_depth_range_unrestricted is supported bool IsDepthRangeUnrestrictedSupported() const { return depth_range_unrestricted; @@ -420,7 +415,6 @@ private: bool fragment_shader_barycentric{}; bool depth_clip_control{}; bool depth_clip_enable{}; - bool depth_clamp_control{}; bool depth_range_unrestricted{}; bool dynamic_state_3{}; bool vertex_input_dynamic_state{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index d9e01091e..31ede7936 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -290,6 +290,7 @@ bool PipelineCache::RefreshGraphicsKey() { key.stencil_format = regs.depth_buffer.StencilValid() ? regs.depth_buffer.stencil_info.format.Value() : Liverpool::DepthBuffer::StencilFormat::Invalid; + key.depth_clamp_enable = !regs.depth_render_override.disable_viewport_clamp; key.depth_clip_enable = regs.clipper_control.ZclipEnable(); key.clip_space = regs.clipper_control.clip_space; key.provoking_vtx_last = regs.polygon_control.provoking_vtx_last; @@ -298,8 +299,6 @@ bool PipelineCache::RefreshGraphicsKey() { key.logic_op = regs.color_control.rop3; key.num_samples = regs.NumSamples(); - RefreshDepthClampRange(); - const bool skip_cb_binding = regs.color_control.mode == AmdGpu::Liverpool::ColorControl::OperationMode::Disable; @@ -488,62 +487,6 @@ bool PipelineCache::RefreshGraphicsKey() { return true; } -void PipelineCache::RefreshDepthClampRange() { - auto& regs = liverpool->regs; - auto& key = graphics_key; - - key.depth_clamp_enable = !regs.depth_render_override.disable_viewport_clamp; - if (key.z_format == Liverpool::DepthBuffer::ZFormat::Invalid || !key.depth_clamp_enable) { - return; - } - - bool depth_clamp_can_use_viewport_range = true; - bool depth_clamp_is_same_on_all_viewports = true; - float zmin = std::numeric_limits::max(); - float zmax = std::numeric_limits::max(); - const auto& vp_ctl = regs.viewport_control; - for (u32 i = 0; i < Liverpool::NumViewports; i++) { - const auto& vp = regs.viewports[i]; - const auto& vp_d = regs.viewport_depths[i]; - if (vp.xscale == 0) { - continue; - } - const auto zoffset = vp_ctl.zoffset_enable ? vp.zoffset : 0.f; - const auto zscale = vp_ctl.zscale_enable ? vp.zscale : 1.f; - - float min_depth; - float max_depth; - if (regs.clipper_control.clip_space == AmdGpu::Liverpool::ClipSpace::MinusWToW) { - min_depth = zoffset - zscale; - max_depth = zoffset + zscale; - } else { - min_depth = zoffset; - max_depth = zoffset + zscale; - } - if (zmin == std::numeric_limits::max()) { - zmin = vp_d.zmin; - zmax = vp_d.zmax; - } - depth_clamp_is_same_on_all_viewports &= (zmin == vp_d.zmin && zmax == vp_d.zmax); - depth_clamp_can_use_viewport_range &= (min_depth == vp_d.zmin && max_depth == vp_d.zmax); - } - - if (zmin == std::numeric_limits::max()) { - return; - } - - if (!depth_clamp_can_use_viewport_range && !depth_clamp_is_same_on_all_viewports) { - LOG_ERROR(Render_Vulkan, - "Viewport depth clamping configuration cannot be accurately emulated"); - } - - key.depth_clamp_user_defined_range = !depth_clamp_can_use_viewport_range; - if (key.depth_clamp_user_defined_range) { - key.min_depth_clamp = zmin; - key.max_depth_clamp = zmax; - } -} - bool PipelineCache::RefreshComputeKey() { Shader::Backend::Bindings binding{}; const auto& cs_pgm = liverpool->GetCsRegs(); diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 405275439..ba3407b48 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h @@ -76,8 +76,6 @@ private: bool RefreshGraphicsKey(); bool RefreshComputeKey(); - void RefreshDepthClampRange(); - void DumpShader(std::span code, u64 hash, Shader::Stage stage, size_t perm_idx, std::string_view ext); std::optional> GetShaderPatch(u64 hash, Shader::Stage stage, size_t perm_idx, From 4407ebdd9be6710f9852b6d85be4daae2b524f95 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Tue, 15 Jul 2025 18:49:12 +0300 Subject: [PATCH 07/21] shader_recompiler: Implement guest barycentrics (#3245) * shader_recompiler: Implement guest barycentrics * Review comments and some cleanup --- externals/sirit | 2 +- .../backend/spirv/emit_spirv.cpp | 14 +- .../spirv/emit_spirv_context_get_set.cpp | 112 ++++++------- .../backend/spirv/emit_spirv_special.cpp | 2 +- .../backend/spirv/spirv_emit_context.cpp | 155 +++++++++--------- .../backend/spirv/spirv_emit_context.h | 15 +- .../frontend/translate/translate.cpp | 63 +++---- .../frontend/translate/translate.h | 5 +- .../translate/vector_interpolation.cpp | 75 ++++++++- src/shader_recompiler/info.h | 19 ++- src/shader_recompiler/ir/attribute.cpp | 14 ++ src/shader_recompiler/ir/attribute.h | 36 ++-- src/shader_recompiler/profile.h | 9 +- .../renderer_vulkan/vk_graphics_pipeline.cpp | 3 +- .../renderer_vulkan/vk_instance.cpp | 7 +- src/video_core/renderer_vulkan/vk_instance.h | 6 + .../renderer_vulkan/vk_pipeline_cache.cpp | 6 + 17 files changed, 314 insertions(+), 229 deletions(-) diff --git a/externals/sirit b/externals/sirit index b4eccb336..282083a59 160000 --- a/externals/sirit +++ b/externals/sirit @@ -1 +1 @@ -Subproject commit b4eccb336f1b1169af48dac1e04015985af86e3e +Subproject commit 282083a595dcca86814dedab2f2b0363ef38f1ec diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index c4c310586..baf9ced25 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -293,9 +293,17 @@ void SetupCapabilities(const Info& info, const Profile& profile, EmitContext& ct if (stage == LogicalStage::Geometry) { ctx.AddCapability(spv::Capability::Geometry); } - if (info.stage == Stage::Fragment && profile.needs_manual_interpolation) { - ctx.AddExtension("SPV_KHR_fragment_shader_barycentric"); - ctx.AddCapability(spv::Capability::FragmentBarycentricKHR); + if (info.stage == Stage::Fragment) { + if (profile.supports_amd_shader_explicit_vertex_parameter) { + ctx.AddExtension("SPV_AMD_shader_explicit_vertex_parameter"); + } else if (profile.supports_fragment_shader_barycentric) { + ctx.AddExtension("SPV_KHR_fragment_shader_barycentric"); + ctx.AddCapability(spv::Capability::FragmentBarycentricKHR); + } + if (info.loads.GetAny(IR::Attribute::BaryCoordSmoothSample) || + info.loads.GetAny(IR::Attribute::BaryCoordNoPerspSample)) { + ctx.AddCapability(spv::Capability::SampleRateShading); + } } if (stage == LogicalStage::TessellationControl || stage == LogicalStage::TessellationEval) { ctx.AddCapability(spv::Capability::Tessellation); diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 40f8d307c..ead2a2825 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -45,7 +45,7 @@ Id VsOutputAttrPointer(EmitContext& ctx, VsOutput output) { return ctx.OpAccessChain(ctx.output_f32, ctx.cull_distances, cull_num); } default: - UNREACHABLE(); + UNREACHABLE_MSG("Vertex output {}", u32(output)); } } @@ -88,7 +88,7 @@ Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr, u32 element) { case IR::Attribute::Depth: return ctx.frag_depth; default: - throw NotImplementedException("Write attribute {}", attr); + UNREACHABLE_MSG("Write attribute {}", attr); } } @@ -111,7 +111,7 @@ std::pair OutputAttrComponentType(EmitContext& ctx, IR::Attribute attr case IR::Attribute::Depth: return {ctx.F32[1], false}; default: - throw NotImplementedException("Write attribute {}", attr); + UNREACHABLE_MSG("Write attribute {}", attr); } } } // Anonymous namespace @@ -159,81 +159,61 @@ Id EmitReadConstBuffer(EmitContext& ctx, u32 handle, Id index) { return result; } -static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index) { - if (IR::IsPosition(attr)) { - ASSERT(attr == IR::Attribute::Position0); - const auto position_arr_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[4]); - const auto pointer{ - ctx.OpAccessChain(position_arr_ptr, ctx.gl_in, ctx.ConstU32(index), ctx.ConstU32(0u))}; - const auto position_comp_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]); - return ctx.OpLoad(ctx.F32[1], - ctx.OpAccessChain(position_comp_ptr, pointer, ctx.ConstU32(comp))); - } - - if (IR::IsParam(attr)) { - const u32 param_id{u32(attr) - u32(IR::Attribute::Param0)}; - const auto param = ctx.input_params.at(param_id).id; - const auto param_arr_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[4]); - const auto pointer{ctx.OpAccessChain(param_arr_ptr, param, ctx.ConstU32(index))}; - const auto position_comp_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]); - return ctx.OpLoad(ctx.F32[1], - ctx.OpAccessChain(position_comp_ptr, pointer, ctx.ConstU32(comp))); - } - UNREACHABLE(); -} - Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, u32 index) { - if (ctx.info.l_stage == LogicalStage::Geometry) { - return EmitGetAttributeForGeometry(ctx, attr, comp, index); - } else if (ctx.info.l_stage == LogicalStage::TessellationControl || - ctx.info.l_stage == LogicalStage::TessellationEval) { - if (IR::IsTessCoord(attr)) { - const u32 component = attr == IR::Attribute::TessellationEvaluationPointU ? 0 : 1; - const auto component_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]); - const auto pointer{ - ctx.OpAccessChain(component_ptr, ctx.tess_coord, ctx.ConstU32(component))}; - return ctx.OpLoad(ctx.F32[1], pointer); - } - UNREACHABLE(); - } - if (IR::IsParam(attr)) { const u32 param_index{u32(attr) - u32(IR::Attribute::Param0)}; const auto& param{ctx.input_params.at(param_index)}; - Id result; - if (param.is_loaded) { - // Attribute is either default or manually interpolated. The id points to an already - // loaded vector. - result = ctx.OpCompositeExtract(param.component_type, param.id, comp); - } else if (param.num_components > 1) { - // Attribute is a vector and we need to access a specific component. - const Id pointer{ctx.OpAccessChain(param.pointer_type, param.id, ctx.ConstU32(comp))}; - result = ctx.OpLoad(param.component_type, pointer); - } else { - // Attribute is a single float or interger, simply load it. - result = ctx.OpLoad(param.component_type, param.id); - } - if (param.is_integer) { - result = ctx.OpBitcast(ctx.F32[1], result); - } - return result; + const Id value = [&] { + if (param.is_array) { + ASSERT(param.num_components > 1); + if (param.is_loaded) { + return ctx.OpCompositeExtract(param.component_type, param.id_array[index], + comp); + } else { + return ctx.OpLoad(param.component_type, + ctx.OpAccessChain(param.pointer_type, param.id, + ctx.ConstU32(index), ctx.ConstU32(comp))); + } + } else { + ASSERT(!param.is_loaded); + if (param.num_components > 1) { + return ctx.OpLoad( + param.component_type, + ctx.OpAccessChain(param.pointer_type, param.id, ctx.ConstU32(comp))); + } else { + return ctx.OpLoad(param.component_type, param.id); + } + } + }(); + return param.is_integer ? ctx.OpBitcast(ctx.F32[1], value) : value; + } + if (IR::IsBarycentricCoord(attr) && ctx.profile.supports_fragment_shader_barycentric) { + ++comp; } - switch (attr) { - case IR::Attribute::FragCoord: { - const Id coord = ctx.OpLoad( - ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.frag_coord, ctx.ConstU32(comp))); - if (comp == 3) { - return ctx.OpFDiv(ctx.F32[1], ctx.ConstF32(1.f), coord); - } - return coord; - } + case IR::Attribute::Position0: + ASSERT(ctx.l_stage == LogicalStage::Geometry); + return ctx.OpLoad(ctx.F32[1], + ctx.OpAccessChain(ctx.input_f32, ctx.gl_in, ctx.ConstU32(index), + ctx.ConstU32(0U), ctx.ConstU32(comp))); + case IR::Attribute::FragCoord: + return ctx.OpLoad(ctx.F32[1], + ctx.OpAccessChain(ctx.input_f32, ctx.frag_coord, ctx.ConstU32(comp))); case IR::Attribute::TessellationEvaluationPointU: return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.tess_coord, ctx.u32_zero_value)); case IR::Attribute::TessellationEvaluationPointV: return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.tess_coord, ctx.ConstU32(1U))); + case IR::Attribute::BaryCoordSmooth: + return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.bary_coord_smooth, + ctx.ConstU32(comp))); + case IR::Attribute::BaryCoordSmoothSample: + return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.bary_coord_smooth_sample, + ctx.ConstU32(comp))); + case IR::Attribute::BaryCoordNoPersp: + return ctx.OpLoad(ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.bary_coord_nopersp, + ctx.ConstU32(comp))); default: UNREACHABLE_MSG("Read attribute {}", attr); } diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp index fe7bd3356..70a44cbe4 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp @@ -9,7 +9,7 @@ namespace Shader::Backend::SPIRV { void EmitPrologue(EmitContext& ctx) { if (ctx.stage == Stage::Fragment) { - ctx.DefineInterpolatedAttribs(); + ctx.DefineAmdPerVertexAttribs(); } if (ctx.info.loads.Get(IR::Attribute::WorkgroupIndex)) { ctx.DefineWorkgroupIndex(); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index e16bba755..f373808d9 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -196,14 +196,15 @@ const VectorIds& GetAttributeType(EmitContext& ctx, AmdGpu::NumberFormat fmt) { } EmitContext::SpirvAttribute EmitContext::GetAttributeInfo(AmdGpu::NumberFormat fmt, Id id, - u32 num_components, bool output) { + u32 num_components, bool output, + bool loaded, bool array) { switch (GetNumberClass(fmt)) { case AmdGpu::NumberClass::Float: - return {id, output ? output_f32 : input_f32, F32[1], num_components, false}; + return {id, output ? output_f32 : input_f32, F32[1], num_components, false, loaded, array}; case AmdGpu::NumberClass::Uint: - return {id, output ? output_u32 : input_u32, U32[1], num_components, true}; + return {id, output ? output_u32 : input_u32, U32[1], num_components, true, loaded, array}; case AmdGpu::NumberClass::Sint: - return {id, output ? output_s32 : input_s32, S32[1], num_components, true}; + return {id, output ? output_s32 : input_s32, S32[1], num_components, true, loaded, array}; default: break; } @@ -298,33 +299,24 @@ void EmitContext::DefineBufferProperties() { } } -void EmitContext::DefineInterpolatedAttribs() { - if (!profile.needs_manual_interpolation) { +void EmitContext::DefineAmdPerVertexAttribs() { + if (!profile.supports_amd_shader_explicit_vertex_parameter) { return; } - // Iterate all input attributes, load them and manually interpolate. for (s32 i = 0; i < runtime_info.fs_info.num_inputs; i++) { const auto& input = runtime_info.fs_info.inputs[i]; - auto& params = input_params[i]; - if (input.is_flat || params.is_loaded) { + if (input.IsDefault() || info.fs_interpolation[i].primary != Qualifier::PerVertex) { continue; } - const Id p_array{OpLoad(TypeArray(F32[4], ConstU32(3U)), params.id)}; - const Id p0{OpCompositeExtract(F32[4], p_array, 0U)}; - const Id p1{OpCompositeExtract(F32[4], p_array, 1U)}; - const Id p2{OpCompositeExtract(F32[4], p_array, 2U)}; - const Id p10{OpFSub(F32[4], p1, p0)}; - const Id p20{OpFSub(F32[4], p2, p0)}; - const Id bary_coord{OpLoad(F32[3], IsLinear(info.interp_qualifiers[i]) - ? bary_coord_linear_id - : bary_coord_persp_id)}; - const Id bary_coord_y{OpCompositeExtract(F32[1], bary_coord, 1)}; - const Id bary_coord_z{OpCompositeExtract(F32[1], bary_coord, 2)}; - const Id p10_y{OpVectorTimesScalar(F32[4], p10, bary_coord_y)}; - const Id p20_z{OpVectorTimesScalar(F32[4], p20, bary_coord_z)}; - params.id = OpFAdd(F32[4], p0, OpFAdd(F32[4], p10_y, p20_z)); - Name(params.id, fmt::format("fs_in_attr{}", i)); - params.is_loaded = true; + auto& param = input_params[i]; + const Id pointer = param.id; + param.id_array[0] = + OpInterpolateAtVertexAMD(F32[param.num_components], pointer, ConstU32(0U)); + param.id_array[1] = + OpInterpolateAtVertexAMD(F32[param.num_components], pointer, ConstU32(1U)); + param.id_array[2] = + OpInterpolateAtVertexAMD(F32[param.num_components], pointer, ConstU32(2U)); + param.is_loaded = true; } } @@ -342,21 +334,6 @@ void EmitContext::DefineWorkgroupIndex() { Name(workgroup_index_id, "workgroup_index"); } -Id MakeDefaultValue(EmitContext& ctx, u32 default_value) { - switch (default_value) { - case 0: - return ctx.ConstF32(0.f, 0.f, 0.f, 0.f); - case 1: - return ctx.ConstF32(0.f, 0.f, 0.f, 1.f); - case 2: - return ctx.ConstF32(1.f, 1.f, 1.f, 0.f); - case 3: - return ctx.ConstF32(1.f, 1.f, 1.f, 1.f); - default: - UNREACHABLE(); - } -} - void EmitContext::DefineInputs() { if (info.uses_lane_id) { subgroup_local_invocation_id = DefineVariable( @@ -398,49 +375,71 @@ void EmitContext::DefineInputs() { front_facing = DefineVariable(U1[1], spv::BuiltIn::FrontFacing, spv::StorageClass::Input); } - if (profile.needs_manual_interpolation) { - if (info.has_perspective_interp) { - bary_coord_persp_id = + if (info.loads.GetAny(IR::Attribute::BaryCoordSmooth)) { + if (profile.supports_amd_shader_explicit_vertex_parameter) { + bary_coord_smooth = DefineVariable(F32[2], spv::BuiltIn::BaryCoordSmoothAMD, + spv::StorageClass::Input); + } else if (profile.supports_fragment_shader_barycentric) { + bary_coord_smooth = DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input); + } else { + bary_coord_smooth = ConstF32(0.f, 0.f); } - if (info.has_linear_interp) { - bary_coord_linear_id = DefineVariable(F32[3], spv::BuiltIn::BaryCoordNoPerspKHR, - spv::StorageClass::Input); + } + if (info.loads.GetAny(IR::Attribute::BaryCoordSmoothSample)) { + if (profile.supports_amd_shader_explicit_vertex_parameter) { + bary_coord_smooth_sample = DefineVariable( + F32[2], spv::BuiltIn::BaryCoordSmoothSampleAMD, spv::StorageClass::Input); + } else if (profile.supports_fragment_shader_barycentric) { + bary_coord_smooth_sample = + DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input); + // Decorate(bary_coord_smooth_sample, spv::Decoration::Sample); + } else { + bary_coord_smooth_sample = ConstF32(0.f, 0.f); + } + } + if (info.loads.GetAny(IR::Attribute::BaryCoordNoPersp)) { + if (profile.supports_amd_shader_explicit_vertex_parameter) { + bary_coord_nopersp = DefineVariable(F32[2], spv::BuiltIn::BaryCoordNoPerspAMD, + spv::StorageClass::Input); + } else if (profile.supports_fragment_shader_barycentric) { + bary_coord_nopersp = DefineVariable(F32[3], spv::BuiltIn::BaryCoordNoPerspKHR, + spv::StorageClass::Input); + } else { + bary_coord_nopersp = ConstF32(0.f, 0.f); } } for (s32 i = 0; i < runtime_info.fs_info.num_inputs; i++) { const auto& input = runtime_info.fs_info.inputs[i]; if (input.IsDefault()) { - input_params[i] = { - .id = MakeDefaultValue(*this, input.default_value), - .pointer_type = input_f32, - .component_type = F32[1], - .num_components = 4, - .is_integer = false, - .is_loaded = true, - }; continue; } - const IR::Attribute param{IR::Attribute::Param0 + i}; + const IR::Attribute param = IR::Attribute::Param0 + i; const u32 num_components = info.loads.NumComponents(param); - const Id type{F32[num_components]}; - Id attr_id{}; - if (profile.needs_manual_interpolation && !input.is_flat) { - attr_id = DefineInput(TypeArray(type, ConstU32(3U)), input.param_index); - Decorate(attr_id, spv::Decoration::PerVertexKHR); - Name(attr_id, fmt::format("fs_in_attr{}_p", i)); - } else { - attr_id = DefineInput(type, input.param_index); - Name(attr_id, fmt::format("fs_in_attr{}", i)); - - if (input.is_flat) { - Decorate(attr_id, spv::Decoration::Flat); - } else if (IsLinear(info.interp_qualifiers[i])) { - Decorate(attr_id, spv::Decoration::NoPerspective); + const auto [primary, auxiliary] = info.fs_interpolation[i]; + const Id type = F32[num_components]; + const Id attr_id = [&] { + if (primary == Qualifier::PerVertex && + profile.supports_fragment_shader_barycentric) { + return Name(DefineInput(TypeArray(type, ConstU32(3U)), input.param_index), + fmt::format("fs_in_attr{}_p", i)); } + return Name(DefineInput(type, input.param_index), fmt::format("fs_in_attr{}", i)); + }(); + if (primary == Qualifier::PerVertex) { + Decorate(attr_id, profile.supports_amd_shader_explicit_vertex_parameter + ? spv::Decoration::ExplicitInterpAMD + : spv::Decoration::PerVertexKHR); + } else if (primary != Qualifier::Smooth) { + Decorate(attr_id, primary == Qualifier::Flat ? spv::Decoration::Flat + : spv::Decoration::NoPerspective); } - input_params[i] = - GetAttributeInfo(AmdGpu::NumberFormat::Float, attr_id, num_components, false); + if (auxiliary != Qualifier::None) { + Decorate(attr_id, auxiliary == Qualifier::Centroid ? spv::Decoration::Centroid + : spv::Decoration::Sample); + } + input_params[i] = GetAttributeInfo(AmdGpu::NumberFormat::Float, attr_id, num_components, + false, false, primary == Qualifier::PerVertex); } break; case LogicalStage::Compute: @@ -461,17 +460,16 @@ void EmitContext::DefineInputs() { case LogicalStage::Geometry: { primitive_id = DefineVariable(U32[1], spv::BuiltIn::PrimitiveId, spv::StorageClass::Input); const auto gl_per_vertex = - Name(TypeStruct(TypeVector(F32[1], 4), F32[1], TypeArray(F32[1], ConstU32(1u))), - "gl_PerVertex"); + Name(TypeStruct(F32[4], F32[1], TypeArray(F32[1], ConstU32(1u))), "gl_PerVertex"); MemberName(gl_per_vertex, 0, "gl_Position"); MemberName(gl_per_vertex, 1, "gl_PointSize"); MemberName(gl_per_vertex, 2, "gl_ClipDistance"); MemberDecorate(gl_per_vertex, 0, spv::Decoration::BuiltIn, - static_cast(spv::BuiltIn::Position)); + static_cast(spv::BuiltIn::Position)); MemberDecorate(gl_per_vertex, 1, spv::Decoration::BuiltIn, - static_cast(spv::BuiltIn::PointSize)); + static_cast(spv::BuiltIn::PointSize)); MemberDecorate(gl_per_vertex, 2, spv::Decoration::BuiltIn, - static_cast(spv::BuiltIn::ClipDistance)); + static_cast(spv::BuiltIn::ClipDistance)); Decorate(gl_per_vertex, spv::Decoration::Block); const auto num_verts_in = NumVertices(runtime_info.gs_info.in_primitive); const auto vertices_in = TypeArray(gl_per_vertex, ConstU32(num_verts_in)); @@ -483,7 +481,8 @@ void EmitContext::DefineInputs() { const Id type{TypeArray(F32[4], ConstU32(num_verts_in))}; const Id id{DefineInput(type, param_id)}; Name(id, fmt::format("gs_in_attr{}", param_id)); - input_params[param_id] = {id, input_f32, F32[1], 4}; + input_params[param_id] = + GetAttributeInfo(AmdGpu::NumberFormat::Float, id, 4, false, false, true); } break; } @@ -665,7 +664,7 @@ void EmitContext::DefineOutputs() { for (u32 attr_id = 0; attr_id < info.gs_copy_data.num_attrs; attr_id++) { const Id id{DefineOutput(F32[4], attr_id)}; Name(id, fmt::format("out_attr{}", attr_id)); - output_params[attr_id] = {id, output_f32, F32[1], 4u}; + output_params[attr_id] = GetAttributeInfo(AmdGpu::NumberFormat::Float, id, 4, true); } break; } diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 186925706..f57dbebd8 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -45,7 +45,7 @@ public: Id Def(const IR::Value& value); void DefineBufferProperties(); - void DefineInterpolatedAttribs(); + void DefineAmdPerVertexAttribs(); void DefineWorkgroupIndex(); [[nodiscard]] Id DefineInput(Id type, std::optional location = std::nullopt, @@ -279,8 +279,9 @@ public: Id shared_memory_u32_type{}; Id shared_memory_u64_type{}; - Id bary_coord_persp_id{}; - Id bary_coord_linear_id{}; + Id bary_coord_smooth{}; + Id bary_coord_smooth_sample{}; + Id bary_coord_nopersp{}; struct TextureDefinition { const VectorIds* data_types; @@ -355,12 +356,16 @@ public: Id sampler_pointer_type{}; struct SpirvAttribute { - Id id; + union { + Id id; + std::array id_array; + }; Id pointer_type; Id component_type; u32 num_components; bool is_integer{}; bool is_loaded{}; + bool is_array{}; }; Id input_attr_array; Id output_attr_array; @@ -390,7 +395,7 @@ private: void DefineFunctions(); SpirvAttribute GetAttributeInfo(AmdGpu::NumberFormat fmt, Id id, u32 num_components, - bool output); + bool output, bool loaded = false, bool array = false); BufferSpv DefineBuffer(bool is_storage, bool is_written, u32 elem_shift, BufferType buffer_type, Id data_type); diff --git a/src/shader_recompiler/frontend/translate/translate.cpp b/src/shader_recompiler/frontend/translate/translate.cpp index 310ac9156..578c1f96a 100644 --- a/src/shader_recompiler/frontend/translate/translate.cpp +++ b/src/shader_recompiler/frontend/translate/translate.cpp @@ -21,50 +21,39 @@ namespace Shader::Gcn { -Translator::Translator(Info& info_, const RuntimeInfo& runtime_info_, const Profile& profile_) - : info{info_}, runtime_info{runtime_info_}, profile{profile_}, - next_vgpr_num{runtime_info.num_allocated_vgprs} { - if (info.l_stage == LogicalStage::Fragment) { - dst_frag_vreg = GatherInterpQualifiers(); +static IR::VectorReg IterateBarycentrics(const RuntimeInfo& runtime_info, auto&& set_attribute) { + if (runtime_info.stage != Stage::Fragment) { + return IR::VectorReg::V0; } -} - -IR::VectorReg Translator::GatherInterpQualifiers() { u32 dst_vreg{}; if (runtime_info.fs_info.addr_flags.persp_sample_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveSample; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveSample; // J - info.has_perspective_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmoothSample, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmoothSample, 1); // J } if (runtime_info.fs_info.addr_flags.persp_center_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveCenter; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveCenter; // J - info.has_perspective_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmooth, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmooth, 1); // J } if (runtime_info.fs_info.addr_flags.persp_centroid_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveCentroid; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::PerspectiveCentroid; // J - info.has_perspective_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmoothCentroid, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordSmoothCentroid, 1); // J } if (runtime_info.fs_info.addr_flags.persp_pull_model_ena) { - ++dst_vreg; // I/W - ++dst_vreg; // J/W - ++dst_vreg; // 1/W + set_attribute(dst_vreg++, IR::Attribute::BaryCoordPullModel, 0); // I/W + set_attribute(dst_vreg++, IR::Attribute::BaryCoordPullModel, 1); // J/W + set_attribute(dst_vreg++, IR::Attribute::BaryCoordPullModel, 2); // 1/W } if (runtime_info.fs_info.addr_flags.linear_sample_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearSample; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearSample; // J - info.has_linear_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPerspSample, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPerspSample, 1); // J } if (runtime_info.fs_info.addr_flags.linear_center_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearCenter; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearCenter; // J - info.has_linear_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPersp, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPersp, 1); // J } if (runtime_info.fs_info.addr_flags.linear_centroid_ena) { - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearCentroid; // I - vgpr_to_interp[dst_vreg++] = IR::Interpolation::LinearCentroid; // J - info.has_linear_interp = true; + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPerspCentroid, 0); // I + set_attribute(dst_vreg++, IR::Attribute::BaryCoordNoPerspCentroid, 1); // J } if (runtime_info.fs_info.addr_flags.line_stipple_tex_ena) { ++dst_vreg; @@ -72,6 +61,14 @@ IR::VectorReg Translator::GatherInterpQualifiers() { return IR::VectorReg(dst_vreg); } +Translator::Translator(Info& info_, const RuntimeInfo& runtime_info_, const Profile& profile_) + : info{info_}, runtime_info{runtime_info_}, profile{profile_}, + next_vgpr_num{runtime_info.num_allocated_vgprs} { + IterateBarycentrics(runtime_info, [this](u32 vreg, IR::Attribute attrib, u32) { + vgpr_to_interp[vreg] = attrib; + }); +} + void Translator::EmitPrologue(IR::Block* first_block) { ir = IR::IREmitter(*first_block, first_block->begin()); @@ -127,7 +124,10 @@ void Translator::EmitPrologue(IR::Block* first_block) { } break; case LogicalStage::Fragment: - dst_vreg = dst_frag_vreg; + dst_vreg = + IterateBarycentrics(runtime_info, [this](u32 vreg, IR::Attribute attrib, u32 comp) { + ir.SetVectorReg(IR::VectorReg(vreg), ir.GetAttribute(attrib, comp)); + }); if (runtime_info.fs_info.addr_flags.pos_x_float_ena) { if (runtime_info.fs_info.en_flags.pos_x_float_ena) { ir.SetVectorReg(dst_vreg++, ir.GetAttribute(IR::Attribute::FragCoord, 0)); @@ -151,7 +151,8 @@ void Translator::EmitPrologue(IR::Block* first_block) { } if (runtime_info.fs_info.addr_flags.pos_w_float_ena) { if (runtime_info.fs_info.en_flags.pos_w_float_ena) { - ir.SetVectorReg(dst_vreg++, ir.GetAttribute(IR::Attribute::FragCoord, 3)); + ir.SetVectorReg(dst_vreg++, + ir.FPRecip(ir.GetAttribute(IR::Attribute::FragCoord, 3))); } else { ir.SetVectorReg(dst_vreg++, ir.Imm32(0.0f)); } diff --git a/src/shader_recompiler/frontend/translate/translate.h b/src/shader_recompiler/frontend/translate/translate.h index 4b5ff827b..a29bdc993 100644 --- a/src/shader_recompiler/frontend/translate/translate.h +++ b/src/shader_recompiler/frontend/translate/translate.h @@ -265,6 +265,7 @@ public: // Vector interpolation // VINTRP + void V_INTERP_P1_F32(const GcnInst& inst); void V_INTERP_P2_F32(const GcnInst& inst); void V_INTERP_MOV_F32(const GcnInst& inst); @@ -323,7 +324,6 @@ private: void LogMissingOpcode(const GcnInst& inst); IR::VectorReg GetScratchVgpr(u32 offset); - IR::VectorReg GatherInterpQualifiers(); private: IR::IREmitter ir; @@ -332,8 +332,7 @@ private: const Profile& profile; u32 next_vgpr_num; std::unordered_map vgpr_map; - std::array vgpr_to_interp{}; - IR::VectorReg dst_frag_vreg{}; + std::array vgpr_to_interp{}; bool opcode_missing = false; }; diff --git a/src/shader_recompiler/frontend/translate/vector_interpolation.cpp b/src/shader_recompiler/frontend/translate/vector_interpolation.cpp index 5a287dbe2..c32e80815 100644 --- a/src/shader_recompiler/frontend/translate/vector_interpolation.cpp +++ b/src/shader_recompiler/frontend/translate/vector_interpolation.cpp @@ -5,11 +5,32 @@ namespace Shader::Gcn { +using Interpolation = Info::Interpolation; + +static Interpolation GetInterpolation(IR::Attribute attribute) { + switch (attribute) { + case IR::Attribute::BaryCoordNoPersp: + return {Qualifier::NoPerspective, Qualifier::None}; + case IR::Attribute::BaryCoordNoPerspCentroid: + return {Qualifier::NoPerspective, Qualifier::Centroid}; + case IR::Attribute::BaryCoordNoPerspSample: + return {Qualifier::NoPerspective, Qualifier::Sample}; + case IR::Attribute::BaryCoordSmooth: + return {Qualifier::Smooth, Qualifier::None}; + case IR::Attribute::BaryCoordSmoothCentroid: + return {Qualifier::Smooth, Qualifier::Centroid}; + case IR::Attribute::BaryCoordSmoothSample: + return {Qualifier::Smooth, Qualifier::Sample}; + default: + UNREACHABLE_MSG("Unhandled barycentric attribute {}", NameOf(attribute)); + } +} + void Translator::EmitVectorInterpolation(const GcnInst& inst) { switch (inst.opcode) { // VINTRP case Opcode::V_INTERP_P1_F32: - return; + return V_INTERP_P1_F32(inst); case Opcode::V_INTERP_P2_F32: return V_INTERP_P2_F32(inst); case Opcode::V_INTERP_MOV_F32: @@ -21,19 +42,57 @@ void Translator::EmitVectorInterpolation(const GcnInst& inst) { // VINTRP +void Translator::V_INTERP_P1_F32(const GcnInst& inst) { + if (!profile.needs_manual_interpolation) { + return; + } + // VDST = P10 * VSRC + P0 + const u32 attr_index = inst.control.vintrp.attr; + const IR::Attribute attrib = IR::Attribute::Param0 + attr_index; + const IR::F32 p0 = ir.GetAttribute(attrib, inst.control.vintrp.chan, 0); + const IR::F32 p1 = ir.GetAttribute(attrib, inst.control.vintrp.chan, 1); + const IR::F32 i = GetSrc(inst.src[0]); + const IR::F32 result = ir.FPFma(ir.FPSub(p1, p0), i, p0); + SetDst(inst.dst[0], result); +} + void Translator::V_INTERP_P2_F32(const GcnInst& inst) { const u32 attr_index = inst.control.vintrp.attr; - const auto& attr = runtime_info.fs_info.inputs.at(attr_index); - info.interp_qualifiers[attr_index] = vgpr_to_interp[inst.src[0].code]; - const IR::Attribute attrib{IR::Attribute::Param0 + attr_index}; - SetDst(inst.dst[0], ir.GetAttribute(attrib, inst.control.vintrp.chan)); + const IR::Attribute attrib = IR::Attribute::Param0 + attr_index; + const auto& attr = runtime_info.fs_info.inputs[attr_index]; + auto& interp = info.fs_interpolation[attr_index]; + ASSERT(!attr.IsDefault() && !attr.is_flat); + if (!profile.needs_manual_interpolation) { + interp = GetInterpolation(vgpr_to_interp[inst.src[0].code]); + SetDst(inst.dst[0], ir.GetAttribute(attrib, inst.control.vintrp.chan)); + return; + } + // VDST = P20 * VSRC + VDST + const IR::F32 p0 = ir.GetAttribute(attrib, inst.control.vintrp.chan, 0); + const IR::F32 p2 = ir.GetAttribute(attrib, inst.control.vintrp.chan, 2); + const IR::F32 j = GetSrc(inst.src[0]); + const IR::F32 result = ir.FPFma(ir.FPSub(p2, p0), j, GetSrc(inst.dst[0])); + interp.primary = Qualifier::PerVertex; + SetDst(inst.dst[0], result); } void Translator::V_INTERP_MOV_F32(const GcnInst& inst) { const u32 attr_index = inst.control.vintrp.attr; - const auto& attr = runtime_info.fs_info.inputs.at(attr_index); - const IR::Attribute attrib{IR::Attribute::Param0 + attr_index}; - SetDst(inst.dst[0], ir.GetAttribute(attrib, inst.control.vintrp.chan)); + const IR::Attribute attrib = IR::Attribute::Param0 + attr_index; + const auto& attr = runtime_info.fs_info.inputs[attr_index]; + auto& interp = info.fs_interpolation[attr_index]; + ASSERT(attr.is_flat); + if (profile.supports_amd_shader_explicit_vertex_parameter || + (profile.supports_fragment_shader_barycentric && + !profile.has_incomplete_fragment_shader_barycentric)) { + // VSRC 0=P10, 1=P20, 2=P0 + interp.primary = Qualifier::PerVertex; + SetDst(inst.dst[0], + ir.GetAttribute(attrib, inst.control.vintrp.chan, (inst.src[0].code + 1) % 3)); + } else { + interp.primary = Qualifier::Flat; + SetDst(inst.dst[0], ir.GetAttribute(attrib, inst.control.vintrp.chan)); + } } } // namespace Shader::Gcn diff --git a/src/shader_recompiler/info.h b/src/shader_recompiler/info.h index 6e12c6816..bb5c88584 100644 --- a/src/shader_recompiler/info.h +++ b/src/shader_recompiler/info.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later + #pragma once #include @@ -135,6 +136,16 @@ struct PushData { static_assert(sizeof(PushData) <= 128, "PushData size is greater than minimum size guaranteed by Vulkan spec"); +enum class Qualifier : u8 { + None, + Smooth, + NoPerspective, + PerVertex, + Flat, + Centroid, + Sample, +}; + /** * Contains general information generated by the shader recompiler for an input program. */ @@ -194,7 +205,11 @@ struct Info { PersistentSrtInfo srt_info; std::vector flattened_ud_buf; - std::array interp_qualifiers{}; + struct Interpolation { + Qualifier primary; + Qualifier auxiliary; + }; + std::array fs_interpolation{}; IR::ScalarReg tess_consts_ptr_base = IR::ScalarReg::Max; s32 tess_consts_dword_offset = -1; @@ -209,8 +224,6 @@ struct Info { bool has_discard{}; bool has_image_gather{}; bool has_image_query{}; - bool has_perspective_interp{}; - bool has_linear_interp{}; bool uses_buffer_atomic_float_min_max{}; bool uses_image_atomic_float_min_max{}; bool uses_lane_id{}; diff --git a/src/shader_recompiler/ir/attribute.cpp b/src/shader_recompiler/ir/attribute.cpp index b2f11d141..094c34ee8 100644 --- a/src/shader_recompiler/ir/attribute.cpp +++ b/src/shader_recompiler/ir/attribute.cpp @@ -130,6 +130,20 @@ std::string NameOf(Attribute attribute) { return "LocalInvocationIndex"; case Attribute::FragCoord: return "FragCoord"; + case Attribute::BaryCoordNoPersp: + return "BaryCoordNoPersp"; + case Attribute::BaryCoordNoPerspCentroid: + return "BaryCoordNoPerspCentroid"; + case Attribute::BaryCoordNoPerspSample: + return "BaryCoordNoPerspSample"; + case Attribute::BaryCoordSmooth: + return "BaryCoordSmooth"; + case Attribute::BaryCoordSmoothCentroid: + return "BaryCoordSmoothCentroid"; + case Attribute::BaryCoordSmoothSample: + return "BaryCoordSmoothSample"; + case Attribute::BaryCoordPullModel: + return "BaryCoordPullModel"; case Attribute::InvocationId: return "InvocationId"; case Attribute::PatchVertices: diff --git a/src/shader_recompiler/ir/attribute.h b/src/shader_recompiler/ir/attribute.h index b6b1c8b59..00ec6c4b3 100644 --- a/src/shader_recompiler/ir/attribute.h +++ b/src/shader_recompiler/ir/attribute.h @@ -73,24 +73,21 @@ enum class Attribute : u64 { LocalInvocationId = 76, LocalInvocationIndex = 77, FragCoord = 78, - InvocationId = 81, // TCS id in output patch and instanced geometry shader id - PatchVertices = 82, - TessellationEvaluationPointU = 83, - TessellationEvaluationPointV = 84, - PackedHullInvocationInfo = 85, // contains patch id within the VGT and invocation ID + BaryCoordNoPersp = 79, + BaryCoordNoPerspCentroid = 80, + BaryCoordNoPerspSample = 81, + BaryCoordSmooth = 82, + BaryCoordSmoothCentroid = 83, + BaryCoordSmoothSample = 84, + BaryCoordPullModel = 85, + InvocationId = 86, // TCS id in output patch and instanced geometry shader id + PatchVertices = 87, + TessellationEvaluationPointU = 88, + TessellationEvaluationPointV = 89, + PackedHullInvocationInfo = 90, // contains patch id within the VGT and invocation ID Max, }; -enum class Interpolation { - Invalid = 0, - PerspectiveSample = 1, - PerspectiveCenter = 2, - PerspectiveCentroid = 3, - LinearSample = 4, - LinearCenter = 5, - LinearCentroid = 6, -}; - constexpr size_t NumAttributes = static_cast(Attribute::Max); constexpr size_t NumRenderTargets = 8; constexpr size_t NumParams = 32; @@ -112,13 +109,8 @@ constexpr bool IsMrt(Attribute attribute) noexcept { return attribute >= Attribute::RenderTarget0 && attribute <= Attribute::RenderTarget7; } -constexpr bool IsLinear(Interpolation interp) noexcept { - return interp >= Interpolation::LinearSample && interp <= Interpolation::LinearCentroid; -} - -constexpr bool IsPerspective(Interpolation interp) noexcept { - return interp >= Interpolation::PerspectiveSample && - interp <= Interpolation::PerspectiveCentroid; +constexpr bool IsBarycentricCoord(Attribute attribute) noexcept { + return attribute >= Attribute::BaryCoordSmooth && attribute <= Attribute::BaryCoordSmoothSample; } [[nodiscard]] std::string NameOf(Attribute attribute); diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index ad36a2e13..d57e18ff0 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -10,16 +10,10 @@ namespace Shader { struct Profile { u32 supported_spirv{0x00010000}; u32 subgroup_size{}; - bool unified_descriptor_binding{}; - bool support_descriptor_aliasing{}; bool support_int8{}; bool support_int16{}; bool support_int64{}; bool support_float64{}; - bool support_vertex_instance_id{}; - bool support_float_controls{}; - bool support_separate_denorm_behavior{}; - bool support_separate_rounding_mode{}; bool support_fp32_denorm_preserve{}; bool support_fp32_denorm_flush{}; bool support_fp32_round_to_zero{}; @@ -33,6 +27,9 @@ struct Profile { bool supports_buffer_int64_atomics{}; bool supports_shared_int64_atomics{}; bool supports_workgroup_explicit_memory_layout{}; + bool supports_amd_shader_explicit_vertex_parameter{}; + bool supports_fragment_shader_barycentric{}; + bool has_incomplete_fragment_shader_barycentric{}; bool has_broken_spirv_clamp{}; bool lower_left_origin_mode{}; bool needs_manual_interpolation{}; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 3c8332c10..4d89c83b2 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -137,7 +137,8 @@ GraphicsPipeline::GraphicsPipeline( const vk::PipelineMultisampleStateCreateInfo multisampling = { .rasterizationSamples = LiverpoolToVK::NumSamples(key.num_samples, instance.GetFramebufferSampleCounts()), - .sampleShadingEnable = false, + .sampleShadingEnable = + fs_info.addr_flags.persp_sample_ena || fs_info.addr_flags.linear_sample_ena, }; const vk::PipelineViewportDepthClipControlCreateInfoEXT clip_control = { diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index c0b138fad..119c0a367 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -273,7 +273,12 @@ bool Instance::CreateDevice() { depth_clip_enable = add_extension(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME); vertex_input_dynamic_state = add_extension(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); list_restart = add_extension(VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME); - fragment_shader_barycentric = add_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); + amd_shader_explicit_vertex_parameter = + add_extension(VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME); + if (!amd_shader_explicit_vertex_parameter) { + fragment_shader_barycentric = + add_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME); + } legacy_vertex_attributes = add_extension(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME); provoking_vertex = add_extension(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME); shader_stencil_export = add_extension(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME); diff --git a/src/video_core/renderer_vulkan/vk_instance.h b/src/video_core/renderer_vulkan/vk_instance.h index d96abfabe..9be2d9520 100644 --- a/src/video_core/renderer_vulkan/vk_instance.h +++ b/src/video_core/renderer_vulkan/vk_instance.h @@ -145,6 +145,11 @@ public: return fragment_shader_barycentric; } + /// Returns true when VK_AMD_shader_explicit_vertex_parameter is supported. + bool IsAmdShaderExplicitVertexParameterSupported() const { + return amd_shader_explicit_vertex_parameter; + } + /// Returns true when VK_EXT_primitive_topology_list_restart is supported. bool IsListRestartSupported() const { return list_restart; @@ -413,6 +418,7 @@ private: u32 queue_family_index{0}; bool custom_border_color{}; bool fragment_shader_barycentric{}; + bool amd_shader_explicit_vertex_parameter{}; bool depth_clip_control{}; bool depth_clip_enable{}; bool depth_range_unrestricted{}; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 31ede7936..4de8fd73b 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -220,6 +220,12 @@ PipelineCache::PipelineCache(const Instance& instance_, Scheduler& scheduler_, .supports_shared_int64_atomics = instance_.IsSharedInt64AtomicsSupported(), .supports_workgroup_explicit_memory_layout = instance_.IsWorkgroupMemoryExplicitLayoutSupported(), + .supports_amd_shader_explicit_vertex_parameter = + instance_.IsAmdShaderExplicitVertexParameterSupported(), + .supports_fragment_shader_barycentric = instance_.IsFragmentShaderBarycentricSupported(), + .has_incomplete_fragment_shader_barycentric = + instance_.IsFragmentShaderBarycentricSupported() && + instance.GetDriverID() == vk::DriverId::eMoltenvk, .needs_manual_interpolation = instance.IsFragmentShaderBarycentricSupported() && instance.GetDriverID() == vk::DriverId::eNvidiaProprietary, .needs_lds_barriers = instance.GetDriverID() == vk::DriverId::eNvidiaProprietary || From 6d6068e0e292e7457c3c55802f7dc4cccef1e226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Tue, 15 Jul 2025 20:39:37 +0200 Subject: [PATCH 08/21] Fix ff1_i32_b64 not accepting vcc as its argument (#3251) --- .../frontend/translate/scalar_alu.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/shader_recompiler/frontend/translate/scalar_alu.cpp b/src/shader_recompiler/frontend/translate/scalar_alu.cpp index e3134c300..bb685d4bf 100644 --- a/src/shader_recompiler/frontend/translate/scalar_alu.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_alu.cpp @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include "common/assert.h" #include "shader_recompiler/frontend/translate/translate.h" @@ -680,9 +681,18 @@ void Translator::S_FF1_I32_B32(const GcnInst& inst) { } void Translator::S_FF1_I32_B64(const GcnInst& inst) { - ASSERT(inst.src[0].field == OperandField::ScalarGPR); - const IR::U32 result{ - ir.BallotFindLsb(ir.Ballot(ir.GetThreadBitScalarReg(IR::ScalarReg(inst.src[0].code))))}; + const auto src = [&] { + switch (inst.src[0].field) { + case OperandField::ScalarGPR: + return ir.GetThreadBitScalarReg(IR::ScalarReg(inst.src[0].code)); + case OperandField::VccLo: + return ir.GetVcc(); + default: + UNREACHABLE_MSG("unhandled operand type {}", magic_enum::enum_name(inst.src[0].field)); + } + }(); + const IR::U32 result{ir.BallotFindLsb(ir.Ballot(src))}; + SetDst(inst.dst[0], result); } From 83475ac8280f9cffd573701abe5b3d3f1f31b3d4 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Tue, 15 Jul 2025 22:55:57 +0300 Subject: [PATCH 09/21] attribute: Correct bary coord function (#3253) --- src/shader_recompiler/ir/attribute.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shader_recompiler/ir/attribute.h b/src/shader_recompiler/ir/attribute.h index 00ec6c4b3..58f28fb81 100644 --- a/src/shader_recompiler/ir/attribute.h +++ b/src/shader_recompiler/ir/attribute.h @@ -110,7 +110,8 @@ constexpr bool IsMrt(Attribute attribute) noexcept { } constexpr bool IsBarycentricCoord(Attribute attribute) noexcept { - return attribute >= Attribute::BaryCoordSmooth && attribute <= Attribute::BaryCoordSmoothSample; + return attribute >= Attribute::BaryCoordNoPersp && + attribute <= Attribute::BaryCoordSmoothSample; } [[nodiscard]] std::string NameOf(Attribute attribute); From a82698d60103b561385fb56a148eaa1dd8c12bc2 Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Tue, 15 Jul 2025 18:15:59 -0300 Subject: [PATCH 10/21] qt: fix gui emulatorLanguage (#3250) --- src/qt_gui/settings_dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index ed2a17e25..f903562f9 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -437,7 +437,7 @@ void SettingsDialog::LoadValuesFromConfig() { toml::find_or(data, "Settings", "consoleLanguage", 6))) % languageIndexes.size()); ui->emulatorLanguageComboBox->setCurrentIndex( - languages[toml::find_or(data, "GUI", "emulatorLanguage", "en_US")]); + languages[m_gui_settings->GetValue(gui::gen_guiLanguage).toString().toStdString()]); ui->hideCursorComboBox->setCurrentIndex(toml::find_or(data, "Input", "cursorState", 1)); OnCursorStateChanged(toml::find_or(data, "Input", "cursorState", 1)); ui->idleTimeoutSpinBox->setValue(toml::find_or(data, "Input", "cursorHideTimeout", 5)); From 6e350a50852fc6c39029d383064e2fa32c472168 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Wed, 16 Jul 2025 01:28:03 +0300 Subject: [PATCH 11/21] Avoid clearing HTILE when shader contains address calculation (#3252) * resource_tracking: Mark image as written when its used with atomics * texture_cache: Remove meta registered flag Mostly useless and it is possible for images to switch metas * vk_rasterizer: Use xor as heuristic for HTILE clear --- src/shader_recompiler/frontend/instruction.h | 2 -- src/shader_recompiler/info.h | 1 + .../ir/passes/resource_tracking_pass.cpp | 5 +-- .../ir/passes/shader_info_collection_pass.cpp | 3 ++ .../renderer_vulkan/vk_rasterizer.cpp | 19 +++++++--- src/video_core/texture_cache/image.h | 7 ++-- .../texture_cache/texture_cache.cpp | 36 ++++++++----------- src/video_core/texture_cache/texture_cache.h | 4 +++ 8 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/shader_recompiler/frontend/instruction.h b/src/shader_recompiler/frontend/instruction.h index 7c2e0bd1e..f4e7bc9f2 100644 --- a/src/shader_recompiler/frontend/instruction.h +++ b/src/shader_recompiler/frontend/instruction.h @@ -3,8 +3,6 @@ #pragma once -#include -#include "common/bit_field.h" #include "shader_recompiler/frontend/opcodes.h" namespace Shader::Gcn { diff --git a/src/shader_recompiler/info.h b/src/shader_recompiler/info.h index bb5c88584..11dd9c05e 100644 --- a/src/shader_recompiler/info.h +++ b/src/shader_recompiler/info.h @@ -222,6 +222,7 @@ struct Info { VAddr pgm_base; bool has_storage_images{}; bool has_discard{}; + bool has_bitwise_xor{}; bool has_image_gather{}; bool has_image_query{}; bool uses_buffer_atomic_float_min_max{}; diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index e5a4beb8b..2cf39c98e 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -455,11 +455,12 @@ void PatchImageSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& // Read image sharp. const auto tsharp = TrackSharp(tsharp_handle, info); const auto inst_info = inst.Flags(); - const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite; + const bool is_atomic = IsImageAtomicInstruction(inst); + const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite || is_atomic; const ImageResource image_res = { .sharp_idx = tsharp, .is_depth = bool(inst_info.is_depth), - .is_atomic = IsImageAtomicInstruction(inst), + .is_atomic = is_atomic, .is_array = bool(inst_info.is_array), .is_written = is_written, .is_r128 = bool(inst_info.is_r128), diff --git a/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp b/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp index 079827866..8f0e61da2 100644 --- a/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp +++ b/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp @@ -95,6 +95,9 @@ void Visit(Info& info, const IR::Inst& inst) { case IR::Opcode::DiscardCond: info.has_discard = true; break; + case IR::Opcode::BitwiseXor32: + info.has_bitwise_xor = true; + break; case IR::Opcode::ImageGather: case IR::Opcode::ImageGatherDref: info.has_image_gather = true; diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index b6130e873..c5f894b10 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -503,9 +503,13 @@ bool Rasterizer::IsComputeMetaClear(const Pipeline* pipeline) { return false; } + // Most of the time when a metadata is updated with a shader it gets cleared. It means + // we can skip the whole dispatch and update the tracked state instead. Also, it is not + // intended to be consumed and in such rare cases (e.g. HTile introspection, CRAA) we + // will need its full emulation anyways. const auto& info = pipeline->GetStage(Shader::LogicalStage::Compute); - // Assume if a shader reads and writes metas at the same time, it is a copy shader. + // Assume if a shader reads metadata, it is a copy shader. for (const auto& desc : info.buffers) { const VAddr address = desc.GetSharp(info).base_address; if (!desc.IsSpecial() && !desc.is_written && texture_cache.IsMeta(address)) { @@ -513,10 +517,15 @@ bool Rasterizer::IsComputeMetaClear(const Pipeline* pipeline) { } } - // Most of the time when a metadata is updated with a shader it gets cleared. It means - // we can skip the whole dispatch and update the tracked state instead. Also, it is not - // intended to be consumed and in such rare cases (e.g. HTile introspection, CRAA) we - // will need its full emulation anyways. + // Metadata surfaces are tiled and thus need address calculation to be written properly. + // If a shader wants to encode HTILE, for example, from a depth image it will have to compute + // proper tile address from dispatch invocation id. This address calculation contains an xor + // operation so use it as a heuristic for metadata writes that are probably not clears. + if (info.has_bitwise_xor) { + return false; + } + + // Assume if a shader writes metadata without address calculation, it is a clear shader. for (const auto& desc : info.buffers) { const VAddr address = desc.GetSharp(info).base_address; if (!desc.IsSpecial() && desc.is_written && texture_cache.ClearMeta(address)) { diff --git a/src/video_core/texture_cache/image.h b/src/video_core/texture_cache/image.h index 31b67e021..2dbaff053 100644 --- a/src/video_core/texture_cache/image.h +++ b/src/video_core/texture_cache/image.h @@ -27,10 +27,9 @@ enum ImageFlagBits : u32 { CpuDirty = 1 << 1, ///< Contents have been modified from the CPU GpuDirty = 1 << 2, ///< Contents have been modified from the GPU (valid data in buffer cache) Dirty = MaybeCpuDirty | CpuDirty | GpuDirty, - GpuModified = 1 << 3, ///< Contents have been modified from the GPU - Registered = 1 << 6, ///< True when the image is registered - Picked = 1 << 7, ///< Temporary flag to mark the image as picked - MetaRegistered = 1 << 8, ///< True when metadata for this surface is known and registered + GpuModified = 1 << 3, ///< Contents have been modified from the GPU + Registered = 1 << 6, ///< True when the image is registered + Picked = 1 << 7, ///< Temporary flag to mark the image as picked }; DECLARE_ENUM_FLAG_OPERATORS(ImageFlagBits) diff --git a/src/video_core/texture_cache/texture_cache.cpp b/src/video_core/texture_cache/texture_cache.cpp index 723b95892..a6657d8d9 100644 --- a/src/video_core/texture_cache/texture_cache.cpp +++ b/src/video_core/texture_cache/texture_cache.cpp @@ -508,20 +508,16 @@ ImageView& TextureCache::FindRenderTarget(BaseDesc& desc) { UpdateImage(image_id); // Register meta data for this color buffer - if (!(image.flags & ImageFlagBits::MetaRegistered)) { - if (desc.info.meta_info.cmask_addr) { - surface_metas.emplace(desc.info.meta_info.cmask_addr, - MetaDataInfo{.type = MetaDataInfo::Type::CMask}); - image.info.meta_info.cmask_addr = desc.info.meta_info.cmask_addr; - image.flags |= ImageFlagBits::MetaRegistered; - } + if (desc.info.meta_info.cmask_addr) { + surface_metas.emplace(desc.info.meta_info.cmask_addr, + MetaDataInfo{.type = MetaDataInfo::Type::CMask}); + image.info.meta_info.cmask_addr = desc.info.meta_info.cmask_addr; + } - if (desc.info.meta_info.fmask_addr) { - surface_metas.emplace(desc.info.meta_info.fmask_addr, - MetaDataInfo{.type = MetaDataInfo::Type::FMask}); - image.info.meta_info.fmask_addr = desc.info.meta_info.fmask_addr; - image.flags |= ImageFlagBits::MetaRegistered; - } + if (desc.info.meta_info.fmask_addr) { + surface_metas.emplace(desc.info.meta_info.fmask_addr, + MetaDataInfo{.type = MetaDataInfo::Type::FMask}); + image.info.meta_info.fmask_addr = desc.info.meta_info.fmask_addr; } return RegisterImageView(image_id, desc.view_info); @@ -536,15 +532,11 @@ ImageView& TextureCache::FindDepthTarget(BaseDesc& desc) { UpdateImage(image_id); // Register meta data for this depth buffer - if (!(image.flags & ImageFlagBits::MetaRegistered)) { - if (desc.info.meta_info.htile_addr) { - surface_metas.emplace( - desc.info.meta_info.htile_addr, - MetaDataInfo{.type = MetaDataInfo::Type::HTile, - .clear_mask = image.info.meta_info.htile_clear_mask}); - image.info.meta_info.htile_addr = desc.info.meta_info.htile_addr; - image.flags |= ImageFlagBits::MetaRegistered; - } + if (desc.info.meta_info.htile_addr) { + surface_metas.emplace(desc.info.meta_info.htile_addr, + MetaDataInfo{.type = MetaDataInfo::Type::HTile, + .clear_mask = image.info.meta_info.htile_clear_mask}); + image.info.meta_info.htile_addr = desc.info.meta_info.htile_addr; } // If there is a stencil attachment, link depth and stencil. diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index ff8ffb61c..9a9679c0a 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -161,10 +161,12 @@ public: /// Registers an image view for provided image ImageView& RegisterImageView(ImageId image_id, const ImageViewInfo& view_info); + /// Returns true if the specified address is a metadata surface. bool IsMeta(VAddr address) const { return surface_metas.contains(address); } + /// Returns true if a slice of the specified metadata surface has been cleared. bool IsMetaCleared(VAddr address, u32 slice) const { const auto& it = surface_metas.find(address); if (it != surface_metas.end()) { @@ -173,6 +175,7 @@ public: return false; } + /// Clears all slices of the specified metadata surface. bool ClearMeta(VAddr address) { auto it = surface_metas.find(address); if (it != surface_metas.end()) { @@ -182,6 +185,7 @@ public: return false; } + /// Updates the state of a slice of the specified metadata surface. bool TouchMeta(VAddr address, u32 slice, bool is_clear) { auto it = surface_metas.find(address); if (it != surface_metas.end()) { From cf8a6efd3716ba9130e221767a88d2e542241005 Mon Sep 17 00:00:00 2001 From: TheTurtle Date: Wed, 16 Jul 2025 01:54:56 +0300 Subject: [PATCH 12/21] liverpool_to_vk: Don't use remapped format for clear value (#3254) --- src/video_core/amdgpu/liverpool.h | 1 - src/video_core/renderer_vulkan/liverpool_to_vk.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index c517285fb..d693a0a38 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -1009,7 +1009,6 @@ struct Liverpool { return RemapSwizzle(info.format, mrt_swizzle); } - private: [[nodiscard]] NumberFormat GetFixedNumberFormat() const { // There is a small difference between T# and CB number types, account for it. return info.number_type == NumberFormat::SnormNz ? NumberFormat::Srgb diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index fd1a91260..cd597e16c 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -807,8 +807,8 @@ vk::Format DepthFormat(DepthBuffer::ZFormat z_format, DepthBuffer::StencilFormat vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color_buffer) { const auto comp_swizzle = color_buffer.Swizzle(); - const auto format = color_buffer.GetDataFmt(); - const auto number_type = color_buffer.GetNumberFmt(); + const auto format = color_buffer.info.format.Value(); + const auto number_type = color_buffer.GetFixedNumberFormat(); const auto& c0 = color_buffer.clear_word0; const auto& c1 = color_buffer.clear_word1; From 499451bb8089e536edd6ae90f8e16517bc562e85 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:23:03 +0200 Subject: [PATCH 13/21] Standardize RegisterLib names for HLE libraries (#3234) --- src/core/libraries/ajm/ajm.cpp | 2 +- src/core/libraries/ajm/ajm.h | 2 +- .../libraries/app_content/app_content.cpp | 2 +- src/core/libraries/app_content/app_content.h | 2 +- src/core/libraries/audio/audioin.cpp | 2 +- src/core/libraries/audio/audioin.h | 2 +- src/core/libraries/audio/audioout.cpp | 2 +- src/core/libraries/audio/audioout.h | 2 +- src/core/libraries/audio3d/audio3d.cpp | 2 +- src/core/libraries/audio3d/audio3d.h | 2 +- src/core/libraries/avplayer/avplayer.cpp | 2 +- src/core/libraries/avplayer/avplayer.h | 2 +- src/core/libraries/camera/camera.cpp | 2 +- src/core/libraries/camera/camera.h | 2 +- .../libraries/companion/companion_httpd.cpp | 2 +- .../libraries/companion/companion_httpd.h | 2 +- .../libraries/companion/companion_util.cpp | 2 +- src/core/libraries/companion/companion_util.h | 2 +- src/core/libraries/disc_map/disc_map.cpp | 2 +- src/core/libraries/disc_map/disc_map.h | 2 +- src/core/libraries/fiber/fiber.cpp | 2 +- src/core/libraries/fiber/fiber.h | 2 +- .../game_live_streaming/gamelivestreaming.cpp | 2 +- .../game_live_streaming/gamelivestreaming.h | 2 +- src/core/libraries/gnmdriver/gnmdriver.cpp | 2 +- src/core/libraries/gnmdriver/gnmdriver.h | 2 +- src/core/libraries/hmd/hmd.cpp | 2 +- src/core/libraries/hmd/hmd.h | 2 +- src/core/libraries/ime/error_dialog.cpp | 2 +- src/core/libraries/ime/error_dialog.h | 2 +- src/core/libraries/ime/ime.cpp | 2 +- src/core/libraries/ime/ime.h | 2 +- src/core/libraries/ime/ime_dialog.cpp | 2 +- src/core/libraries/ime/ime_dialog.h | 2 +- src/core/libraries/jpeg/jpegenc.cpp | 2 +- src/core/libraries/jpeg/jpegenc.h | 2 +- src/core/libraries/kernel/kernel.cpp | 2 +- src/core/libraries/kernel/kernel.h | 2 +- src/core/libraries/libpng/pngdec.cpp | 2 +- src/core/libraries/libpng/pngdec.h | 2 +- src/core/libraries/libs.cpp | 118 +++++++++--------- src/core/libraries/mouse/mouse.cpp | 2 +- src/core/libraries/mouse/mouse.h | 2 +- src/core/libraries/move/move.cpp | 2 +- src/core/libraries/move/move.h | 2 +- src/core/libraries/network/http.cpp | 2 +- src/core/libraries/network/http.h | 2 +- src/core/libraries/network/http2.cpp | 2 +- src/core/libraries/network/http2.h | 2 +- src/core/libraries/network/net.cpp | 2 +- src/core/libraries/network/net.h | 2 +- src/core/libraries/network/netctl.cpp | 2 +- src/core/libraries/network/netctl.h | 2 +- src/core/libraries/network/ssl.cpp | 2 +- src/core/libraries/network/ssl.h | 2 +- src/core/libraries/network/ssl2.cpp | 2 +- src/core/libraries/network/ssl2.h | 2 +- src/core/libraries/np_auth/np_auth.cpp | 2 +- src/core/libraries/np_auth/np_auth.h | 2 +- src/core/libraries/np_common/np_common.cpp | 2 +- src/core/libraries/np_common/np_common.h | 2 +- src/core/libraries/np_manager/np_manager.cpp | 2 +- src/core/libraries/np_manager/np_manager.h | 2 +- src/core/libraries/np_party/np_party.cpp | 2 +- src/core/libraries/np_party/np_party.h | 2 +- src/core/libraries/np_score/np_score.cpp | 2 +- src/core/libraries/np_score/np_score.h | 2 +- src/core/libraries/np_trophy/np_trophy.cpp | 2 +- src/core/libraries/np_trophy/np_trophy.h | 2 +- src/core/libraries/np_web_api/np_web_api.cpp | 2 +- src/core/libraries/np_web_api/np_web_api.h | 2 +- src/core/libraries/pad/pad.cpp | 2 +- src/core/libraries/pad/pad.h | 2 +- src/core/libraries/playgo/playgo.cpp | 2 +- src/core/libraries/playgo/playgo.h | 2 +- src/core/libraries/playgo/playgo_dialog.cpp | 2 +- src/core/libraries/playgo/playgo_dialog.h | 2 +- src/core/libraries/random/random.cpp | 2 +- src/core/libraries/random/random.h | 2 +- src/core/libraries/razor_cpu/razor_cpu.cpp | 2 +- src/core/libraries/razor_cpu/razor_cpu.h | 2 +- src/core/libraries/remote_play/remoteplay.cpp | 2 +- src/core/libraries/remote_play/remoteplay.h | 2 +- .../save_data/dialog/savedatadialog.cpp | 2 +- .../save_data/dialog/savedatadialog.h | 2 +- src/core/libraries/save_data/savedata.cpp | 2 +- src/core/libraries/save_data/savedata.h | 2 +- src/core/libraries/screenshot/screenshot.cpp | 2 +- src/core/libraries/screenshot/screenshot.h | 2 +- src/core/libraries/share_play/shareplay.cpp | 2 +- src/core/libraries/share_play/shareplay.h | 2 +- .../libraries/signin_dialog/signindialog.cpp | 2 +- .../libraries/signin_dialog/signindialog.h | 2 +- src/core/libraries/system/commondialog.cpp | 2 +- src/core/libraries/system/commondialog.h | 2 +- src/core/libraries/system/msgdialog.cpp | 2 +- src/core/libraries/system/msgdialog.h | 2 +- src/core/libraries/system/posix.cpp | 2 +- src/core/libraries/system/posix.h | 2 +- src/core/libraries/system/sysmodule.cpp | 2 +- src/core/libraries/system/sysmodule.h | 2 +- src/core/libraries/system/systemservice.cpp | 2 +- src/core/libraries/system/systemservice.h | 2 +- src/core/libraries/system/userservice.cpp | 2 +- src/core/libraries/system/userservice.h | 2 +- src/core/libraries/ulobjmgr/ulobjmgr.cpp | 2 +- src/core/libraries/ulobjmgr/ulobjmgr.h | 2 +- src/core/libraries/usbd/usbd.cpp | 2 +- src/core/libraries/usbd/usbd.h | 2 +- src/core/libraries/videodec/videodec.cpp | 2 +- src/core/libraries/videodec/videodec.h | 2 +- src/core/libraries/videodec/videodec2.cpp | 2 +- src/core/libraries/videodec/videodec2.h | 2 +- src/core/libraries/voice/voice.cpp | 2 +- src/core/libraries/voice/voice.h | 2 +- .../web_browser_dialog/webbrowserdialog.cpp | 2 +- .../web_browser_dialog/webbrowserdialog.h | 2 +- src/core/libraries/zlib/zlib.cpp | 2 +- src/core/libraries/zlib/zlib_sce.h | 2 +- 119 files changed, 177 insertions(+), 177 deletions(-) diff --git a/src/core/libraries/ajm/ajm.cpp b/src/core/libraries/ajm/ajm.cpp index 5c55d2c06..d8b1dc137 100644 --- a/src/core/libraries/ajm/ajm.cpp +++ b/src/core/libraries/ajm/ajm.cpp @@ -219,7 +219,7 @@ int PS4_SYSV_ABI sceAjmStrError() { return ORBIS_OK; } -void RegisterlibSceAjm(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("NVDXiUesSbA", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchCancel); LIB_FUNCTION("WfAiBW8Wcek", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchErrorDump); LIB_FUNCTION("dmDybN--Fn8", "libSceAjm", 1, "libSceAjm", 1, 1, sceAjmBatchJobControlBufferRa); diff --git a/src/core/libraries/ajm/ajm.h b/src/core/libraries/ajm/ajm.h index 34aeb9aa4..2c529cd4b 100644 --- a/src/core/libraries/ajm/ajm.h +++ b/src/core/libraries/ajm/ajm.h @@ -229,5 +229,5 @@ int PS4_SYSV_ABI sceAjmModuleRegister(u32 context, AjmCodecType codec_type, s64 int PS4_SYSV_ABI sceAjmModuleUnregister(); int PS4_SYSV_ABI sceAjmStrError(); -void RegisterlibSceAjm(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Ajm diff --git a/src/core/libraries/app_content/app_content.cpp b/src/core/libraries/app_content/app_content.cpp index fad270e2b..59497f847 100644 --- a/src/core/libraries/app_content/app_content.cpp +++ b/src/core/libraries/app_content/app_content.cpp @@ -369,7 +369,7 @@ int PS4_SYSV_ABI sceAppContentGetDownloadedStoreCountry() { return ORBIS_OK; } -void RegisterlibSceAppContent(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("AS45QoYHjc4", "libSceAppContent", 1, "libSceAppContentUtil", 1, 1, _Z5dummyv); LIB_FUNCTION("ZiATpP9gEkA", "libSceAppContent", 1, "libSceAppContentUtil", 1, 1, sceAppContentAddcontDelete); diff --git a/src/core/libraries/app_content/app_content.h b/src/core/libraries/app_content/app_content.h index 05bd3bc49..a8e1ee178 100644 --- a/src/core/libraries/app_content/app_content.h +++ b/src/core/libraries/app_content/app_content.h @@ -119,5 +119,5 @@ int PS4_SYSV_ABI sceAppContentGetAddcontInfoByEntitlementId(); int PS4_SYSV_ABI sceAppContentGetAddcontInfoListByIroTag(); int PS4_SYSV_ABI sceAppContentGetDownloadedStoreCountry(); -void RegisterlibSceAppContent(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::AppContent diff --git a/src/core/libraries/audio/audioin.cpp b/src/core/libraries/audio/audioin.cpp index 0a2489740..c227d8f15 100644 --- a/src/core/libraries/audio/audioin.cpp +++ b/src/core/libraries/audio/audioin.cpp @@ -218,7 +218,7 @@ int PS4_SYSV_ABI sceAudioInVmicWrite() { return ORBIS_OK; } -void RegisterlibSceAudioIn(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("IQtWgnrw6v8", "libSceAudioIn", 1, "libSceAudioIn", 1, 1, sceAudioInChangeAppModuleState); LIB_FUNCTION("Jh6WbHhnI68", "libSceAudioIn", 1, "libSceAudioIn", 1, 1, sceAudioInClose); diff --git a/src/core/libraries/audio/audioin.h b/src/core/libraries/audio/audioin.h index 28162d464..cbcee6d03 100644 --- a/src/core/libraries/audio/audioin.h +++ b/src/core/libraries/audio/audioin.h @@ -54,5 +54,5 @@ int PS4_SYSV_ABI sceAudioInVmicCreate(); int PS4_SYSV_ABI sceAudioInVmicDestroy(); int PS4_SYSV_ABI sceAudioInVmicWrite(); -void RegisterlibSceAudioIn(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::AudioIn diff --git a/src/core/libraries/audio/audioout.cpp b/src/core/libraries/audio/audioout.cpp index 92488443f..421289a9d 100644 --- a/src/core/libraries/audio/audioout.cpp +++ b/src/core/libraries/audio/audioout.cpp @@ -596,7 +596,7 @@ int PS4_SYSV_ABI sceAudioOutSetSystemDebugState() { return ORBIS_OK; } -void RegisterlibSceAudioOut(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("cx2dYFbzIAg", "libSceAudioOutDeviceService", 1, "libSceAudioOut", 1, 1, sceAudioOutDeviceIdOpen); LIB_FUNCTION("tKumjQSzhys", "libSceAudioDeviceControl", 1, "libSceAudioOut", 1, 1, diff --git a/src/core/libraries/audio/audioout.h b/src/core/libraries/audio/audioout.h index 7fcc25095..4f799665e 100644 --- a/src/core/libraries/audio/audioout.h +++ b/src/core/libraries/audio/audioout.h @@ -181,5 +181,5 @@ int PS4_SYSV_ABI sceAudioOutSystemControlSet(); int PS4_SYSV_ABI sceAudioOutSparkControlSetEqCoef(); int PS4_SYSV_ABI sceAudioOutSetSystemDebugState(); -void RegisterlibSceAudioOut(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::AudioOut diff --git a/src/core/libraries/audio3d/audio3d.cpp b/src/core/libraries/audio3d/audio3d.cpp index 81befc5bf..abcd24041 100644 --- a/src/core/libraries/audio3d/audio3d.cpp +++ b/src/core/libraries/audio3d/audio3d.cpp @@ -537,7 +537,7 @@ s32 PS4_SYSV_ABI sceAudio3dTerminate() { return ORBIS_OK; } -void RegisterlibSceAudio3d(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("pZlOm1aF3aA", "libSceAudio3d", 1, "libSceAudio3d", 1, 1, sceAudio3dAudioOutClose); LIB_FUNCTION("ucEsi62soTo", "libSceAudio3d", 1, "libSceAudio3d", 1, 1, sceAudio3dAudioOutOpen); LIB_FUNCTION("7NYEzJ9SJbM", "libSceAudio3d", 1, "libSceAudio3d", 1, 1, diff --git a/src/core/libraries/audio3d/audio3d.h b/src/core/libraries/audio3d/audio3d.h index f4e9ada8a..1057c1f31 100644 --- a/src/core/libraries/audio3d/audio3d.h +++ b/src/core/libraries/audio3d/audio3d.h @@ -141,5 +141,5 @@ s32 PS4_SYSV_ABI sceAudio3dSetGpuRenderer(); s32 PS4_SYSV_ABI sceAudio3dStrError(); s32 PS4_SYSV_ABI sceAudio3dTerminate(); -void RegisterlibSceAudio3d(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Audio3d diff --git a/src/core/libraries/avplayer/avplayer.cpp b/src/core/libraries/avplayer/avplayer.cpp index 176fda137..b1009891e 100644 --- a/src/core/libraries/avplayer/avplayer.cpp +++ b/src/core/libraries/avplayer/avplayer.cpp @@ -278,7 +278,7 @@ s32 PS4_SYSV_ABI sceAvPlayerVprintf(const char* format, va_list args) { return ORBIS_OK; } -void RegisterlibSceAvPlayer(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("KMcEa+rHsIo", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerAddSource); LIB_FUNCTION("x8uvuFOPZhU", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerAddSourceEx); diff --git a/src/core/libraries/avplayer/avplayer.h b/src/core/libraries/avplayer/avplayer.h index 2d472f801..910f57c77 100644 --- a/src/core/libraries/avplayer/avplayer.h +++ b/src/core/libraries/avplayer/avplayer.h @@ -290,6 +290,6 @@ enum class SceAvPlayerAvSyncMode { using SceAvPlayerLogCallback = int PS4_SYSV_ABI (*)(void* p, const char* format, va_list args); -void RegisterlibSceAvPlayer(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::AvPlayer diff --git a/src/core/libraries/camera/camera.cpp b/src/core/libraries/camera/camera.cpp index 996d1c895..5cfa92af3 100644 --- a/src/core/libraries/camera/camera.cpp +++ b/src/core/libraries/camera/camera.cpp @@ -410,7 +410,7 @@ s32 PS4_SYSV_ABI sceCameraStopByHandle() { return ORBIS_OK; } -void RegisterlibSceCamera(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("QhjrPkRPUZQ", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAccGetData); LIB_FUNCTION("UFonL7xopFM", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioClose); LIB_FUNCTION("fkZE7Hup2ro", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioGetData); diff --git a/src/core/libraries/camera/camera.h b/src/core/libraries/camera/camera.h index 51aa8b729..8eee94897 100644 --- a/src/core/libraries/camera/camera.h +++ b/src/core/libraries/camera/camera.h @@ -304,5 +304,5 @@ s32 PS4_SYSV_ABI sceCameraStartByHandle(); s32 PS4_SYSV_ABI sceCameraStop(s32 handle); s32 PS4_SYSV_ABI sceCameraStopByHandle(); -void RegisterlibSceCamera(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Camera \ No newline at end of file diff --git a/src/core/libraries/companion/companion_httpd.cpp b/src/core/libraries/companion/companion_httpd.cpp index 39081fa4e..1e91fa7f3 100644 --- a/src/core/libraries/companion/companion_httpd.cpp +++ b/src/core/libraries/companion/companion_httpd.cpp @@ -102,7 +102,7 @@ s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestCallback() { return ORBIS_OK; } -void RegisterlibSceCompanionHttpd(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("8pWltDG7h6A", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", 1, 1, sceCompanionHttpdAddHeader); LIB_FUNCTION("B-QBMeFdNgY", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", 1, 1, diff --git a/src/core/libraries/companion/companion_httpd.h b/src/core/libraries/companion/companion_httpd.h index b6d441653..bc6807fbc 100644 --- a/src/core/libraries/companion/companion_httpd.h +++ b/src/core/libraries/companion/companion_httpd.h @@ -87,5 +87,5 @@ s32 PS4_SYSV_ABI sceCompanionHttpdTerminate(); s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestBodyReceptionCallback(); s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestCallback(); -void RegisterlibSceCompanionHttpd(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::CompanionHttpd \ No newline at end of file diff --git a/src/core/libraries/companion/companion_util.cpp b/src/core/libraries/companion/companion_util.cpp index c144ebdcc..60bfeade3 100644 --- a/src/core/libraries/companion/companion_util.cpp +++ b/src/core/libraries/companion/companion_util.cpp @@ -56,7 +56,7 @@ s32 PS4_SYSV_ABI sceCompanionUtilTerminate() { return ORBIS_OK; } -void RegisterlibSceCompanionUtil(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("cE5Msy11WhU", "libSceCompanionUtil", 1, "libSceCompanionUtil", 1, 1, sceCompanionUtilGetEvent); LIB_FUNCTION("MaVrz79mT5o", "libSceCompanionUtil", 1, "libSceCompanionUtil", 1, 1, diff --git a/src/core/libraries/companion/companion_util.h b/src/core/libraries/companion/companion_util.h index 921b5b21e..e44b095ee 100644 --- a/src/core/libraries/companion/companion_util.h +++ b/src/core/libraries/companion/companion_util.h @@ -29,5 +29,5 @@ s32 PS4_SYSV_ABI sceCompanionUtilInitialize(); s32 PS4_SYSV_ABI sceCompanionUtilOptParamInitialize(); s32 PS4_SYSV_ABI sceCompanionUtilTerminate(); -void RegisterlibSceCompanionUtil(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::CompanionUtil \ No newline at end of file diff --git a/src/core/libraries/disc_map/disc_map.cpp b/src/core/libraries/disc_map/disc_map.cpp index e8b40e624..8b1e3c653 100644 --- a/src/core/libraries/disc_map/disc_map.cpp +++ b/src/core/libraries/disc_map/disc_map.cpp @@ -34,7 +34,7 @@ int PS4_SYSV_ABI Func_E7EBCE96E92F91F8() { return ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO; } -void RegisterlibSceDiscMap(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("fl1eoDnwQ4s", "libSceDiscMap", 1, "libSceDiscMap", 1, 1, sceDiscMapGetPackageSize); LIB_FUNCTION("lbQKqsERhtE", "libSceDiscMap", 1, "libSceDiscMap", 1, 1, diff --git a/src/core/libraries/disc_map/disc_map.h b/src/core/libraries/disc_map/disc_map.h index dc8b875ac..df6c25aa0 100644 --- a/src/core/libraries/disc_map/disc_map.h +++ b/src/core/libraries/disc_map/disc_map.h @@ -18,5 +18,5 @@ int PS4_SYSV_ABI Func_8A828CAEE7EDD5E9(char* path, s64 offset, s64 nbytes, int* int* ret2); int PS4_SYSV_ABI Func_E7EBCE96E92F91F8(); -void RegisterlibSceDiscMap(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::DiscMap \ No newline at end of file diff --git a/src/core/libraries/fiber/fiber.cpp b/src/core/libraries/fiber/fiber.cpp index 345f0834d..6810d5854 100644 --- a/src/core/libraries/fiber/fiber.cpp +++ b/src/core/libraries/fiber/fiber.cpp @@ -545,7 +545,7 @@ s32 PS4_SYSV_ABI sceFiberSwitch(OrbisFiber* fiber, u64 arg_on_run_to, u64* arg_o return sceFiberSwitchImpl(fiber, nullptr, 0, arg_on_run_to, arg_on_run); } -void RegisterlibSceFiber(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("hVYD7Ou2pCQ", "libSceFiber", 1, "libSceFiber", 1, 1, sceFiberInitialize); LIB_FUNCTION("7+OJIpko9RY", "libSceFiber", 1, "libSceFiber", 1, 1, sceFiberInitializeImpl); // _sceFiberInitializeWithInternalOptionImpl diff --git a/src/core/libraries/fiber/fiber.h b/src/core/libraries/fiber/fiber.h index edcd9afe8..f52a751b1 100644 --- a/src/core/libraries/fiber/fiber.h +++ b/src/core/libraries/fiber/fiber.h @@ -116,5 +116,5 @@ s32 PS4_SYSV_ABI sceFiberRename(OrbisFiber* fiber, const char* name); s32 PS4_SYSV_ABI sceFiberGetThreadFramePointerAddress(u64* addr_frame_pointer); -void RegisterlibSceFiber(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Fiber \ No newline at end of file diff --git a/src/core/libraries/game_live_streaming/gamelivestreaming.cpp b/src/core/libraries/game_live_streaming/gamelivestreaming.cpp index a1ebddfbf..1457052d2 100644 --- a/src/core/libraries/game_live_streaming/gamelivestreaming.cpp +++ b/src/core/libraries/game_live_streaming/gamelivestreaming.cpp @@ -246,7 +246,7 @@ int PS4_SYSV_ABI sceGameLiveStreamingUnregisterCallback() { return ORBIS_OK; } -void RegisterlibSceGameLiveStreaming(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("caqgDl+V9qA", "libSceGameLiveStreaming_debug", 1, "libSceGameLiveStreaming", 1, 1, sceGameLiveStreamingStartDebugBroadcast); LIB_FUNCTION("0i8Lrllxwow", "libSceGameLiveStreaming_debug", 1, "libSceGameLiveStreaming", 1, 1, diff --git a/src/core/libraries/game_live_streaming/gamelivestreaming.h b/src/core/libraries/game_live_streaming/gamelivestreaming.h index 468750fd1..0bab969bd 100644 --- a/src/core/libraries/game_live_streaming/gamelivestreaming.h +++ b/src/core/libraries/game_live_streaming/gamelivestreaming.h @@ -77,5 +77,5 @@ int PS4_SYSV_ABI sceGameLiveStreamingStopSocialFeedbackMessageFiltering(); int PS4_SYSV_ABI sceGameLiveStreamingTerminate(); int PS4_SYSV_ABI sceGameLiveStreamingUnregisterCallback(); -void RegisterlibSceGameLiveStreaming(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::GameLiveStreaming \ No newline at end of file diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index 8c3ab1612..a8860888b 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -2823,7 +2823,7 @@ int PS4_SYSV_ABI Func_F916890425496553() { return ORBIS_OK; } -void RegisterlibSceGnmDriver(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LOG_INFO(Lib_GnmDriver, "Initializing presenter"); liverpool = std::make_unique(); presenter = std::make_unique(*g_window, liverpool.get()); diff --git a/src/core/libraries/gnmdriver/gnmdriver.h b/src/core/libraries/gnmdriver/gnmdriver.h index a3d4968d3..0f804a91f 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.h +++ b/src/core/libraries/gnmdriver/gnmdriver.h @@ -297,5 +297,5 @@ int PS4_SYSV_ABI Func_BFB41C057478F0BF(); int PS4_SYSV_ABI Func_E51D44DB8151238C(); int PS4_SYSV_ABI Func_F916890425496553(); -void RegisterlibSceGnmDriver(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::GnmDriver diff --git a/src/core/libraries/hmd/hmd.cpp b/src/core/libraries/hmd/hmd.cpp index b43789822..43c9cb5d5 100644 --- a/src/core/libraries/hmd/hmd.cpp +++ b/src/core/libraries/hmd/hmd.cpp @@ -939,7 +939,7 @@ s32 PS4_SYSV_ABI Func_FF2E0E53015FE231() { return ORBIS_OK; } -void RegisterlibSceHmd(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("8gH1aLgty5I", "libsceHmdReprojectionMultilayer", 1, "libSceHmd", 1, 1, sceHmdReprojectionStartMultilayer); LIB_FUNCTION("gEokC+OGI8g", "libSceHmdDistortion", 1, "libSceHmd", 1, 1, diff --git a/src/core/libraries/hmd/hmd.h b/src/core/libraries/hmd/hmd.h index 12f1ac70a..1f1455989 100644 --- a/src/core/libraries/hmd/hmd.h +++ b/src/core/libraries/hmd/hmd.h @@ -199,5 +199,5 @@ s32 PS4_SYSV_ABI Func_B9A6FA0735EC7E49(); s32 PS4_SYSV_ABI Func_FC193BD653F2AF2E(); s32 PS4_SYSV_ABI Func_FF2E0E53015FE231(); -void RegisterlibSceHmd(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Hmd \ No newline at end of file diff --git a/src/core/libraries/ime/error_dialog.cpp b/src/core/libraries/ime/error_dialog.cpp index 07580fe1d..c4fc18381 100644 --- a/src/core/libraries/ime/error_dialog.cpp +++ b/src/core/libraries/ime/error_dialog.cpp @@ -190,7 +190,7 @@ Status PS4_SYSV_ABI sceErrorDialogUpdateStatus() { return g_status; } -void RegisterlibSceErrorDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("ekXHb1kDBl0", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1, sceErrorDialogClose); LIB_FUNCTION("t2FvHRXzgqk", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1, diff --git a/src/core/libraries/ime/error_dialog.h b/src/core/libraries/ime/error_dialog.h index 3e6651d4a..75643b1db 100644 --- a/src/core/libraries/ime/error_dialog.h +++ b/src/core/libraries/ime/error_dialog.h @@ -24,5 +24,5 @@ int PS4_SYSV_ABI sceErrorDialogOpenWithReport(); CommonDialog::Error PS4_SYSV_ABI sceErrorDialogTerminate(); CommonDialog::Status PS4_SYSV_ABI sceErrorDialogUpdateStatus(); -void RegisterlibSceErrorDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::ErrorDialog \ No newline at end of file diff --git a/src/core/libraries/ime/ime.cpp b/src/core/libraries/ime/ime.cpp index 54e856e87..dc87e486d 100644 --- a/src/core/libraries/ime/ime.cpp +++ b/src/core/libraries/ime/ime.cpp @@ -481,7 +481,7 @@ int PS4_SYSV_ABI sceImeVshUpdateContext2() { return ORBIS_OK; } -void RegisterlibSceIme(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("mN+ZoSN-8hQ", "libSceIme", 1, "libSceIme", 1, 1, FinalizeImeModule); LIB_FUNCTION("uTW+63goeJs", "libSceIme", 1, "libSceIme", 1, 1, InitializeImeModule); LIB_FUNCTION("Lf3DeGWC6xg", "libSceIme", 1, "libSceIme", 1, 1, sceImeCheckFilterText); diff --git a/src/core/libraries/ime/ime.h b/src/core/libraries/ime/ime.h index c2b80809c..6691965b8 100644 --- a/src/core/libraries/ime/ime.h +++ b/src/core/libraries/ime/ime.h @@ -68,6 +68,6 @@ int PS4_SYSV_ABI sceImeVshUpdate(); int PS4_SYSV_ABI sceImeVshUpdateContext(); int PS4_SYSV_ABI sceImeVshUpdateContext2(); -void RegisterlibSceIme(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Ime diff --git a/src/core/libraries/ime/ime_dialog.cpp b/src/core/libraries/ime/ime_dialog.cpp index 6f808636b..21bb47bfc 100644 --- a/src/core/libraries/ime/ime_dialog.cpp +++ b/src/core/libraries/ime/ime_dialog.cpp @@ -280,7 +280,7 @@ Error PS4_SYSV_ABI sceImeDialogTerm() { return Error::OK; } -void RegisterlibSceImeDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("oBmw4xrmfKs", "libSceImeDialog", 1, "libSceImeDialog", 1, 1, sceImeDialogAbort); LIB_FUNCTION("bX4H+sxPI-o", "libSceImeDialog", 1, "libSceImeDialog", 1, 1, sceImeDialogForceClose); diff --git a/src/core/libraries/ime/ime_dialog.h b/src/core/libraries/ime/ime_dialog.h index a056fdd5e..569bdf3c0 100644 --- a/src/core/libraries/ime/ime_dialog.h +++ b/src/core/libraries/ime/ime_dialog.h @@ -47,5 +47,5 @@ int PS4_SYSV_ABI sceImeDialogInitInternal3(); int PS4_SYSV_ABI sceImeDialogSetPanelPosition(); Error PS4_SYSV_ABI sceImeDialogTerm(); -void RegisterlibSceImeDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::ImeDialog diff --git a/src/core/libraries/jpeg/jpegenc.cpp b/src/core/libraries/jpeg/jpegenc.cpp index b9c88d094..537efec97 100644 --- a/src/core/libraries/jpeg/jpegenc.cpp +++ b/src/core/libraries/jpeg/jpegenc.cpp @@ -197,7 +197,7 @@ s32 PS4_SYSV_ABI sceJpegEncQueryMemorySize(const OrbisJpegEncCreateParam* param) return ORBIS_JPEG_ENC_MINIMUM_MEMORY_SIZE; } -void RegisterlibSceJpegEnc(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("K+rocojkr-I", "libSceJpegEnc", 1, "libSceJpegEnc", 1, 1, sceJpegEncCreate); LIB_FUNCTION("j1LyMdaM+C0", "libSceJpegEnc", 1, "libSceJpegEnc", 1, 1, sceJpegEncDelete); LIB_FUNCTION("QbrU0cUghEM", "libSceJpegEnc", 1, "libSceJpegEnc", 1, 1, sceJpegEncEncode); diff --git a/src/core/libraries/jpeg/jpegenc.h b/src/core/libraries/jpeg/jpegenc.h index a6b4d311a..e0c39c58d 100644 --- a/src/core/libraries/jpeg/jpegenc.h +++ b/src/core/libraries/jpeg/jpegenc.h @@ -80,5 +80,5 @@ s32 PS4_SYSV_ABI sceJpegEncEncode(OrbisJpegEncHandle handle, const OrbisJpegEncE OrbisJpegEncOutputInfo* output_info); s32 PS4_SYSV_ABI sceJpegEncQueryMemorySize(const OrbisJpegEncCreateParam* param); -void RegisterlibSceJpegEnc(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::JpegEnc diff --git a/src/core/libraries/kernel/kernel.cpp b/src/core/libraries/kernel/kernel.cpp index a4d3accac..3272e8727 100644 --- a/src/core/libraries/kernel/kernel.cpp +++ b/src/core/libraries/kernel/kernel.cpp @@ -257,7 +257,7 @@ s32 PS4_SYSV_ABI sceKernelGetSystemSwVersion(SwVersionStruct* ret) { return ORBIS_OK; } -void RegisterKernel(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { service_thread = std::jthread{KernelServiceThread}; Libraries::Kernel::RegisterFileSystem(sym); diff --git a/src/core/libraries/kernel/kernel.h b/src/core/libraries/kernel/kernel.h index 018759e14..212471ccb 100644 --- a/src/core/libraries/kernel/kernel.h +++ b/src/core/libraries/kernel/kernel.h @@ -41,6 +41,6 @@ struct SwVersionStruct { u32 hex_representation; }; -void RegisterKernel(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Kernel diff --git a/src/core/libraries/libpng/pngdec.cpp b/src/core/libraries/libpng/pngdec.cpp index d9a324fc5..7ff12473d 100644 --- a/src/core/libraries/libpng/pngdec.cpp +++ b/src/core/libraries/libpng/pngdec.cpp @@ -261,7 +261,7 @@ s32 PS4_SYSV_ABI scePngDecQueryMemorySize(const OrbisPngDecCreateParam* param) { return sizeof(PngHandler); } -void RegisterlibScePngDec(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("m0uW+8pFyaw", "libScePngDec", 1, "libScePngDec", 1, 1, scePngDecCreate); LIB_FUNCTION("WC216DD3El4", "libScePngDec", 1, "libScePngDec", 1, 1, scePngDecDecode); LIB_FUNCTION("cJ--1xAbj-I", "libScePngDec", 1, "libScePngDec", 1, 1, diff --git a/src/core/libraries/libpng/pngdec.h b/src/core/libraries/libpng/pngdec.h index c897d7c95..b306d6100 100644 --- a/src/core/libraries/libpng/pngdec.h +++ b/src/core/libraries/libpng/pngdec.h @@ -79,5 +79,5 @@ s32 PS4_SYSV_ABI scePngDecParseHeader(const OrbisPngDecParseParam* param, OrbisPngDecImageInfo* imageInfo); s32 PS4_SYSV_ABI scePngDecQueryMemorySize(const OrbisPngDecCreateParam* param); -void RegisterlibScePngDec(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::PngDec diff --git a/src/core/libraries/libs.cpp b/src/core/libraries/libs.cpp index 762c1e762..af9328a57 100644 --- a/src/core/libraries/libs.cpp +++ b/src/core/libraries/libs.cpp @@ -70,66 +70,66 @@ namespace Libraries { void InitHLELibs(Core::Loader::SymbolsResolver* sym) { LOG_INFO(Lib_Kernel, "Initializing HLE libraries"); - Libraries::Kernel::RegisterKernel(sym); - Libraries::GnmDriver::RegisterlibSceGnmDriver(sym); + Libraries::Kernel::RegisterLib(sym); + Libraries::GnmDriver::RegisterLib(sym); Libraries::VideoOut::RegisterLib(sym); - Libraries::UserService::RegisterlibSceUserService(sym); - Libraries::SystemService::RegisterlibSceSystemService(sym); - Libraries::CommonDialog::RegisterlibSceCommonDialog(sym); - Libraries::MsgDialog::RegisterlibSceMsgDialog(sym); - Libraries::AudioOut::RegisterlibSceAudioOut(sym); - Libraries::Http::RegisterlibSceHttp(sym); - Libraries::Http2::RegisterlibSceHttp2(sym); - Libraries::Net::RegisterlibSceNet(sym); - Libraries::NetCtl::RegisterlibSceNetCtl(sym); - Libraries::SaveData::RegisterlibSceSaveData(sym); - Libraries::SaveData::Dialog::RegisterlibSceSaveDataDialog(sym); - Libraries::Ssl::RegisterlibSceSsl(sym); - Libraries::Ssl2::RegisterlibSceSsl2(sym); - Libraries::SysModule::RegisterlibSceSysmodule(sym); - Libraries::Posix::Registerlibsceposix(sym); - Libraries::AudioIn::RegisterlibSceAudioIn(sym); - Libraries::NpCommon::RegisterlibSceNpCommon(sym); - Libraries::NpManager::RegisterlibSceNpManager(sym); - Libraries::NpScore::RegisterlibSceNpScore(sym); - Libraries::NpTrophy::RegisterlibSceNpTrophy(sym); - Libraries::NpWebApi::RegisterlibSceNpWebApi(sym); - Libraries::NpAuth::RegisterlibSceNpAuth(sym); - Libraries::ScreenShot::RegisterlibSceScreenShot(sym); - Libraries::AppContent::RegisterlibSceAppContent(sym); - Libraries::PngDec::RegisterlibScePngDec(sym); - Libraries::PlayGo::RegisterlibScePlayGo(sym); - Libraries::PlayGo::Dialog::RegisterlibScePlayGoDialog(sym); - Libraries::Random::RegisterlibSceRandom(sym); - Libraries::Usbd::RegisterlibSceUsbd(sym); - Libraries::Pad::RegisterlibScePad(sym); - Libraries::Ajm::RegisterlibSceAjm(sym); - Libraries::ErrorDialog::RegisterlibSceErrorDialog(sym); - Libraries::ImeDialog::RegisterlibSceImeDialog(sym); - Libraries::AvPlayer::RegisterlibSceAvPlayer(sym); - Libraries::Vdec2::RegisterlibSceVdec2(sym); - Libraries::Audio3d::RegisterlibSceAudio3d(sym); - Libraries::Ime::RegisterlibSceIme(sym); - Libraries::GameLiveStreaming::RegisterlibSceGameLiveStreaming(sym); - Libraries::SharePlay::RegisterlibSceSharePlay(sym); - Libraries::Remoteplay::RegisterlibSceRemoteplay(sym); - Libraries::Videodec::RegisterlibSceVideodec(sym); - Libraries::RazorCpu::RegisterlibSceRazorCpu(sym); - Libraries::Move::RegisterlibSceMove(sym); - Libraries::Fiber::RegisterlibSceFiber(sym); - Libraries::JpegEnc::RegisterlibSceJpegEnc(sym); - Libraries::Mouse::RegisterlibSceMouse(sym); - Libraries::WebBrowserDialog::RegisterlibSceWebBrowserDialog(sym); - Libraries::NpParty::RegisterlibSceNpParty(sym); - Libraries::Zlib::RegisterlibSceZlib(sym); - Libraries::Hmd::RegisterlibSceHmd(sym); - Libraries::DiscMap::RegisterlibSceDiscMap(sym); - Libraries::Ulobjmgr::RegisterlibSceUlobjmgr(sym); - Libraries::SigninDialog::RegisterlibSceSigninDialog(sym); - Libraries::Camera::RegisterlibSceCamera(sym); - Libraries::CompanionHttpd::RegisterlibSceCompanionHttpd(sym); - Libraries::CompanionUtil::RegisterlibSceCompanionUtil(sym); - Libraries::Voice::RegisterlibSceVoice(sym); + Libraries::UserService::RegisterLib(sym); + Libraries::SystemService::RegisterLib(sym); + Libraries::CommonDialog::RegisterLib(sym); + Libraries::MsgDialog::RegisterLib(sym); + Libraries::AudioOut::RegisterLib(sym); + Libraries::Http::RegisterLib(sym); + Libraries::Http2::RegisterLib(sym); + Libraries::Net::RegisterLib(sym); + Libraries::NetCtl::RegisterLib(sym); + Libraries::SaveData::RegisterLib(sym); + Libraries::SaveData::Dialog::RegisterLib(sym); + Libraries::Ssl::RegisterLib(sym); + Libraries::Ssl2::RegisterLib(sym); + Libraries::SysModule::RegisterLib(sym); + Libraries::Posix::RegisterLib(sym); + Libraries::AudioIn::RegisterLib(sym); + Libraries::NpCommon::RegisterLib(sym); + Libraries::NpManager::RegisterLib(sym); + Libraries::NpScore::RegisterLib(sym); + Libraries::NpTrophy::RegisterLib(sym); + Libraries::NpWebApi::RegisterLib(sym); + Libraries::NpAuth::RegisterLib(sym); + Libraries::ScreenShot::RegisterLib(sym); + Libraries::AppContent::RegisterLib(sym); + Libraries::PngDec::RegisterLib(sym); + Libraries::PlayGo::RegisterLib(sym); + Libraries::PlayGo::Dialog::RegisterLib(sym); + Libraries::Random::RegisterLib(sym); + Libraries::Usbd::RegisterLib(sym); + Libraries::Pad::RegisterLib(sym); + Libraries::Ajm::RegisterLib(sym); + Libraries::ErrorDialog::RegisterLib(sym); + Libraries::ImeDialog::RegisterLib(sym); + Libraries::AvPlayer::RegisterLib(sym); + Libraries::Vdec2::RegisterLib(sym); + Libraries::Audio3d::RegisterLib(sym); + Libraries::Ime::RegisterLib(sym); + Libraries::GameLiveStreaming::RegisterLib(sym); + Libraries::SharePlay::RegisterLib(sym); + Libraries::Remoteplay::RegisterLib(sym); + Libraries::Videodec::RegisterLib(sym); + Libraries::RazorCpu::RegisterLib(sym); + Libraries::Move::RegisterLib(sym); + Libraries::Fiber::RegisterLib(sym); + Libraries::JpegEnc::RegisterLib(sym); + Libraries::Mouse::RegisterLib(sym); + Libraries::WebBrowserDialog::RegisterLib(sym); + Libraries::NpParty::RegisterLib(sym); + Libraries::Zlib::RegisterLib(sym); + Libraries::Hmd::RegisterLib(sym); + Libraries::DiscMap::RegisterLib(sym); + Libraries::Ulobjmgr::RegisterLib(sym); + Libraries::SigninDialog::RegisterLib(sym); + Libraries::Camera::RegisterLib(sym); + Libraries::CompanionHttpd::RegisterLib(sym); + Libraries::CompanionUtil::RegisterLib(sym); + Libraries::Voice::RegisterLib(sym); } } // namespace Libraries diff --git a/src/core/libraries/mouse/mouse.cpp b/src/core/libraries/mouse/mouse.cpp index dffd2346c..d9bd2669f 100644 --- a/src/core/libraries/mouse/mouse.cpp +++ b/src/core/libraries/mouse/mouse.cpp @@ -79,7 +79,7 @@ int PS4_SYSV_ABI sceMouseSetProcessPrivilege() { return ORBIS_OK; } -void RegisterlibSceMouse(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("cAnT0Rw-IwU", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseClose); LIB_FUNCTION("Ymyy1HSSJLQ", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseConnectPort); LIB_FUNCTION("BRXOoXQtb+k", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseDebugGetDeviceId); diff --git a/src/core/libraries/mouse/mouse.h b/src/core/libraries/mouse/mouse.h index 8264f62e0..192343434 100644 --- a/src/core/libraries/mouse/mouse.h +++ b/src/core/libraries/mouse/mouse.h @@ -25,5 +25,5 @@ int PS4_SYSV_ABI sceMouseSetHandType(); int PS4_SYSV_ABI sceMouseSetPointerSpeed(); int PS4_SYSV_ABI sceMouseSetProcessPrivilege(); -void RegisterlibSceMouse(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Mouse \ No newline at end of file diff --git a/src/core/libraries/move/move.cpp b/src/core/libraries/move/move.cpp index 500d89586..f63142615 100644 --- a/src/core/libraries/move/move.cpp +++ b/src/core/libraries/move/move.cpp @@ -38,7 +38,7 @@ int PS4_SYSV_ABI sceMoveInit() { return ORBIS_OK; } -void RegisterlibSceMove(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("HzC60MfjJxU", "libSceMove", 1, "libSceMove", 1, 1, sceMoveOpen); LIB_FUNCTION("GWXTyxs4QbE", "libSceMove", 1, "libSceMove", 1, 1, sceMoveGetDeviceInfo); LIB_FUNCTION("ttU+JOhShl4", "libSceMove", 1, "libSceMove", 1, 1, sceMoveReadStateLatest); diff --git a/src/core/libraries/move/move.h b/src/core/libraries/move/move.h index 2d7adaba7..8ae6c545c 100644 --- a/src/core/libraries/move/move.h +++ b/src/core/libraries/move/move.h @@ -17,5 +17,5 @@ int PS4_SYSV_ABI sceMoveReadStateRecent(); int PS4_SYSV_ABI sceMoveTerm(); int PS4_SYSV_ABI sceMoveInit(); -void RegisterlibSceMove(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Move \ No newline at end of file diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index dbb5b096a..f7cbed931 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -847,7 +847,7 @@ int PS4_SYSV_ABI sceHttpWaitRequest() { return ORBIS_OK; } -void RegisterlibSceHttp(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("hvG6GfBMXg8", "libSceHttp", 1, "libSceHttp", 1, 1, sceHttpAbortRequest); LIB_FUNCTION("JKl06ZIAl6A", "libSceHttp", 1, "libSceHttp", 1, 1, sceHttpAbortRequestForce); LIB_FUNCTION("sWQiqKvYTVA", "libSceHttp", 1, "libSceHttp", 1, 1, sceHttpAbortWaitRequest); diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index c687c60c4..cc9ca57af 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -141,5 +141,5 @@ int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize) int PS4_SYSV_ABI sceHttpUriUnescape(char* out, size_t* require, size_t prepare, const char* in); int PS4_SYSV_ABI sceHttpWaitRequest(); -void RegisterlibSceHttp(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Http diff --git a/src/core/libraries/network/http2.cpp b/src/core/libraries/network/http2.cpp index 52f73edc6..f6a0eba4e 100644 --- a/src/core/libraries/network/http2.cpp +++ b/src/core/libraries/network/http2.cpp @@ -289,7 +289,7 @@ int PS4_SYSV_ABI sceHttp2WaitAsync() { return ORBIS_OK; } -void RegisterlibSceHttp2(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("AS45QoYHjc4", "libSceHttp2", 1, "libSceHttp2", 1, 1, _Z5dummyv); LIB_FUNCTION("IZ-qjhRqvjk", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AbortRequest); LIB_FUNCTION("flPxnowtvWY", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AddCookie); diff --git a/src/core/libraries/network/http2.h b/src/core/libraries/network/http2.h index aa1d0c5b4..99359518a 100644 --- a/src/core/libraries/network/http2.h +++ b/src/core/libraries/network/http2.h @@ -68,5 +68,5 @@ int PS4_SYSV_ABI sceHttp2SslEnableOption(); int PS4_SYSV_ABI sceHttp2Term(); int PS4_SYSV_ABI sceHttp2WaitAsync(); -void RegisterlibSceHttp2(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Http2 \ No newline at end of file diff --git a/src/core/libraries/network/net.cpp b/src/core/libraries/network/net.cpp index 9607f0d78..6df4f2f40 100644 --- a/src/core/libraries/network/net.cpp +++ b/src/core/libraries/network/net.cpp @@ -1942,7 +1942,7 @@ int PS4_SYSV_ABI sceNetEmulationSet() { return ORBIS_OK; } -void RegisterlibSceNet(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("ZRAJo-A-ukc", "libSceNet", 1, "libSceNet", 1, 1, in6addr_any); LIB_FUNCTION("XCuA-GqjA-k", "libSceNet", 1, "libSceNet", 1, 1, in6addr_loopback); LIB_FUNCTION("VZgoeBxPXUQ", "libSceNet", 1, "libSceNet", 1, 1, sce_net_dummy); diff --git a/src/core/libraries/network/net.h b/src/core/libraries/network/net.h index 1393ecb1d..7b6a5680c 100644 --- a/src/core/libraries/network/net.h +++ b/src/core/libraries/network/net.h @@ -336,5 +336,5 @@ int PS4_SYSV_ABI Func_0E707A589F751C68(); int PS4_SYSV_ABI sceNetEmulationGet(); int PS4_SYSV_ABI sceNetEmulationSet(); -void RegisterlibSceNet(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Net diff --git a/src/core/libraries/network/netctl.cpp b/src/core/libraries/network/netctl.cpp index 38225c48c..54a273dc3 100644 --- a/src/core/libraries/network/netctl.cpp +++ b/src/core/libraries/network/netctl.cpp @@ -547,7 +547,7 @@ int PS4_SYSV_ABI sceNetCtlApRpUnregisterCallback() { return ORBIS_OK; } -void RegisterlibSceNetCtl(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("XtClSOC1xcU", "libSceNetBwe", 1, "libSceNetCtl", 1, 1, sceNetBweCheckCallbackIpcInt); LIB_FUNCTION("YALqoY4aeY0", "libSceNetBwe", 1, "libSceNetCtl", 1, 1, sceNetBweClearEventIpcInt); diff --git a/src/core/libraries/network/netctl.h b/src/core/libraries/network/netctl.h index 203c75822..7f139e8c3 100644 --- a/src/core/libraries/network/netctl.h +++ b/src/core/libraries/network/netctl.h @@ -165,5 +165,5 @@ int PS4_SYSV_ABI sceNetCtlApRpStartWithRetry(); int PS4_SYSV_ABI sceNetCtlApRpStop(); int PS4_SYSV_ABI sceNetCtlApRpUnregisterCallback(); -void RegisterlibSceNetCtl(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NetCtl diff --git a/src/core/libraries/network/ssl.cpp b/src/core/libraries/network/ssl.cpp index a5ac8f5ef..1e013bc26 100644 --- a/src/core/libraries/network/ssl.cpp +++ b/src/core/libraries/network/ssl.cpp @@ -1050,7 +1050,7 @@ int PS4_SYSV_ABI Func_28F8791A771D39C7() { return ORBIS_OK; } -void RegisterlibSceSsl(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("Pgt0gg14ewU", "libSceSsl", 1, "libSceSsl", 1, 1, CA_MGMT_allocCertDistinguishedName); LIB_FUNCTION("wJ5jCpkCv-c", "libSceSsl", 1, "libSceSsl", 1, 1, diff --git a/src/core/libraries/network/ssl.h b/src/core/libraries/network/ssl.h index fcdcdd166..051c6363e 100644 --- a/src/core/libraries/network/ssl.h +++ b/src/core/libraries/network/ssl.h @@ -220,5 +220,5 @@ int PS4_SYSV_ABI VLONG_freeVlongQueue(); int PS4_SYSV_ABI Func_22E76E60BC0587D7(); int PS4_SYSV_ABI Func_28F8791A771D39C7(); -void RegisterlibSceSsl(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Ssl diff --git a/src/core/libraries/network/ssl2.cpp b/src/core/libraries/network/ssl2.cpp index 8ca29526e..701f091a3 100644 --- a/src/core/libraries/network/ssl2.cpp +++ b/src/core/libraries/network/ssl2.cpp @@ -290,7 +290,7 @@ int PS4_SYSV_ABI Func_28F8791A771D39C7() { return ORBIS_OK; } -void RegisterlibSceSsl2(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("Md+HYkCBZB4", "libSceSsl", 1, "libSceSsl", 2, 1, CA_MGMT_extractKeyBlobEx); LIB_FUNCTION("9bKYzKP6kYU", "libSceSsl", 1, "libSceSsl", 2, 1, CA_MGMT_extractPublicKeyInfo); LIB_FUNCTION("ipLIammTj2Q", "libSceSsl", 1, "libSceSsl", 2, 1, CA_MGMT_freeKeyBlob); diff --git a/src/core/libraries/network/ssl2.h b/src/core/libraries/network/ssl2.h index 03ee3b86e..754dda40c 100644 --- a/src/core/libraries/network/ssl2.h +++ b/src/core/libraries/network/ssl2.h @@ -10,5 +10,5 @@ class SymbolsResolver; } namespace Libraries::Ssl2 { -void RegisterlibSceSsl2(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Ssl2 \ No newline at end of file diff --git a/src/core/libraries/np_auth/np_auth.cpp b/src/core/libraries/np_auth/np_auth.cpp index 9ec986f3c..90f249c97 100644 --- a/src/core/libraries/np_auth/np_auth.cpp +++ b/src/core/libraries/np_auth/np_auth.cpp @@ -73,7 +73,7 @@ s32 PS4_SYSV_ABI sceNpAuthWaitAsync() { return ORBIS_OK; } -void RegisterlibSceNpAuth(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("KxGkOrQJTqY", "libSceNpAuthCompat", 1, "libSceNpAuth", 1, 1, sceNpAuthGetAuthorizationCode); LIB_FUNCTION("uaB-LoJqHis", "libSceNpAuthCompat", 1, "libSceNpAuth", 1, 1, sceNpAuthGetIdToken); diff --git a/src/core/libraries/np_auth/np_auth.h b/src/core/libraries/np_auth/np_auth.h index a6a66b452..17f293865 100644 --- a/src/core/libraries/np_auth/np_auth.h +++ b/src/core/libraries/np_auth/np_auth.h @@ -25,5 +25,5 @@ s32 PS4_SYSV_ABI sceNpAuthPollAsync(); s32 PS4_SYSV_ABI sceNpAuthSetTimeout(); s32 PS4_SYSV_ABI sceNpAuthWaitAsync(); -void RegisterlibSceNpAuth(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpAuth \ No newline at end of file diff --git a/src/core/libraries/np_common/np_common.cpp b/src/core/libraries/np_common/np_common.cpp index 1234705cc..4c68fbf7a 100644 --- a/src/core/libraries/np_common/np_common.cpp +++ b/src/core/libraries/np_common/np_common.cpp @@ -6129,7 +6129,7 @@ int PS4_SYSV_ABI Func_FFF4A3E279FB44A7() { return ORBIS_OK; } -void RegisterlibSceNpCommon(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("i8UmXTSq7N4", "libSceNpCommonCompat", 1, "libSceNpCommon", 1, 1, sceNpCmpNpId); LIB_FUNCTION("TcwEFnakiSc", "libSceNpCommonCompat", 1, "libSceNpCommon", 1, 1, sceNpCmpNpIdInOrder); diff --git a/src/core/libraries/np_common/np_common.h b/src/core/libraries/np_common/np_common.h index 886610ccc..2ef3f5e69 100644 --- a/src/core/libraries/np_common/np_common.h +++ b/src/core/libraries/np_common/np_common.h @@ -1241,5 +1241,5 @@ int PS4_SYSV_ABI Func_FE55EE32098D0D58(); int PS4_SYSV_ABI Func_FE79841022E1DA1C(); int PS4_SYSV_ABI Func_FFF4A3E279FB44A7(); -void RegisterlibSceNpCommon(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpCommon \ No newline at end of file diff --git a/src/core/libraries/np_manager/np_manager.cpp b/src/core/libraries/np_manager/np_manager.cpp index bc920b5a9..b161a5a50 100644 --- a/src/core/libraries/np_manager/np_manager.cpp +++ b/src/core/libraries/np_manager/np_manager.cpp @@ -2563,7 +2563,7 @@ int PS4_SYSV_ABI sceNpUnregisterStateCallbackForToolkit() { return ORBIS_OK; } -void RegisterlibSceNpManager(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("70N4VzVCpQg", "libSceNpManagerForSys", 1, "libSceNpManager", 1, 1, Func_EF4378573542A508); LIB_FUNCTION("pHLjntY0psg", "libSceNpManager", 1, "libSceNpManager", 1, 1, diff --git a/src/core/libraries/np_manager/np_manager.h b/src/core/libraries/np_manager/np_manager.h index 1078a9f3e..261e40208 100644 --- a/src/core/libraries/np_manager/np_manager.h +++ b/src/core/libraries/np_manager/np_manager.h @@ -542,5 +542,5 @@ int PS4_SYSV_ABI sceNpRegisterStateCallbackForToolkit(OrbisNpStateCallbackForNpT void* userdata); int PS4_SYSV_ABI sceNpUnregisterStateCallbackForToolkit(); -void RegisterlibSceNpManager(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpManager diff --git a/src/core/libraries/np_party/np_party.cpp b/src/core/libraries/np_party/np_party.cpp index 8a66ccb22..bd04e64d4 100644 --- a/src/core/libraries/np_party/np_party.cpp +++ b/src/core/libraries/np_party/np_party.cpp @@ -138,7 +138,7 @@ s32 PS4_SYSV_ABI sceNpPartyUnregisterPrivateHandler() { return ORBIS_OK; } -void RegisterlibSceNpParty(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("3e4k2mzLkmc", "libSceNpParty", 1, "libSceNpParty", 1, 1, sceNpPartyCheckCallback); LIB_FUNCTION("nOZRy-slBoA", "libSceNpParty", 1, "libSceNpParty", 1, 1, sceNpPartyCreate); LIB_FUNCTION("XQSUbbnpPBA", "libSceNpParty", 1, "libSceNpParty", 1, 1, sceNpPartyCreateA); diff --git a/src/core/libraries/np_party/np_party.h b/src/core/libraries/np_party/np_party.h index d5f20e4f8..ace565d46 100644 --- a/src/core/libraries/np_party/np_party.h +++ b/src/core/libraries/np_party/np_party.h @@ -40,5 +40,5 @@ s32 PS4_SYSV_ABI sceNpPartyUnregisterPrivateHandler(); s32 PS4_SYSV_ABI module_start(); s32 PS4_SYSV_ABI module_stop(); -void RegisterlibSceNpParty(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpParty \ No newline at end of file diff --git a/src/core/libraries/np_score/np_score.cpp b/src/core/libraries/np_score/np_score.cpp index dc16e12d2..e34c872e7 100644 --- a/src/core/libraries/np_score/np_score.cpp +++ b/src/core/libraries/np_score/np_score.cpp @@ -263,7 +263,7 @@ int PS4_SYSV_ABI sceNpScoreWaitAsync() { return ORBIS_OK; } -void RegisterlibSceNpScore(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("1i7kmKbX6hk", "libSceNpScore", 1, "libSceNpScore", 1, 1, sceNpScoreAbortRequest); LIB_FUNCTION("2b3TI0mDYiI", "libSceNpScore", 1, "libSceNpScore", 1, 1, sceNpScoreCensorComment); LIB_FUNCTION("4eOvDyN-aZc", "libSceNpScore", 1, "libSceNpScore", 1, 1, diff --git a/src/core/libraries/np_score/np_score.h b/src/core/libraries/np_score/np_score.h index 3d991efbd..1429075b4 100644 --- a/src/core/libraries/np_score/np_score.h +++ b/src/core/libraries/np_score/np_score.h @@ -63,5 +63,5 @@ int PS4_SYSV_ABI sceNpScoreSetThreadParam(); int PS4_SYSV_ABI sceNpScoreSetTimeout(); int PS4_SYSV_ABI sceNpScoreWaitAsync(); -void RegisterlibSceNpScore(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpScore \ No newline at end of file diff --git a/src/core/libraries/np_trophy/np_trophy.cpp b/src/core/libraries/np_trophy/np_trophy.cpp index c0642f81c..ed48bb670 100644 --- a/src/core/libraries/np_trophy/np_trophy.cpp +++ b/src/core/libraries/np_trophy/np_trophy.cpp @@ -1023,7 +1023,7 @@ int PS4_SYSV_ABI Func_FA7A2DD770447552() { return ORBIS_OK; } -void RegisterlibSceNpTrophy(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("aTnHs7W-9Uk", "libSceNpTrophy", 1, "libSceNpTrophy", 1, 1, sceNpTrophyAbortHandle); LIB_FUNCTION("cqGkYAN-gRw", "libSceNpTrophy", 1, "libSceNpTrophy", 1, 1, diff --git a/src/core/libraries/np_trophy/np_trophy.h b/src/core/libraries/np_trophy/np_trophy.h index 9abc795bc..1d200242d 100644 --- a/src/core/libraries/np_trophy/np_trophy.h +++ b/src/core/libraries/np_trophy/np_trophy.h @@ -225,5 +225,5 @@ int PS4_SYSV_ABI Func_9F80071876FFA5F6(); int PS4_SYSV_ABI Func_F8EF6F5350A91990(); int PS4_SYSV_ABI Func_FA7A2DD770447552(); -void RegisterlibSceNpTrophy(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpTrophy \ No newline at end of file diff --git a/src/core/libraries/np_web_api/np_web_api.cpp b/src/core/libraries/np_web_api/np_web_api.cpp index 8a7979978..a7c0cdc62 100644 --- a/src/core/libraries/np_web_api/np_web_api.cpp +++ b/src/core/libraries/np_web_api/np_web_api.cpp @@ -509,7 +509,7 @@ s32 PS4_SYSV_ABI Func_F9A32E8685627436() { return ORBIS_OK; } -void RegisterlibSceNpWebApi(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("x1Y7yiYSk7c", "libSceNpWebApiCompat", 1, "libSceNpWebApi", 1, 1, sceNpWebApiCreateContext); LIB_FUNCTION("y5Ta5JCzQHY", "libSceNpWebApiCompat", 1, "libSceNpWebApi", 1, 1, diff --git a/src/core/libraries/np_web_api/np_web_api.h b/src/core/libraries/np_web_api/np_web_api.h index cc007394f..bb3bcbb60 100644 --- a/src/core/libraries/np_web_api/np_web_api.h +++ b/src/core/libraries/np_web_api/np_web_api.h @@ -112,5 +112,5 @@ s32 PS4_SYSV_ABI Func_E324765D18EE4D12(); s32 PS4_SYSV_ABI Func_E789F980D907B653(); s32 PS4_SYSV_ABI Func_F9A32E8685627436(); -void RegisterlibSceNpWebApi(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::NpWebApi \ No newline at end of file diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index 59964fa58..4aeaeb911 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -761,7 +761,7 @@ int PS4_SYSV_ABI Func_EF103E845B6F0420() { return ORBIS_OK; } -void RegisterlibScePad(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("6ncge5+l5Qs", "libScePad", 1, "libScePad", 1, 1, scePadClose); LIB_FUNCTION("kazv1NzSB8c", "libScePad", 1, "libScePad", 1, 1, scePadConnectPort); LIB_FUNCTION("AcslpN1jHR8", "libScePad", 1, "libScePad", 1, 1, diff --git a/src/core/libraries/pad/pad.h b/src/core/libraries/pad/pad.h index 68943b460..ca6e8a73f 100644 --- a/src/core/libraries/pad/pad.h +++ b/src/core/libraries/pad/pad.h @@ -348,5 +348,5 @@ int PS4_SYSV_ABI Func_51E514BCD3A05CA5(); int PS4_SYSV_ABI Func_89C9237E393DA243(); int PS4_SYSV_ABI Func_EF103E845B6F0420(); -void RegisterlibScePad(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Pad diff --git a/src/core/libraries/playgo/playgo.cpp b/src/core/libraries/playgo/playgo.cpp index aec32e139..221d6f109 100644 --- a/src/core/libraries/playgo/playgo.cpp +++ b/src/core/libraries/playgo/playgo.cpp @@ -385,7 +385,7 @@ s32 PS4_SYSV_ABI scePlayGoTerminate() { return ORBIS_OK; } -void RegisterlibScePlayGo(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("uEqMfMITvEI", "libSceDbgPlayGo", 1, "libScePlayGo", 1, 0, sceDbgPlayGoRequestNextChunk); LIB_FUNCTION("vU+FqrH+pEY", "libSceDbgPlayGo", 1, "libScePlayGo", 1, 0, sceDbgPlayGoSnapshot); diff --git a/src/core/libraries/playgo/playgo.h b/src/core/libraries/playgo/playgo.h index 2338c9ebf..68a5f1e84 100644 --- a/src/core/libraries/playgo/playgo.h +++ b/src/core/libraries/playgo/playgo.h @@ -41,5 +41,5 @@ s32 PS4_SYSV_ABI scePlayGoSetToDoList(OrbisPlayGoHandle handle, const OrbisPlayG uint32_t numberOfEntries); s32 PS4_SYSV_ABI scePlayGoTerminate(); -void RegisterlibScePlayGo(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::PlayGo \ No newline at end of file diff --git a/src/core/libraries/playgo/playgo_dialog.cpp b/src/core/libraries/playgo/playgo_dialog.cpp index 16f7aa05d..be9a65f1a 100644 --- a/src/core/libraries/playgo/playgo_dialog.cpp +++ b/src/core/libraries/playgo/playgo_dialog.cpp @@ -58,7 +58,7 @@ Status PS4_SYSV_ABI scePlayGoDialogUpdateStatus() { return Status::FINISHED; } -void RegisterlibScePlayGoDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("fbigNQiZpm0", "libScePlayGoDialog", 1, "libScePlayGoDialog", 1, 1, scePlayGoDialogClose); LIB_FUNCTION("wx9TDplJKB4", "libScePlayGoDialog", 1, "libScePlayGoDialog", 1, 1, diff --git a/src/core/libraries/playgo/playgo_dialog.h b/src/core/libraries/playgo/playgo_dialog.h index fa9c64680..d9b991f48 100644 --- a/src/core/libraries/playgo/playgo_dialog.h +++ b/src/core/libraries/playgo/playgo_dialog.h @@ -34,5 +34,5 @@ CommonDialog::Error PS4_SYSV_ABI scePlayGoDialogOpen(const OrbisPlayGoDialogPara CommonDialog::Error PS4_SYSV_ABI scePlayGoDialogTerminate(); CommonDialog::Status PS4_SYSV_ABI scePlayGoDialogUpdateStatus(); -void RegisterlibScePlayGoDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::PlayGo::Dialog diff --git a/src/core/libraries/random/random.cpp b/src/core/libraries/random/random.cpp index f7cc3fd2c..fd2053377 100644 --- a/src/core/libraries/random/random.cpp +++ b/src/core/libraries/random/random.cpp @@ -22,7 +22,7 @@ s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, std::size_t size) { return ORBIS_OK; } -void RegisterlibSceRandom(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("PI7jIZj4pcE", "libSceRandom", 1, "libSceRandom", 1, 1, sceRandomGetRandomNumber); }; diff --git a/src/core/libraries/random/random.h b/src/core/libraries/random/random.h index 172494106..9f86a900f 100644 --- a/src/core/libraries/random/random.h +++ b/src/core/libraries/random/random.h @@ -15,6 +15,6 @@ constexpr s32 SCE_RANDOM_MAX_SIZE = 64; s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, std::size_t size); -void RegisterlibSceRandom(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Random diff --git a/src/core/libraries/razor_cpu/razor_cpu.cpp b/src/core/libraries/razor_cpu/razor_cpu.cpp index 99707e972..f5cd952bf 100644 --- a/src/core/libraries/razor_cpu/razor_cpu.cpp +++ b/src/core/libraries/razor_cpu/razor_cpu.cpp @@ -180,7 +180,7 @@ s32 PS4_SYSV_ABI sceRazorCpuWriteBookmark() { return ORBIS_OK; } -void RegisterlibSceRazorCpu(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("JFzLJBlYIJE", "libSceRazorCpu", 1, "libSceRazorCpu", 1, 1, sceRazorCpuBeginLogicalFileAccess); LIB_FUNCTION("SfRTRZ1Sh+U", "libSceRazorCpu", 1, "libSceRazorCpu", 1, 1, diff --git a/src/core/libraries/razor_cpu/razor_cpu.h b/src/core/libraries/razor_cpu/razor_cpu.h index ec25e44b9..c8ed3c942 100644 --- a/src/core/libraries/razor_cpu/razor_cpu.h +++ b/src/core/libraries/razor_cpu/razor_cpu.h @@ -13,5 +13,5 @@ class SymbolsResolver; } namespace Libraries::RazorCpu { -void RegisterlibSceRazorCpu(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::RazorCpu \ No newline at end of file diff --git a/src/core/libraries/remote_play/remoteplay.cpp b/src/core/libraries/remote_play/remoteplay.cpp index b7402173e..1f2933755 100644 --- a/src/core/libraries/remote_play/remoteplay.cpp +++ b/src/core/libraries/remote_play/remoteplay.cpp @@ -219,7 +219,7 @@ int PS4_SYSV_ABI Func_1D5EE365ED5FADB3() { return ORBIS_OK; } -void RegisterlibSceRemoteplay(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("xQeIryTX7dY", "libSceRemoteplay", 1, "libSceRemoteplay", 0, 0, sceRemoteplayApprove); LIB_FUNCTION("IYZ+Mu+8tPo", "libSceRemoteplay", 1, "libSceRemoteplay", 0, 0, diff --git a/src/core/libraries/remote_play/remoteplay.h b/src/core/libraries/remote_play/remoteplay.h index 979f73a9e..35465d6df 100644 --- a/src/core/libraries/remote_play/remoteplay.h +++ b/src/core/libraries/remote_play/remoteplay.h @@ -58,5 +58,5 @@ int PS4_SYSV_ABI sceRemoteplaySetRpMode(); int PS4_SYSV_ABI sceRemoteplayTerminate(); int PS4_SYSV_ABI Func_1D5EE365ED5FADB3(); -void RegisterlibSceRemoteplay(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Remoteplay \ No newline at end of file diff --git a/src/core/libraries/save_data/dialog/savedatadialog.cpp b/src/core/libraries/save_data/dialog/savedatadialog.cpp index 2f0619165..3dd6d8ff9 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog.cpp +++ b/src/core/libraries/save_data/dialog/savedatadialog.cpp @@ -139,7 +139,7 @@ Status PS4_SYSV_ABI sceSaveDataDialogUpdateStatus() { return g_status; } -void RegisterlibSceSaveDataDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("fH46Lag88XY", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1, sceSaveDataDialogClose); LIB_FUNCTION("yEiJ-qqr6Cg", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1, diff --git a/src/core/libraries/save_data/dialog/savedatadialog.h b/src/core/libraries/save_data/dialog/savedatadialog.h index 34afe98a7..39450b36b 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog.h +++ b/src/core/libraries/save_data/dialog/savedatadialog.h @@ -29,5 +29,5 @@ sceSaveDataDialogProgressBarSetValue(OrbisSaveDataDialogProgressBarTarget target CommonDialog::Error PS4_SYSV_ABI sceSaveDataDialogTerminate(); CommonDialog::Status PS4_SYSV_ABI sceSaveDataDialogUpdateStatus(); -void RegisterlibSceSaveDataDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SaveData::Dialog diff --git a/src/core/libraries/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index b25ebde6c..62426d461 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -1723,7 +1723,7 @@ int PS4_SYSV_ABI Func_02E4C4D201716422() { return ORBIS_OK; } -void RegisterlibSceSaveData(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("dQ2GohUHXzk", "libSceSaveData", 1, "libSceSaveData", 1, 1, sceSaveDataAbort); LIB_FUNCTION("z1JA8-iJt3k", "libSceSaveData", 1, "libSceSaveData", 1, 1, sceSaveDataBackup); LIB_FUNCTION("kLJQ3XioYiU", "libSceSaveData", 1, "libSceSaveData", 1, 1, diff --git a/src/core/libraries/save_data/savedata.h b/src/core/libraries/save_data/savedata.h index 5faf3f2d5..d1c625980 100644 --- a/src/core/libraries/save_data/savedata.h +++ b/src/core/libraries/save_data/savedata.h @@ -184,5 +184,5 @@ int PS4_SYSV_ABI sceSaveDataUnregisterEventCallback(); int PS4_SYSV_ABI sceSaveDataUpload(); int PS4_SYSV_ABI Func_02E4C4D201716422(); -void RegisterlibSceSaveData(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SaveData diff --git a/src/core/libraries/screenshot/screenshot.cpp b/src/core/libraries/screenshot/screenshot.cpp index eaa535de7..9c8e3c189 100644 --- a/src/core/libraries/screenshot/screenshot.cpp +++ b/src/core/libraries/screenshot/screenshot.cpp @@ -78,7 +78,7 @@ int PS4_SYSV_ABI sceScreenShotSetDrcParam() { return ORBIS_OK; } -void RegisterlibSceScreenShot(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("AS45QoYHjc4", "libSceScreenShot", 1, "libSceScreenShot", 0, 9, _Z5dummyv); LIB_FUNCTION("JuMLLmmvRgk", "libSceScreenShot", 1, "libSceScreenShot", 0, 9, sceScreenShotCapture); diff --git a/src/core/libraries/screenshot/screenshot.h b/src/core/libraries/screenshot/screenshot.h index d2fb4a4ea..0aee54173 100644 --- a/src/core/libraries/screenshot/screenshot.h +++ b/src/core/libraries/screenshot/screenshot.h @@ -26,5 +26,5 @@ int PS4_SYSV_ABI sceScreenShotSetOverlayImageWithOrigin(); int PS4_SYSV_ABI sceScreenShotSetParam(); int PS4_SYSV_ABI sceScreenShotSetDrcParam(); -void RegisterlibSceScreenShot(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::ScreenShot \ No newline at end of file diff --git a/src/core/libraries/share_play/shareplay.cpp b/src/core/libraries/share_play/shareplay.cpp index 8370438b9..9815d917b 100644 --- a/src/core/libraries/share_play/shareplay.cpp +++ b/src/core/libraries/share_play/shareplay.cpp @@ -131,7 +131,7 @@ int PS4_SYSV_ABI Func_F3DD6199DA15ED44() { return ORBIS_OK; } -void RegisterlibSceSharePlay(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("ggnCfalLU-8", "libSceSharePlay", 1, "libSceSharePlay", 0, 0, sceSharePlayCrashDaemon); LIB_FUNCTION("OOrLKB0bSDs", "libSceSharePlay", 1, "libSceSharePlay", 0, 0, diff --git a/src/core/libraries/share_play/shareplay.h b/src/core/libraries/share_play/shareplay.h index 8b1ad5f47..d515e02c1 100644 --- a/src/core/libraries/share_play/shareplay.h +++ b/src/core/libraries/share_play/shareplay.h @@ -50,5 +50,5 @@ int PS4_SYSV_ABI Func_C1C236728D88E177(); int PS4_SYSV_ABI Func_E9E80C474781F115(); int PS4_SYSV_ABI Func_F3DD6199DA15ED44(); -void RegisterlibSceSharePlay(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SharePlay \ No newline at end of file diff --git a/src/core/libraries/signin_dialog/signindialog.cpp b/src/core/libraries/signin_dialog/signindialog.cpp index 0e4eb63a2..6cf0a8a07 100644 --- a/src/core/libraries/signin_dialog/signindialog.cpp +++ b/src/core/libraries/signin_dialog/signindialog.cpp @@ -44,7 +44,7 @@ s32 PS4_SYSV_ABI sceSigninDialogTerminate() { return ORBIS_OK; } -void RegisterlibSceSigninDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("mlYGfmqE3fQ", "libSceSigninDialog", 1, "libSceSigninDialog", 1, 1, sceSigninDialogInitialize); LIB_FUNCTION("JlpJVoRWv7U", "libSceSigninDialog", 1, "libSceSigninDialog", 1, 1, diff --git a/src/core/libraries/signin_dialog/signindialog.h b/src/core/libraries/signin_dialog/signindialog.h index 8726ad1f6..35740efff 100644 --- a/src/core/libraries/signin_dialog/signindialog.h +++ b/src/core/libraries/signin_dialog/signindialog.h @@ -25,5 +25,5 @@ s32 PS4_SYSV_ABI sceSigninDialogGetResult(); s32 PS4_SYSV_ABI sceSigninDialogClose(); s32 PS4_SYSV_ABI sceSigninDialogTerminate(); -void RegisterlibSceSigninDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SigninDialog diff --git a/src/core/libraries/system/commondialog.cpp b/src/core/libraries/system/commondialog.cpp index cb9ce0442..8c3b819e5 100644 --- a/src/core/libraries/system/commondialog.cpp +++ b/src/core/libraries/system/commondialog.cpp @@ -156,7 +156,7 @@ int PS4_SYSV_ABI Func_F2AEE270605622B0() { return ORBIS_OK; } -void RegisterlibSceCommonDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("2RdicdHhtGA", "libSceCommonDialog", 1, "libSceCommonDialog", 1, 1, _ZN3sce16CommonDialogUtil12getSelfAppIdEv); LIB_FUNCTION("I+tdxsCap08", "libSceCommonDialog", 1, "libSceCommonDialog", 1, 1, diff --git a/src/core/libraries/system/commondialog.h b/src/core/libraries/system/commondialog.h index 6b8ea3d95..cee783e32 100644 --- a/src/core/libraries/system/commondialog.h +++ b/src/core/libraries/system/commondialog.h @@ -81,5 +81,5 @@ int PS4_SYSV_ABI Func_B71349CF15FACAB0(); int PS4_SYSV_ABI Func_CB18E00EFA946C64(); int PS4_SYSV_ABI Func_F2AEE270605622B0(); -void RegisterlibSceCommonDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::CommonDialog diff --git a/src/core/libraries/system/msgdialog.cpp b/src/core/libraries/system/msgdialog.cpp index 8a01f429f..980e361b5 100644 --- a/src/core/libraries/system/msgdialog.cpp +++ b/src/core/libraries/system/msgdialog.cpp @@ -149,7 +149,7 @@ Status PS4_SYSV_ABI sceMsgDialogUpdateStatus() { return g_status; } -void RegisterlibSceMsgDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("HTrcDKlFKuM", "libSceMsgDialog", 1, "libSceMsgDialog", 1, 1, sceMsgDialogClose); LIB_FUNCTION("Lr8ovHH9l6A", "libSceMsgDialog", 1, "libSceMsgDialog", 1, 1, sceMsgDialogGetResult); diff --git a/src/core/libraries/system/msgdialog.h b/src/core/libraries/system/msgdialog.h index b8a1f3f07..9f8c065c3 100644 --- a/src/core/libraries/system/msgdialog.h +++ b/src/core/libraries/system/msgdialog.h @@ -29,5 +29,5 @@ CommonDialog::Error PS4_SYSV_ABI sceMsgDialogProgressBarSetValue(OrbisMsgDialogP CommonDialog::Error PS4_SYSV_ABI sceMsgDialogTerminate(); CommonDialog::Status PS4_SYSV_ABI sceMsgDialogUpdateStatus(); -void RegisterlibSceMsgDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::MsgDialog diff --git a/src/core/libraries/system/posix.cpp b/src/core/libraries/system/posix.cpp index 524c74b90..d09366ca0 100644 --- a/src/core/libraries/system/posix.cpp +++ b/src/core/libraries/system/posix.cpp @@ -5,6 +5,6 @@ namespace Libraries::Posix { -void Registerlibsceposix(Core::Loader::SymbolsResolver* sym) {} +void RegisterLib(Core::Loader::SymbolsResolver* sym) {} } // namespace Libraries::Posix diff --git a/src/core/libraries/system/posix.h b/src/core/libraries/system/posix.h index 881718d7a..4d08a2785 100644 --- a/src/core/libraries/system/posix.h +++ b/src/core/libraries/system/posix.h @@ -8,5 +8,5 @@ class SymbolsResolver; } namespace Libraries::Posix { -void Registerlibsceposix(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Posix diff --git a/src/core/libraries/system/sysmodule.cpp b/src/core/libraries/system/sysmodule.cpp index d9e78e4ab..7105fd66b 100644 --- a/src/core/libraries/system/sysmodule.cpp +++ b/src/core/libraries/system/sysmodule.cpp @@ -134,7 +134,7 @@ int PS4_SYSV_ABI sceSysmoduleUnloadModuleInternalWithArg() { return ORBIS_OK; } -void RegisterlibSceSysmodule(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("D8cuU4d72xM", "libSceSysmodule", 1, "libSceSysmodule", 1, 1, sceSysmoduleGetModuleHandleInternal); LIB_FUNCTION("4fU5yvOkVG4", "libSceSysmodule", 1, "libSceSysmodule", 1, 1, diff --git a/src/core/libraries/system/sysmodule.h b/src/core/libraries/system/sysmodule.h index 9a5fe9513..27d0e19d4 100644 --- a/src/core/libraries/system/sysmodule.h +++ b/src/core/libraries/system/sysmodule.h @@ -170,5 +170,5 @@ int PS4_SYSV_ABI sceSysmoduleUnloadModuleByNameInternal(); int PS4_SYSV_ABI sceSysmoduleUnloadModuleInternal(); int PS4_SYSV_ABI sceSysmoduleUnloadModuleInternalWithArg(); -void RegisterlibSceSysmodule(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SysModule diff --git a/src/core/libraries/system/systemservice.cpp b/src/core/libraries/system/systemservice.cpp index 9dc9dd781..d8f0b339b 100644 --- a/src/core/libraries/system/systemservice.cpp +++ b/src/core/libraries/system/systemservice.cpp @@ -2429,7 +2429,7 @@ void PushSystemServiceEvent(const OrbisSystemServiceEvent& event) { g_event_queue.push(event); } -void RegisterlibSceSystemService(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("alZfRdr2RP8", "libSceAppMessaging", 1, "libSceSystemService", 1, 1, sceAppMessagingClearEventFlag); LIB_FUNCTION("jKgAUl6cLy0", "libSceAppMessaging", 1, "libSceSystemService", 1, 1, diff --git a/src/core/libraries/system/systemservice.h b/src/core/libraries/system/systemservice.h index c22ccc88f..fec7be399 100644 --- a/src/core/libraries/system/systemservice.h +++ b/src/core/libraries/system/systemservice.h @@ -607,5 +607,5 @@ int PS4_SYSV_ABI Func_CB5E885E225F69F0(); void PushSystemServiceEvent(const OrbisSystemServiceEvent& event); -void RegisterlibSceSystemService(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::SystemService diff --git a/src/core/libraries/system/userservice.cpp b/src/core/libraries/system/userservice.cpp index b4bf189ea..90571e4bc 100644 --- a/src/core/libraries/system/userservice.cpp +++ b/src/core/libraries/system/userservice.cpp @@ -2167,7 +2167,7 @@ int PS4_SYSV_ABI Func_D2B814603E7B4477() { return ORBIS_OK; } -void RegisterlibSceUserService(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("Psl9mfs3duM", "libSceUserServiceForShellCore", 1, "libSceUserService", 1, 1, sceUserServiceInitializeForShellCore); LIB_FUNCTION("CydP+QtA0KI", "libSceUserServiceForShellCore", 1, "libSceUserService", 1, 1, diff --git a/src/core/libraries/system/userservice.h b/src/core/libraries/system/userservice.h index 66ac2b69d..30920e002 100644 --- a/src/core/libraries/system/userservice.h +++ b/src/core/libraries/system/userservice.h @@ -481,5 +481,5 @@ int PS4_SYSV_ABI Func_A6BDC9DFDAFD02B4(); int PS4_SYSV_ABI Func_BB9491DFE6B4953C(); int PS4_SYSV_ABI Func_D2B814603E7B4477(); -void RegisterlibSceUserService(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::UserService diff --git a/src/core/libraries/ulobjmgr/ulobjmgr.cpp b/src/core/libraries/ulobjmgr/ulobjmgr.cpp index cad6feda9..7f1658b56 100644 --- a/src/core/libraries/ulobjmgr/ulobjmgr.cpp +++ b/src/core/libraries/ulobjmgr/ulobjmgr.cpp @@ -35,7 +35,7 @@ s32 PS4_SYSV_ABI Func_4B07893BBB77A649(u64 arg0) { return ORBIS_OK; } -void RegisterlibSceUlobjmgr(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("BG26hBGiNlw", "ulobjmgr", 1, "ulobjmgr", 1, 1, Func_046DBA8411A2365C); LIB_FUNCTION("HZ9Q2c+4BU4", "ulobjmgr", 1, "ulobjmgr", 1, 1, Func_1D9F50D9CFB8054E); LIB_FUNCTION("Smf+fUNblPc", "ulobjmgr", 1, "ulobjmgr", 1, 1, Func_4A67FE7D435B94F7); diff --git a/src/core/libraries/ulobjmgr/ulobjmgr.h b/src/core/libraries/ulobjmgr/ulobjmgr.h index 9a1440e5c..baf90719c 100644 --- a/src/core/libraries/ulobjmgr/ulobjmgr.h +++ b/src/core/libraries/ulobjmgr/ulobjmgr.h @@ -10,5 +10,5 @@ class SymbolsResolver; } namespace Libraries::Ulobjmgr { -void RegisterlibSceUlobjmgr(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Ulobjmgr \ No newline at end of file diff --git a/src/core/libraries/usbd/usbd.cpp b/src/core/libraries/usbd/usbd.cpp index e5f6151eb..56280fdc4 100644 --- a/src/core/libraries/usbd/usbd.cpp +++ b/src/core/libraries/usbd/usbd.cpp @@ -478,7 +478,7 @@ int PS4_SYSV_ABI Func_D56B43060720B1E0() { return ORBIS_OK; } -void RegisterlibSceUsbd(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("0ktE1PhzGFU", "libSceUsbd", 1, "libSceUsbd", 1, 1, sceUsbdAllocTransfer); LIB_FUNCTION("BKMEGvfCPyU", "libSceUsbd", 1, "libSceUsbd", 1, 1, sceUsbdAttachKernelDriver); LIB_FUNCTION("fotb7DzeHYw", "libSceUsbd", 1, "libSceUsbd", 1, 1, sceUsbdBulkTransfer); diff --git a/src/core/libraries/usbd/usbd.h b/src/core/libraries/usbd/usbd.h index 3bd8134a7..0841036a4 100644 --- a/src/core/libraries/usbd/usbd.h +++ b/src/core/libraries/usbd/usbd.h @@ -150,5 +150,5 @@ int PS4_SYSV_ABI Func_97F056BAD90AADE7(); int PS4_SYSV_ABI Func_C55104A33B35B264(); int PS4_SYSV_ABI Func_D56B43060720B1E0(); -void RegisterlibSceUsbd(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec.cpp b/src/core/libraries/videodec/videodec.cpp index ae7d17560..2894080f3 100644 --- a/src/core/libraries/videodec/videodec.cpp +++ b/src/core/libraries/videodec/videodec.cpp @@ -131,7 +131,7 @@ int PS4_SYSV_ABI sceVideodecReset(OrbisVideodecCtrl* pCtrlIn) { return ORBIS_OK; } -void RegisterlibSceVideodec(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("qkgRiwHyheU", "libSceVideodec", 1, "libSceVideodec", 1, 1, sceVideodecCreateDecoder); LIB_FUNCTION("q0W5GJMovMs", "libSceVideodec", 1, "libSceVideodec", 1, 1, sceVideodecDecode); diff --git a/src/core/libraries/videodec/videodec.h b/src/core/libraries/videodec/videodec.h index 45c5a6924..ab4bd9531 100644 --- a/src/core/libraries/videodec/videodec.h +++ b/src/core/libraries/videodec/videodec.h @@ -104,5 +104,5 @@ int PS4_SYSV_ABI sceVideodecQueryResourceInfo(const OrbisVideodecConfigInfo* pCf OrbisVideodecResourceInfo* pRsrcInfoOut); int PS4_SYSV_ABI sceVideodecReset(OrbisVideodecCtrl* pCtrlIn); -void RegisterlibSceVideodec(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Videodec \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec2.cpp b/src/core/libraries/videodec/videodec2.cpp index 8c91e2bf1..ef14c223f 100644 --- a/src/core/libraries/videodec/videodec2.cpp +++ b/src/core/libraries/videodec/videodec2.cpp @@ -214,7 +214,7 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp return ORBIS_OK; } -void RegisterlibSceVdec2(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("RnDibcGCPKw", "libSceVideodec2", 1, "libSceVideodec2", 1, 1, sceVideodec2QueryComputeMemoryInfo); LIB_FUNCTION("eD+X2SmxUt4", "libSceVideodec2", 1, "libSceVideodec2", 1, 1, diff --git a/src/core/libraries/videodec/videodec2.h b/src/core/libraries/videodec/videodec2.h index 410ee8ea6..0f080129f 100644 --- a/src/core/libraries/videodec/videodec2.h +++ b/src/core/libraries/videodec/videodec2.h @@ -137,5 +137,5 @@ s32 PS4_SYSV_ABI sceVideodec2Reset(OrbisVideodec2Decoder decoder); s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outputInfo, void* p1stPictureInfo, void* p2ndPictureInfo); -void RegisterlibSceVdec2(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Vdec2 \ No newline at end of file diff --git a/src/core/libraries/voice/voice.cpp b/src/core/libraries/voice/voice.cpp index caa16431a..7c912d798 100644 --- a/src/core/libraries/voice/voice.cpp +++ b/src/core/libraries/voice/voice.cpp @@ -166,7 +166,7 @@ s32 PS4_SYSV_ABI sceVoiceWriteToIPort() { return ORBIS_OK; } -void RegisterlibSceVoice(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("oV9GAdJ23Gw", "libSceVoice", 1, "libSceVoice", 0, 0, sceVoiceConnectIPortToOPort); LIB_FUNCTION("nXpje5yNpaE", "libSceVoice", 1, "libSceVoice", 0, 0, sceVoiceCreatePort); LIB_FUNCTION("b7kJI+nx2hg", "libSceVoice", 1, "libSceVoice", 0, 0, sceVoiceDeletePort); diff --git a/src/core/libraries/voice/voice.h b/src/core/libraries/voice/voice.h index 8f008f2cc..89467c83c 100644 --- a/src/core/libraries/voice/voice.h +++ b/src/core/libraries/voice/voice.h @@ -52,5 +52,5 @@ s32 PS4_SYSV_ABI sceVoiceVADAdjustment(); s32 PS4_SYSV_ABI sceVoiceVADSetVersion(); s32 PS4_SYSV_ABI sceVoiceWriteToIPort(); -void RegisterlibSceVoice(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Voice \ No newline at end of file diff --git a/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp b/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp index ee434f96a..0b1206249 100644 --- a/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp +++ b/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp @@ -78,7 +78,7 @@ s32 PS4_SYSV_ABI Func_F2BE042771625F8C() { return ORBIS_OK; } -void RegisterlibSceWebBrowserDialog(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("PSK+Eik919Q", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", 1, 1, sceWebBrowserDialogClose); LIB_FUNCTION("Wit4LjeoeX4", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", 1, 1, diff --git a/src/core/libraries/web_browser_dialog/webbrowserdialog.h b/src/core/libraries/web_browser_dialog/webbrowserdialog.h index aa118fe45..08f76a4fe 100644 --- a/src/core/libraries/web_browser_dialog/webbrowserdialog.h +++ b/src/core/libraries/web_browser_dialog/webbrowserdialog.h @@ -26,5 +26,5 @@ s32 PS4_SYSV_ABI sceWebBrowserDialogTerminate(); s32 PS4_SYSV_ABI sceWebBrowserDialogUpdateStatus(); s32 PS4_SYSV_ABI Func_F2BE042771625F8C(); -void RegisterlibSceWebBrowserDialog(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::WebBrowserDialog \ No newline at end of file diff --git a/src/core/libraries/zlib/zlib.cpp b/src/core/libraries/zlib/zlib.cpp index b304992ad..639cdc047 100644 --- a/src/core/libraries/zlib/zlib.cpp +++ b/src/core/libraries/zlib/zlib.cpp @@ -172,7 +172,7 @@ s32 PS4_SYSV_ABI sceZlibFinalize() { return ORBIS_OK; } -void RegisterlibSceZlib(Core::Loader::SymbolsResolver* sym) { +void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("m1YErdIXCp4", "libSceZlib", 1, "libSceZlib", 1, 1, sceZlibInitialize); LIB_FUNCTION("6na+Sa-B83w", "libSceZlib", 1, "libSceZlib", 1, 1, sceZlibFinalize); LIB_FUNCTION("TLar1HULv1Q", "libSceZlib", 1, "libSceZlib", 1, 1, sceZlibInflate); diff --git a/src/core/libraries/zlib/zlib_sce.h b/src/core/libraries/zlib/zlib_sce.h index 6f8cf9468..32d738f48 100644 --- a/src/core/libraries/zlib/zlib_sce.h +++ b/src/core/libraries/zlib/zlib_sce.h @@ -17,5 +17,5 @@ s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout); s32 PS4_SYSV_ABI sceZlibGetResult(u64 request_id, u32* dst_length, s32* status); s32 PS4_SYSV_ABI sceZlibFinalize(); -void RegisterlibSceZlib(Core::Loader::SymbolsResolver* sym); +void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Zlib \ No newline at end of file From aeab525a7fc66bedbb449ac7e6986fc922d36e5b Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Wed, 16 Jul 2025 04:30:20 -0500 Subject: [PATCH 14/21] Fix create flag handling in open (#3255) If the create flag is specified, but the file already exists, then the file should open successfully, regardless of permissions. This fixes a crash seen in Phantasy Star Online 2 New Genesis (CUSA29813) --- src/core/libraries/kernel/file_system.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 76d1a3339..9dd70afc6 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -118,14 +118,16 @@ s32 PS4_SYSV_ABI open(const char* raw_path, s32 flags, u16 mode) { return -1; } - if (read_only) { - // Can't create files in a read only directory - h->DeleteHandle(handle); - *__Error() = POSIX_EROFS; - return -1; + if (!exists) { + if (read_only) { + // Can't create files in a read only directory + h->DeleteHandle(handle); + *__Error() = POSIX_EROFS; + return -1; + } + // Create a file if it doesn't exist + Common::FS::IOFile out(file->m_host_name, Common::FS::FileAccessMode::Write); } - // Create a file if it doesn't exist - Common::FS::IOFile out(file->m_host_name, Common::FS::FileAccessMode::Write); } else if (!exists) { // If we're not creating a file, and it doesn't exist, return ENOENT h->DeleteHandle(handle); From 68b147488eef593586dad6f1b7bb409b0e5c5770 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Wed, 16 Jul 2025 17:03:39 +0200 Subject: [PATCH 15/21] If CONTENT_ID is empty in param.sfo, try using TITLE_ID as fallback (#3258) * If CONTENT_ID is empty in param.sfo, try using TITLE_ID as fallback * Remove assert that is now not needed and fix me switching up variable names --- src/emulator.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index 480ceee0b..9485b0e23 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -99,9 +99,12 @@ void Emulator::Run(std::filesystem::path file, const std::vector ar ASSERT_MSG(param_sfo->Open(param_sfo_path), "Failed to open param.sfo"); const auto content_id = param_sfo->GetString("CONTENT_ID"); - ASSERT_MSG(content_id.has_value(), "Failed to get CONTENT_ID"); - - id = std::string(*content_id, 7, 9); + const auto title_id = param_sfo->GetString("TITLE_ID"); + if (content_id.has_value() && !content_id->empty()) { + id = std::string(*content_id, 7, 9); + } else if (title_id.has_value()) { + id = *title_id; + } title = param_sfo->GetString("TITLE").value_or("Unknown title"); fw_version = param_sfo->GetInteger("SYSTEM_VER").value_or(0x4700000); app_version = param_sfo->GetString("APP_VER").value_or("Unknown version"); From 161aa49f37cb94827bcc574ca374eb2a3748ee7f Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Wed, 16 Jul 2025 18:04:27 +0300 Subject: [PATCH 16/21] New Crowdin updates (#3219) * New translations en_us.ts (Ukrainian) * New translations en_us.ts (Ukrainian) * New translations en_us.ts (Spanish) * New translations en_us.ts (Albanian) * New translations en_us.ts (Polish) * New translations en_us.ts (Polish) * New translations en_us.ts (Turkish) * New translations en_us.ts (German) --- src/qt_gui/translations/de_DE.ts | 49 +++++++++++------------ src/qt_gui/translations/es_ES.ts | 8 +++- src/qt_gui/translations/pl_PL.ts | 68 ++++++++++++++++---------------- src/qt_gui/translations/sq_AL.ts | 2 +- src/qt_gui/translations/tr_TR.ts | 24 +++++------ src/qt_gui/translations/uk_UA.ts | 48 +++++++++++----------- 6 files changed, 101 insertions(+), 98 deletions(-) diff --git a/src/qt_gui/translations/de_DE.ts b/src/qt_gui/translations/de_DE.ts index 46295c164..7e460afb8 100644 --- a/src/qt_gui/translations/de_DE.ts +++ b/src/qt_gui/translations/de_DE.ts @@ -527,71 +527,70 @@ unmapped - unmapped + Nicht zugeordnet L1 - L1 + L1 R1 - R1 + R1 L2 - L2 + L2 Options - Options + Optionen R2 - R2 + R2 Touchpad Left - Touchpad Left + Touchpad Links Touchpad Center - Touchpad Center + Touchpad Mitte Touchpad Right - Touchpad Right + Touchpad Rechts Triangle - Triangle + Dreieck Square - Square + Quadrat Circle - Circle + Kreis Cross - Cross + Kreuz Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: - -%1 + %1 +Einzigartige Inputs können nicht öfters als einmal gebunden werden. Input-Duplikate werden auf folgende Knöpfe gebunden Press a button - Press a button + Drücke einen Knopf Move analog stick - Move analog stick + Bewege den Analogstick @@ -778,7 +777,7 @@ Favorite - Favorite + Favoriten @@ -984,11 +983,11 @@ Remove from Favorites - Remove from Favorites + Von Favoriten Entfernen Add to Favorites - Add to Favorites + Zu Favoriten hinzufügen @@ -1226,15 +1225,15 @@ Touchpad Left - Touchpad Left + Touchpad Links Touchpad Center - Touchpad Center + Touchpad Mitte Touchpad Right - Touchpad Right + Touchpad Rechts @@ -2080,7 +2079,7 @@ Hinweis: Der Sound funktioniert nur in Qt-Versionen. * Unsupported Vulkan Version - * Unsupported Vulkan Version + * Nicht unterstützte Vulkan Version diff --git a/src/qt_gui/translations/es_ES.ts b/src/qt_gui/translations/es_ES.ts index 72b18437c..ce434d83f 100644 --- a/src/qt_gui/translations/es_ES.ts +++ b/src/qt_gui/translations/es_ES.ts @@ -581,7 +581,9 @@ Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - No se puede asignar un control único más de una vez. Controles duplicados asignados a los siguientes botones + No se puede asignar un control único más de una vez. Controles duplicados asignados a los siguientes botones: + +%1 Press a button @@ -1218,7 +1220,9 @@ Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - No se puede asignar un control único más de una vez. Controles duplicados asignados a los siguientes botones: + No se puede asignar un control único más de una vez. Controles duplicados asignados a los siguientes botones: + +%1 Touchpad Left diff --git a/src/qt_gui/translations/pl_PL.ts b/src/qt_gui/translations/pl_PL.ts index c5611c5b1..0ea902c5a 100644 --- a/src/qt_gui/translations/pl_PL.ts +++ b/src/qt_gui/translations/pl_PL.ts @@ -527,71 +527,71 @@ unmapped - unmapped + nieprzypisane L1 - L1 + L1 R1 - R1 + R1 L2 - L2 + L2 Options - Options + Options R2 - R2 + R2 Touchpad Left - Touchpad Left + Lewy Touchpad Touchpad Center - Touchpad Center + Środkowy Touchpad Touchpad Right - Touchpad Right + Prawy Touchpad Triangle - Triangle + Trójkąt Square - Square + Kwadrat Circle - Circle + Kółko Cross - Cross + Krzyżyk Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: + Nie można zbindować unikalnych akcji więcej niż raz. Zduplikowane akcje są przepisane do następujących przycisków: %1 Press a button - Press a button + Naciśnij przycisk Move analog stick - Move analog stick + Rusz gałką analogową @@ -778,7 +778,7 @@ Favorite - Favorite + Ulubione @@ -984,11 +984,11 @@ Remove from Favorites - Remove from Favorites + Usuń z Ulubionych Add to Favorites - Add to Favorites + Dodaj do Ulubionych @@ -1220,21 +1220,21 @@ Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: + Nie można zbindować unikalnych akcji więcej niż raz. Zduplikowane akcje są przepisane do następujących przycisków: %1 Touchpad Left - Touchpad Left + Lewy Touchpad Touchpad Center - Touchpad Center + Środkowy Touchpad Touchpad Right - Touchpad Right + Prawy Touchpad @@ -1457,43 +1457,43 @@ Play - Play + Graj Pause - Pause + Pauza Stop - Stop + Stop Restart - Restart + Restart Full Screen - Full Screen + Pełny ekran Controllers - Controllers + Kontrolery Keyboard - Keyboard + Klawiatura Refresh List - Refresh List + Odśwież Listę Resume - Resume + Wznów Show Labels Under Icons - Show Labels Under Icons + Pokaż etykiety pod ikonami @@ -2076,7 +2076,7 @@ * Unsupported Vulkan Version - * Unsupported Vulkan Version + * Nieobsługiwana wersja Vulkan diff --git a/src/qt_gui/translations/sq_AL.ts b/src/qt_gui/translations/sq_AL.ts index 9908dc564..a0958f348 100644 --- a/src/qt_gui/translations/sq_AL.ts +++ b/src/qt_gui/translations/sq_AL.ts @@ -1220,7 +1220,7 @@ Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Nuk mund të caktohet e njëjta hyrje unike më shumë se një herë. Hyrjet e dublikuara janë caktuar në butonët e mëposhtëm: + Nuk mund të caktohet e njëjta hyrje unike më shumë se një herë. Hyrjet e dyfishta janë caktuar në butonët e mëposhtëm: %1 diff --git a/src/qt_gui/translations/tr_TR.ts b/src/qt_gui/translations/tr_TR.ts index d4a94b42f..91d856482 100644 --- a/src/qt_gui/translations/tr_TR.ts +++ b/src/qt_gui/translations/tr_TR.ts @@ -531,15 +531,15 @@ L1 - L1 + L1 R1 - R1 + R1 L2 - L2 + L2 Options @@ -547,19 +547,19 @@ R2 - R2 + R2 Touchpad Left - Touchpad Left + Dokunmatik Yüzey Sol Touchpad Center - Touchpad Center + Dokunmatik Yüzey Orta Touchpad Right - Touchpad Right + Dokunmatik Yüzey Sağ Triangle @@ -591,7 +591,7 @@ Move analog stick - Move analog stick + Analog çubuğu taşı @@ -984,7 +984,7 @@ Remove from Favorites - Remove from Favorites + Favorilerden kaldır Add to Favorites @@ -1226,15 +1226,15 @@ Touchpad Left - Touchpad Left + Dokunmatik Yüzey Sol Touchpad Center - Touchpad Center + Dokunmatik Yüzey Orta Touchpad Right - Touchpad Right + Dokunmatik Yüzey Sağ diff --git a/src/qt_gui/translations/uk_UA.ts b/src/qt_gui/translations/uk_UA.ts index 73aa2c352..1f510e018 100644 --- a/src/qt_gui/translations/uk_UA.ts +++ b/src/qt_gui/translations/uk_UA.ts @@ -527,71 +527,71 @@ unmapped - unmapped + Не назначено L1 - L1 + L1 R1 - R1 + R1 L2 - L2 + L2 Options - Options + Опції R2 - R2 + R2 Touchpad Left - Touchpad Left + Ліва сторона сенсору Touchpad Center - Touchpad Center + Середина сенсору Touchpad Right - Touchpad Right + Права сторона сенсору Triangle - Triangle + Трикутник Square - Square + Квадрат Circle - Circle + Коло Cross - Cross + Хрест Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: + Неможливо призначити одну й ту саму кнопку більше одного разу. Повторне призначення виявлено для таких кнопок: %1 Press a button - Press a button + Натисніть кнопку Move analog stick - Move analog stick + Перемістити аналоговий стік @@ -778,7 +778,7 @@ Favorite - Favorite + Обране @@ -984,11 +984,11 @@ Remove from Favorites - Remove from Favorites + Видалити з обраного Add to Favorites - Add to Favorites + Додати до обраного @@ -1220,21 +1220,21 @@ Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: %1 - Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons: + Унікальний вхід не може бути призначений двічі. Дублікати на кнопках: %1 Touchpad Left - Touchpad Left + Ліва сторона сенсору Touchpad Center - Touchpad Center + Середина сенсору Touchpad Right - Touchpad Right + Права сторона сенсору @@ -2076,7 +2076,7 @@ * Unsupported Vulkan Version - * Unsupported Vulkan Version + * Непідтримувана версія Vulkan From fddded8d204374febcba210b8e2e325973f973b2 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Wed, 16 Jul 2025 17:06:58 +0200 Subject: [PATCH 17/21] Add an unreachable on hitting ud2 instead of getting stuck in an infinite loop (#3257) * Add an unreachable on hitting ud2 instead of getting stuck in an infinite loop * Add [[unlikely]] to get ahead of the inevitable PR review comment --- src/core/cpu_patches.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/cpu_patches.cpp b/src/core/cpu_patches.cpp index e4f65cd31..8c0897a48 100644 --- a/src/core/cpu_patches.cpp +++ b/src/core/cpu_patches.cpp @@ -753,6 +753,10 @@ static bool PatchesIllegalInstructionHandler(void* context) { ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]; const auto status = Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address); + if (ZYAN_SUCCESS(status) && instruction.mnemonic == ZydisMnemonic::ZYDIS_MNEMONIC_UD2) + [[unlikely]] { + UNREACHABLE_MSG("ud2 at code address {:#x}", (u64)code_address); + } LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}", (u64)code_address, ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic) : "Failed to decode"); From 1689cdb1a298fa2a793653ed735ed72594d7e31a Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 17 Jul 2025 20:30:14 +0300 Subject: [PATCH 18/21] Update Readme with new compatibility list link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22fc27a33..06da2d471 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ SPDX-License-Identifier: GPL-2.0-or-later **shadPS4** is an early **PlayStation 4** emulator for **Windows**, **Linux** and **macOS** written in C++. If you encounter problems or have doubts, do not hesitate to look at the [**Quickstart**](https://github.com/shadps4-emu/shadPS4/wiki/I.-Quick-start-%5BUsers%5D).\ -To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-emu/shadps4-game-compatibility).\ +To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-compatibility/shadps4-game-compatibility).\ To discuss shadPS4 development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/bFJxfftGW6).\ To get the latest news, go to our [**X (Twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/).\ For those who'd like to donate to the project, we now have a [**Kofi page**](https://ko-fi.com/shadps4)! From e914099ae224a18117a00f534bb63f7d791d5243 Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Fri, 18 Jul 2025 04:50:32 -0300 Subject: [PATCH 19/21] new compatibility repository (#3265) --- .github/ISSUE_TEMPLATE/game-bug-report.yaml | 2 +- documents/Debugging/Debugging.md | 2 +- src/qt_gui/compatibility_info.cpp | 4 ++-- src/qt_gui/game_list_frame.cpp | 3 ++- src/qt_gui/gui_context_menus.h | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/game-bug-report.yaml b/.github/ISSUE_TEMPLATE/game-bug-report.yaml index d9ebd8347..848877037 100644 --- a/.github/ISSUE_TEMPLATE/game-bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/game-bug-report.yaml @@ -17,7 +17,7 @@ body: This repository does not provide support for game patches. If you are having issues with patches please refer to [Cheats and Patches Repository](https://github.com/shadps4-emu/ps4_cheats). - Before submitting an issue please check [Game Compatibility Repository](https://github.com/shadps4-emu/shadps4-game-compatibility) for the information about the status of the game. + Before submitting an issue please check [Game Compatibility Repository](https://github.com/shadps4-compatibility/shadps4-game-compatibility) for the information about the status of the game. Please make an effort to make sure your issue isn't already reported. diff --git a/documents/Debugging/Debugging.md b/documents/Debugging/Debugging.md index ef9aab879..d2eda61b7 100644 --- a/documents/Debugging/Debugging.md +++ b/documents/Debugging/Debugging.md @@ -147,7 +147,7 @@ Accurately identifying games will help other developers that own that game recog - If your issue is small or you aren't sure whether you have properly identified something, [join the Discord server](https://discord.gg/MyZRaBngxA) and use the #development channel to concisely explain the issue, as well as any findings you currently have. -- It is recommended that you check the [game compatibility issue tracker](https://github.com/shadps4-emu/shadps4-game-compatibility/issues) and post very short summaries of progress changes there, +- It is recommended that you check the [game compatibility issue tracker](https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues) and post very short summaries of progress changes there, (such as the game now booting into the menu or getting in-game) for organizational and status update purposes. - ⚠ **Do not post theoretical, unproven game-specific issues in the emulator issue tracker that you cannot verify and locate in the emulator source code as being a bug.**\ diff --git a/src/qt_gui/compatibility_info.cpp b/src/qt_gui/compatibility_info.cpp index da32f24ae..eecd1bd47 100644 --- a/src/qt_gui/compatibility_info.cpp +++ b/src/qt_gui/compatibility_info.cpp @@ -22,8 +22,8 @@ void CompatibilityInfoClass::UpdateCompatibilityDatabase(QWidget* parent, bool f if (!forced && LoadCompatibilityFile()) return; - QUrl url("https://github.com/shadps4-emu/shadps4-game-compatibility/releases/latest/download/" - "compatibility_data.json"); + QUrl url("https://github.com/shadps4-compatibility/shadps4-game-compatibility/releases/latest/" + "download/compatibility_data.json"); QNetworkRequest request(url); QNetworkReply* reply = m_network_manager->get(request); diff --git a/src/qt_gui/game_list_frame.cpp b/src/qt_gui/game_list_frame.cpp index e4c40b4f9..e0995d3ef 100644 --- a/src/qt_gui/game_list_frame.cpp +++ b/src/qt_gui/game_list_frame.cpp @@ -91,7 +91,8 @@ GameListFrame::GameListFrame(std::shared_ptr gui_settings, connect(this, &QTableWidget::cellClicked, this, [=, this](int row, int column) { if (column == 2 && m_game_info->m_games[row].compatibility.issue_number != "") { - auto url_issues = "https://github.com/shadps4-emu/shadps4-game-compatibility/issues/"; + auto url_issues = + "https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/"; QDesktopServices::openUrl( QUrl(url_issues + m_game_info->m_games[row].compatibility.issue_number)); } else if (column == 10) { diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 6c384c4bc..110421002 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -581,7 +581,7 @@ public: if (selected == viewCompatibilityReport) { if (m_games[itemID].compatibility.issue_number != "") { auto url_issues = - "https://github.com/shadps4-emu/shadps4-game-compatibility/issues/"; + "https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/"; QDesktopServices::openUrl( QUrl(url_issues + m_games[itemID].compatibility.issue_number)); } @@ -589,8 +589,8 @@ public: if (selected == submitCompatibilityReport) { if (m_games[itemID].compatibility.issue_number == "") { - QUrl url = - QUrl("https://github.com/shadps4-emu/shadps4-game-compatibility/issues/new"); + QUrl url = QUrl("https://github.com/shadps4-compatibility/" + "shadps4-game-compatibility/issues/new"); QUrlQuery query; query.addQueryItem("template", QString("game_compatibility.yml")); query.addQueryItem( @@ -605,7 +605,7 @@ public: QDesktopServices::openUrl(url); } else { auto url_issues = - "https://github.com/shadps4-emu/shadps4-game-compatibility/issues/"; + "https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues/"; QDesktopServices::openUrl( QUrl(url_issues + m_games[itemID].compatibility.issue_number)); } From fafd3fb564886602724da12ce0e72f09d92488e1 Mon Sep 17 00:00:00 2001 From: UltraDaCat <113462733+UltraDaCat@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:20:05 +0200 Subject: [PATCH 20/21] Volume slider that adjusts how loud games are on a global level (#3240) * Update config.cpp * Update config.h * Update sdl_audio.cpp * Update settings_dialog.cpp * Update settings_dialog.h * Update settings_dialog.ui * Update gui_settings.h * Update audioout.cpp * Update audioout.h * Update settings_dialog.cpp * remove leftover settings_dialog.ui * Update settings_dialog.ui --------- Co-authored-by: georgemoralis --- src/common/config.cpp | 11 + src/common/config.h | 2 + src/core/libraries/audio/audioout.cpp | 15 + src/core/libraries/audio/audioout.h | 1 + src/core/libraries/audio/sdl_audio.cpp | 5 +- src/qt_gui/gui_settings.h | 1 + src/qt_gui/settings_dialog.cpp | 31 +- src/qt_gui/settings_dialog.h | 3 +- src/qt_gui/settings_dialog.ui | 403 +++++++++++++++---------- 9 files changed, 304 insertions(+), 168 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 6f8563377..a1b12ee5d 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -32,6 +32,7 @@ std::filesystem::path find_fs_path_or(const basic_value& v, const K& ky, namespace Config { // General +static int volumeSlider = 100; static bool isNeo = false; static bool isDevKit = false; static bool isPSNSignedIn = false; @@ -108,6 +109,9 @@ static std::string trophyKey = ""; // Expected number of items in the config file static constexpr u64 total_entries = 54; +int getVolumeSlider() { + return volumeSlider; +} bool allowHDR() { return isHDRAllowed; } @@ -157,6 +161,10 @@ std::filesystem::path GetSaveDataPath() { return save_data_path; } +void setVolumeSlider(int volumeValue) { + volumeSlider = volumeValue; +} + void setLoadGameSizeEnabled(bool enable) { load_game_size = enable; } @@ -611,6 +619,7 @@ void load(const std::filesystem::path& path) { if (data.contains("General")) { const toml::value& general = data.at("General"); + volumeSlider = toml::find_or(general, "volumeSlider", volumeSlider); isNeo = toml::find_or(general, "isPS4Pro", isNeo); isDevKit = toml::find_or(general, "isDevKit", isDevKit); isPSNSignedIn = toml::find_or(general, "isPSNSignedIn", isPSNSignedIn); @@ -806,6 +815,7 @@ void save(const std::filesystem::path& path) { fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); } + data["General"]["volumeSlider"] = volumeSlider; data["General"]["isPS4Pro"] = isNeo; data["General"]["isDevKit"] = isDevKit; data["General"]["isPSNSignedIn"] = isPSNSignedIn; @@ -901,6 +911,7 @@ void save(const std::filesystem::path& path) { void setDefaultValues() { // General + volumeSlider = 100; isNeo = false; isDevKit = false; isPSNSignedIn = false; diff --git a/src/common/config.h b/src/common/config.h index e54425676..4ace4d316 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -19,6 +19,8 @@ enum HideCursorState : int { Never, Idle, Always }; void load(const std::filesystem::path& path); void save(const std::filesystem::path& path); +int getVolumeSlider(); +void setVolumeSlider(int volumeValue); std::string getTrophyKey(); void setTrophyKey(std::string key); bool getIsFullscreen(); diff --git a/src/core/libraries/audio/audioout.cpp b/src/core/libraries/audio/audioout.cpp index 421289a9d..2ec44e80f 100644 --- a/src/core/libraries/audio/audioout.cpp +++ b/src/core/libraries/audio/audioout.cpp @@ -523,9 +523,24 @@ s32 PS4_SYSV_ABI sceAudioOutSetVolume(s32 handle, s32 flag, s32* vol) { } port.impl->SetVolume(port.volume); } + AdjustVol(); return ORBIS_OK; } +void AdjustVol() { + if (audio == nullptr) { + return; + } + + for (int i = 0; i < ports_out.size(); i++) { + std::unique_lock lock{ports_out[i].mutex}; + if (!ports_out[i].IsOpen()) { + continue; + } + ports_out[i].impl->SetVolume(ports_out[i].volume); + } +} + int PS4_SYSV_ABI sceAudioOutSetVolumeDown() { LOG_ERROR(Lib_AudioOut, "(STUBBED) called"); return ORBIS_OK; diff --git a/src/core/libraries/audio/audioout.h b/src/core/libraries/audio/audioout.h index 4f799665e..5247561ee 100644 --- a/src/core/libraries/audio/audioout.h +++ b/src/core/libraries/audio/audioout.h @@ -181,5 +181,6 @@ int PS4_SYSV_ABI sceAudioOutSystemControlSet(); int PS4_SYSV_ABI sceAudioOutSparkControlSetEqCoef(); int PS4_SYSV_ABI sceAudioOutSetSystemDebugState(); +void AdjustVol(); void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::AudioOut diff --git a/src/core/libraries/audio/sdl_audio.cpp b/src/core/libraries/audio/sdl_audio.cpp index 9aee2b447..94d624b0c 100644 --- a/src/core/libraries/audio/sdl_audio.cpp +++ b/src/core/libraries/audio/sdl_audio.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "common/logging/log.h" #include "core/libraries/audio/audioout.h" @@ -41,6 +42,7 @@ public: stream = nullptr; return; } + SDL_SetAudioStreamGain(stream, Config::getVolumeSlider() / 100.0f); } ~SDLPortBackend() override { @@ -77,7 +79,8 @@ public: } // SDL does not have per-channel volumes, for now just take the maximum of the channels. const auto vol = *std::ranges::max_element(ch_volumes); - if (!SDL_SetAudioStreamGain(stream, static_cast(vol) / SCE_AUDIO_OUT_VOLUME_0DB)) { + if (!SDL_SetAudioStreamGain(stream, static_cast(vol) / SCE_AUDIO_OUT_VOLUME_0DB * + Config::getVolumeSlider() / 100.0f)) { LOG_WARNING(Lib_AudioOut, "Failed to change SDL audio stream volume: {}", SDL_GetError()); } diff --git a/src/qt_gui/gui_settings.h b/src/qt_gui/gui_settings.h index 4c1eafc95..4d2a1b7f7 100644 --- a/src/qt_gui/gui_settings.h +++ b/src/qt_gui/gui_settings.h @@ -37,6 +37,7 @@ const gui_value gl_showBackgroundImage = gui_value(game_list, "showBackgroundIma const gui_value gl_backgroundImageOpacity = gui_value(game_list, "backgroundImageOpacity", 50); const gui_value gl_playBackgroundMusic = gui_value(game_list, "playBackgroundMusic", true); const gui_value gl_backgroundMusicVolume = gui_value(game_list, "backgroundMusicVolume", 50); +const gui_value gl_VolumeSlider = gui_value(game_list, "volumeSlider", 100); // game grid settings const gui_value gg_icon_size = gui_value(game_grid, "icon_size", 69); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index f903562f9..b08bb5aee 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -11,6 +11,7 @@ #include "common/config.h" #include "common/scm_rev.h" +#include "core/libraries/audio/audioout.h" #include "qt_gui/compatibility_info.h" #ifdef ENABLE_DISCORD_RPC #include "common/discord_rpc_handler.h" @@ -68,6 +69,7 @@ QMap chooseHomeTabMap; int backgroundImageOpacitySlider_backup; int bgm_volume_backup; +int volume_slider_backup; static std::vector m_physical_devices; @@ -149,9 +151,11 @@ SettingsDialog::SettingsDialog(std::shared_ptr gui_settings, } else if (button == ui->buttonBox->button(QDialogButtonBox::Close)) { ui->backgroundImageOpacitySlider->setValue(backgroundImageOpacitySlider_backup); emit BackgroundOpacityChanged(backgroundImageOpacitySlider_backup); + ui->horizontalVolumeSlider->setValue(volume_slider_backup); + Config::setVolumeSlider(volume_slider_backup); ui->BGMVolumeSlider->setValue(bgm_volume_backup); BackgroundMusicPlayer::getInstance().setVolume(bgm_volume_backup); - ResetInstallFolders(); + SyncRealTimeWidgetstoConfig(); } if (Common::Log::IsActive()) { Common::Log::Filter filter; @@ -170,6 +174,12 @@ SettingsDialog::SettingsDialog(std::shared_ptr gui_settings, // GENERAL TAB { + connect(ui->horizontalVolumeSlider, &QSlider::valueChanged, this, [this](int value) { + VolumeSliderChange(value); + Config::setVolumeSlider(value); + Libraries::AudioOut::AdjustVol(); + }); + #ifdef ENABLE_UPDATER #if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0)) connect(ui->updateCheckBox, &QCheckBox::stateChanged, this, [this](int state) { @@ -398,6 +408,8 @@ void SettingsDialog::closeEvent(QCloseEvent* event) { if (!is_saving) { ui->backgroundImageOpacitySlider->setValue(backgroundImageOpacitySlider_backup); emit BackgroundOpacityChanged(backgroundImageOpacitySlider_backup); + ui->horizontalVolumeSlider->setValue(volume_slider_backup); + Config::setVolumeSlider(volume_slider_backup); ui->BGMVolumeSlider->setValue(bgm_volume_backup); BackgroundMusicPlayer::getInstance().setVolume(bgm_volume_backup); } @@ -463,6 +475,8 @@ void SettingsDialog::LoadValuesFromConfig() { ui->radioButton_Bottom->setChecked(side == "bottom"); ui->BGMVolumeSlider->setValue(m_gui_settings->GetValue(gui::gl_backgroundMusicVolume).toInt()); + ui->horizontalVolumeSlider->setValue(m_gui_settings->GetValue(gui::gl_VolumeSlider).toInt()); + ui->volumeText->setText(QString::number(ui->horizontalVolumeSlider->sliderPosition()) + "%"); ui->discordRPCCheckbox->setChecked( toml::find_or(data, "General", "enableDiscordRPC", true)); QString translatedText_FullscreenMode = @@ -532,7 +546,7 @@ void SettingsDialog::LoadValuesFromConfig() { toml::find_or(data, "Input", "isMotionControlsEnabled", true)); ui->removeFolderButton->setEnabled(!ui->gameFoldersListWidget->selectedItems().isEmpty()); - ResetInstallFolders(); + SyncRealTimeWidgetstoConfig(); ui->backgroundImageOpacitySlider->setValue( m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt()); ui->showBackgroundImageCheckBox->setChecked( @@ -541,6 +555,7 @@ void SettingsDialog::LoadValuesFromConfig() { backgroundImageOpacitySlider_backup = m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt(); bgm_volume_backup = m_gui_settings->GetValue(gui::gl_backgroundMusicVolume).toInt(); + volume_slider_backup = m_gui_settings->GetValue(gui::gl_VolumeSlider).toInt(); } void SettingsDialog::InitializeEmulatorLanguages() { @@ -599,6 +614,10 @@ void SettingsDialog::OnCursorStateChanged(s16 index) { } } +void SettingsDialog::VolumeSliderChange(int value) { + ui->volumeText->setText(QString::number(ui->horizontalVolumeSlider->sliderPosition()) + "%"); +} + int SettingsDialog::exec() { return QDialog::exec(); } @@ -719,7 +738,6 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) { if (qobject_cast(obj)) { bool hovered = (event->type() == QEvent::Enter); QString elementName = obj->objectName(); - if (hovered) { updateNoteTextEdit(elementName); } else { @@ -759,6 +777,7 @@ void SettingsDialog::UpdateSettings() { Config::setCursorState(ui->hideCursorComboBox->currentIndex()); Config::setCursorHideTimeout(ui->idleTimeoutSpinBox->value()); Config::setGpuId(ui->graphicsAdapterBox->currentIndex() - 1); + m_gui_settings->SetValue(gui::gl_VolumeSlider, ui->horizontalVolumeSlider->value()); m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, ui->BGMVolumeSlider->value()); Config::setLanguage(languageIndexes[ui->consoleLanguageComboBox->currentIndex()]); Config::setEnableDiscordRPC(ui->discordRPCCheckbox->isChecked()); @@ -815,9 +834,10 @@ void SettingsDialog::UpdateSettings() { #endif BackgroundMusicPlayer::getInstance().setVolume(ui->BGMVolumeSlider->value()); + Config::setVolumeSlider(ui->horizontalVolumeSlider->value()); } -void SettingsDialog::ResetInstallFolders() { +void SettingsDialog::SyncRealTimeWidgetstoConfig() { ui->gameFoldersListWidget->clear(); std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir); @@ -865,6 +885,7 @@ void SettingsDialog::setDefaultValues() { m_gui_settings->SetValue(gui::gl_backgroundImageOpacity, 50); m_gui_settings->SetValue(gui::gl_playBackgroundMusic, false); m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50); + m_gui_settings->SetValue(gui::gl_VolumeSlider, 100); m_gui_settings->SetValue(gui::gen_checkForUpdates, false); m_gui_settings->SetValue(gui::gen_showChangeLog, false); if (Common::g_is_release) { @@ -873,4 +894,4 @@ void SettingsDialog::setDefaultValues() { m_gui_settings->SetValue(gui::gen_updateChannel, "Nightly"); } m_gui_settings->SetValue(gui::gen_guiLanguage, "en_US"); -} \ No newline at end of file +} diff --git a/src/qt_gui/settings_dialog.h b/src/qt_gui/settings_dialog.h index d9fbcb214..13fab36a2 100644 --- a/src/qt_gui/settings_dialog.h +++ b/src/qt_gui/settings_dialog.h @@ -39,12 +39,13 @@ signals: private: void LoadValuesFromConfig(); void UpdateSettings(); - void ResetInstallFolders(); + void SyncRealTimeWidgetstoConfig(); void InitializeEmulatorLanguages(); void OnLanguageChanged(int index); void OnCursorStateChanged(s16 index); void closeEvent(QCloseEvent* event) override; void setDefaultValues(); + void VolumeSliderChange(int value); std::unique_ptr ui; diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 8d239b58c..9ebb1cbc1 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -59,7 +59,7 @@ - 5 + 0 @@ -73,8 +73,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -86,148 +86,7 @@ 6 - - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - Emulator - - - false - - - false - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - 10 - - - - - Show Splash - - - - - - - Enable Discord Rich Presence - - - - - - - - - - - - - - 6 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - System - - - - 70 - - - - - Console Language - - - - - - - - - - - - Emulator Language - - - - - - - - - - - - - - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - + Qt::Orientation::Vertical @@ -240,8 +99,8 @@ - - + + Qt::Orientation::Vertical @@ -253,7 +112,7 @@ - + 6 @@ -427,6 +286,228 @@ + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + System + + + + 70 + + + + + Console Language + + + + + + + + + + + + Emulator Language + + + + + + + + + + + + + + + + + Volume + + + + + + + 0 + 0 + + + + + + + true + + + + + 0 + 0 + 414 + 69 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + 100% + + + Qt::AlignmentFlag::AlignCenter + + + true + + + + + + + Qt::FocusPolicy::StrongFocus + + + 500 + + + 100 + + + 100 + + + Qt::Orientation::Horizontal + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Emulator + + + false + + + false + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + 10 + + + + + Show Splash + + + + + + + Enable Discord Rich Presence + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + @@ -444,8 +525,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -700,7 +781,7 @@ - + 0 0 @@ -893,8 +974,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -1188,8 +1269,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -1430,8 +1511,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -1684,8 +1765,8 @@ 0 0 - 946 - 536 + 944 + 537 @@ -1826,8 +1907,8 @@ 0 0 - 946 - 536 + 944 + 537 From 76f003d38888d357678d29ad182930d56eba17ef Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:37:29 +0200 Subject: [PATCH 21/21] Disable autoupdate on branches that aren't the official main (#3262) * Disable autoupdate on branches that aren't the official main * Change to status messages because Fire Cube was complaining about this --- CMakeLists.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index adff454b8..24a81243f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,7 @@ execute_process( # If there's no upstream set or the command failed, check remote.pushDefault if (GIT_REMOTE_RESULT OR GIT_REMOTE_NAME STREQUAL "") - message("check default push") + message(STATUS "check default push") execute_process( COMMAND git config --get remote.pushDefault OUTPUT_VARIABLE GIT_REMOTE_NAME @@ -134,30 +134,30 @@ if (GIT_REMOTE_RESULT OR GIT_REMOTE_NAME STREQUAL "") ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) - message("got remote: ${GIT_REMOTE_NAME}") + message(STATUS "got remote: ${GIT_REMOTE_NAME}") endif() # If running in GitHub Actions and the above fails if (GIT_REMOTE_RESULT OR GIT_REMOTE_NAME STREQUAL "") - message("check github") + message(STATUS "check github") set(GIT_REMOTE_NAME "origin") # Retrieve environment variables if (DEFINED ENV{GITHUB_HEAD_REF} AND NOT "$ENV{GITHUB_HEAD_REF}" STREQUAL "") - message("github head ref: $ENV{GITHUB_HEAD_REF}") + message(STATUS "github head ref: $ENV{GITHUB_HEAD_REF}") set(GITHUB_HEAD_REF "$ENV{GITHUB_HEAD_REF}") else() set(GITHUB_HEAD_REF "") endif() if (DEFINED ENV{GITHUB_REF} AND NOT "$ENV{GITHUB_REF}" STREQUAL "") - message("github ref: $ENV{GITHUB_REF}") + message(STATUS "github ref: $ENV{GITHUB_REF}") string(REGEX REPLACE "^refs/[^/]*/" "" GITHUB_BRANCH "$ENV{GITHUB_REF}") string(REGEX MATCH "refs/pull/([0-9]+)/merge" MATCHED_REF "$ENV{GITHUB_REF}") if (MATCHED_REF) set(PR_NUMBER "${CMAKE_MATCH_1}") set(GITHUB_BRANCH "") - message("PR number: ${PR_NUMBER}") + message(STATUS "PR number: ${PR_NUMBER}") else() set(PR_NUMBER "") endif() @@ -179,7 +179,7 @@ if (GIT_REMOTE_RESULT OR GIT_REMOTE_NAME STREQUAL "") elseif ("${PR_NUMBER}" STREQUAL "" AND NOT "${GITHUB_REF}" STREQUAL "") set(GIT_BRANCH "${GITHUB_REF}") elseif("${GIT_BRANCH}" STREQUAL "") - message("couldn't find branch") + message(STATUS "couldn't find branch") set(GIT_BRANCH "detached-head") endif() else() @@ -188,13 +188,13 @@ else() if (INDEX GREATER -1) string(SUBSTRING "${GIT_REMOTE_NAME}" 0 "${INDEX}" GIT_REMOTE_NAME) elseif("${GIT_REMOTE_NAME}" STREQUAL "") - message("reset to origin") + message(STATUS "reset to origin") set(GIT_REMOTE_NAME "origin") endif() endif() # Get remote link -message("getting remote link") +message(STATUS "getting remote link") execute_process( COMMAND git config --get remote.${GIT_REMOTE_NAME}.url OUTPUT_VARIABLE GIT_REMOTE_URL @@ -212,7 +212,12 @@ set(APP_VERSION "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_ set(APP_IS_RELEASE false) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/src/common/scm_rev.cpp" @ONLY) -message("end git things, remote: ${GIT_REMOTE_NAME}, branch: ${GIT_BRANCH}") +message("-- end git things, remote: ${GIT_REMOTE_NAME}, branch: ${GIT_BRANCH}, link: ${GIT_REMOTE_URL}") + +if(NOT GIT_REMOTE_URL MATCHES "shadps4-emu/shadPS4" OR NOT GIT_BRANCH STREQUAL "main") + message(STATUS "not main, disabling auto update") + set(ENABLE_UPDATER OFF) +endif() if(WIN32 AND ENABLE_QT_GUI AND NOT CMAKE_PREFIX_PATH) include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/DetectQtInstallation.cmake")