| 78 | } |
| 79 | |
| 80 | bool GL46TextureSingle::Update() |
| 81 | { |
| 82 | auto texture = GetTexture(); |
| 83 | |
| 84 | if (CanAutoGenerateMipmaps()) |
| 85 | { |
| 86 | // Only update the level 0 texture and then generate the remaining |
| 87 | // mipmaps from it. |
| 88 | if (!Update(0)) |
| 89 | { |
| 90 | return false; |
| 91 | } |
| 92 | GenerateMipmaps(); |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | // Automatic generation of mipmaps is not enabled, so all mipmap |
| 97 | // levels must be copied to the GPU. |
| 98 | auto const numLevels = texture->GetNumLevels(); |
| 99 | for (uint32_t level = 0; level < numLevels; ++level) |
| 100 | { |
| 101 | if (!Update(level)) |
| 102 | { |
| 103 | return false; |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | return true; |
| 109 | } |
| 110 | |
| 111 | bool GL46TextureSingle::CopyCpuToGpu() |
| 112 | { |
nothing calls this directly
no test coverage detected