You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have just spent a some time debugging why my set_viewport calls seem to cause inconsistent behaviour between metal on macos and my vulkan linux. After some investigation into wgpu-hal and blade, I found a difference in how viewports are created.
In blade, the viewport in vulkan always has the y set to the height upon starting a render
/// blade:s begin_renderlet viewport = vk::Viewport{x:0.0,y: target_size[1]asf32,// AHA! Missed this.. We shift it here alreadywidth: target_size[0]asf32,height: -(target_size[1]asf32),min_depth:0.0,max_depth:1.0,};
let vk_viewports = [vk::Viewport{x: rect.x,y:ifself.device.private_caps.flip_y_requires_shift{
rect.y + rect.h// shift is applied..}else{
rect.y},width: rect.w,height: -rect.h,// flip Ymin_depth: depth_range.start,max_depth: depth_range.end,}];
In wgpu-hal vulkan/mod.rs they state:
structPrivateCapabilities{/// Y-flipping is implemented with either `VK_AMD_negative_viewport_height` or `VK_KHR_maintenance1`/1.1+. The AMD extension for negative viewport height does not require a Y shift.////// This flag is `true` if the device has `VK_KHR_maintenance1`/1.1+ and `false` otherwise (i.e. in the case of `VK_AMD_negative_viewport_height`).flip_y_requires_shift:bool,// ..}
The text was updated successfully, but these errors were encountered:
Do I understand it correctly that since blade requires vulkan be >= API_VERSION_1_1, and always has a flipped y, blade should always set the viewport:s y to rect.y + rect.h?
I have just spent a some time debugging why my
set_viewport
calls seem to cause inconsistent behaviour between metal on macos and my vulkan linux. After some investigation intowgpu-hal
andblade
, I found a difference in how viewports are created.In blade, the viewport in vulkan always has the
y
set to the height upon starting a renderbut wgpu-hal sometimes has it set to 0
In wgpu-hal
vulkan/mod.rs
they state:The text was updated successfully, but these errors were encountered: