Add validation code for texture subresource usage tracking

This patch also add validation tests for texture subresource tracking
for render pass. Resource usage tracking for compute is per each
dispatch() call, I will add it in next patch.

BUG=dawn:157

Change-Id: I6c4b932e317d66521fa428311e727876d0adf4ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17661
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Yunchao He
2020-05-04 17:10:49 +00:00
committed by Commit Bot service account
parent a6d7f56cf8
commit 23428ea82f
14 changed files with 272 additions and 37 deletions

View File

@@ -421,7 +421,7 @@ namespace dawn_native { namespace opengl {
// Clear textures that are not output attachments. Output attachments will be
// cleared in BeginRenderPass by setting the loadop to clear when the
// texture subresource has not been initialized before the render pass.
if (!(usages.textureUsages[i] & wgpu::TextureUsage::OutputAttachment)) {
if (!(usages.textureUsages[i].usage & wgpu::TextureUsage::OutputAttachment)) {
texture->EnsureSubresourceContentInitialized(0, texture->GetNumMipLevels(), 0,
texture->GetArrayLayers());
}