Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Format::UNDEFINED #2262

Merged
merged 3 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions examples/src/bin/async-update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down Expand Up @@ -316,7 +314,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent: [TRANSFER_GRANULARITY * 2, TRANSFER_GRANULARITY * 2, 1],
usage: ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED,
..Default::default()
Expand Down
12 changes: 5 additions & 7 deletions examples/src/bin/buffer-allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
12 changes: 5 additions & 7 deletions examples/src/bin/clear_attachments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
12 changes: 6 additions & 6 deletions examples/src/bin/deferred/frame/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl FrameSystem {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::A2B10G10R10_UNORM_PACK32),
format: Format::A2B10G10R10_UNORM_PACK32,
extent: [1, 1, 1],
usage: ImageUsage::COLOR_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT
Expand All @@ -175,7 +175,7 @@ impl FrameSystem {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R16G16B16A16_SFLOAT),
format: Format::R16G16B16A16_SFLOAT,
extent: [1, 1, 1],
usage: ImageUsage::TRANSIENT_ATTACHMENT | ImageUsage::INPUT_ATTACHMENT,
..Default::default()
Expand All @@ -190,7 +190,7 @@ impl FrameSystem {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::D16_UNORM),
format: Format::D16_UNORM,
extent: [1, 1, 1],
usage: ImageUsage::TRANSIENT_ATTACHMENT | ImageUsage::INPUT_ATTACHMENT,
..Default::default()
Expand Down Expand Up @@ -284,7 +284,7 @@ impl FrameSystem {
&self.memory_allocator,
ImageCreateInfo {
extent,
format: Some(Format::A2B10G10R10_UNORM_PACK32),
format: Format::A2B10G10R10_UNORM_PACK32,
usage: ImageUsage::COLOR_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT
| ImageUsage::INPUT_ATTACHMENT,
Expand All @@ -300,7 +300,7 @@ impl FrameSystem {
&self.memory_allocator,
ImageCreateInfo {
extent,
format: Some(Format::R16G16B16A16_SFLOAT),
format: Format::R16G16B16A16_SFLOAT,
usage: ImageUsage::COLOR_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT
| ImageUsage::INPUT_ATTACHMENT,
Expand All @@ -316,7 +316,7 @@ impl FrameSystem {
&self.memory_allocator,
ImageCreateInfo {
extent,
format: Some(Format::D16_UNORM),
format: Format::D16_UNORM,
usage: ImageUsage::DEPTH_STENCIL_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT
| ImageUsage::INPUT_ATTACHMENT,
Expand Down
12 changes: 5 additions & 7 deletions examples/src/bin/deferred/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

let (swapchain, images) = Swapchain::new(
device.clone(),
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/dynamic-local-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent: [1024, 1024, 1],
usage: ImageUsage::TRANSFER_SRC | ImageUsage::STORAGE,
..Default::default()
Expand Down
14 changes: 6 additions & 8 deletions examples/src/bin/gl-interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ mod linux {
ImageCreateInfo {
flags: ImageCreateFlags::MUTABLE_FORMAT,
image_type: ImageType::Dim2d,
format: Some(Format::R16G16B16A16_UNORM),
format: Format::R16G16B16A16_UNORM,
extent: [200, 200, 1],
usage: ImageUsage::TRANSFER_SRC | ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED,
external_memory_handle_types: ExternalMemoryHandleTypes::OPAQUE_FD,
Expand Down Expand Up @@ -562,13 +562,11 @@ mod linux {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
14 changes: 6 additions & 8 deletions examples/src/bin/image-self-copy-blit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down Expand Up @@ -252,7 +250,7 @@ fn main() {
let image = Image::new(
&memory_allocator,
ImageCreateInfo {
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent,
usage: ImageUsage::TRANSFER_SRC | ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED,
..Default::default()
Expand Down
14 changes: 6 additions & 8 deletions examples/src/bin/image/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down Expand Up @@ -251,7 +249,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_SRGB),
format: Format::R8G8B8A8_SRGB,
extent,
usage: ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED,
..Default::default()
Expand Down
14 changes: 6 additions & 8 deletions examples/src/bin/immutable-sampler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down Expand Up @@ -257,7 +255,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_SRGB),
format: Format::R8G8B8A8_SRGB,
extent,
usage: ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED,
..Default::default()
Expand Down
12 changes: 5 additions & 7 deletions examples/src/bin/indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
12 changes: 5 additions & 7 deletions examples/src/bin/instancing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/msaa-renderpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent: [1024, 1024, 1],
usage: ImageUsage::COLOR_ATTACHMENT | ImageUsage::TRANSIENT_ATTACHMENT,
samples: SampleCount::Sample4,
Expand All @@ -178,7 +178,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent: [1024, 1024, 1],
usage: ImageUsage::TRANSFER_SRC
| ImageUsage::TRANSFER_DST
Expand Down
24 changes: 10 additions & 14 deletions examples/src/bin/multi-window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,11 @@ fn main() {

// The swapchain and framebuffer images for this particular window.
let (swapchain, images) = {
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;
let window = surface.object().unwrap().downcast_ref::<Window>().unwrap();

Swapchain::new(
Expand Down Expand Up @@ -362,13 +360,11 @@ fn main() {
.into_iter()
.next()
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/multi_window_game_of_life/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl GameOfLifeComputePipeline {
memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::R8G8B8A8_UNORM),
format: Format::R8G8B8A8_UNORM,
extent: [size[0], size[1], 1],
usage: ImageUsage::TRANSFER_DST | ImageUsage::SAMPLED | ImageUsage::STORAGE,
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/multiview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn main() {
&memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::B8G8R8A8_SRGB),
format: Format::B8G8R8A8_SRGB,
extent: [512, 512, 1],
array_layers: 2,
usage: ImageUsage::TRANSFER_SRC | ImageUsage::COLOR_ATTACHMENT,
Expand Down
14 changes: 6 additions & 8 deletions examples/src/bin/occlusion-query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ fn main() {
.physical_device()
.surface_capabilities(&surface, Default::default())
.unwrap();
let image_format = Some(
device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0,
);
let image_format = device
.physical_device()
.surface_formats(&surface, Default::default())
.unwrap()[0]
.0;

Swapchain::new(
device.clone(),
Expand Down Expand Up @@ -574,7 +572,7 @@ fn window_size_dependent_setup(
memory_allocator,
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Some(Format::D16_UNORM),
format: Format::D16_UNORM,
extent: images[0].extent(),
usage: ImageUsage::DEPTH_STENCIL_ATTACHMENT | ImageUsage::TRANSIENT_ATTACHMENT,
..Default::default()
Expand Down
Loading