Permalink
Browse files

Logging improvements, avoid resetting the Android text drawer unneces…

…sarily
  • Loading branch information...
hrydgard committed Nov 10, 2017
1 parent 3cc5d8f commit ee768ca9494f5d2a3b969d47862e544d60591d78
@@ -65,6 +65,16 @@ std::string VulkanVendorString(uint32_t vendorId) {
}
}
const char *PresentModeString(VkPresentModeKHR presentMode) {
switch (presentMode) {
case VK_PRESENT_MODE_IMMEDIATE_KHR: return "IMMEDIATE";
case VK_PRESENT_MODE_MAILBOX_KHR: return "MAILBOX";
case VK_PRESENT_MODE_FIFO_KHR: return "FIFO";
case VK_PRESENT_MODE_FIFO_RELAXED_KHR: return "FIFO_RELAXED";
default: return "UNKNOWN";
}
}
VulkanContext::VulkanContext() {
if (!VulkanLoad()) {
init_error_ = "Failed to load Vulkan driver library";
@@ -719,7 +729,7 @@ bool VulkanContext::InitSwapchain() {
// to fall back in a sensible way.
VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR;
for (size_t i = 0; i < presentModeCount; i++) {
ILOG("Supported present mode: %d", presentModes[i]);
ILOG("Supported present mode: %d (%s)", presentModes[i], PresentModeString(presentModes[i]));
}
for (size_t i = 0; i < presentModeCount; i++) {
if (swapchainPresentMode == VK_PRESENT_MODE_MAX_ENUM_KHR) {
@@ -743,7 +753,7 @@ bool VulkanContext::InitSwapchain() {
// HACK
swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR;
#endif
ILOG("Chosen present mode: %d", swapchainPresentMode);
ILOG("Chosen present mode: %d (%s)", swapchainPresentMode, PresentModeString(swapchainPresentMode));
delete[] presentModes;
// Determine the number of VkImage's to use in the swap chain (we desire to
// own only 1 image at a time, besides the images being displayed and
@@ -742,7 +742,8 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv
ILOG("NativeApp.backbufferResize(%d x %d)", bufw, bufh);
bool new_size = pixel_xres != bufw || pixel_yres != bufh;
int old_w = pixel_xres;
int old_h = pixel_yres;
// pixel_*res is the backbuffer resolution.
pixel_xres = bufw;
pixel_yres = bufh;
@@ -770,7 +771,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv
ILOG("pixel_xres=%d pixel_yres=%d", pixel_xres, pixel_yres);
if (new_size) {
ILOG("Size change detected - calling NativeResized()");
ILOG("Size change detected (previously %d,%d) - calling NativeResized()", old_w, old_h);
NativeResized();
}
}
@@ -58,7 +58,7 @@
// Remember to loadLibrary your JNI .so in a static {} block
// Adjust these as necessary
private static String TAG = "NativeActivity";
private static String TAG = "PPSSPPNativeActivity";
// Allows us to skip a lot of initialization on secondary calls to onCreate.
private static boolean initialized = false;
@@ -29,7 +29,8 @@ TextDrawerAndroid::TextDrawerAndroid(Draw::DrawContext *draw) : TextDrawer(draw)
} else {
ELOG("Failed to find class: '%s'", textRendererClassName);
}
dpiScale_ = 1.0f;
dpiScale_ = CalculateDPIScale();
ILOG("Initializing TextDrawerAndroid with DPI scale %f", dpiScale_);
}
TextDrawerAndroid::~TextDrawerAndroid() {
@@ -2,14 +2,14 @@
#include "VulkanQueueRunner.h"
#include "VulkanRenderManager.h"
// Debug help: adb logcat -s DEBUG NativeActivity NativeApp PPSSPP
// Debug help: adb logcat -s DEBUG PPSSPPNativeActivity PPSSPP
// TODO: This is only enough for 4x render resolution / 4x texture upscale for debugger.
// Maybe we should use a dynamically allocated one for larger?
const uint32_t readbackBufferSize = 2048 * 2048 * 4;
void VulkanQueueRunner::CreateDeviceObjects() {
ILOG("VulkanQueueRuner::CreateDeviceObjects");
ILOG("VulkanQueueRunner::CreateDeviceObjects");
InitBackbufferRenderPass();
InitRenderpasses();
@@ -37,7 +37,7 @@ void VulkanQueueRunner::CreateDeviceObjects() {
}
void VulkanQueueRunner::DestroyDeviceObjects() {
ILOG("VulkanQueueRuner::DestroyDeviceObjects");
ILOG("VulkanQueueRunner::DestroyDeviceObjects");
VkDevice device = vulkan_->GetDevice();
vulkan_->Delete().QueueDeleteDeviceMemory(readbackMemory_);
vkFreeMemory(device, readbackMemory_, nullptr);

1 comment on commit ee768ca

@brujo5

This comment has been minimized.

Show comment
Hide comment
@brujo5

brujo5 Nov 10, 2017

This still happens when use per game settings

brujo5 commented on ee768ca Nov 10, 2017

This still happens when use per game settings

Please sign in to comment.