From 6d90e01858da6a2084f047c21299b7d6c1c800ea Mon Sep 17 00:00:00 2001 From: Stephen White Date: Fri, 23 Mar 2018 11:51:03 -0400 Subject: [PATCH] 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. --- scripts/travis_lint_format.sh | 2 +- src/backend/opengl/CommandBufferGL.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/travis_lint_format.sh b/scripts/travis_lint_format.sh index b4d0f8e399..82f315fb10 100755 --- a/scripts/travis_lint_format.sh +++ b/scripts/travis_lint_format.sh @@ -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 diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index 73466d53a8..d56fee70d7 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -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());