Skip to content

Commit 94f016b

Browse files
gmtalinusg
authored andcommitted
LibGL+LibGPU+LibSoftGPU: Report texture env add extension
The Quake 3 port makes use of this extension to determine a more efficient multitexturing strategy. Since LibSoftGPU supports it, let's report the extension in LibGL. :^)
1 parent adf85c7 commit 94f016b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Userland/Libraries/LibGL/GLContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,11 @@ void GLContext::build_extension_string()
933933
if (m_device_info.num_texture_units > 1)
934934
extensions.append("GL_ARB_multitexture"sv);
935935

936+
if (m_device_info.supports_texture_env_add) {
937+
extensions.append("GL_ARB_texture_env_add"sv);
938+
extensions.append("GL_EXT_texture_env_add"sv);
939+
}
940+
936941
m_extensions = String::join(' ', extensions);
937942
}
938943

Userland/Libraries/LibGPU/DeviceInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ struct DeviceInfo final {
1818
unsigned max_clip_planes;
1919
u8 stencil_bits;
2020
bool supports_npot_textures;
21+
bool supports_texture_env_add;
2122
};
2223

2324
}

Userland/Libraries/LibSoftGPU/Device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ GPU::DeviceInfo Device::info() const
835835
.max_clip_planes = MAX_CLIP_PLANES,
836836
.stencil_bits = sizeof(GPU::StencilType) * 8,
837837
.supports_npot_textures = true,
838+
.supports_texture_env_add = true,
838839
};
839840
}
840841

0 commit comments

Comments
 (0)