CMapSurfaceShader: hsh pipeline definition

This commit is contained in:
Luke Street 2020-10-02 23:32:45 -04:00
parent ba904ff996
commit 6fa9d39cd6
2 changed files with 16 additions and 6 deletions

View File

@ -64,4 +64,5 @@ runtime_add_hsh(Graphics
Shaders/CElementGenShaders.cpp
Shaders/CEnvFxShaders.cpp
Shaders/CFogVolumeFilter.cpp
Shaders/CMapSurfaceShader.cpp
)

View File

@ -1,15 +1,24 @@
#include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp"
#include <array>
#include "Runtime/Graphics/CGraphics.hpp"
namespace urde {
#include "CMapSurfaceShader.cpp.hshhead"
CMapSurfaceShader::CMapSurfaceShader(hsh::vertex_buffer<Vert> vbo,
hsh::index_buffer<uint32_t> ibo) {
namespace urde {
using namespace hsh::pipeline;
struct CMapSurfaceShaderPipeline : pipeline<topology<hsh::TriangleStrip>, BlendAttachment<>, depth_compare<hsh::GEqual>,
depth_write<false>, cull_mode<hsh::CullBack>> {
CMapSurfaceShaderPipeline(hsh::uniform_buffer<CMapSurfaceShader::Uniform> uniBuf,
hsh::vertex_buffer<CMapSurfaceShader::Vert> vbo, hsh::index_buffer<uint32_t> ibo) {
this->position = uniBuf->mtx * hsh::float4(vbo->pos, 1.f);
this->color_out[0] = uniBuf->color;
}
};
CMapSurfaceShader::CMapSurfaceShader(hsh::vertex_buffer<Vert> vbo, hsh::index_buffer<uint32_t> ibo) {
m_uniBuf = hsh::create_dynamic_uniform_buffer<Uniform>();
m_dataBind.hsh_bind(m_uniBuf.get(), vbo, ibo);
m_dataBind.hsh_bind(CMapSurfaceShaderPipeline(m_uniBuf.get(), vbo, ibo));
}
void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count) {