core,shader_recompiler: align structures for 64-bit platforms

Decreased sizes:
 * TextureDefinition 32 bytes -> 24 bytes
 * PortOut 72 bytes -> 64 bytes
 * Request 48 bytes -> 40 bytes
 * WindowSystemInfo 32 bytes -> 24 bytes
This commit is contained in:
Herman Semenov 2024-08-21 22:05:33 +03:00
parent 834e3a500e
commit 53ca0da4b2
6 changed files with 13 additions and 15 deletions

View file

@ -22,15 +22,15 @@ public:
private:
struct PortOut {
bool isOpen = false;
int type = 0;
SDL_AudioStream* stream = nullptr;
u32 samples_num = 0;
u8 sample_size = 0;
u32 freq = 0;
u32 format = -1;
int type = 0;
int channels_num = 0;
int volume[8] = {};
SDL_AudioStream* stream = nullptr;
u8 sample_size = 0;
bool isOpen = false;
};
std::mutex m_mutex;
std::array<PortOut, 22> portsOut; // main up to 8 ports , BGM 1 port , voice up to 4 ports ,

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <pthread.h>
@ -220,9 +220,8 @@ bool VideoOutDriver::SubmitFlip(VideoOutPort* port, s32 index, s64 flip_arg,
requests.push({
.frame = frame,
.port = port,
.index = index,
.flip_arg = flip_arg,
.submit_tsc = Libraries::Kernel::sceKernelReadTsc(),
.index = index,
.eop = is_eop,
});

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@ -91,9 +91,8 @@ private:
struct Request {
Vulkan::Frame* frame;
VideoOutPort* port;
s32 index;
s64 flip_arg;
u64 submit_tsc;
s32 index;
bool eop;
operator bool() const noexcept {

View file

@ -24,9 +24,6 @@ enum class WindowSystemType : u8 {
};
struct WindowSystemInfo {
// Window system type. Determines which GL context or Vulkan WSI is used.
WindowSystemType type = WindowSystemType::Headless;
// Connection to a display server. This is used on X11 and Wayland platforms.
void* display_connection = nullptr;
@ -37,6 +34,9 @@ struct WindowSystemInfo {
// Scale of the render surface. For hidpi systems, this will be >1.
float render_surface_scale = 1.0f;
// Window system type. Determines which GL context or Vulkan WSI is used.
WindowSystemType type = WindowSystemType::Headless;
};
class WindowSDL {

View file

@ -469,8 +469,8 @@ void EmitContext::DefineImagesAndSamplers() {
Name(id, fmt::format("{}_{}{}_{:02x}", stage, "img", image_desc.sgpr_base,
image_desc.dword_offset));
images.push_back({
.id = id,
.data_types = data_types,
.id = id,
.sampled_type = image_desc.is_storage ? sampled_type : TypeSampledImage(image_type),
.pointer_type = pointer_type,
.image_type = image_type,

View file

@ -193,8 +193,8 @@ public:
Id shared_memory_u32_type{};
struct TextureDefinition {
Id id;
const VectorIds* data_types;
Id id;
Id sampled_type;
Id pointer_type;
Id image_type;