Compare commits
2 Commits
custom-tex
...
web-serv
Author | SHA1 | Date | |
---|---|---|---|
1998a3d38e | |||
f166cbc35b |
5
dist/qt_themes/qdarkstyle/style.qss
vendored
5
dist/qt_themes/qdarkstyle/style.qss
vendored
@ -298,11 +298,6 @@ QAbstractItemView:read-only {
|
||||
alternate-background-color: #232629;
|
||||
}
|
||||
|
||||
/* Workaround for https://bugreports.qt.io/browse/QTBUG-115529 */
|
||||
QAbstractItemView:item {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
QWidget:focus {
|
||||
border: 1px solid #3daee9;
|
||||
}
|
||||
|
@ -481,11 +481,6 @@ QAbstractItemView QLineEdit {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
/* Workaround for https://bugreports.qt.io/browse/QTBUG-115529 */
|
||||
QAbstractItemView:item {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
/* QAbstractScrollArea ----------------------------------------------------
|
||||
|
||||
https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qabstractscrollarea
|
||||
|
1
externals/CMakeLists.txt
vendored
1
externals/CMakeLists.txt
vendored
@ -201,7 +201,6 @@ target_link_libraries(httplib INTERFACE ${OPENSSL_LIBRARIES})
|
||||
|
||||
if(ANDROID)
|
||||
add_subdirectory(android-ifaddrs)
|
||||
target_link_libraries(httplib INTERFACE ifaddrs)
|
||||
endif()
|
||||
|
||||
# cpp-jwt
|
||||
|
@ -341,6 +341,10 @@ if (USE_DISCORD_PRESENCE)
|
||||
target_compile_definitions(citra-qt PRIVATE -DUSE_DISCORD_PRESENCE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citra-qt PRIVATE -DENABLE_WEB_SERVICE)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(TARGETS citra-qt RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
endif()
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "citra_qt/debugger/graphics/graphics_cmdlists.h"
|
||||
#include "citra_qt/util/util.h"
|
||||
#include "common/vector_math.h"
|
||||
#include "core/core.h"
|
||||
#include "core/memory.h"
|
||||
#include "video_core/debug_utils/debug_utils.h"
|
||||
#include "video_core/pica_state.h"
|
||||
@ -167,7 +166,7 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
|
||||
const auto format = texture.format;
|
||||
|
||||
const auto info = Pica::Texture::TextureInfo::FromPicaRegister(config, format);
|
||||
const u8* src = system.Memory().GetPhysicalPointer(config.GetPhysicalAddress());
|
||||
const u8* src = memory.GetPhysicalPointer(config.GetPhysicalAddress());
|
||||
new_info_widget = new TextureInfoWidget(src, info);
|
||||
}
|
||||
if (command_info_widget) {
|
||||
@ -181,8 +180,8 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
|
||||
}
|
||||
#undef COMMAND_IN_RANGE
|
||||
|
||||
GPUCommandListWidget::GPUCommandListWidget(Core::System& system_, QWidget* parent)
|
||||
: QDockWidget(tr("Pica Command List"), parent), system{system_} {
|
||||
GPUCommandListWidget::GPUCommandListWidget(Memory::MemorySystem& memory_, QWidget* parent)
|
||||
: QDockWidget(tr("Pica Command List"), parent), memory{memory_} {
|
||||
setObjectName(QStringLiteral("Pica Command List"));
|
||||
GPUCommandListModel* model = new GPUCommandListModel(this);
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
class QPushButton;
|
||||
class QTreeView;
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
namespace Memory {
|
||||
class MemorySystem;
|
||||
}
|
||||
|
||||
class GPUCommandListModel : public QAbstractListModel {
|
||||
@ -42,7 +42,7 @@ class GPUCommandListWidget : public QDockWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GPUCommandListWidget(Core::System& system, QWidget* parent = nullptr);
|
||||
explicit GPUCommandListWidget(Memory::MemorySystem& memory, QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void OnToggleTracing();
|
||||
@ -57,7 +57,7 @@ signals:
|
||||
|
||||
private:
|
||||
std::unique_ptr<Pica::DebugUtils::PicaTrace> pica_trace;
|
||||
Core::System& system;
|
||||
Memory::MemorySystem& memory;
|
||||
QTreeView* list_widget;
|
||||
QWidget* command_info_widget;
|
||||
QPushButton* toggle_tracing;
|
||||
|
@ -448,7 +448,7 @@ void GMainWindow::InitializeDebugWidgets() {
|
||||
graphicsWidget->hide();
|
||||
debug_menu->addAction(graphicsWidget->toggleViewAction());
|
||||
|
||||
graphicsCommandsWidget = new GPUCommandListWidget(system, this);
|
||||
graphicsCommandsWidget = new GPUCommandListWidget(system.Memory(), this);
|
||||
addDockWidget(Qt::RightDockWidgetArea, graphicsCommandsWidget);
|
||||
graphicsCommandsWidget->hide();
|
||||
debug_menu->addAction(graphicsCommandsWidget->toggleViewAction());
|
||||
|
@ -480,11 +480,15 @@ target_link_libraries(citra_core PUBLIC dds-ktx PRIVATE cryptopp fmt::fmt lodepn
|
||||
set_target_properties(citra_core PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${ENABLE_LTO})
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citra_core PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citra_core PRIVATE web_service)
|
||||
if (ANDROID)
|
||||
target_link_libraries(citra_core PRIVATE ifaddrs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_SCRIPTING)
|
||||
target_compile_definitions(citra_core PUBLIC -DENABLE_SCRIPTING)
|
||||
target_compile_definitions(citra_core PRIVATE -DENABLE_SCRIPTING)
|
||||
target_sources(citra_core PRIVATE
|
||||
rpc/packet.cpp
|
||||
rpc/packet.h
|
||||
|
@ -10,6 +10,7 @@ create_target_directory_groups(citra-room)
|
||||
|
||||
target_link_libraries(citra-room PRIVATE citra_common network)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citra-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citra-room PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
|
@ -19,7 +19,11 @@ add_library(network STATIC
|
||||
create_target_directory_groups(network)
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(network PRIVATE web_service)
|
||||
if (ANDROID)
|
||||
target_link_libraries(network PRIVATE ifaddrs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(network PRIVATE citra_common enet Boost::serialization httplib)
|
||||
|
@ -127,29 +127,6 @@ void RasterizerCache<T>::RemoveFramebuffers(SurfaceId surface_id) {
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void RasterizerCache<T>::RemoveTextureCubeFace(SurfaceId surface_id) {
|
||||
if (False(slot_surfaces[surface_id].flags & SurfaceFlagBits::Tracked)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto it = texture_cube_cache.begin(); it != texture_cube_cache.end();) {
|
||||
TextureCube& cube = it->second;
|
||||
for (SurfaceId& face_id : cube.face_ids) {
|
||||
if (face_id == surface_id) {
|
||||
face_id = SurfaceId{};
|
||||
}
|
||||
}
|
||||
if (std::none_of(cube.face_ids.begin(), cube.face_ids.end(),
|
||||
[](SurfaceId id) { return id; })) {
|
||||
sentenced.emplace_back(cube.surface_id, frame_tick);
|
||||
it = texture_cube_cache.erase(it);
|
||||
} else {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool RasterizerCache<T>::AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) {
|
||||
const DebugScope scope{runtime, Common::Vec4f{0.f, 0.f, 1.f, 1.f},
|
||||
@ -889,6 +866,39 @@ SurfaceId RasterizerCache<T>::FindMatch(const SurfaceParams& params, ScaleMatch
|
||||
return match_id;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void RasterizerCache<T>::DuplicateSurface(SurfaceId src_id, SurfaceId dst_id) {
|
||||
Surface& src_surface = slot_surfaces[src_id];
|
||||
Surface& dst_surface = slot_surfaces[dst_id];
|
||||
ASSERT(dst_surface.addr <= src_surface.addr && dst_surface.end >= src_surface.end);
|
||||
|
||||
const auto src_rect = src_surface.GetScaledRect();
|
||||
const auto dst_rect = dst_surface.GetScaledSubRect(src_surface);
|
||||
ASSERT(src_rect.GetWidth() == dst_rect.GetWidth());
|
||||
|
||||
const TextureCopy copy = {
|
||||
.src_level = 0,
|
||||
.dst_level = 0,
|
||||
.src_offset = {src_rect.left, src_rect.bottom},
|
||||
.dst_offset = {dst_rect.left, dst_rect.bottom},
|
||||
.extent = {src_rect.GetWidth(), src_rect.GetHeight()},
|
||||
};
|
||||
runtime.CopyTextures(src_surface, dst_surface, copy);
|
||||
|
||||
dst_surface.invalid_regions -= src_surface.GetInterval();
|
||||
dst_surface.invalid_regions += src_surface.invalid_regions;
|
||||
|
||||
SurfaceRegions regions;
|
||||
for (const auto& pair : RangeFromInterval(dirty_regions, src_surface.GetInterval())) {
|
||||
if (pair.second == src_id) {
|
||||
regions += pair.first;
|
||||
}
|
||||
}
|
||||
for (const auto& interval : regions) {
|
||||
dirty_regions.set({interval, dst_id});
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void RasterizerCache<T>::ValidateSurface(SurfaceId surface_id, PAddr addr, u32 size) {
|
||||
if (size == 0) [[unlikely]] {
|
||||
@ -1047,7 +1057,6 @@ bool RasterizerCache<T>::UploadCustomSurface(SurfaceId surface_id, SurfaceInterv
|
||||
const SurfaceBase old_surface{slot_surfaces[surface_id]};
|
||||
const SurfaceId old_id =
|
||||
slot_surfaces.swap_and_insert(surface_id, runtime, old_surface, material);
|
||||
slot_surfaces[old_id].flags &= ~SurfaceFlagBits::Registered;
|
||||
sentenced.emplace_back(old_id, frame_tick);
|
||||
}
|
||||
Surface& surface = slot_surfaces[surface_id];
|
||||
@ -1194,6 +1203,7 @@ void RasterizerCache<T>::ClearAll(bool flush) {
|
||||
cached_pages -= flush_interval;
|
||||
dirty_regions.clear();
|
||||
page_table.clear();
|
||||
remove_surfaces.clear();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@ -1222,7 +1232,7 @@ void RasterizerCache<T>::FlushRegion(PAddr addr, u32 size, SurfaceId flush_surfa
|
||||
interval.lower(), interval.upper()};
|
||||
|
||||
SCOPE_EXIT({ flushed_intervals += interval; });
|
||||
if (surface.type == SurfaceType::Fill) {
|
||||
if (surface.IsFill()) {
|
||||
DownloadFillSurface(surface, interval);
|
||||
continue;
|
||||
}
|
||||
@ -1264,7 +1274,6 @@ void RasterizerCache<T>::InvalidateRegion(PAddr addr, u32 size, SurfaceId region
|
||||
region_owner.MarkValid(invalid_interval);
|
||||
}
|
||||
|
||||
boost::container::small_vector<SurfaceId, 4> remove_surfaces;
|
||||
ForEachSurfaceInRegion(addr, size, [&](SurfaceId surface_id, Surface& surface) {
|
||||
if (surface_id == region_owner_id) {
|
||||
return;
|
||||
@ -1292,12 +1301,13 @@ void RasterizerCache<T>::InvalidateRegion(PAddr addr, u32 size, SurfaceId region
|
||||
|
||||
for (const SurfaceId surface_id : remove_surfaces) {
|
||||
UnregisterSurface(surface_id);
|
||||
if (slot_surfaces[surface_id].type != SurfaceType::Fill) {
|
||||
if (!slot_surfaces[surface_id].IsFill()) {
|
||||
sentenced.emplace_back(surface_id, frame_tick);
|
||||
} else {
|
||||
slot_surfaces.erase(surface_id);
|
||||
}
|
||||
}
|
||||
remove_surfaces.clear();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@ -1357,7 +1367,25 @@ void RasterizerCache<T>::UnregisterSurface(SurfaceId surface_id) {
|
||||
surfaces.erase(vector_it);
|
||||
});
|
||||
|
||||
RemoveTextureCubeFace(surface_id);
|
||||
if (False(surface.flags & SurfaceFlagBits::Tracked)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto it = texture_cube_cache.begin(); it != texture_cube_cache.end();) {
|
||||
TextureCube& cube = it->second;
|
||||
for (SurfaceId& face_id : cube.face_ids) {
|
||||
if (face_id == surface_id) {
|
||||
face_id = SurfaceId{};
|
||||
}
|
||||
}
|
||||
if (std::none_of(cube.face_ids.begin(), cube.face_ids.end(),
|
||||
[](SurfaceId id) { return id; })) {
|
||||
sentenced.emplace_back(cube.surface_id, frame_tick);
|
||||
it = texture_cube_cache.erase(it);
|
||||
} else {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@ -1369,6 +1397,7 @@ void RasterizerCache<T>::UnregisterAll() {
|
||||
}
|
||||
}
|
||||
texture_cube_cache.clear();
|
||||
remove_surfaces.clear();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
@ -165,8 +165,8 @@ private:
|
||||
/// Removes any framebuffers that reference the provided surface_id.
|
||||
void RemoveFramebuffers(SurfaceId surface_id);
|
||||
|
||||
/// Removes any references of the provided surface id from cached texture cubes.
|
||||
void RemoveTextureCubeFace(SurfaceId surface_id);
|
||||
/// Transfers ownership of a memory region from src_surface to dest_surface
|
||||
void DuplicateSurface(SurfaceId src_id, SurfaceId dst_id);
|
||||
|
||||
/// Computes the hash of the provided texture data.
|
||||
u64 ComputeHash(const SurfaceParams& load_info, std::span<u8> upload_data);
|
||||
@ -224,6 +224,7 @@ private:
|
||||
Common::SlotVector<Framebuffer> slot_framebuffers;
|
||||
SurfaceMap dirty_regions;
|
||||
PageMap cached_pages;
|
||||
std::vector<SurfaceId> remove_surfaces;
|
||||
u32 resolution_scale_factor;
|
||||
u64 frame_tick{};
|
||||
FramebufferParams fb_params;
|
||||
|
@ -46,6 +46,10 @@ public:
|
||||
/// Returns true if the surface contains a custom material with a normal map.
|
||||
bool HasNormalMap() const noexcept;
|
||||
|
||||
bool IsFill() const noexcept {
|
||||
return type == SurfaceType::Fill;
|
||||
}
|
||||
|
||||
bool Overlaps(PAddr overlap_addr, size_t overlap_size) const noexcept {
|
||||
const PAddr overlap_end = overlap_addr + static_cast<PAddr>(overlap_size);
|
||||
return addr < overlap_end && overlap_addr < end;
|
||||
|
@ -16,7 +16,6 @@ add_library(web_service STATIC
|
||||
|
||||
create_target_directory_groups(web_service)
|
||||
|
||||
target_compile_definitions(web_service PUBLIC -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(web_service PRIVATE citra_common network json-headers httplib cpp-jwt)
|
||||
target_link_libraries(web_service PUBLIC ${OPENSSL_LIBS})
|
||||
set_target_properties(web_service PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${ENABLE_LTO})
|
||||
|
Reference in New Issue
Block a user