wvr_server: context menu graphics fix

This commit is contained in:
galister 2026-07-04 20:04:36 +09:00
parent 9b3f315ff1
commit 59bda287ba
4 changed files with 28 additions and 3 deletions

View File

@ -21,7 +21,9 @@ use wgui::gfx::WGfx;
use vulkano::instance::InstanceCreateFlags;
use wlx_capture::DrmFormat;
use crate::shaders::{frag_color, frag_grid, frag_screen, frag_sky, frag_srgb, vert_quad};
use crate::shaders::{
frag_color, frag_grid, frag_screen, frag_simple, frag_sky, frag_srgb, vert_quad,
};
#[cfg(feature = "openxr")]
use {ash::vk, std::os::raw::c_void};
@ -83,6 +85,9 @@ impl WGfxExtras {
let shader = frag_screen::load(gfx.device.clone())?;
shaders.insert("frag_screen", shader);
let shader = frag_simple::load(gfx.device.clone())?;
shaders.insert("frag_simple", shader);
let drm_formats = get_drm_formats(gfx.device.clone()).into();
let vertices = [

View File

@ -156,8 +156,8 @@ impl WvrWindowBackend {
) -> anyhow::Result<Self> {
let popups_pipeline = app.gfx.create_pipeline(
app.gfx_extras.shaders.get("vert_quad").unwrap(), // want panic
app.gfx_extras.shaders.get("frag_screen").unwrap(), // want panic
WPipelineCreateInfo::new(app.gfx.surface_format).use_blend(AttachmentBlend::default()),
app.gfx_extras.shaders.get("frag_simple").unwrap(), // want panic
WPipelineCreateInfo::new(app.gfx.surface_format).use_blend(AttachmentBlend::alpha()),
)?;
let on_custom_attrib: OnCustomAttribFunc =

View File

@ -26,6 +26,13 @@ pub mod frag_screen {
}
}
pub mod frag_simple {
vulkano_shaders::shader! {
ty: "fragment",
path: "src/shaders/simple.frag",
}
}
pub mod frag_srgb {
vulkano_shaders::shader! {
ty: "fragment",

View File

@ -0,0 +1,13 @@
#version 310 es
precision highp float;
layout (location = 0) in vec2 in_uv;
layout (location = 0) out vec4 out_color;
layout (set = 0, binding = 0) uniform sampler2D in_texture;
void main()
{
out_color = texture(in_texture, in_uv);
}