Move ShaderStage and name into Shader struct

These fields will eventually be determined automatically but for now it
makes more sense to pass them as arguements to RenderDriver::create_shader.
This commit is contained in:
2025-04-23 00:25:15 +10:00
parent 74eba7266e
commit e710b80f36
4 changed files with 11 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ namespace Nova {
virtual void resize_swapchain(SwapchainID swapchain) = 0;
virtual void destroy_swapchain(SwapchainID swapchain) = 0;
[[nodiscard]] virtual ShaderID create_shader(const std::span<u8> bytes) = 0;
[[nodiscard]] virtual ShaderID create_shader(const std::span<u8> bytes, ShaderStage stage) = 0;
virtual void destroy_shader(ShaderID shader) = 0;
[[nodiscard]] virtual PipelineID create_pipeline(GraphicsPipelineParams& params) = 0;

View File

@@ -9,7 +9,6 @@
#include <nova/render/render_fwd.h>
#include <nova/types.h>
#include <unordered_map>
#include <vector>
namespace Nova {
@@ -27,7 +26,7 @@ namespace Nova {
};
struct GraphicsPipelineParams {
std::unordered_map<ShaderStage, ShaderID> shaders;
std::vector<ShaderID> shaders;
std::vector<VertexBinding> bindings;
std::vector<VertexAttribute> attributes;
PrimitiveTopology topology = PrimitiveTopology::TRIANGLE_LIST;