Add shader getter to IMaterial interface

This commit is contained in:
Wojciech Figat
2022-05-12 13:47:19 +02:00
parent 69b9c1b9ee
commit f7e48d9b23
14 changed files with 45 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
#include "MaterialInfo.h"
struct MaterialParamsLink;
class GPUShader;
class GPUContext;
class GPUTextureView;
class RenderBuffers;
@@ -26,6 +27,12 @@ public:
/// <returns>The constant reference to the material descriptor.</returns>
virtual const MaterialInfo& GetInfo() const = 0;
/// <summary>
/// Gets the shader resource.
/// </summary>
/// <returns>The material shader resource.</returns>
virtual GPUShader* GetShader() const = 0;
/// <summary>
/// Determines whether material is a surface shader.
/// </summary>

View File

@@ -98,8 +98,6 @@ public:
/// <returns>The created and loaded material or null if failed.</returns>
static MaterialShader* CreateDummy(MemoryReadStream& shaderCacheStream, const MaterialInfo& info);
GPUShader* GetShader() const;
/// <summary>
/// Clears the loaded data.
/// </summary>
@@ -114,5 +112,6 @@ public:
// [IMaterial]
const MaterialInfo& GetInfo() const override;
GPUShader* GetShader() const override;
bool IsReady() const override;
};