| 109 | } |
| 110 | |
| 111 | bool GL46TextureSingle::CopyCpuToGpu() |
| 112 | { |
| 113 | auto texture = GetTexture(); |
| 114 | |
| 115 | if (CanAutoGenerateMipmaps()) |
| 116 | { |
| 117 | // Only update the level 0 texture and then generate the remaining |
| 118 | // mipmaps from it. |
| 119 | if (!CopyCpuToGpu(0)) |
| 120 | { |
| 121 | return false; |
| 122 | } |
| 123 | GenerateMipmaps(); |
| 124 | } |
| 125 | else |
| 126 | { |
| 127 | // Automatic generation of mipmaps is not enabled, so all mipmap |
| 128 | // levels must be copied to the GPU. |
| 129 | auto const numLevels = texture->GetNumLevels(); |
| 130 | for (uint32_t level = 0; level < numLevels; ++level) |
| 131 | { |
| 132 | if (!CopyCpuToGpu(level)) |
| 133 | { |
| 134 | return false; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | return true; |
| 140 | } |
| 141 | |
| 142 | bool GL46TextureSingle::CopyGpuToCpu() |
| 143 | { |
nothing calls this directly
no test coverage detected