mirror of https://git.citron-emu.org/Citron/Citron
Compare commits
2 Commits
278486d059
...
3205c9b691
| Author | SHA1 | Date |
|---|---|---|
|
|
3205c9b691 | |
|
|
f1e169e060 |
|
|
@ -19,31 +19,24 @@ namespace {
|
|||
|
||||
s32 NormalizeSwapInterval(f32* out_speed_scale, s32 swap_interval) {
|
||||
if (swap_interval <= 0) {
|
||||
// If swap_interval is 0 and setting enabled, respect it as unlocked FPS
|
||||
if (swap_interval == 0 && Settings::values.respect_present_interval_zero.GetValue()) {
|
||||
if (out_speed_scale) {
|
||||
*out_speed_scale = 1.0f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// As an extension, treat nonpositive swap interval as speed multiplier.
|
||||
if (out_speed_scale) {
|
||||
*out_speed_scale = 2.f * static_cast<f32>(1 - swap_interval);
|
||||
}
|
||||
|
||||
swap_interval = 1;
|
||||
// Only normalize swap_interval to 1 if we're not respecting present interval 0
|
||||
if (swap_interval == 0 && Settings::values.respect_present_interval_zero.GetValue()) {
|
||||
// Keep swap_interval as 0 to allow for unlocked FPS
|
||||
} else {
|
||||
swap_interval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (swap_interval >= 5) {
|
||||
// As an extension, treat high swap interval as precise speed control.
|
||||
if (out_speed_scale) {
|
||||
*out_speed_scale = static_cast<f32>(swap_interval) / 100.f;
|
||||
}
|
||||
|
||||
swap_interval = 1;
|
||||
}
|
||||
|
||||
return swap_interval;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ void AsyncCompileShader(const Device& device, const std::string& shader_path,
|
|||
}).detach();
|
||||
}
|
||||
|
||||
ShaderManager::ShaderManager(const Device& device) : device(device) {
|
||||
ShaderManager::ShaderManager(const Device& device_) : device(device_) {
|
||||
// Initialize command queue system
|
||||
InitializeCommandQueue();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,26 +116,27 @@ vk::Image TextureManager::LoadTexture(const std::string& texture_path) {
|
|||
|
||||
vk::Image TextureManager::CreateDefaultTexture() {
|
||||
// Create a small default texture (1x1 pixel) to use as a fallback
|
||||
const VkExtent2D extent{1, 1};
|
||||
// const VkExtent2D extent{1, 1};
|
||||
|
||||
// Create image
|
||||
const VkImageCreateInfo image_ci{
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.imageType = VK_IMAGE_TYPE_2D,
|
||||
.format = texture_format,
|
||||
.extent = {extent.width, extent.height, 1},
|
||||
.mipLevels = 1,
|
||||
.arrayLayers = 1,
|
||||
.samples = VK_SAMPLE_COUNT_1_BIT,
|
||||
.tiling = VK_IMAGE_TILING_OPTIMAL,
|
||||
.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
.queueFamilyIndexCount = 0,
|
||||
.pQueueFamilyIndices = nullptr,
|
||||
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
};
|
||||
// Avoid unused variable warning by commenting out the unused struct
|
||||
// VkImageCreateInfo image_ci{
|
||||
// .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||
// .pNext = nullptr,
|
||||
// .flags = 0,
|
||||
// .imageType = VK_IMAGE_TYPE_2D,
|
||||
// .format = texture_format,
|
||||
// .extent = {extent.width, extent.height, 1},
|
||||
// .mipLevels = 1,
|
||||
// .arrayLayers = 1,
|
||||
// .samples = VK_SAMPLE_COUNT_1_BIT,
|
||||
// .tiling = VK_IMAGE_TILING_OPTIMAL,
|
||||
// .usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
// .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
// .queueFamilyIndexCount = 0,
|
||||
// .pQueueFamilyIndices = nullptr,
|
||||
// .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
// };
|
||||
|
||||
// TODO: create an actual VkImage [ZEP]
|
||||
LOG_INFO(Render_Vulkan, "Created default fallback texture");
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void FaultManagedAllocator::ExceptionHandlerThread() {
|
|||
|
||||
void FaultManagedAllocator::Initialize(void* base, size_t size) {
|
||||
#if defined(__linux__) || defined(__ANDROID__)
|
||||
uffd = syscall(SYS_userfaultfd, O_CLOEXEC | O_NONBLOCK);
|
||||
uffd = static_cast<int>(syscall(SYS_userfaultfd, O_CLOEXEC | O_NONBLOCK));
|
||||
if (uffd < 0) {
|
||||
LOG_ERROR(Render_Vulkan, "Failed to create userfaultfd, fault handling disabled");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue