Skip to content

Commit

Permalink
Enable image_view_format_swizzle feature
Browse files Browse the repository at this point in the history
Need to enable it before it can be used (at least on macOS). Also switching check to check for enabled instead of supported.
  • Loading branch information
henrikno committed Feb 23, 2025
1 parent 1d080fe commit ab58dbb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion examples/demo_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ pub struct Window {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);
// Vulkano windows (create one)
let windows = VulkanoWindows::default();

Expand Down
4 changes: 3 additions & 1 deletion examples/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ pub struct App {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);

// Vulkano windows
let windows = VulkanoWindows::default();
Expand Down
4 changes: 3 additions & 1 deletion examples/multisample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ pub struct App {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);

// Vulkano windows
let windows = VulkanoWindows::default();
Expand Down
4 changes: 3 additions & 1 deletion examples/paint_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pub struct App {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);

// Vulkano windows
let windows = VulkanoWindows::default();
Expand Down
4 changes: 3 additions & 1 deletion examples/subpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ pub struct App {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);

// Vulkano windows
let windows = VulkanoWindows::default();
Expand Down
4 changes: 3 additions & 1 deletion examples/wholesome/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ pub struct App {
impl Default for App {
fn default() -> Self {
// Vulkano context
let context = VulkanoContext::new(VulkanoConfig::default());
let mut config = VulkanoConfig::default();
config.device_features.image_view_format_swizzle = true;
let context = VulkanoContext::new(config);

// Vulkano windows
let windows = VulkanoWindows::default();
Expand Down
4 changes: 2 additions & 2 deletions src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ impl Renderer {
fn choose_font_format(device: &vulkano::device::Device) -> Format {
// Some portability subset devices are unable to swizzle views.
let supports_swizzle =
!device.physical_device().supported_extensions().khr_portability_subset
|| device.physical_device().supported_features().image_view_format_swizzle;
!device.enabled_extensions().khr_portability_subset
|| device.enabled_features().image_view_format_swizzle;
// Check that this format is supported for all our uses:
let is_supported = |device: &vulkano::device::Device, format: Format| {
device
Expand Down

0 comments on commit ab58dbb

Please sign in to comment.