mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:07:35 +00:00
LibGL: Also track active texture unit index
In addition to tracking a pointer to the active texture unit we also track its index in the array.
This commit is contained in:
parent
9627576d9c
commit
bc17a87450
2 changed files with 4 additions and 2 deletions
|
@ -1868,9 +1868,10 @@ GLboolean SoftwareGLContext::gl_is_texture(GLuint texture)
|
||||||
|
|
||||||
void SoftwareGLContext::gl_active_texture(GLenum texture)
|
void SoftwareGLContext::gl_active_texture(GLenum texture)
|
||||||
{
|
{
|
||||||
RETURN_WITH_ERROR_IF(texture < GL_TEXTURE0 || texture > GL_TEXTURE31, GL_INVALID_ENUM);
|
RETURN_WITH_ERROR_IF(texture < GL_TEXTURE0 || texture >= GL_TEXTURE0 + m_device_info.num_texture_units, GL_INVALID_ENUM);
|
||||||
|
|
||||||
m_active_texture_unit = &m_texture_units.at(texture - GL_TEXTURE0);
|
m_active_texture_unit_index = texture - GL_TEXTURE0;
|
||||||
|
m_active_texture_unit = &m_texture_units.at(m_active_texture_unit_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoftwareGLContext::gl_get_booleanv(GLenum pname, GLboolean* data)
|
void SoftwareGLContext::gl_get_booleanv(GLenum pname, GLboolean* data)
|
||||||
|
|
|
@ -264,6 +264,7 @@ private:
|
||||||
HashMap<GLuint, RefPtr<Texture>> m_allocated_textures;
|
HashMap<GLuint, RefPtr<Texture>> m_allocated_textures;
|
||||||
Vector<TextureUnit> m_texture_units;
|
Vector<TextureUnit> m_texture_units;
|
||||||
TextureUnit* m_active_texture_unit;
|
TextureUnit* m_active_texture_unit;
|
||||||
|
size_t m_active_texture_unit_index { 0 };
|
||||||
|
|
||||||
// Texture coordinate generation state
|
// Texture coordinate generation state
|
||||||
struct TextureCoordinateGeneration {
|
struct TextureCoordinateGeneration {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue