remove msaa
This commit is contained in:
+6
-81
@@ -3,8 +3,6 @@
|
|||||||
#![feature(portable_simd)]
|
#![feature(portable_simd)]
|
||||||
|
|
||||||
const DYNAMIC_STATE: bool = true;
|
const DYNAMIC_STATE: bool = true;
|
||||||
const MSAA_ENABLE: bool = false;
|
|
||||||
const MSAA_SAMPLES: u32 = 4;
|
|
||||||
const SAMPLE_RATE_SHADING: Option<f32> = None; //1.0;
|
const SAMPLE_RATE_SHADING: Option<f32> = None; //1.0;
|
||||||
|
|
||||||
const DUMP_SPV_TO_FILE: bool = false;
|
const DUMP_SPV_TO_FILE: bool = false;
|
||||||
@@ -50,7 +48,7 @@ use vulkano::{
|
|||||||
QueueCreateInfo, QueueFlags, physical::PhysicalDeviceType,
|
QueueCreateInfo, QueueFlags, physical::PhysicalDeviceType,
|
||||||
},
|
},
|
||||||
format::Format,
|
format::Format,
|
||||||
image::{Image, ImageCreateInfo, ImageType, ImageUsage, view::ImageView},
|
image::{Image, ImageCreateInfo, ImageType, ImageUsage, SampleCount, view::ImageView},
|
||||||
instance::{Instance, InstanceCreateInfo, InstanceExtensions},
|
instance::{Instance, InstanceCreateInfo, InstanceExtensions},
|
||||||
memory::allocator::{
|
memory::allocator::{
|
||||||
AllocationCreateInfo, MemoryAllocatePreference, MemoryTypeFilter, StandardMemoryAllocator,
|
AllocationCreateInfo, MemoryAllocatePreference, MemoryTypeFilter, StandardMemoryAllocator,
|
||||||
@@ -102,8 +100,6 @@ use crate::interpreter::{IntervalInterpreter, PointInterpreter, VALUE_0};
|
|||||||
mod types;
|
mod types;
|
||||||
mod vm;
|
mod vm;
|
||||||
|
|
||||||
const MSAA_SAMPLES_ACTUAL: u32 = if MSAA_ENABLE { MSAA_SAMPLES } else { 1 };
|
|
||||||
|
|
||||||
fn main() -> Result<(), impl Error> {
|
fn main() -> Result<(), impl Error> {
|
||||||
CombinedLogger::init(vec![
|
CombinedLogger::init(vec![
|
||||||
TermLogger::new(
|
TermLogger::new(
|
||||||
@@ -734,42 +730,7 @@ impl ApplicationHandler for App {
|
|||||||
|
|
||||||
drop(pariter);
|
drop(pariter);
|
||||||
|
|
||||||
let render_pass = if MSAA_ENABLE {
|
let render_pass = vulkano::ordered_passes_renderpass!(
|
||||||
vulkano::ordered_passes_renderpass!(
|
|
||||||
self.device.clone(),
|
|
||||||
attachments: {
|
|
||||||
intermediary: {
|
|
||||||
format: swapchain.image_format(),
|
|
||||||
samples: MSAA_SAMPLES_ACTUAL,
|
|
||||||
load_op: Clear,
|
|
||||||
store_op: DontCare,
|
|
||||||
},
|
|
||||||
color: {
|
|
||||||
format: swapchain.image_format(),
|
|
||||||
samples: 1,
|
|
||||||
load_op: DontCare,
|
|
||||||
store_op: Store,
|
|
||||||
},
|
|
||||||
multi_depth: {
|
|
||||||
format: Format::D16_UNORM,
|
|
||||||
samples: MSAA_SAMPLES_ACTUAL,
|
|
||||||
load_op: Clear,
|
|
||||||
store_op: DontCare,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
passes: [{
|
|
||||||
color: [intermediary],
|
|
||||||
color_resolve: [color],
|
|
||||||
depth_stencil: {multi_depth},
|
|
||||||
input: [],
|
|
||||||
},{
|
|
||||||
color: [color],
|
|
||||||
depth_stencil: {},
|
|
||||||
input: [],
|
|
||||||
}]
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
vulkano::ordered_passes_renderpass!(
|
|
||||||
self.device.clone(),
|
self.device.clone(),
|
||||||
attachments: {
|
attachments: {
|
||||||
color: {
|
color: {
|
||||||
@@ -795,7 +756,6 @@ impl ApplicationHandler for App {
|
|||||||
input: [],
|
input: [],
|
||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
}
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let viewport = Viewport {
|
let viewport = Viewport {
|
||||||
@@ -826,7 +786,7 @@ impl ApplicationHandler for App {
|
|||||||
GuiConfig {
|
GuiConfig {
|
||||||
allow_srgb_render_target: true,
|
allow_srgb_render_target: true,
|
||||||
is_overlay: true,
|
is_overlay: true,
|
||||||
samples: MSAA_SAMPLES_ACTUAL.try_into().unwrap(),
|
samples: SampleCount::Sample1,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1201,11 +1161,7 @@ impl App {
|
|||||||
builder
|
builder
|
||||||
.begin_render_pass(
|
.begin_render_pass(
|
||||||
RenderPassBeginInfo {
|
RenderPassBeginInfo {
|
||||||
clear_values: if MSAA_ENABLE {
|
clear_values: vec![Some([0.12, 0.1, 0.1, 1.0].into()), Some(1.0.into())],
|
||||||
vec![Some([0.12, 0.1, 0.1, 1.0].into()), None, Some(1.0.into())]
|
|
||||||
} else {
|
|
||||||
vec![Some([0.12, 0.1, 0.1, 1.0].into()), Some(1.0.into())]
|
|
||||||
},
|
|
||||||
..RenderPassBeginInfo::framebuffer(
|
..RenderPassBeginInfo::framebuffer(
|
||||||
rcx.framebuffers[image_index as usize].clone(),
|
rcx.framebuffers[image_index as usize].clone(),
|
||||||
)
|
)
|
||||||
@@ -1321,7 +1277,6 @@ fn framebuffer_generation(
|
|||||||
format: Format::D16_UNORM,
|
format: Format::D16_UNORM,
|
||||||
extent: images[0].extent(),
|
extent: images[0].extent(),
|
||||||
usage: ImageUsage::DEPTH_STENCIL_ATTACHMENT | ImageUsage::TRANSIENT_ATTACHMENT,
|
usage: ImageUsage::DEPTH_STENCIL_ATTACHMENT | ImageUsage::TRANSIENT_ATTACHMENT,
|
||||||
samples: MSAA_SAMPLES_ACTUAL.try_into().unwrap(),
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
AllocationCreateInfo::default(),
|
AllocationCreateInfo::default(),
|
||||||
@@ -1330,29 +1285,6 @@ fn framebuffer_generation(
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let intermediary = if MSAA_ENABLE {
|
|
||||||
Some(
|
|
||||||
ImageView::new_default(
|
|
||||||
Image::new(
|
|
||||||
allocator.clone(),
|
|
||||||
ImageCreateInfo {
|
|
||||||
image_type: ImageType::Dim2d,
|
|
||||||
format: images[0].format(),
|
|
||||||
extent: images[0].extent(),
|
|
||||||
usage: ImageUsage::COLOR_ATTACHMENT | ImageUsage::TRANSIENT_ATTACHMENT,
|
|
||||||
samples: MSAA_SAMPLES_ACTUAL.try_into().unwrap(),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
AllocationCreateInfo::default(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
let framebuffers = images
|
let framebuffers = images
|
||||||
.iter()
|
.iter()
|
||||||
.map(|image| {
|
.map(|image| {
|
||||||
@@ -1361,15 +1293,8 @@ fn framebuffer_generation(
|
|||||||
Framebuffer::new(
|
Framebuffer::new(
|
||||||
render_pass.clone(),
|
render_pass.clone(),
|
||||||
FramebufferCreateInfo {
|
FramebufferCreateInfo {
|
||||||
attachments: if MSAA_ENABLE {
|
attachments: vec![view, depth_buffer.clone()],
|
||||||
vec![
|
|
||||||
intermediary.as_ref().unwrap().clone(),
|
|
||||||
view,
|
|
||||||
depth_buffer.clone(),
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
vec![view, depth_buffer.clone()]
|
|
||||||
},
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user