eliemichel / LearnWebGPU-Code

The accompanying code of the Learn WebGPU C++ programming guide
https://eliemichel.github.io/LearnWebGPU
MIT License
114 stars 30 forks source link

Shrinking automatically when drawing triangle #11

Open rollschild opened 1 year ago

rollschild commented 1 year ago

Hi,

I'm on step030 - Triangle and running into the issue where the surface automatically shrinks as long as it starts drawing the triangle.

Here is a GIF, hopefully it's clear enough: triangle

As you can see (sorry if it still flashes too fast, I did my best to slow it down), I was able to draw it and at first it was the original size (640x480) but shortly after it started to draw the triangle it automatically shrank to a much smaller size. This really puzzles me.

I'm using wgpu as backend and it's on Wayland.

Thanks!

eliemichel commented 1 year ago

This is hard for me to reproduce, can it be your window manager doing weird things with DPI settings? If you can check whether glfwGetWindowSize changes in your main loop, also I think GLFW has some getters about DPI/pixel density that you may want to check.