Browse Source

Fix Pass:compute example;

bjorn 1 year ago
parent
commit
20179d68b3
2 changed files with 5 additions and 7 deletions
  1. 1 1
      api/init.lua
  2. 4 6
      api/lovr/graphics/Pass/compute.lua

File diff suppressed because it is too large
+ 1 - 1
api/init.lua


+ 4 - 6
api/lovr/graphics/Pass/compute.lua

@@ -123,20 +123,18 @@ return {
         local sx, sy = shader:getWorkgroupSize()
         local sx, sy = shader:getWorkgroupSize()
         local gx, gy = math.ceil(tw / sx), math.ceil(th / sy)
         local gx, gy = math.ceil(tw / sx), math.ceil(th / sy)
 
 
-        local computer = lovr.graphics.getPass('compute'),
-        local transfer = lovr.graphics.getPass('transfer')
+        local computer = lovr.graphics.getPass('compute')
 
 
         computer:setShader(shader)
         computer:setShader(shader)
         computer:send('image', texture)
         computer:send('image', texture)
         computer:compute(gx, gy)
         computer:compute(gx, gy)
-        transfer:mipmap(texture)
+        lovr.graphics.submit(computer)
 
 
-        lovr.graphics.submit(computer, transfer)
+        texture:generateMipmaps()
       end
       end
 
 
       function lovr.draw(pass)
       function lovr.draw(pass)
-        pass:setMaterial(texture)
-        pass:plane(0, 1.7, -1)
+        pass:draw(texture, 0, 1.7, -1)
       end
       end
     ]=]
     ]=]
   },
   },

Some files were not shown because too many files changed in this diff