This commit is contained in:
Martin Slachta
2026-07-18 14:31:15 +02:00
commit a04f0dc262
3343 changed files with 1140208 additions and 0 deletions
+32
View File
@@ -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
View File
@@ -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);
}