#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_GRAPHICS_RASTERIZATION_RASTERIZERRESOURCES_H #define NUCLEX_GRAPHICS_RASTERIZATION_RASTERIZERRESOURCES_H #include namespace Nuclex { namespace Graphics { namespace Rasterization { // ------------------------------------------------------------------------------------------- // class Resource; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Rasterization namespace Nuclex { namespace Graphics { namespace Rasterization { // ------------------------------------------------------------------------------------------- // ///Allows fine-grained control of a rasterizer's resource management class RasterizerResources { /// Frees all resources owned by the rasterizer resource interface public: virtual ~RasterizerResources() {} /// Prepares a resource for usage by this rasterizer /// Resource the rasterizer will prepare to use public: virtual void Prepare(const std::shared_ptr &resource) = 0; /// Evicts the resource from the rasterizer /// Resource that will be evicted from the rasterizer public: virtual void Evict(const std::shared_ptr &resource) = 0; /* /// Prepares a buffer for usage by this rasterizer /// Buffer the rasterizer will prepare to use /// /// There is no need to explicitly call this method before using a buffer with /// a rasterizer. Using this method gives you little bit more control over when /// resources are allocated and transferred into GPU memory, which is useful if /// your application uses streamed geometry (for example, you might want to keep /// preparing resources that are soon needed up to a certain per-frame time budget). /// public: virtual void Prepare(const std::shared_ptr &buffer) = 0; /// Evicts the buffer from the rasterizer's resources /// Buffer that will be evicted from the rasterizer /// /// Normally you should just delete a buffer if you do not need it anymore. /// Calling this method allows you to release any GPU resources reserved for /// the buffer while keeping the buffer in system memory for possible later use. /// public: virtual void Evict(const std::shared_ptr &buffer) = 0; /// Prepares a texture for usage by this rasterizer /// Texture the rasterizer will prepare to use /// /// There is no need to explicitly call this method before using a texture with /// a rasterizer. Using this method gives you little bit more control over when /// resources are allocated and transferred into GPU memory, which is useful if /// your application uses streamed geometry (for example, you might want to keep /// preparing resources that are soon needed up to a certain per-frame time budget). /// public: virtual void Prepare(const std::shared_ptr &texture) = 0; /// Evicts the texture from the rasterizer's resources /// Texture that will be evicted from the rasterizer /// /// Normally you should just delete a texture if you do not need it anymore. /// Calling this method allows you to release any GPU resources reserved for /// the texture while keeping the texture in system memory for possible later use. /// public: virtual void Evict(const std::shared_ptr &texture) = 0; /// Prepares a shader for usage by this rasterizer /// Shader the rasterizer will prepare to use /// /// There is no need to explicitly call this method before using a shader with /// a rasterizer. Using this method gives you little bit more control over when /// resources are allocated and transferred into GPU memory, which is useful if /// your application uses streamed geometry (for example, you might want to keep /// preparing resources that are soon needed up to a certain per-frame time budget). /// public: virtual void Prepare(const std::shared_ptr &shader) = 0; /// Evicts the shader from the rasterizer's resources /// Shader that will be evicted from the rasterizer /// /// Normally you should just delete a shader if you do not need it anymore. /// Calling this method allows you to release any GPU resources reserved for /// the shader while keeping the shader in system memory for possible later use. /// public: virtual void Evict(const std::shared_ptr &shader) = 0; */ }; // ------------------------------------------------------------------------------------------- // }}} // namespace Nuclex::Graphics::Rasterization #endif // NUCLEX_GRAPHICS_RASTERIZATION_RASTERIZERRESOURCES_H