webgpu: implement the scissor backend function (#9783)
also enable ScissorViewportRegion backend test. It was previously skipped, now it is passing. BUGS=474393992
This commit is contained in:
@@ -1970,9 +1970,19 @@ void WebGPUDriver::dispatchCompute(Handle<HwProgram> program, math::uint3 workGr
|
||||
//todo
|
||||
}
|
||||
|
||||
void WebGPUDriver::scissor(
|
||||
Viewport scissor) {
|
||||
//todo
|
||||
void WebGPUDriver::scissor(Viewport scissor) {
|
||||
assert_invariant(mRenderPassEncoder);
|
||||
assert_invariant(mCurrentRenderTarget);
|
||||
|
||||
// The WebGPU scissor starts from the top-left corner
|
||||
assert_invariant(scissor.left >= 0 &&
|
||||
mCurrentRenderTarget->height >= scissor.bottom + scissor.height /*top >= 0*/ &&
|
||||
scissor.width <= mCurrentRenderTarget->width &&
|
||||
scissor.height <= mCurrentRenderTarget->height);
|
||||
|
||||
mRenderPassEncoder.SetScissorRect(scissor.left,
|
||||
mCurrentRenderTarget->height - scissor.bottom - scissor.height /*top*/, scissor.width,
|
||||
scissor.height);
|
||||
}
|
||||
|
||||
void WebGPUDriver::beginTimerQuery(Handle<HwTimerQuery> tqh) {
|
||||
|
||||
@@ -32,7 +32,6 @@ using namespace filament;
|
||||
using namespace filament::backend;
|
||||
|
||||
TEST_F(BackendTest, ScissorViewportRegion) {
|
||||
SKIP_IF(Backend::WEBGPU, "test cases fail in WebGPU, see b/424157731");
|
||||
auto& api = getDriverApi();
|
||||
|
||||
constexpr int kSrcTexWidth = 1024;
|
||||
|
||||
Reference in New Issue
Block a user