core,shader_recompiler: align structures for 64-bit platforms (#447)

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-24 13:18:12 +00:00 committed by GitHub
parent fc745ee767
commit 243fd0be78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 13 deletions

View File

@ -22,15 +22,15 @@ public:
private: private:
struct PortOut { struct PortOut {
bool isOpen = false; SDL_AudioStream* stream = nullptr;
int type = 0;
u32 samples_num = 0; u32 samples_num = 0;
u8 sample_size = 0;
u32 freq = 0; u32 freq = 0;
u32 format = -1; u32 format = -1;
int type = 0;
int channels_num = 0; int channels_num = 0;
int volume[8] = {}; int volume[8] = {};
SDL_AudioStream* stream = nullptr; u8 sample_size = 0;
bool isOpen = false;
}; };
std::shared_mutex m_mutex; std::shared_mutex m_mutex;
std::array<PortOut, 22> portsOut; // main up to 8 ports , BGM 1 port , voice up to 4 ports , 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 // SPDX-License-Identifier: GPL-2.0-or-later
#include <pthread.h> #include <pthread.h>
@ -252,8 +252,8 @@ void VideoOutDriver::SubmitFlipInternal(VideoOutPort* port, s32 index, s64 flip_
requests.push({ requests.push({
.frame = frame, .frame = frame,
.port = port, .port = port,
.index = index,
.flip_arg = flip_arg, .flip_arg = flip_arg,
.index = index,
.eop = is_eop, .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 // SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
@ -92,8 +92,8 @@ private:
struct Request { struct Request {
Vulkan::Frame* frame; Vulkan::Frame* frame;
VideoOutPort* port; VideoOutPort* port;
s32 index;
s64 flip_arg; s64 flip_arg;
s32 index;
bool eop; bool eop;
operator bool() const noexcept { operator bool() const noexcept {

View File

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

View File

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

View File

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