(Vulkan) Add fancy snow for Vulkan
This commit is contained in:
parent
962149ef63
commit
0d873b6da1
|
@ -331,7 +331,7 @@ typedef struct vk
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool blend;
|
bool blend;
|
||||||
VkPipeline pipelines[5 * 2];
|
VkPipeline pipelines[12];
|
||||||
struct vk_texture blank_texture;
|
struct vk_texture blank_texture;
|
||||||
} display;
|
} display;
|
||||||
|
|
||||||
|
|
|
@ -229,6 +229,10 @@ static void vulkan_init_pipelines(
|
||||||
#include "vulkan_shaders/pipeline_snow_simple.frag.inc"
|
#include "vulkan_shaders/pipeline_snow_simple.frag.inc"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
static const uint32_t pipeline_snow_frag[] =
|
||||||
|
#include "vulkan_shaders/pipeline_snow.frag.inc"
|
||||||
|
;
|
||||||
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
VkPipelineInputAssemblyStateCreateInfo input_assembly = {
|
VkPipelineInputAssemblyStateCreateInfo input_assembly = {
|
||||||
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO };
|
VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO };
|
||||||
|
@ -413,6 +417,11 @@ static void vulkan_init_pipelines(
|
||||||
module_info.pCode = alpha_blend_vert;
|
module_info.pCode = alpha_blend_vert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
module_info.codeSize = sizeof(alpha_blend_vert);
|
||||||
|
module_info.pCode = alpha_blend_vert;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
retro_assert(0 && "No shader for menu pipeline.");
|
retro_assert(0 && "No shader for menu pipeline.");
|
||||||
break;
|
break;
|
||||||
|
@ -440,6 +449,11 @@ static void vulkan_init_pipelines(
|
||||||
module_info.pCode = pipeline_snow_simple_frag;
|
module_info.pCode = pipeline_snow_simple_frag;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
module_info.codeSize = sizeof(pipeline_snow_frag);
|
||||||
|
module_info.pCode = pipeline_snow_frag;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
retro_assert(0 && "No shader for menu pipeline.");
|
retro_assert(0 && "No shader for menu pipeline.");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -90,6 +90,8 @@ static unsigned to_menu_pipeline(
|
||||||
return 6 + (type == MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
return 6 + (type == MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
||||||
case VIDEO_SHADER_MENU_3:
|
case VIDEO_SHADER_MENU_3:
|
||||||
return 8 + (type == MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
return 8 + (type == MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
||||||
|
case VIDEO_SHADER_MENU_4:
|
||||||
|
return 10 + (type == MENU_DISPLAY_PRIM_TRIANGLESTRIP);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +121,7 @@ static void menu_display_vk_draw_pipeline(void *data)
|
||||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||||
video_coord_array_t *ca = NULL;
|
video_coord_array_t *ca = NULL;
|
||||||
|
|
||||||
static uint8_t ubo_scratch_data[256];
|
static uint8_t ubo_scratch_data[512];
|
||||||
static float t = 0.0f;
|
static float t = 0.0f;
|
||||||
static struct video_coords blank_coords;
|
static struct video_coords blank_coords;
|
||||||
|
|
||||||
|
@ -149,6 +151,7 @@ static void menu_display_vk_draw_pipeline(void *data)
|
||||||
|
|
||||||
/* Snow simple */
|
/* Snow simple */
|
||||||
case VIDEO_SHADER_MENU_3:
|
case VIDEO_SHADER_MENU_3:
|
||||||
|
case VIDEO_SHADER_MENU_4:
|
||||||
draw->pipeline.backend_data = ubo_scratch_data;
|
draw->pipeline.backend_data = ubo_scratch_data;
|
||||||
draw->pipeline.backend_data_size = sizeof(math_matrix_4x4) + 3 * sizeof(float);
|
draw->pipeline.backend_data_size = sizeof(math_matrix_4x4) + 3 * sizeof(float);
|
||||||
|
|
||||||
|
@ -225,6 +228,7 @@ static void menu_display_vk_draw(void *data)
|
||||||
case VIDEO_SHADER_MENU:
|
case VIDEO_SHADER_MENU:
|
||||||
case VIDEO_SHADER_MENU_2:
|
case VIDEO_SHADER_MENU_2:
|
||||||
case VIDEO_SHADER_MENU_3:
|
case VIDEO_SHADER_MENU_3:
|
||||||
|
case VIDEO_SHADER_MENU_4:
|
||||||
{
|
{
|
||||||
const struct vk_draw_triangles call = {
|
const struct vk_draw_triangles call = {
|
||||||
vk->display.pipelines[
|
vk->display.pipelines[
|
||||||
|
@ -241,7 +245,6 @@ static void menu_display_vk_draw(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not implemented yet. */
|
/* Not implemented yet. */
|
||||||
case VIDEO_SHADER_MENU_4:
|
|
||||||
case VIDEO_SHADER_MENU_5:
|
case VIDEO_SHADER_MENU_5:
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue