Get multi sampled text to work
This commit is contained in:
parent
beddd8c1f7
commit
4956d611e0
3 changed files with 21 additions and 11 deletions
|
@ -1301,22 +1301,20 @@ impl GuiHandler {
|
||||||
.add_target_info(CustomTarget {
|
.add_target_info(CustomTarget {
|
||||||
usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.into(),
|
usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.into(),
|
||||||
format: VK_FORMAT_R8G8B8A8_UNORM,
|
format: VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
clear_on_load: false,
|
clear_on_load: true,
|
||||||
store_on_save: true,
|
store_on_save: true,
|
||||||
attach_sampler: false,
|
attach_sampler: false,
|
||||||
use_as_input: false,
|
use_as_input: false,
|
||||||
clear_value: ClearValue::Color([0.0, 0.0, 0.0, 0.0]),
|
clear_value: ClearValue::Color([0.0, 0.0, 0.0, 0.0]),
|
||||||
})
|
})
|
||||||
.set_sample_count(sample_count)
|
.set_sample_count(sample_count)
|
||||||
.add_resolve_targets(CustomTarget {
|
.add_resolve_targets(CustomTarget::resolve(
|
||||||
usage: VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.into(),
|
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
||||||
format: VK_FORMAT_R8G8B8A8_UNORM,
|
VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
clear_on_load: true,
|
None,
|
||||||
store_on_save: true,
|
false,
|
||||||
attach_sampler: false,
|
true,
|
||||||
use_as_input: true,
|
))
|
||||||
clear_value: ClearValue::Color([0.0, 0.0, 0.0, 0.0]),
|
|
||||||
})
|
|
||||||
.use_queue(queue.clone())
|
.use_queue(queue.clone())
|
||||||
.build(device)?,
|
.build(device)?,
|
||||||
)
|
)
|
||||||
|
@ -1512,7 +1510,7 @@ impl GuiHandler {
|
||||||
)?;
|
)?;
|
||||||
let fragment_shader = ShaderModule::from_slice(
|
let fragment_shader = ShaderModule::from_slice(
|
||||||
device.clone(),
|
device.clone(),
|
||||||
include_bytes!("guishader/rect.frag.spv"),
|
include_bytes!("guishader/input_rect.frag.spv"),
|
||||||
ShaderType::Fragment,
|
ShaderType::Fragment,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
12
src/guihandler/guishader/input_rect.frag
Normal file
12
src/guihandler/guishader/input_rect.frag
Normal 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);
|
||||||
|
}
|
BIN
src/guihandler/guishader/input_rect.frag.spv
Normal file
BIN
src/guihandler/guishader/input_rect.frag.spv
Normal file
Binary file not shown.
Loading…
Reference in a new issue