Skip to content

Commit

Permalink
Refactor for success
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Oct 17, 2023
1 parent 8b87204 commit 923f09c
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,21 @@ g.test('depthCompare_optional')

const areDepthFailOpKeep =
stencilFrontDepthFailOp === 'keep' && stencilBackDepthFailOp === 'keep';
const success =

let success = false;
if (!info.depth) {
// depthCompare is optional for stencil-only formats.
(!info.depth && depthWriteEnabled !== true) ||
// depthCompare is optional for formats with a depth if it is not used for anything.
(!!info.depth &&
((depthWriteEnabled === false && areDepthFailOpKeep) ||
(!!depthCompare &&
((!!info.stencil && depthWriteEnabled !== undefined) ||
(!!depthWriteEnabled && areDepthFailOpKeep)))));
if (!depthWriteEnabled) success = true;
} else {
// depthCompare is optional for formats with a depth if it's not used for anything.
if (depthWriteEnabled === false && areDepthFailOpKeep) success = true;
if (depthCompare) {
// validation will succeed normally for formats with depth aspect.
if (depthWriteEnabled && areDepthFailOpKeep) success = true;
// validation will succeed as well for formats with stencil and depth aspect.
if (info.stencil && depthWriteEnabled !== undefined) success = true;
}
}

t.doCreateRenderPipelineTest(isAsync, success, descriptor);
});
Expand Down

0 comments on commit 923f09c

Please sign in to comment.