void PrimitiveBuilder::vertex_(const Vector4 &v)
{
const VertexFormat &format = array.get_format();
- for(const UInt16 *a=format.begin(); a!=format.end(); ++a)
+ for(const uint16_t *a=format.begin(); a!=format.end(); ++a)
{
unsigned sem = get_attribute_semantic(*a);
if(sem<attr.size())
{
char *ptr = array.append();
const VertexFormat &format = array.get_format();
- for(const UInt16 *a=format.begin(); a!=format.end(); ++a)
+ for(const uint16_t *a=format.begin(); a!=format.end(); ++a)
{
unsigned sem = get_attribute_semantic(*a);
bool integer = is_integer_attribute(*a);
{
const Vector4 &value = (sem==0 ? vtx : attr[sem]);
if(type==UNSIGNED_BYTE)
- store_attribute<UInt8>(ptr, value, !integer, cc);
+ store_attribute<uint8_t>(ptr, value, !integer, cc);
else if(type==BYTE)
- store_attribute<Int8>(ptr, value, !integer, cc);
+ store_attribute<int8_t>(ptr, value, !integer, cc);
else if(type==UNSIGNED_SHORT)
- store_attribute<UInt16>(ptr, value, !integer, cc);
+ store_attribute<uint16_t>(ptr, value, !integer, cc);
else if(type==SHORT)
- store_attribute<Int16>(ptr, value, !integer, cc);
+ store_attribute<int16_t>(ptr, value, !integer, cc);
else if(type==UNSIGNED_INT)
- store_attribute<UInt32>(ptr, value, !integer, cc);
+ store_attribute<uint32_t>(ptr, value, !integer, cc);
else if(type==INT)
- store_attribute<Int32>(ptr, value, !integer, cc);
+ store_attribute<int32_t>(ptr, value, !integer, cc);
else if(type==FLOAT)
store_attribute<float>(ptr, value, false, cc);
}
namespace {
template<typename T>
-void append(vector<Msp::UInt8> &data, T i)
+void append(vector<uint8_t> &data, T i)
{
data.insert(data.end(), sizeof(T), 0);
*(T *)(&data[data.size()-sizeof(T)]) = i;
}
template<typename T, typename U>
-void expand(vector<Msp::UInt8> &data)
+void expand(vector<uint8_t> &data)
{
unsigned count = data.size()/sizeof(T);
data.resize(count*sizeof(U));
}
template<typename T, typename U>
-void shrink(vector<Msp::UInt8> &data)
+void shrink(vector<uint8_t> &data)
{
unsigned count = data.size()/sizeof(T);
for(unsigned i=0; i<count; ++i)
throw invalid_operation("Batch::set_data_type");
if(index_type==UNSIGNED_SHORT && t==UNSIGNED_INT)
- expand<UInt16, UInt32>(data);
+ expand<uint16_t, uint32_t>(data);
else if(index_type==UNSIGNED_INT && t==UNSIGNED_SHORT)
- shrink<UInt32, UInt16>(data);
+ shrink<uint32_t, uint16_t>(data);
index_type = t;
gl_index_type = get_gl_type(t);
else if(MSP_primitive_restart)
{
if(index_type==UNSIGNED_INT)
- ::append<UInt32>(data, 0xFFFFFFFF);
+ ::append<uint32_t>(data, 0xFFFFFFFF);
else
- ::append<UInt16>(data, 0xFFFF);
+ ::append<uint16_t>(data, 0xFFFF);
}
else if(prim_type==TRIANGLE_STRIP)
{
set_index_type(UNSIGNED_INT);
if(index_type==UNSIGNED_INT)
- ::append<UInt32>(data, i);
+ ::append<uint32_t>(data, i);
else
- ::append<UInt16>(data, i);
+ ::append<uint16_t>(data, i);
}
unsigned Batch::get_index_size() const
{
- return (index_type==UNSIGNED_INT ? sizeof(UInt32) : sizeof(UInt16));
+ return (index_type==UNSIGNED_INT ? sizeof(uint32_t) : sizeof(uint16_t));
}
unsigned Batch::get_index(unsigned i) const
{
if(index_type==UNSIGNED_INT)
- return *(UInt32 *)&data[i*sizeof(UInt32)];
+ return *(uint32_t *)&data[i*sizeof(uint32_t)];
else
- return *(UInt16 *)&data[i*sizeof(UInt16)];
+ return *(uint16_t *)&data[i*sizeof(uint16_t)];
}
GLenum gl_prim_type;
DataType index_type;
GLenum gl_index_type;
- std::vector<UInt8> data;
+ std::vector<std::uint8_t> data;
unsigned max_index;
public:
vector<GLenum> color_bufs;
color_bufs.reserve(format.size());
unsigned i = 0;
- for(const UInt16 *j=format.begin(); j!=format.end(); ++j, ++i)
+ for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
{
GLenum gl_attach_point = get_gl_attachment(static_cast<FrameAttachment>(*j));
if(dirty&(1<<i))
throw incompatible_data("Framebuffer::attach");
unsigned i = 0;
- for(const UInt16 *j=format.begin(); j!=format.end(); ++j, ++i)
+ for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
if(*j==attch)
{
attachments[i].set(tex, level, layer);
throw invalid_operation("FrameFormat::operator,");
FrameFormat r = *this;
- UInt16 &fa = r.attachments[r.count-1];
+ uint16_t &fa = r.attachments[r.count-1];
fa = make_typed_attachment(static_cast<FrameAttachment>(fa), pf);
return r;
throw invalid_operation("FrameFormat::operator,");
FrameFormat r = *this;
- UInt16 &fa = r.attachments[r.count-1];
+ uint16_t &fa = r.attachments[r.count-1];
fa = make_indexed_attachment(static_cast<FrameAttachment>(fa), index);
return r;
throw invalid_argument("make_indexed_attachment");
}
-PixelFormat get_attachment_pixelformat(UInt16 fa)
+PixelFormat get_attachment_pixelformat(uint16_t fa)
{
PixelComponents comp;
if(get_attach_point(fa)==get_attach_point(DEPTH_ATTACHMENT))
#ifndef MSP_GL_FRAMEFORMAT_H_
#define MSP_GL_FRAMEFORMAT_H_
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include "pixelformat.h"
namespace Msp {
private:
enum { MAX_ATTACHMENTS = 7 };
- UInt8 count;
- UInt8 samples;
- UInt16 attachments[MAX_ATTACHMENTS];
+ std::uint8_t count;
+ std::uint8_t samples;
+ std::uint16_t attachments[MAX_ATTACHMENTS];
public:
FrameFormat();
unsigned size() const { return count; }
bool empty() const { return !count; }
- const UInt16 *begin() const { return attachments; }
- const UInt16 *end() const { return attachments+count; }
+ const std::uint16_t *begin() const { return attachments; }
+ const std::uint16_t *end() const { return attachments+count; }
int index(FrameAttachment) const;
};
inline FrameAttachment operator,(FrameAttachment fa, unsigned i)
{ return make_indexed_attachment(fa, i); }
-inline unsigned get_attach_point(UInt16 fa)
+inline unsigned get_attach_point(std::uint16_t fa)
{ return fa>>10; }
-PixelFormat get_attachment_pixelformat(UInt16);
+PixelFormat get_attachment_pixelformat(std::uint16_t);
GLenum get_gl_attachment(FrameAttachment);
return new AsyncLoader(*this, io);
}
-UInt64 Mesh::get_data_size() const
+uint64_t Mesh::get_data_size() const
{
- UInt64 size = 0;
+ uint64_t size = 0;
if(vbuf)
size += vbuf->get_size();
if(ibuf)
public:
virtual int get_load_priority() const { return 1; }
virtual Resource::AsyncLoader *load(IO::Seekable &, const Resources * = 0);
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload();
void set_debug_name(const std::string &);
void SpirVModule::load_code(IO::Base &io)
{
- UInt32 buffer[1024];
+ uint32_t buffer[1024];
while(1)
{
unsigned len = io.read(reinterpret_cast<char *>(buffer), sizeof(buffer));
if(code[0]==SPIRV_MAGIC_REVERSED)
{
- for(UInt32 &c: code)
+ for(uint32_t &c: code)
c = ((c&0xFF)<<24) || ((c&0xFF00)<<8) | ((c>>8)&0xFF00) | ((c>>24)&0xFF);
}
else if(code[0]!=SPIRV_MAGIC)
{ }
-UInt32 SpirVModule::Reflection::get_opcode(UInt32 op)
+uint32_t SpirVModule::Reflection::get_opcode(uint32_t op)
{
return op&0xFFFF;
}
throw invalid_module("Unterminated SPIR-V string literal");
}
-void SpirVModule::Reflection::reflect_code(const vector<UInt32> &code)
+void SpirVModule::Reflection::reflect_code(const vector<uint32_t> &code)
{
for(CodeIterator op=code.begin()+5; op!=code.end(); )
{
struct Reflection
{
- typedef std::vector<UInt32>::const_iterator CodeIterator;
+ typedef std::vector<std::uint32_t>::const_iterator CodeIterator;
std::map<unsigned, std::string> names;
std::map<unsigned, Constant> constants;
std::map<unsigned, Structure> structs;
std::map<unsigned, Variable> variables;
- static UInt32 get_opcode(UInt32);
+ static std::uint32_t get_opcode(std::uint32_t);
static CodeIterator get_op_end(const CodeIterator &);
static std::string read_string(CodeIterator &, const CodeIterator &);
- void reflect_code(const std::vector<UInt32> &);
+ void reflect_code(const std::vector<std::uint32_t> &);
void reflect_name(CodeIterator);
void reflect_member_name(CodeIterator);
void reflect_entry_point(CodeIterator);
void reflect_member_decorate(CodeIterator);
};
- std::vector<UInt32> code;
+ std::vector<std::uint32_t> code;
std::vector<EntryPoint> entry_points;
std::vector<Structure> structs;
std::vector<Variable> variables;
void reflect();
public:
- const std::vector<UInt32> &get_code() const { return code; }
+ const std::vector<std::uint32_t> &get_code() const { return code; }
const std::vector<EntryPoint> &get_entry_points() const { return entry_points; }
const std::vector<Variable> &get_variables() const { return variables; }
const std::vector<Constant> &get_spec_constants() const { return spec_constants; }
used_stage_ids[n_stages++] = stage_id;
}
- const vector<UInt32> &code = mod.get_code();
+ const vector<uint32_t> &code = mod.get_code();
glShaderBinary(n_stages, used_stage_ids, GL_SHADER_BINARY_FORMAT_SPIR_V, &code[0], code.size()*4);
if(!spec_values.empty() && !transient)
GLenum get_target() const { return target; }
unsigned get_id() const { return id; }
- virtual UInt64 get_data_size() const { return 0; }
+ virtual std::uint64_t get_data_size() const { return 0; }
void set_debug_name(const std::string &);
return width>>level;
}
-UInt64 Texture1D::get_data_size() const
+uint64_t Texture1D::get_data_size() const
{
return id ? width*get_pixel_size(storage_fmt) : 0;
}
public:
virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload() { }
};
return ldr;
}
-UInt64 Texture2D::get_data_size() const
+uint64_t Texture2D::get_data_size() const
{
return id ? width*height*get_pixel_size(format) : 0;
}
public:
virtual Resource::AsyncLoader *load(IO::Seekable &, const Resources * = 0);
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload();
};
throw invalid_operation("Texture2DMultisample::image");
}
-UInt64 Texture2DMultisample::get_data_size() const
+uint64_t Texture2DMultisample::get_data_size() const
{
return id ? width*height*get_pixel_size(format)*samples : 0;
}
unsigned get_samples() const { return samples; }
virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload() { }
};
return LinAl::Vector<unsigned, 3>(w, h, d);
}
-UInt64 Texture3D::get_data_size() const
+uint64_t Texture3D::get_data_size() const
{
return id ? width*height*depth*get_pixel_size(storage_fmt) : 0;
}
public:
virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload() { }
};
return fv+s*sv+t*tv;
}
-UInt64 TextureCube::get_data_size() const
+uint64_t TextureCube::get_data_size() const
{
return id ? size*size*6*get_pixel_size(storage_fmt) : 0;
}
Vector3 get_texel_direction(TextureCubeFace, unsigned, unsigned);
virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) { return 0; }
- virtual UInt64 get_data_size() const;
+ virtual std::uint64_t get_data_size() const;
virtual void unload() { }
};
throw invalid_operation("VertexFormat::operator,");
VertexFormat r = *this;
- UInt16 &a = r.attributes[r.count-1];
+ uint16_t &a = r.attributes[r.count-1];
a = make_typed_attribute(static_cast<VertexAttribute>(a), t);
return r;
throw invalid_operation("VertexFormat::operator,");
VertexFormat r = *this;
- UInt16 &a = r.attributes[r.count-1];
+ uint16_t &a = r.attributes[r.count-1];
a = make_indexed_attribute(static_cast<VertexAttribute>(a), i);
return r;
unsigned VertexFormat::stride() const
{
unsigned s = 0;
- for(const UInt16 *i=begin(); i!=end(); ++i)
+ for(const uint16_t *i=begin(); i!=end(); ++i)
s += get_attribute_size(*i);
return s;
}
{
unsigned sem = get_attribute_semantic(attr);
unsigned offs = 0;
- for(const UInt16 *i=begin(); i!=end(); ++i)
+ for(const uint16_t *i=begin(); i!=end(); ++i)
{
if(get_attribute_semantic(*i)==sem)
{
#ifndef MSP_GL_VERTEXFORMAT_H_
#define MSP_GL_VERTEXFORMAT_H_
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include <msp/strings/lexicalcast.h>
#include "datatype.h"
private:
enum { MAX_ATTRIBUTES = 15 };
- UInt8 count;
- UInt16 attributes[MAX_ATTRIBUTES];
+ std::uint8_t count;
+ std::uint16_t attributes[MAX_ATTRIBUTES];
public:
VertexFormat();
bool operator!=(const VertexFormat &other) const { return !(*this==other); }
bool empty() const { return !count; }
- const UInt16 *begin() const { return attributes; }
- const UInt16 *end() const { return attributes+count; }
+ const std::uint16_t *begin() const { return attributes; }
+ const std::uint16_t *end() const { return attributes+count; }
unsigned stride() const;
int offset(VertexAttribute) const;
};
inline VertexAttribute operator,(VertexAttribute a, unsigned i)
{ return make_indexed_attribute(a, i); }
-inline unsigned get_attribute_semantic(UInt16 a)
+inline unsigned get_attribute_semantic(std::uint16_t a)
{ return a>>10; }
-inline DataType get_attribute_source_type(UInt16 a)
+inline DataType get_attribute_source_type(std::uint16_t a)
{ return static_cast<DataType>((a&0x70)>>4 | (a&0x180)<<1); }
-inline unsigned get_attribute_component_count(UInt16 a)
+inline unsigned get_attribute_component_count(std::uint16_t a)
{ return a&7; }
-inline unsigned get_attribute_size(UInt16 a)
+inline unsigned get_attribute_size(std::uint16_t a)
{ return get_attribute_component_count(a)*get_type_size(get_attribute_source_type(a)); }
-inline bool is_integer_attribute(UInt16 a)
+inline bool is_integer_attribute(std::uint16_t a)
{ return a&8; }
void operator>>(const LexicalConverter &, VertexAttribute &);
unsigned max_attribs = Limits::get_global().max_vertex_attributes;
- for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a)
+ for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a)
if(get_attribute_semantic(*a)>=max_attribs)
return false;
void VertexSetup::require_format(const VertexFormat &fmt)
{
bool has_int = false;
- for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a)
+ for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a)
has_int = has_int | is_integer_attribute(*a);
if(has_int)
}
unsigned offset = 0;
- for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a)
+ for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a)
{
unsigned sem = get_attribute_semantic(*a);
bool integer = is_integer_attribute(*a);
glBindVertexArray(id);
glBindBuffer(GL_ARRAY_BUFFER, 0);
- for(const UInt16 *a=vertex_format.begin(); a!=vertex_format.end(); ++a)
+ for(const uint16_t *a=vertex_format.begin(); a!=vertex_format.end(); ++a)
{
unsigned sem = get_attribute_semantic(*a);
glDisableVertexAttribArray(sem);
glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0);
}
- for(const UInt16 *a=inst_format.begin(); a!=inst_format.end(); ++a)
+ for(const uint16_t *a=inst_format.begin(); a!=inst_format.end(); ++a)
{
unsigned sem = get_attribute_semantic(*a);
glDisableVertexAttribArray(sem);
throw key_error(Stage::get_stage_name(stage_type));
}
-vector<UInt32> Compiler::get_combined_spirv() const
+vector<uint32_t> Compiler::get_combined_spirv() const
{
if(!compiled)
throw invalid_operation("Compiler::get_combined_spirv");
/** Returns a combined SPIR-V binary for all shader stages. The result is
suitable for use with OpenGL or Vulkan. */
- std::vector<UInt32> get_combined_spirv() const;
+ std::vector<std::uint32_t> get_combined_spirv() const;
/** Returns a map of vertex attribute locations. If the target GLSL version
supports interface layouts, the map is empty (locations are included in the
static const char component_names[] = { 'x', 'r', 's', 'y', 'g', 't', 'z', 'b', 'p', 'w', 'a', 'q' };
bool ok = true;
- UInt8 components[4] = { };
+ uint8_t components[4] = { };
for(unsigned i=0; (ok && i<memacc.member.size()); ++i)
ok = ((components[i] = (std::find(component_names, component_names+12, memacc.member[i])-component_names)/3) < 4);
char arg_types[5];
char extension[13];
Word opcode;
- UInt8 arg_order[4];
+ std::uint8_t arg_order[4];
Word capability;
void (SpirVGenerator::*handler)(FunctionCall &, const std::vector<Id> &);
};
#include <string>
#include <vector>
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include "spirvconstants.h"
namespace Msp {
struct SpirVContent
{
- typedef UInt32 Word;
+ typedef std::uint32_t Word;
std::vector<Word> code;
std::vector<Word> capabilities;
#include <set>
#include <string>
#include <vector>
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include <msp/core/refptr.h>
#include <msp/core/variant.h>
#include "features.h"
char token[4];
char token2[2];
- UInt8 precedence;
+ std::uint8_t precedence;
Type type;
Associativity assoc;
NodePtr<Expression> left;
std::string component_group;
unsigned count;
- UInt8 components[4];
+ std::uint8_t components[4];
Swizzle();
};
Statement *declaration;
- Msp::UInt8 chain_len;
- Msp::UInt8 chain[7];
+ std::uint8_t chain_len;
+ std::uint8_t chain[7];
Target(Statement * = 0);
void ProgramData::update_block_uniform_indices(SharedBlock &block, const Program::UniformBlockInfo &info) const
{
- UInt8 *indices = block.indices.values;
+ uint8_t *indices = block.indices.values;
if(info.uniforms.size()>16)
{
if(block.indices.type_flag==0xFD)
{
- block.indices.dynamic.values = new UInt8[info.uniforms.size()];
+ block.indices.dynamic.values = new uint8_t[info.uniforms.size()];
block.indices.type_flag = 0xFE;
}
indices = block.indices.dynamic.values;
void ProgramData::update_block(SharedBlock &block, const Program::UniformBlockInfo &info) const
{
- const UInt8 *indices = block.get_uniform_indices();
+ const uint8_t *indices = block.get_uniform_indices();
for(unsigned i=0; i<info.uniforms.size(); ++i)
{
if(is_image(info.uniforms[i]->type))
indices.type_flag = 0xFD;
}
-const UInt8 *ProgramData::SharedBlock::get_uniform_indices() const
+const uint8_t *ProgramData::SharedBlock::get_uniform_indices() const
{
return (indices.type_flag==0xFE ? indices.dynamic.values : indices.values);
}
UniformBlock *block;
union
{
- UInt8 type_flag;
- UInt8 values[16];
+ std::uint8_t type_flag;
+ std::uint8_t values[16];
struct
{
- UInt8 type_flag;
- UInt8 *values;
+ std::uint8_t type_flag;
+ std::uint8_t *values;
} dynamic;
} indices;
SharedBlock(Program::LayoutHash);
- const UInt8 *get_uniform_indices() const;
+ const std::uint8_t *get_uniform_indices() const;
};
struct ProgramBlock
{
textures.reserve(f.size());
unsigned samples = f.get_samples();
- for(const UInt16 *i=f.begin(); i!=f.end(); ++i)
+ for(const uint16_t *i=f.begin(); i!=f.end(); ++i)
{
FrameAttachment fa = static_cast<FrameAttachment>(*i);
PixelFormat pf = get_attachment_pixelformat(*i);
fbo.set_debug_name(name+" [FBO]");
const FrameFormat &fmt = fbo.get_format();
unsigned i = 0;
- for(const UInt16 *j=fmt.begin(); j!=fmt.end(); ++i, ++j)
+ for(const uint16_t *j=fmt.begin(); j!=fmt.end(); ++i, ++j)
{
unsigned attach_pt = get_attach_point(static_cast<FrameAttachment>(*j));
#ifndef MSP_GL_RESOURCE_H_
#define MSP_GL_RESOURCE_H_
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include <msp/io/seekable.h>
namespace Msp {
/** Returns the amount of graphics memory used by this resource. The
returned value must not change while the resource is loaded. */
- virtual UInt64 get_data_size() const = 0;
+ virtual std::uint64_t get_data_size() const = 0;
virtual void unload() = 0;
};
async_loads = a;
}
-void ResourceManager::set_size_limit(UInt64 s)
+void ResourceManager::set_size_limit(uint64_t s)
{
size_limit = s;
}
while(total_data_size>size_limit)
{
ManagedResource *best = 0;
- UInt64 best_impact = 0;
+ uint64_t best_impact = 0;
for(auto &kvp: resources)
if(kvp.second.state==ManagedResource::LOADED && kvp.second.last_used<unload_limit)
{
- UInt64 impact = kvp.second.data_size*(frame-kvp.second.last_used);
+ uint64_t impact = kvp.second.data_size*(frame-kvp.second.last_used);
if(!best || impact>best_impact)
{
best = &kvp.second;
return any_finished;
}
-UInt64 ResourceManager::LoadingThread::get_and_reset_loaded_data_size()
+uint64_t ResourceManager::LoadingThread::get_and_reset_loaded_data_size()
{
MutexLock lock(data_size_mutex);
- UInt64 result = loaded_data_size;
+ uint64_t result = loaded_data_size;
loaded_data_size = 0;
return result;
}
#define MSP_GL_RESOURCEMANAGER_H_
#include <deque>
-#include <msp/core/inttypes.h>
+#include <cstdint>
#include <msp/core/mutex.h>
#include <msp/core/semaphore.h>
#include <msp/core/thread.h>
Resource::AsyncLoader *loader;
State state;
unsigned last_used;
- UInt64 data_size;
+ std::uint64_t data_size;
std::vector<ResourceObserver *> observers;
ManagedResource(Resource &);
unsigned size;
std::list<resource_load_error> error_queue;
Mutex data_size_mutex;
- UInt64 loaded_data_size;
+ std::uint64_t loaded_data_size;
volatile bool done;
public:
public:
bool sync();
bool needs_work() const { return size<capacity; }
- UInt64 get_and_reset_loaded_data_size();
+ std::uint64_t get_and_reset_loaded_data_size();
void terminate();
};
mutable Mutex map_mutex;
std::map<const Resource *, ManagedResource> resources;
std::deque<ManagedResource *> queue;
- UInt64 total_data_size;
- UInt64 size_limit;
+ std::uint64_t total_data_size;
+ std::uint64_t size_limit;
unsigned frame;
unsigned min_retain_frames;
unsigned max_retain_frames;
void set_loading_policy(LoadingPolicy);
void set_async_loads(bool);
- void set_size_limit(UInt64);
+ void set_size_limit(std::uint64_t);
void set_min_retain_frames(unsigned);
void set_max_retain_frames(unsigned);
void unload_by_age();
void unload_by_size();
public:
- UInt64 get_total_data_size() const { return total_data_size; }
+ std::uint64_t get_total_data_size() const { return total_data_size; }
private:
static bool age_order(ManagedResource *, ManagedResource *);
if(compile_mode==GL::SL::Compiler::SPIRV)
{
- vector<UInt32> code = compiler.get_combined_spirv();
+ vector<uint32_t> code = compiler.get_combined_spirv();
out->write(reinterpret_cast<char *>(&code.front()), code.size()*4);
}
else if(combined)