Edit

kc3-lang/angle/src/libANGLE/es3_copy_conversion_table_autogen.cpp

Branch :

  • Show log

    Commit

  • Author : Geoff Lang
    Date : 2020-08-06 20:55:05
    Hash : f0b02054
    Message : Add a Vulkan feature to compress float32 vertex formats. Use the vertex conversion pipeline in VertexArrayVk to detect static vertex data and convert float32 vertices to float16. This feature is useful for determining if an allication is vertex bandwidth bound and seeing what gains could be had by using smaller attributes. This feature could be implemented in ANGLE's frontend but new infrastructure for converting and storing the converted attributes would need to be added to gl::VertexArray. Our backends already have the functionality needed to handle unsupported attribute formats and this can be repurposed for compressing vertex formats. Bug: b/167404532 Bug: b/161716126 Change-Id: I9a09656a72e8499faa4124adf876d7261c8341c9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342285 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>

  • src/libANGLE/es3_copy_conversion_table_autogen.cpp
  • // GENERATED FILE - DO NOT EDIT.
    // Generated by gen_copy_conversion_table.py using data from es3_copy_conversion_formats.json.
    //
    // Copyright 2020 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // format_map:
    //   Determining the sized internal format from a (format,type) pair.
    //   Also check es3 format combinations for validity.
    
    #include "angle_gl.h"
    #include "common/debug.h"
    
    namespace gl
    {
    
    bool ValidES3CopyConversion(GLenum textureFormat, GLenum framebufferFormat)
    {
        switch (textureFormat)
        {
            case GL_ALPHA:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_BGRA_EXT:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_LUMINANCE:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RED:
                    case GL_RG:
                    case GL_RGB:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_LUMINANCE_ALPHA:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RED:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RED:
                    case GL_RG:
                    case GL_RGB:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RED_INTEGER:
                switch (framebufferFormat)
                {
                    case GL_RED_INTEGER:
                    case GL_RGBA_INTEGER:
                    case GL_RGB_INTEGER:
                    case GL_RG_INTEGER:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RG:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RG:
                    case GL_RGB:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RGB:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RGB:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RGBA:
                switch (framebufferFormat)
                {
                    case GL_BGRA_EXT:
                    case GL_RGBA:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RGBA_INTEGER:
                switch (framebufferFormat)
                {
                    case GL_RGBA_INTEGER:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RGB_INTEGER:
                switch (framebufferFormat)
                {
                    case GL_RGBA_INTEGER:
                    case GL_RGB_INTEGER:
                        return true;
                    default:
                        break;
                }
                break;
    
            case GL_RG_INTEGER:
                switch (framebufferFormat)
                {
                    case GL_RGBA_INTEGER:
                    case GL_RGB_INTEGER:
                    case GL_RG_INTEGER:
                        return true;
                    default:
                        break;
                }
                break;
    
            default:
                break;
        }
    
        return false;
    }
    
    }  // namespace gl