Get multi sampled text to work

This commit is contained in:
hodasemi 2023-01-22 18:18:24 +01:00
parent 775bda1d07
commit d563a6c089
3 changed files with 21 additions and 11 deletions

View file

@ -1301,22 +1301,20 @@ impl GuiHandler {
.add_target_info(CustomTarget {
usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.into(),
format: VK_FORMAT_R8G8B8A8_UNORM,
clear_on_load: false,
clear_on_load: true,
store_on_save: true,
attach_sampler: false,
use_as_input: false,
clear_value: ClearValue::Color([0.0, 0.0, 0.0, 0.0]),
})
.set_sample_count(sample_count)
.add_resolve_targets(CustomTarget {
usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.into(),
format: VK_FORMAT_R8G8B8A8_UNORM,
clear_on_load: true,
store_on_save: true,
attach_sampler: false,
use_as_input: true,
clear_value: ClearValue::Color([0.0, 0.0, 0.0, 0.0]),
})
.add_resolve_targets(CustomTarget::resolve(
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
VK_FORMAT_R8G8B8A8_UNORM,
None,
false,
true,
))
.use_queue(queue.clone())
.build(device)?,
)
@ -1512,7 +1510,7 @@ impl GuiHandler {
)?;
let fragment_shader = ShaderModule::from_slice(
device.clone(),
include_bytes!("guishader/rect.frag.spv"),
include_bytes!("guishader/input_rect.frag.spv"),
ShaderType::Fragment,
)?;

View file

@ -0,0 +1,12 @@
#version 450
layout (location = 0) in vec2 uv;
layout (input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput image;
layout (location = 0) out vec4 color;
void main()
{
color = subpassLoad(image);
}

Binary file not shown.