-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
I have a Libretro frontend for Reinforcement Learning that works perfectly with OpenGL. However, I wanted to implement Vulkan functionality and ran into some issues. One of them is how to properly implement Vulkan and pass information to the Libretro API and get cores to work. I couldn't find any documentation on this, and reading the extensive code behind the tips is a time-consuming, trial-and-error process.
I tried something and left some code below. I'd appreciate any help with any information.
// already true, dont need to change
case RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER: {
unsigned* context_type = (unsigned*)data;
*context_type = RETRO_HW_CONTEXT_VULKAN;
printf("[ENV] RETRO_HW_CONTEXT_VULKAN >>>>>>>>>> \n");
return true;
}
// already true, dont need to change
case RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE: {
unsigned *cb = (unsigned*)data;
printf("[ENV] RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE\n");
*cb = RETRO_HW_CONTEXT_VULKAN;
return false;
}
// already true, dont need to change
case RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT:
{
printf("[ENV] RETRO_ENVIRONMENT_GET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT\n");
struct retro_hw_render_context_negotiation_interface *iface =
(struct retro_hw_render_context_negotiation_interface*)data;
iface->interface_version = RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN_VERSION;
return true;
}
// TODO Implement this
case RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE: {
// video_driver_state_t *video_st = video_state_get_ptr();
// struct retro_hw_render_context_negotiation_interface *iface =
// (struct retro_hw_render_context_negotiation_interface*)data;
printf("[ENV] RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE\n");
// What to do here?
// video_st->hw_render_context_negotiation = iface;
return true;
}
// TODO Implement this
case RETRO_ENVIRONMENT_SET_HW_RENDER:
case RETRO_ENVIRONMENT_SET_HW_RENDER | RETRO_ENVIRONMENT_EXPERIMENTAL: {
// struct retro_hw_render_callback *hw = (struct retro_hw_render_callback*)data;
if(hw->context_type == RETRO_HW_CONTEXT_VULKAN) {
printf("[ENV] SET_HW_RENDER RETRO_HW_CONTEXT_VULKAN\n", hw->context_type);
} else {
printf("[ENV] SET_HW_RENDER received - context_type: %d\n", hw->context_type);
}
// What to do here?
// if (hw->context_type == RETRO_HW_CONTEXT_VULKAN) {
// // Configure nossos callbacks
// hw->context_reset = vulkan_context_reset;
// hw->context_destroy = vulkan_context_destroy;
// hw->bottom_left_origin = true;
// }
// g_video.hw = *hw;
return true;
}Metadata
Metadata
Assignees
Labels
No labels