ada.tv | a lovr project to reproduce the issue, there should be a red square with "draw pass" and a blue square with "xr quad layer" in front of the hmd this is on git monado built as an arch aur package and locally-built git lovr (im not sure if the new undocumented openxr quad layers api is in the appimage versions) i'm running the sway wayland compositor on an amd rx 6600 with mesa 24.2.6 amdgpu and linux kernel 6.6.59 lts
-- conf.lua
function lovr.conf(cfg)
cfg.headset.overlay = true
end
-- main.lua
local mat4 = lovr.math.mat4
local vec3 = lovr.math.vec3
local quat = lovr.math.quat
local xr_layer
function lovr.load()
xr_layer = lovr.headset.newLayer(256, 256)
xr_layer:setDimensions(1.0, 1.0)
lovr.headset.setLayers({xr_layer})
end
function lovr.draw(pass)
local pose_mat = mat4(lovr.headset.getPose("head"))
pass:push()
pass:transform(pose_mat:translate(0.5, 0.0, -1.0))
pass:setColor(0.5, 0.0, 0.0, 1.0)
pass:plane(0.0, 0.0, 0.0, 0.5, 0.5)
pass:setColor(1.0, 1.0, 1.0, 1.0)
pass:text("Draw Pass", 0, 0, 0.01, 0.1)
pass:pop()
local xr_pass = xr_layer:getPass()
xr_pass:setProjection(1, mat4():orthographic(0, 256, 0, 256, -10, 10))
xr_pass:setViewport(0, 0, 256, 256)
xr_pass:setViewPose(1, vec3(), quat())
xr_pass:setDepthTest("none")
xr_pass:setDepthWrite(false)
xr_pass:setColor(0.0, 0.0, 0.5, 1.0)
xr_pass:fill()
xr_pass:setColor(1.0, 1.0, 1.0, 1.0)
xr_pass:text("XR Quad Layer", 128, 128, 0, 36)
lovr.graphics.submit(xr_pass)
xr_layer:setPose(pose_mat:translate(-0.5, 0.0, -1.0):getPose())
end | 12:50:24 |