Before this patch, sometimes rendering a texture
on an android device would result in random things
appearing in the canvas, apart from the stuff
that has been drawn properly.
With these changes this does not seem to appear anymore.
There is no real effect yet when rendering, however debugging the
application with renderdoc reveals that the mipmap generation is
already correct. There's probably something weird going on with the
sampling. I'll have to look into that next.
Before this commit we would greedily wait for the upload to be complete
before exiting the function. This is of course not correct, since
we might be changing data that is still being used in a render in
flight. Of course we also need to cleanup the resources asynchronously
after the frame has been rendered fully.
There was a bug where the count of used builtin uniform buffer objects
was not advanced. This caused another problem since vulkan requires
a certain alignment for the buffer. This commit fixes both of those
things.
using the vulkan functionality probably leads to less bugs.
Until now it was assumed that any image was in the rgba8 format,
which is of course not correct. Clearing a texture to white or black
should now work for any format.
Sometimes canvas commands wouldn't get executed.
This was because when the window gets resized,
the command buffers would get recreated, and would thus
lose the recorded commands.
With this commit you can draw very simple textures.
The following code will showcase it:
```lua
function love.run()
local data = love.image.newImageData(40, 40)
for i = 0,39 do
for j=0,39 do
if i <= 20 then
if j <= 20 then
data:setPixel(i, j, 1, 0, 0, 1)
else
data:setPixel(i, j, 0, 1, 0, 1)
end
else
if j <= 20 then
data:setPixel(i, j, 0, 0, 1, 1)
else
data:setPixel(i, j, 1, 1, 1, 1)
end
end
end
end
local texture
texture = love.graphics.newTexture(data)
return function()
love.event.pump()
for name, a,b,c,d,e,f in love.event.poll() do
if name == "quit" then
if not love.quit or not love.quit() then
return a or 0
end
end
love.handlers[name](a,b,c,d,e,f)
end
love.graphics.origin()
love.graphics.clear()
love.graphics.draw(texture, 50, 500)
love.graphics.present()
end
end
```