initial
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Created by martin on 7/1/24.
|
||||
//
|
||||
|
||||
#ifndef LOFT_SHADERBINARY_H
|
||||
#define LOFT_SHADERBINARY_H
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
struct ShaderBinary {
|
||||
private:
|
||||
std::vector<uint32_t> m_data;
|
||||
|
||||
public:
|
||||
inline const std::vector<uint32_t>& data() const {
|
||||
return m_data;
|
||||
}
|
||||
|
||||
inline const uint32_t code_size() const {
|
||||
// last integer is '\0' => should not be included in code size
|
||||
return m_data.size() - 1;
|
||||
}
|
||||
|
||||
explicit ShaderBinary(std::vector<uint32_t> data) :
|
||||
m_data(std::move(data)) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
#endif //LOFT_SHADERBINARY_H
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include "ShaderBinary.h"
|
||||
|
||||
namespace io::file {
|
||||
/**
|
||||
* Reads file on path in as binary.
|
||||
*
|
||||
* @param path Path of the file
|
||||
* @param pOutSize Pointer to the size_t variable to which the number of
|
||||
* bytes of the file will be set.
|
||||
*/
|
||||
ShaderBinary read_binary(const std::string& path);
|
||||
}
|
||||
Reference in New Issue
Block a user