载入中...
搜索中...
未找到
GraphicsResourceUpdates.cpp
浏览该文件的文档.
24 DiagnosticCode::InvalidArgument, "file texture path is empty", {}, {}, "graphics.texture.request"));
28 if (it != texturesByPath.end() && it->second) return ResultRef<Texture>::success(std::ref(*it->second));
114 return updateTexture(tex, data->getWidth(), data->getHeight(), static_cast<const uint8_t*>(data->getData()));
117bool Graphics::updateMeshVertices(Mesh* mesh, const float* posXYZ, const float* nrmXYZ, const float* uvST,
151 gpu->vertexBuffer = device.CreateBuffer(reinterpret_cast<const wgpu::BufferDescriptor*>(&desc));
158 const wgpu::IndexFormat format = vertexCount <= 65535 ? wgpu::IndexFormat::Uint16 : wgpu::IndexFormat::Uint32;
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
eve::Result< ResourcePin > pin(Resource *resource)
Keeps one cached resource alive across unload()/clear()/reload.
Definition Resource.cpp:311
ResultRef< Resource > waitFor(std::string key)
Block until key is cached, failed, or unclaimed.
Definition Resource.cpp:226
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
std::vector< DeferredFileTexture > deferredFileTextures_
Definition Graphics.h:2313
bool fileTextureSourceExists(const std::string &filename) const
File texture source exists.
Definition Graphics.cpp:1959
void ensureFileTexturesReady()
Finish CPU decode and GPU upload for outstanding newTextureFromFile results. @thread Game/render thre...
Definition GraphicsFileTextures.cpp:33
void requestFileImageDecode(const std::string &key)
Request file image decode.
Definition Graphics.cpp:1954
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
bool uploadDeferredFileTexture(Texture *texture, image::ImageData *data) override
Uploads deferred file texture.
Definition GraphicsResourceUpdates.cpp:59
Texture * newTexture(int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false) override
Creates a texture. @ownership Caller deletes unless documented otherwise.
Definition GraphicsTextures.cpp:78
bool updateMeshVertices(Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount) override
Updates mesh vertices.
Definition GraphicsResourceUpdates.cpp:117
bool reloadTextureFromFile(const std::string &filename) override
Creates a texture from file. @ownership Caller deletes unless documented otherwise.
Definition GraphicsResourceUpdates.cpp:85
bool updateTexture(Texture *texture, int width, int height, const uint8_t *rgba) override
Updates texture.
Definition GraphicsTextures.cpp:638
RAII keep-alive for one RuntimeObjectRegistry entry.
Definition RuntimeRegistry.h:209
T * get() const noexcept
Borrows the pinned object; valid until the pin is released.
Definition RuntimeRegistry.h:250
WGPUStringView sv(const char *s)
Build a WGPUStringView from a C string (null-safe, length auto-computed).
Definition wgpu_types.h:20
@ InvalidArgument
@ NotFound
@ Failed
Options for Graphics::newTexture / newCubemap. When generateMipmaps is true and sampler....
Definition TextureSampler.h:117