Expand allowable formats for color attachments.

Don't assert on color formats which can be cleared with a
floating-point clear value.
So far, these are { unorm } x { r, rg, rgba, bgra }.
Fix linter error when no files to check.
This commit is contained in:
Stephen White 2018-03-23 11:51:03 -04:00 committed by Corentin Wallez
parent d0771f8dd5
commit 6d90e01858
2 changed files with 7 additions and 4 deletions

View File

@ -24,7 +24,7 @@ files_to_check=$(echo $files_to_check | tr '\n' ' ')
# Run git-clang-format, check if it formatted anything
format_output=$(scripts/git-clang-format --binary $1 --commit $base_commit --diff --style=file $files_to_check)
if [ "$format_output" == "clang-format did not modify any files" ] ; then
if [ "$format_output" == "clang-format did not modify any files" ] || [ "format_output" == "no modified files to format" ] ; then
exit 0
fi

View File

@ -311,9 +311,12 @@ namespace backend { namespace opengl {
attachmentCount = location + 1;
// TODO(kainino@chromium.org): the color clears (later in
// this function) may be undefined for other texture formats.
ASSERT(textureView->GetTexture()->GetFormat() ==
nxt::TextureFormat::R8G8B8A8Unorm);
// this function) may be undefined for non-normalized integer formats.
nxt::TextureFormat format = textureView->GetTexture()->GetFormat();
ASSERT(format == nxt::TextureFormat::R8G8B8A8Unorm ||
format == nxt::TextureFormat::R8G8Unorm ||
format == nxt::TextureFormat::R8Unorm ||
format == nxt::TextureFormat::B8G8R8A8Unorm);
}
glDrawBuffers(attachmentCount, drawBuffers.data());