Address feedback, more fixes

This commit is contained in:
Henrik Rydgård committed 2023-01-05 08:38:53 +01:00
1 parent d352340f77
commit 7e374c9324
6 files changed
+19 -8

No files matched your search

+4 -2
View File
@@ -115,15 +115,17 @@ bool VKRGraphicsPipeline::Create(VulkanContext *vulkan, VkRenderPass compatibleR
pipe.basePipelineIndex = 0;
pipe.subpass = 0;
INFO_LOG(G3D, "Creating pipeline... rpType: %08x sampleBits: %d (%s)", (u32)rpType, (u32)sampleCount, tag_.c_str());
double start = time_now_d();
VkPipeline vkpipeline;
VkResult result = vkCreateGraphicsPipelines(vulkan->GetDevice(), desc->pipelineCache, 1, &pipe, nullptr, &vkpipeline);
double taken_ms = (time_now_d() - start) * 1000.0;
if (taken_ms < 0.1) {
DEBUG_LOG(G3D, "Pipeline creation time: %0.2f ms (fast) rpType: %08x sampleBits: %d\n(%s)", taken_ms, (u32)rpType, (u32)sampleCount, tag_.c_str());
DEBUG_LOG(G3D, "Pipeline creation time: %0.2f ms (fast) rpType: %08x sampleBits: %d (%s)", taken_ms, (u32)rpType, (u32)sampleCount, tag_.c_str());
} else {
INFO_LOG(G3D, "Pipeline creation time: %0.2f ms rpType: %08x sampleBits: %d\n(%s)", taken_ms, (u32)rpType, (u32)sampleCount, tag_.c_str());
INFO_LOG(G3D, "Pipeline creation time: %0.2f ms rpType: %08x sampleBits: %d (%s)", taken_ms, (u32)rpType, (u32)sampleCount, tag_.c_str());
}
bool success = true;
+1 -1
View File
@@ -2,7 +2,7 @@
#include <mutex>
// Note that the string pointed to must be have a lifetime until the end of the thread,
// Note that the string pointed to must have a lifetime until the end of the thread,
// for AssertCurrentThreadName to work.
void SetCurrentThreadName(const char *threadName);
void AssertCurrentThreadName(const char *threadName);
+2
View File
@@ -1210,6 +1210,8 @@ void PSPSaveDialog::JoinIOThread() {
static void DoExecuteIOAction(PSPSaveDialog *dialog) {
SetCurrentThreadName("SaveIO");
AndroidJNIThreadContext jniContext;
dialog->ExecuteIOAction();
}
+1 -2
View File
@@ -165,8 +165,7 @@ namespace SaveState
compressThread_ = std::thread([=]{
SetCurrentThreadName("SaveStateCompress");
AndroidJNIThreadContext jniContext;
// Should do no I/O, so no JNI thread context needed.
Compress(*result, *state, *base);
});
}
+6
View File
@@ -212,6 +212,8 @@ static void DiscHandler(const http::Request &request, const Path &filename) {
}
static void HandleListing(const http::Request &request) {
AndroidJNIThreadContext jniContext;
request.WriteHttpResponseHeader("1.0", 200, -1, "text/plain");
request.Out()->Printf("/\n");
if (serverFlags & (int)WebServerFlags::DISCS) {
@@ -269,6 +271,8 @@ static void RedirectToDebugger(const http::Request &request) {
}
static void HandleFallback(const http::Request &request) {
AndroidJNIThreadContext jniContext;
if (serverFlags & (int)WebServerFlags::DISCS) {
Path filename = LocalFromRemotePath(request.resource());
if (!filename.empty()) {
@@ -293,6 +297,8 @@ static void HandleFallback(const http::Request &request) {
}
static void ForwardDebuggerRequest(const http::Request &request) {
AndroidJNIThreadContext jniContext;
if (serverFlags & (int)WebServerFlags::DEBUGGER) {
// Check if this is a websocket request...
std::string upgrade;
+5 -3
View File
@@ -50,6 +50,9 @@ struct JNIEnv {};
#define JNI_VERSION_1_6 16
#endif
#include "Common/Log.h"
#include "Common/LogReporting.h"
#include "Common/Net/Resolve.h"
#include "android/jni/AndroidAudio.h"
#include "Common/GPU/OpenGL/GLCommon.h"
@@ -71,7 +74,6 @@ struct JNIEnv {};
#include "Common/Data/Text/Parsers.h"
#include "Common/VR/PPSSPPVR.h"
#include "Common/Log.h"
#include "Common/GraphicsContext.h"
#include "Common/StringUtils.h"
#include "Common/TimeUtil.h"
@@ -264,7 +266,6 @@ void Android_AttachThreadToJNI() {
JNIEnv *env;
int status = gJvm->GetEnv((void **)&env, JNI_VERSION_1_6);
if (status < 0) {
// TODO: We should have a version of getEnv that doesn't allow auto-attach.
INFO_LOG(SYSTEM, "Attaching thread '%s' (not already attached) to JNI.", GetCurrentThreadName());
JavaVMAttachArgs args{};
args.version = JNI_VERSION_1_6;
@@ -272,7 +273,8 @@ void Android_AttachThreadToJNI() {
status = gJvm->AttachCurrentThread(&env, &args);
if (status < 0) {
// bad, but wh
// bad, but what can we do other than report..
ERROR_LOG_REPORT_ONCE(threadAttachFail, SYSTEM, "Failed to attach thread %s to JNI.", GetCurrentThreadName());
}
} else {
WARN_LOG(SYSTEM, "Thread %s was already attached to JNI.", GetCurrentThreadName());