material work, use multibind and dsa in main texture binding

This commit is contained in:
milek7
2018-07-19 00:20:42 +02:00
parent ee16821509
commit a53224b47d
16 changed files with 128 additions and 178 deletions

View File

@@ -57,6 +57,7 @@ struct opengl_texture {
GLint components_hint; // components that material wants
GLenum target = GL_TEXTURE_2D;
static std::array<GLuint, gl::MAX_TEXTURES + 2> units;
private:
// methods
@@ -91,7 +92,6 @@ private:
static std::unordered_map<GLint, GLint> drivercompressed_formats;
static std::unordered_map<GLint, std::unordered_map<GLint, GLint>> mapping;
static std::array<GLuint, gl::MAX_TEXTURES + 2> m_units;
static GLint m_activeunit;
};
@@ -109,6 +109,7 @@ public:
// binds specified texture to specified texture unit
void
bind( std::size_t const Unit, texture_handle const Texture );
opengl_texture& mark_as_used(texture_handle const Texture);
// provides direct access to specified texture object
opengl_texture &
texture( texture_handle const Texture ) const { return *(m_textures[ Texture ].first); }