1 // GENERATED FILE - DO NOT EDIT. 2 // Generated by gen_copy_conversion_table.py using data from es3_copy_conversion_formats.json. 3 // 4 // Copyright 2016 The ANGLE Project Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style license that can be 6 // found in the LICENSE file. 7 // 8 // format_map: 9 // Determining the sized internal format from a (format,type) pair. 10 // Also check es3 format combinations for validity. 11 12 #include "angle_gl.h" 13 #include "common/debug.h" 14 15 namespace gl 16 { 17 ValidES3CopyConversion(GLenum textureFormat,GLenum framebufferFormat)18bool ValidES3CopyConversion(GLenum textureFormat, GLenum framebufferFormat) 19 { 20 switch (textureFormat) 21 { 22 case GL_ALPHA: 23 switch (framebufferFormat) 24 { 25 case GL_BGRA_EXT: 26 case GL_RGBA: 27 return true; 28 default: 29 break; 30 } 31 break; 32 33 case GL_BGRA_EXT: 34 switch (framebufferFormat) 35 { 36 case GL_BGRA_EXT: 37 return true; 38 default: 39 break; 40 } 41 break; 42 43 case GL_LUMINANCE: 44 switch (framebufferFormat) 45 { 46 case GL_BGRA_EXT: 47 case GL_RED: 48 case GL_RG: 49 case GL_RGB: 50 case GL_RGBA: 51 return true; 52 default: 53 break; 54 } 55 break; 56 57 case GL_LUMINANCE_ALPHA: 58 switch (framebufferFormat) 59 { 60 case GL_BGRA_EXT: 61 case GL_RGBA: 62 return true; 63 default: 64 break; 65 } 66 break; 67 68 case GL_RED: 69 switch (framebufferFormat) 70 { 71 case GL_BGRA_EXT: 72 case GL_RED: 73 case GL_RG: 74 case GL_RGB: 75 case GL_RGBA: 76 return true; 77 default: 78 break; 79 } 80 break; 81 82 case GL_RED_INTEGER: 83 switch (framebufferFormat) 84 { 85 case GL_RED_INTEGER: 86 case GL_RGBA_INTEGER: 87 case GL_RGB_INTEGER: 88 case GL_RG_INTEGER: 89 return true; 90 default: 91 break; 92 } 93 break; 94 95 case GL_RG: 96 switch (framebufferFormat) 97 { 98 case GL_BGRA_EXT: 99 case GL_RG: 100 case GL_RGB: 101 case GL_RGBA: 102 return true; 103 default: 104 break; 105 } 106 break; 107 108 case GL_RGB: 109 switch (framebufferFormat) 110 { 111 case GL_BGRA_EXT: 112 case GL_RGB: 113 case GL_RGBA: 114 return true; 115 default: 116 break; 117 } 118 break; 119 120 case GL_RGBA: 121 switch (framebufferFormat) 122 { 123 case GL_BGRA_EXT: 124 case GL_RGBA: 125 return true; 126 default: 127 break; 128 } 129 break; 130 131 case GL_RGBA_INTEGER: 132 switch (framebufferFormat) 133 { 134 case GL_RGBA_INTEGER: 135 return true; 136 default: 137 break; 138 } 139 break; 140 141 case GL_RGB_INTEGER: 142 switch (framebufferFormat) 143 { 144 case GL_RGBA_INTEGER: 145 case GL_RGB_INTEGER: 146 return true; 147 default: 148 break; 149 } 150 break; 151 152 case GL_RG_INTEGER: 153 switch (framebufferFormat) 154 { 155 case GL_RGBA_INTEGER: 156 case GL_RGB_INTEGER: 157 case GL_RG_INTEGER: 158 return true; 159 default: 160 break; 161 } 162 break; 163 164 default: 165 break; 166 } 167 168 return false; 169 } 170 171 } // namespace gl 172