Freeze texture transitions while attached; consolidate OutputAttachment usage (#67)

* lock usages for attachments during subpasses
* refactor IsTextureTransitionPossible
* change attachment usages to OutputAttachment
* make SetBindGroup validation lazier
This commit is contained in:
Kai Ninomiya
2017-07-07 16:06:14 -07:00
committed by GitHub
parent 794d4faece
commit cb2d6d8553
9 changed files with 90 additions and 59 deletions

View File

@@ -92,6 +92,13 @@ namespace backend {
currentUsage = usage;
}
bool TextureBase::IsDepthFormat(nxt::TextureFormat format) {
switch (format) {
case nxt::TextureFormat::R8G8B8A8Unorm:
return false;
}
}
void TextureBase::TransitionUsage(nxt::TextureUsageBit usage) {
if (!IsTransitionPossible(usage)) {
device->HandleError("Texture frozen or usage not allowed");