3#include "CommonWebGPU.h"
5#include "../Base/TexturesCommon.h"
6#include "../Base/ResourceMap.h"
12 WGPUTextureFormat view_format;
14 WGPUTextureViewDimension view_dimension;
15 WGPUTextureView texture_view;
21 uint32_t estimatedByteSize;
26 WGPUTextureView texture_view;
34 using TexturesCommon::loadTexture;
57 return reinterpret_cast<void*
>(textures[handle].texture);
60 size_t textureMemoryConsumption = 0;
Provides a weakly referenced view over the contents of a string.
virtual void generateMipmaps(TextureHandle handle) override
Use the graphics device to generate mipmaps for the texture with the given texture handle.
virtual void releaseTexture(TextureHandle textureHandle) override
Release the texture with the given textureHandle.
virtual void releaseSamplerState(SamplerStateHandle handle) override
Release the sampler state with the given handle.
virtual SamplerStateHandle loadSamplerState(const SamplerState &state) override
Load a sampler state object.
virtual void releaseNativeTexture(TextureNativeHandle nativeHandle) override
Release a native texture handle.
virtual void annotate(TextureHandle handle, const StringView &name) override
Associate a name with an object for use in graphics debugging.
virtual TextureHandle loadTexture(const TextureDescription &desc, const TextureData *data) override
Load a texture from the given description.
virtual void releaseTextureView(const TextureViewHandle &handle) override
Release the given texture view.
virtual TextureViewHandle createTextureView(TextureViewDescription &view) override
Create a texture view used to bind a limited view of the texture data to the rendering pipeline.
virtual void releaseResources() override
Release all allocated texture resources.
virtual void * getNativeHandle(TextureHandle handle) override
Get the device-specific handle (D3D texture pointer, OpenGL texture ID etc) associated with the given...
Contains all Cogs related functionality.
Encapsulates state for texture sampling in a state object.
ETextureFlags
Texture flags enumeration.
@ Default
Default usage, the texture can be loaded once and bound and sampled in shaders.
Describes how to fetch data from a texture in shaders.