// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "../BinaryAsset.h" #include "Engine/Graphics/Shaders/Cache/ShaderAssetBase.h" class GPUShader; /// /// The shader asset. Contains a program that runs on the GPU and is able to perform rendering calculation using textures, vertices and other resources. /// API_CLASS(NoSpawn) class FLAXENGINE_API Shader : public ShaderAssetTypeBase { DECLARE_BINARY_ASSET_HEADER(Shader, ShadersSerializedVersion); private: GPUShader* _shader; public: /// /// Finalizes an instance of the class. /// ~Shader(); public: /// /// The GPU shader object (not null). /// API_FIELD(ReadOnly) GPUShader* GPU; /// /// Gets the GPU shader object. /// FORCE_INLINE GPUShader* GetShader() const { return GPU; } protected: // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; };