Extra2D/include/renderer/rhi/rhi_shader.h

87 lines
1.6 KiB
C
Raw Permalink Normal View History

#pragma once
#include <renderer/rhi/rhi_types.h>
#include <string>
namespace extra2d {
/**
* @brief RHI
*
* GPU
*/
class RHIShader {
public:
virtual ~RHIShader() = default;
/**
* @brief
* @return
*/
virtual ShaderType getType() const = 0;
/**
* @brief
* @return
*/
virtual bool isCompiled() const = 0;
/**
* @brief
* @return
*/
virtual std::string getCompileLog() const = 0;
/**
* @brief
* @return
*/
virtual bool isValid() const = 0;
};
/**
* @brief RHI 线
*
* GPU 线 (PSO)
*/
class RHIPipeline {
public:
virtual ~RHIPipeline() = default;
/**
* @brief 线
*/
virtual void bind() = 0;
/**
* @brief 线
*/
virtual void unbind() = 0;
/**
* @brief
* @return
*/
virtual ShaderHandle getVertexShader() const = 0;
/**
* @brief
* @return
*/
virtual ShaderHandle getFragmentShader() const = 0;
/**
* @brief
* @return
*/
virtual const VertexLayout& getVertexLayout() const = 0;
/**
* @brief
* @return
*/
virtual bool isValid() const = 0;
};
} // namespace extra2d