| 47 | } |
| 48 | |
| 49 | static ScratchKey ComputeTextureScratchKey(int width, int height, PixelFormat format, |
| 50 | bool mipmapped) { |
| 51 | static const uint32_t DefaultTextureType = UniqueID::Next(); |
| 52 | BytesKey bytesKey(4); |
| 53 | bytesKey.write(DefaultTextureType); |
| 54 | bytesKey.write(width); |
| 55 | bytesKey.write(height); |
| 56 | auto formatValue = static_cast<uint32_t>(format); |
| 57 | auto mipmapValue = static_cast<uint32_t>(mipmapped ? 1 : 0); |
| 58 | bytesKey.write(formatValue | (mipmapValue << 30)); |
| 59 | return bytesKey; |
| 60 | } |
| 61 | |
| 62 | std::shared_ptr<TextureView> TextureView::MakeFormat(Context* context, int width, int height, |
| 63 | const void* pixels, size_t rowBytes, |
no test coverage detected