Dawn/src/dawnopengl/display/shader/buffers/RenderPipelineShaderBuffer.hpp

30 lines
801 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "display/shader/ShaderParameterBuffer.hpp"
namespace Dawn {
struct RenderPipelineShaderBufferData {
SHADER_PARAMETER_BUFFER_MAT4(view);
SHADER_PARAMETER_BUFFER_MAT4(projection);
};
class RenderPipelineShaderBuffer : public ShaderParameterBuffer<struct RenderPipelineShaderBufferData> {
public:
static std::string getShaderUniformName() {
return "ub_RenderPipeline";
}
static std::string getShaderUniform() {
return std::string(
"layout (std140) uniform ub_RenderPipeline {\n"
"mat4 u_View;\n"
"mat4 u_Projection;\n"
"};"
);
}
};
}