#version 460
+#extension GL_EXT_scalar_block_layout : require
+
struct VertexData {
vec4 position;
vec4 normal;
vec4 transform[3];
};
-layout(set = 0, binding = 0) uniform uniformBuffer {
+layout(std430, row_major, set = 0, binding = 0) uniform uniformBuffer {
mat4 viewProj;
};
VertexData vd = vertices[gl_VertexIndex];
mat3 modelRot = mat3(
- td.transform[0].x, td.transform[0].y, td.transform[0].z,
- td.transform[0].w, td.transform[1].x, td.transform[1].y,
- td.transform[1].z, td.transform[1].w, td.transform[2].x
+ td.transform[0].x, td.transform[0].w, td.transform[1].z,
+ td.transform[0].y, td.transform[1].x, td.transform[1].w,
+ td.transform[0].z, td.transform[1].y, td.transform[2].x
);
vec3 modelOff = vec3(td.transform[2].y, td.transform[2].z, td.transform[2].w);
- vec3 posWorld = transpose(modelRot) * vd.position.xyz + modelOff;
- vec4 posClip = transpose(viewProj) * vec4(posWorld, 1.0);
+ vec3 posWorld = modelRot * vd.position.xyz + modelOff;
+ vec4 posClip = viewProj * vec4(posWorld, 1.0);
gl_Position = posClip;
outNormal = vd.normal.xyz;
.iter()
.copied()
.find(|&physical_device| {
- let (
- physical_device_properties,
- _physical_device_properties_11,
- _physical_device_properties_12,
- _physical_device_properties_13,
- ) = {
+ let (properties, _properties_11, _properties_12, _properties_13) = {
let mut properties_13 = vk::PhysicalDeviceVulkan13Properties::default();
let mut properties_12 = vk::PhysicalDeviceVulkan12Properties {
_next: &mut properties_13 as *mut vk::PhysicalDeviceVulkan13Properties
(properties, properties_11, properties_12, properties_13)
};
- let (
- _physical_device_features,
- _physical_device_features_11,
- physical_device_features_12,
- physical_device_features_13,
- ) = {
+ let (_features, _features_11, features_12, features_13) = {
let mut features_13 = vk::PhysicalDeviceVulkan13Features::default();
let mut features_12 = vk::PhysicalDeviceVulkan12Features {
_next: &mut features_13 as *mut vk::PhysicalDeviceVulkan13Features
(features.features, features_11, features_12, features_13)
};
- physical_device_properties.properties.api_version >= vk::VERSION_1_3
- && physical_device_features_13.dynamic_rendering == vk::Bool32::True
- && physical_device_features_12.timeline_semaphore == vk::Bool32::True
- && physical_device_features_12.descriptor_indexing == vk::Bool32::True
- && physical_device_features_12.descriptor_binding_partially_bound
- == vk::Bool32::True
- && physical_device_features_12.draw_indirect_count == vk::Bool32::True
+ properties.properties.api_version >= vk::VERSION_1_3
+ && features_13.dynamic_rendering == vk::Bool32::True
+ && features_12.timeline_semaphore == vk::Bool32::True
+ && features_12.descriptor_indexing == vk::Bool32::True
+ && features_12.descriptor_binding_partially_bound == vk::Bool32::True
+ && features_12.draw_indirect_count == vk::Bool32::True
+ && features_12.uniform_buffer_standard_layout == vk::Bool32::True
})
.expect("no supported physical devices reported");
descriptor_indexing: vk::Bool32::True,
descriptor_binding_partially_bound: vk::Bool32::True,
draw_indirect_count: vk::Bool32::True,
+ uniform_buffer_standard_layout: vk::Bool32::True,
..default()
};
let enabled_features_11 = vk::PhysicalDeviceVulkan11Features {