mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-21 02:45:00 +00:00
Surface management rework (1/3) (#307)
* amdgpu: proper CB and DB sizes calculation; minor refactoring * texture_cache: separate file for image_info * texture_cache: image guest address moved into image info * texture_cache: surface size calculation * shader_recompiler: fixed sin/cos Thanks to red_pring and gandalfthewhite0173 * initial preparations for subresources upload * review comments
This commit is contained in:
parent
2b52a17845
commit
64459f1a76
21 changed files with 467 additions and 233 deletions
|
@ -100,11 +100,11 @@ Id EmitFPNeg64(EmitContext& ctx, Id value) {
|
|||
}
|
||||
|
||||
Id EmitFPSin(EmitContext& ctx, Id value) {
|
||||
return ctx.OpSin(ctx.F32[1], value);
|
||||
return ctx.OpSin(ctx.F32[1], ctx.OpFMul(ctx.F32[1], ctx.pi_x2, value));
|
||||
}
|
||||
|
||||
Id EmitFPCos(EmitContext& ctx, Id value) {
|
||||
return ctx.OpCos(ctx.F32[1], value);
|
||||
return ctx.OpCos(ctx.F32[1], ctx.OpFMul(ctx.F32[1], ctx.pi_x2, value));
|
||||
}
|
||||
|
||||
Id EmitFPExp2(EmitContext& ctx, Id value) {
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <boost/container/static_vector.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include "common/div_ceil.h"
|
||||
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
||||
|
||||
#include <boost/container/static_vector.hpp>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <numbers>
|
||||
|
||||
namespace Shader::Backend::SPIRV {
|
||||
namespace {
|
||||
|
||||
|
@ -100,6 +103,8 @@ void EmitContext::DefineArithmeticTypes() {
|
|||
u32_zero_value = ConstU32(0U);
|
||||
f32_zero_value = ConstF32(0.0f);
|
||||
|
||||
pi_x2 = ConstF32(2.0f * float{std::numbers::pi});
|
||||
|
||||
input_f32 = Name(TypePointer(spv::StorageClass::Input, F32[1]), "input_f32");
|
||||
input_u32 = Name(TypePointer(spv::StorageClass::Input, U32[1]), "input_u32");
|
||||
input_s32 = Name(TypePointer(spv::StorageClass::Input, S32[1]), "input_s32");
|
||||
|
|
|
@ -143,6 +143,8 @@ public:
|
|||
Id full_result_i32x2;
|
||||
Id full_result_u32x2;
|
||||
|
||||
Id pi_x2;
|
||||
|
||||
Id true_value{};
|
||||
Id false_value{};
|
||||
Id u32_one_value{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue