| 123 | } |
| 124 | |
| 125 | bool GL46TextureArray::CopyCpuToGpu() |
| 126 | { |
| 127 | auto texture = GetTexture(); |
| 128 | auto const numItems = texture->GetNumItems(); |
| 129 | |
| 130 | if (CanAutoGenerateMipmaps()) |
| 131 | { |
| 132 | // Only update the level 0 texture and then generate the remaining |
| 133 | // mipmaps from it. |
| 134 | for (uint32_t item = 0; item < numItems; ++item) |
| 135 | { |
| 136 | if (!CopyCpuToGpu(item, 0)) |
| 137 | { |
| 138 | return false; |
| 139 | } |
| 140 | } |
| 141 | GenerateMipmaps(); |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | // Automatic generation of mipmaps is not enabled, so all mipmap |
| 146 | // levels must be copied to the GPU. |
| 147 | auto const numLevels = texture->GetNumLevels(); |
| 148 | for (uint32_t item = 0; item < numItems; ++item) |
| 149 | { |
| 150 | for (uint32_t level = 0; level < numLevels; ++level) |
| 151 | { |
| 152 | if (!CopyCpuToGpu(item, level)) |
| 153 | { |
| 154 | return false; |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | bool GL46TextureArray::CopyGpuToCpu() |
| 164 | { |
nothing calls this directly
no test coverage detected