Last active
April 18, 2024 00:07
-
-
Save greggman/81f9f3e6c9ec92b158d697e50f4241cb to your computer and use it in GitHub Desktop.
2d-array render target - should fail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function main() { | |
const adapter = await navigator.gpu?.requestAdapter(); | |
const device = await adapter?.requestDevice(); | |
const tex = device.createTexture({ | |
size: [2, 2, 2], | |
format: 'rgba8unorm', | |
usage: | |
GPUTextureUsage.RENDER_ATTACHMENT | |
}); | |
device.pushErrorScope('validation'); | |
const commandEncoder = device.createCommandEncoder(); | |
const passEncoder = commandEncoder.beginRenderPass({ | |
colorAttachments: [ | |
{ | |
view: tex.createView({ | |
dimension: '2d-array', | |
arrayLayerCount: 1, | |
}), | |
clearValue: [0, 0, 0, 0], | |
loadOp: 'clear', | |
storeOp: 'store', | |
}, | |
], | |
}); | |
passEncoder.end(); | |
device.queue.submit([commandEncoder.finish()]); | |
const err = await device.popErrorScope(); | |
log(err ? 'pass' : 'fail', ': expected error, got:', err); | |
} | |
main(); | |
function log(...args) { | |
const elem = document.createElement('pre'); | |
elem.textContent = args.join(' '); | |
document.body.appendChild(elem); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"2d-array render target - should fail","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment