Merge pull request #4 from libretro/master

Merge master
This commit is contained in:
Aleksey Samoilov 2018-12-06 17:17:22 +04:00 committed by GitHub
commit 6cf90f739b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 6 deletions

View File

@ -1742,6 +1742,9 @@ static bool vulkan_frame(void *data, const void *frame,
input.view = vk->hw.image->image_view;
input.layout = vk->hw.image->image_layout;
/* The format can change on a whim. */
input.format = vk->hw.image->create_info.format;
if (frame)
{
input.width = frame_width;
@ -1769,6 +1772,7 @@ static bool vulkan_frame(void *data, const void *frame,
input.layout = tex->layout;
input.width = tex->width;
input.height = tex->height;
input.format = VK_FORMAT_UNDEFINED; /* It's already configured. */
}
vulkan_filter_chain_set_input_texture((vulkan_filter_chain_t*)vk->filter_chain, &input);

View File

@ -210,9 +210,10 @@ class Framebuffer
Framebuffer(Framebuffer&&) = delete;
void operator=(Framebuffer&&) = delete;
void set_size(DeferredDisposer &disposer, const Size2D &size);
void set_size(DeferredDisposer &disposer, const Size2D &size, VkFormat format = VK_FORMAT_UNDEFINED);
const Size2D &get_size() const { return size; }
VkFormat get_format() const { return format; }
VkImage get_image() const { return image; }
VkImageView get_view() const { return view; }
VkFramebuffer get_framebuffer() const { return framebuffer; }
@ -1009,9 +1010,10 @@ void vulkan_filter_chain::update_history(DeferredDisposer &disposer, VkCommandBu
swap(back, tmp);
if (input_texture.width != tmp->get_size().width ||
input_texture.height != tmp->get_size().height)
input_texture.height != tmp->get_size().height ||
(input_texture.format != VK_FORMAT_UNDEFINED && input_texture.format != tmp->get_format()))
{
tmp->set_size(disposer, { input_texture.width, input_texture.height });
tmp->set_size(disposer, { input_texture.width, input_texture.height }, input_texture.format);
}
tmp->copy(cmd, input_texture.image, src_layout);
@ -2422,12 +2424,14 @@ void Framebuffer::init_framebuffer()
vkCreateFramebuffer(device, &info, nullptr, &framebuffer);
}
void Framebuffer::set_size(DeferredDisposer &disposer, const Size2D &size)
void Framebuffer::set_size(DeferredDisposer &disposer, const Size2D &size, VkFormat format)
{
this->size = size;
if (format != VK_FORMAT_UNDEFINED)
this->format = format;
RARCH_LOG("[Vulkan filter chain]: Updating framebuffer size %u x %u.\n",
size.width, size.height);
RARCH_LOG("[Vulkan filter chain]: Updating framebuffer size %u x %u (format: %u).\n",
size.width, size.height, (unsigned)this->format);
{
// The current framebuffers, etc, might still be in use

View File

@ -53,6 +53,7 @@ struct vulkan_filter_chain_texture
VkImageLayout layout;
unsigned width;
unsigned height;
VkFormat format;
};
enum vulkan_filter_chain_scale

View File

@ -170,6 +170,7 @@ static void switch_joypad_poll(void)
{
hidSetNpadJoyAssignmentModeSingleByDefault(i);
hidSetNpadJoyAssignmentModeSingleByDefault(i + 1);
hidSetNpadJoyHoldType(HidJoyHoldType_Horizontal);
}
}
lastMode = 1;
@ -185,6 +186,7 @@ static void switch_joypad_poll(void)
{
hidSetNpadJoyAssignmentModeDual(i);
hidSetNpadJoyAssignmentModeDual(i + 1);
hidMergeSingleJoyAsDualJoy(i, i + 1);
}
}
lastMode = 0;