Texture / mesh / shader / canvas creation and release. 更多...
#include <IResourceFactory.h>
Public 成员函数 | |
| virtual | ~IResourceFactory ()=default |
| Releases IResourceFactory resources. | |
| virtual Texture * | newTexture (int width, int height, const uint8_t *rgba, bool repeatU=false, bool repeatV=false)=0 |
| Creates a texture. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTexture (int width, int height, const uint8_t *rgba, const TextureCreateInfo &info)=0 |
| Creates a texture. @ownership Caller deletes unless documented otherwise. | |
| virtual Result< Texture * > | newTextureMipChain (uint32_t width, uint32_t height, uint32_t levels, std::span< const uint8_t > rgba) |
| Upload complete explicit linear RGBA8 mips without regenerating pixels. | |
| virtual Result< Texture * > | newTextureArrayRgba16f (uint32_t width, uint32_t height, uint32_t layers, std::span< const uint16_t > rgbaHalf) |
| Upload a sampled 2D array of tightly packed linear RGBA16F texels. | |
| virtual Result< Texture * > | newTexture3DRgba8 (uint32_t width, uint32_t height, uint32_t depth, std::span< const uint8_t > rgba) |
| Upload one tightly packed linear RGBA8 3D sampled texture. | |
| virtual Texture * | newCubemap (int faceSize, const uint8_t *rgbaFaces)=0 |
| Creates a cubemap. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newCubemap (int faceSize, const uint8_t *rgbaFaces, const TextureCreateInfo &info)=0 |
| Creates a cubemap. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTexture (image::ImageData *data)=0 |
| Creates a texture. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTexture (image::ImageData *data, const TextureCreateInfo &info)=0 |
| Creates a texture. @ownership Caller deletes unless documented otherwise. | |
| virtual ResultRef< Texture > | newSharedTexture (image::ImageData *data, const std::string &contentKey) |
| Reuse or upload immutable RGBA8 pixels under a caller-provided content key. | |
| virtual Texture * | newTextureFromImageData (image::ImageData *data, bool repeatU=false, bool repeatV=false)=0 |
| Creates a texture from image data. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTextureFromImageData (image::ImageData *data, const TextureCreateInfo &info)=0 |
| Creates a texture from image data. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTextureWithSampler (image::ImageData *data, bool repeatU, bool repeatV, bool generateMipmaps, float maxAnisotropy, const std::string &filter, const std::string &mipmap, float lodBias=0.f)=0 |
| Creates a texture with sampler. @ownership Caller deletes unless documented otherwise. | |
| virtual void | setTextureSampler (Texture *texture, const TextureSampler &sampler)=0 |
| Sets the texture sampler. | |
| virtual Texture * | newTextureFromFile (const std::string &filename)=0 |
| Creates a texture from file. @ownership Caller deletes unless documented otherwise. | |
| virtual Texture * | newTextureFromFileRepeated (const std::string &filename, bool repeatU, bool repeatV)=0 |
| Creates a texture from file repeated. @ownership Caller deletes unless documented otherwise. | |
| virtual bool | reloadTextureFromFile (const std::string &filename)=0 |
| Reloads texture from file. | |
| virtual float | getMaxAnisotropy () const =0 |
| Returns the max anisotropy. | |
| virtual bool | releaseTexture (Texture *texture)=0 |
| Release texture. | |
| virtual Mesh * | newMeshFromAssimp (const ::aiMesh &mesh)=0 |
| Creates a mesh from assimp. @ownership Caller deletes unless documented otherwise. | |
| virtual Mesh * | newMeshFromAssimp (const ::aiMesh &mesh, const aiMatrix4x4 &worldTransform)=0 |
| Creates a mesh from assimp. @ownership Caller deletes unless documented otherwise. | |
| virtual Mesh * | newMeshFromArrays (const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0 |
| Creates a mesh from arrays. @ownership Caller deletes unless documented otherwise. | |
| virtual Mesh * | newMeshFromArraysColored (const float *posXYZ, const float *nrmXYZ, const float *uvST, const float *colorRGBA, int vertexCount, const uint32_t *indices, int indexCount)=0 |
| Create a mesh with a packed linear RGBA vertex-color stream. | |
| virtual bool | updateMeshVertices (Mesh *mesh, const float *posXYZ, const float *nrmXYZ, const float *uvST, int vertexCount, const uint32_t *indices, int indexCount)=0 |
| Updates mesh vertices. | |
| virtual bool | bakeMeshMorph (Mesh *mesh)=0 |
| Bake mesh morph. | |
| virtual Mesh * | newMeshSphere (int slices, int stacks)=0 |
| Creates a mesh sphere. @ownership Caller deletes unless documented otherwise. | |
| virtual Mesh * | newMeshCylinder (int slices, int stacks, bool caps)=0 |
| Creates a mesh cylinder. @ownership Caller deletes unless documented otherwise. | |
| virtual Mesh * | newMeshCube (float size)=0 |
| Creates a mesh cube. @ownership Caller deletes unless documented otherwise. | |
| virtual bool | releaseMesh (Mesh *mesh)=0 |
| Release mesh. | |
| virtual Shader * | newShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0 |
| Creates a shader from spv. @ownership Caller deletes unless documented otherwise. | |
| virtual Shader * | newShaderFromSpvFile (const std::string &vertPath, const std::string &fragPath)=0 |
| Creates a shader from spv file. @ownership Caller deletes unless documented otherwise. | |
| virtual Shader * | newShader (const std::string &vertGlsl, const std::string &fragGlsl)=0 |
| Creates a shader. @ownership Caller deletes unless documented otherwise. | |
| virtual Shader * | newShaderFromWgsl (const std::string &vertWgsl, const std::string &fragWgsl)=0 |
| Create a 2D custom shader from WGSL source (WebGPU backend). Empty vert → default textured vertex shader. The fragment WGSL declares the shared 2D bindings (color texture 0, depth texture 1, sampler 2, depth sampler 3, Externals UBO 4) and vs_main/fs_main entry points. Vulkan throws (uses SPIR-V via newShaderFromSpv). | |
| virtual Shader * | newMeshShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0 |
| Create a Mesh3D shader; an empty stage selects the matching engine default. | |
| virtual Shader * | newMeshShaderFromWgsl (const std::string &vertWgsl, const std::string &fragWgsl)=0 |
| Create a WebGPU Mesh3D shader; an empty stage selects the matching engine default. | |
| virtual Shader * | newMeshShader (const std::string &vertGlsl, const std::string &fragGlsl)=0 |
| Creates a mesh shader. @ownership Caller deletes unless documented otherwise. | |
| virtual Shader * | newHairShaderFromSpv (const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv)=0 |
| Creates a hair shader from spv. @ownership Caller deletes unless documented otherwise. | |
| virtual bool | releaseShader (Shader *shader)=0 |
| Release shader. | |
| virtual Canvas * | newCanvas (int width, int height)=0 |
| Creates a canvas. @ownership Caller deletes unless documented otherwise. | |
| virtual Font * | newFont (font::FontData *data, std::string charset)=0 |
| Creates a font. @ownership Caller deletes unless documented otherwise. | |
详细描述
Texture / mesh / shader / canvas creation and release.
在文件 IResourceFactory.h 第 38 行定义.
构造及析构函数说明
◆ ~IResourceFactory()
|
virtualdefault |
Releases IResourceFactory resources.
成员函数说明
◆ bakeMeshMorph()
|
pure virtual |
Bake mesh morph.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ getMaxAnisotropy()
|
pure virtual |
Returns the max anisotropy.
在 eve::graphics::Graphics, eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.
◆ newCanvas()
|
pure virtual |
Creates a canvas. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newCubemap() [1/2]
|
pure virtual |
Creates a cubemap. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newCubemap() [2/2]
|
pure virtual |
Creates a cubemap. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newFont()
|
pure virtual |
Creates a font. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ newHairShaderFromSpv()
|
pure virtual |
Creates a hair shader from spv. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshCube()
|
pure virtual |
Creates a mesh cube. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ newMeshCylinder()
|
pure virtual |
Creates a mesh cylinder. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshFromArrays()
|
pure virtual |
Creates a mesh from arrays. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
被这些函数引用 eve::asset_graphics::GraphicsMeshFactoryAdapter::uploadMesh().
◆ newMeshFromArraysColored()
|
pure virtual |
Create a mesh with a packed linear RGBA vertex-color stream.
- 返回
- Factory-owned mesh, or nullptr when validation or backend allocation fails. @ownership The resource factory owns the returned mesh; release it through releaseMesh. @lifetime Valid until releaseMesh, graphics shutdown, or device loss. @thread Graphics thread; all input arrays are borrowed and consumed synchronously.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
被这些函数引用 eve::asset_graphics::GraphicsMeshFactoryAdapter::uploadMeshColored().
◆ newMeshFromAssimp() [1/2]
|
pure virtual |
Creates a mesh from assimp. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshFromAssimp() [2/2]
|
pure virtual |
Creates a mesh from assimp. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshShader()
|
pure virtual |
Creates a mesh shader. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshShaderFromSpv()
|
pure virtual |
Create a Mesh3D shader; an empty stage selects the matching engine default.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshShaderFromWgsl()
|
pure virtual |
Create a WebGPU Mesh3D shader; an empty stage selects the matching engine default.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newMeshSphere()
|
pure virtual |
Creates a mesh sphere. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newShader()
|
pure virtual |
Creates a shader. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newShaderFromSpv()
|
pure virtual |
Creates a shader from spv. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newShaderFromSpvFile()
|
pure virtual |
Creates a shader from spv file. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newShaderFromWgsl()
|
pure virtual |
Create a 2D custom shader from WGSL source (WebGPU backend). Empty vert → default textured vertex shader. The fragment WGSL declares the shared 2D bindings (color texture 0, depth texture 1, sampler 2, depth sampler 3, Externals UBO 4) and vs_main/fs_main entry points. Vulkan throws (uses SPIR-V via newShaderFromSpv).
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newSharedTexture()
|
inlinevirtual |
Reuse or upload immutable RGBA8 pixels under a caller-provided content key.
- 参数
-
contentKey Stable, collision-resistant key for the complete pixel payload and dimensions. data Borrowed image consumed synchronously when the key is not already resident.
- 返回
- Structured result borrowing the factory-owned texture; Unsupported without a caching provider. @ownership The factory owns the returned texture. @lifetime Until releaseTexture or graphics shutdown. @thread Graphics thread only; no callbacks are invoked. @cost First use performs one texture upload; cache hits are hash-table lookups.
被 eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.
在文件 IResourceFactory.h 第 129 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::Unsupported.
◆ newTexture() [1/4]
|
pure virtual |
Creates a texture. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newTexture() [2/4]
|
pure virtual |
Creates a texture. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newTexture() [3/4]
|
pure virtual |
Creates a texture. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
被这些函数引用 eve::asset_procgen::uploadPackedTerrainMaterialAtlases(), eve::asset_graphics::GraphicsImageFactoryAdapter::uploadRgba8() , 以及 eve::asset_procgen::uploadTerrainMaterialAtlases().
◆ newTexture() [4/4]
|
pure virtual |
Creates a texture. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newTexture3DRgba8()
|
inlinevirtual |
Upload one tightly packed linear RGBA8 3D sampled texture.
- 参数
-
width Positive X extent. height Positive Y extent. depth Positive Z extent. rgba Borrowed Z-major slices, each row-major RGBA8; not retained.
- 返回
- Failure without publication or a factory-owned texture; default is Unsupported. @lifetime Until shutdown or releaseTexture; successful release transfers the CPU facade. @thread Graphics thread only, synchronous, non-reentrant and without callbacks.
Failure.
被 eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.
在文件 IResourceFactory.h 第 100 行定义.
引用了 depth, eve::Diagnostic::error(), eve::Result< T >::failure(), height, eve::Unsupported , 以及 width.
被这些函数引用 eve::asset_graphics::GraphicsImageFactoryAdapter::uploadRgba8Volume().
◆ newTextureArrayRgba16f()
|
inlinevirtual |
Upload a sampled 2D array of tightly packed linear RGBA16F texels.
- 参数
-
rgbaHalf IEEE-754 binary16 channel bits, layer-major and row-major within each layer; borrowed for call.
- 返回
- Failure without publication or a factory-owned texture. Unsupported is explicit on absent providers. @thread Graphics thread only, synchronous, non-reentrant and without callbacks.
Failure.
被 eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.
在文件 IResourceFactory.h 第 77 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), height, eve::Unsupported , 以及 width.
被这些函数引用 eve::graphics::Graphics::configureFoliageWind() , 以及 eve::graphics::uploadAtlas().
◆ newTextureFromFile()
|
pure virtual |
Creates a texture from file. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ newTextureFromFileRepeated()
|
pure virtual |
Creates a texture from file repeated. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ newTextureFromImageData() [1/2]
|
pure virtual |
Creates a texture from image data. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ newTextureFromImageData() [2/2]
|
pure virtual |
Creates a texture from image data. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ newTextureMipChain()
|
inlinevirtual |
Upload complete explicit linear RGBA8 mips without regenerating pixels.
- 参数
-
width Positive base width. height Positive base height. levels Full halving chain through 1x1, clamping each dimension to one. rgba Borrowed tightly packed top-down levels in increasing LOD order; not retained.
- 返回
- Failure without publication or a factory-owned texture; default is Unsupported. @lifetime Until shutdown or releaseTexture; successful release transfers the CPU facade. @thread Graphics thread only, synchronous, non-reentrant and without callbacks.
Failure.
被 eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 重载.
在文件 IResourceFactory.h 第 58 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), height, eve::Unsupported , 以及 width.
被这些函数引用 eve::asset_graphics::GraphicsImageFactoryAdapter::uploadRgba8MipChain().
◆ newTextureWithSampler()
|
pure virtual |
Creates a texture with sampler. @ownership Caller deletes unless documented otherwise.
在 eve::graphics::Graphics 内被实现.
◆ releaseMesh()
|
pure virtual |
Release mesh.
在 eve::graphics::Graphics, eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.
被这些函数引用 eve::asset_graphics::GraphicsMeshFactoryAdapter::releaseMesh().
◆ releaseShader()
|
pure virtual |
Release shader.
在 eve::graphics::Graphics, eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.
◆ releaseTexture()
|
pure virtual |
Release texture.
在 eve::graphics::Graphics, eve::graphics::vulkan::Graphics , 以及 eve::graphics::webgpu::Graphics 内被实现.
被这些函数引用 eve::asset_graphics::GraphicsImageFactoryAdapter::releaseImage(), eve::asset_procgen::releasePackedTerrainMaterialAtlases(), eve::asset_procgen::releaseTerrainMaterialAtlases() , 以及 eve::graphics::releaseVegetationGpuFieldSet().
◆ reloadTextureFromFile()
|
pure virtual |
Reloads texture from file.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ setTextureSampler()
|
pure virtual |
Sets the texture sampler.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
◆ updateMeshVertices()
|
pure virtual |
Updates mesh vertices.
在 eve::graphics::vulkan::Graphics, eve::graphics::webgpu::Graphics , 以及 eve::graphics::Graphics 内被实现.
该类的文档由以下文件生成:
- src/modules/graphics/IResourceFactory.h