56 vc::Error LoadShaderFromFile(
const std::string & path);
60 const ShaderVertexFormat format;
61 const uint32_t binding;
62 const uint32_t location;
63 const uint32_t offset;
72 void AddVertexBufferToLayout(
const ShaderVertexFormat format,
const uint32_t binding,
const uint32_t location,
const uint32_t offset);
82 void AddVertexBufferToLayout(
const std::vector<VertexBufferLayout> & layouts);
84 virtual void SetMultiSamplingCount(
const int samples) = 0;
85 inline vc::Error SetLineWidth(
const float width) { _SetLineWidth(width);
return _ReloadShaderAfterSettings(); }
86 inline vc::Error SetDepthTest(
const bool enable) { _SetDepthTest(enable);
return _ReloadShaderAfterSettings(); }
87 inline vc::Error SetDepthWrite(
const bool enable) { _SetDepthWrite(enable);
return _ReloadShaderAfterSettings(); }
89 inline void SetRenderingPipelineType(
const RenderingPipelineType type) { _renderingPipelineType = type; }
90 inline void SetRenderingPipelineIndex(
const uint32_t index) { _renderingPipelineIndex = index; }
93 virtual void _SetLineWidth(
const float width) = 0;
94 virtual void _SetDepthTest(
const bool enable) = 0;
95 virtual void _SetDepthWrite(
const bool enable) = 0;
96 virtual vc::Error _LoadShader(
const std::string & path) = 0;
97 virtual void _AddVertexBufferToLayout(
const uint32_t vertexSize,
const uint32_t binding,
const uint32_t location,
const uint32_t offset,
const ShaderVertexFormat format) = 0;
99 virtual vc::Error _ReloadShader() = 0;
100 inline vc::Error _ReloadShaderAfterSettings() {
101 if (_loaded)
return _ReloadShader();
102 return vc::Error::Success;
105 RenderingPipelineType _renderingPipelineType;
106 uint32_t _renderingPipelineIndex;
117 inline void SetRenderingPipelineIndex(
const uint32_t index) { _impl->As<
ShaderPipelineImpl>()->SetRenderingPipelineIndex(index); }
118 inline void SetRenderingPipelineType(
const RenderingPipelineType type) { _impl->As<
ShaderPipelineImpl>()->SetRenderingPipelineType(type); }
119 inline vc::Error LoadShaderFromFile(
const char * path) {
return _impl->As<
ShaderPipelineImpl>()->LoadShaderFromFile(path); }
120 inline void AddVertexBufferToLayout(
const ShaderVertexFormat format,
const uint32_t binding,
const uint32_t location,
const uint32_t offset) { _impl->As<
ShaderPipelineImpl>()->AddVertexBufferToLayout(format, binding, location, offset); }
122 inline void AddVertexBufferToLayout(
const std::vector<ShaderPipelineImpl::VertexBufferLayout> & layouts) { _impl->As<
ShaderPipelineImpl>()->AddVertexBufferToLayout(layouts); }
123 inline void SetLineWidth(
const float width) { _impl->As<
ShaderPipelineImpl>()->SetLineWidth(width); }
124 inline void SetDepthTest(
const bool enable) { _impl->As<
ShaderPipelineImpl>()->SetDepthTest(enable); }
125 inline void SetDepthWrite(
const bool enable) { _impl->As<
ShaderPipelineImpl>()->SetDepthWrite(enable); }