Skip to content

Commit

Permalink
add missing texture formats and pixel types (#2483)
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 authored Oct 25, 2024
1 parent 2cc2552 commit c554eff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion common/src/main/java/net/irisshaders/iris/gl/GlVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ public enum GlVersion {
GL_11,
GL_12,
GL_30,
GL_31
GL_31,
GL_33,
GL_41
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.lwjgl.opengl.GL11C;
import org.lwjgl.opengl.GL30C;
import org.lwjgl.opengl.GL31C;
import org.lwjgl.opengl.GL33C;
import org.lwjgl.opengl.GL41C;

import java.util.Locale;
import java.util.Optional;
Expand Down Expand Up @@ -72,10 +74,16 @@ public enum InternalTextureFormat {
RG32UI(GL30C.GL_RG32UI, GlVersion.GL_30, PixelFormat.RG_INTEGER),
RGB32UI(GL30C.GL_RGB32UI, GlVersion.GL_30, PixelFormat.RGB_INTEGER),
RGBA32UI(GL30C.GL_RGBA32UI, GlVersion.GL_30, PixelFormat.RGBA_INTEGER),
// 2-bit normalized
RGBA2(GL11C.GL_RGBA2, GlVersion.GL_11, PixelFormat.RGBA),
// 4-bit normalized
RGBA4(GL11C.GL_RGBA4, GlVersion.GL_11, PixelFormat.RGBA),
// Mixed
R3_G3_B2(GL11C.GL_R3_G3_B2, GlVersion.GL_11, PixelFormat.RGB),
RGB5_A1(GL11C.GL_RGB5_A1, GlVersion.GL_11, PixelFormat.RGBA),
RGB565(GL41C.GL_RGB565, GlVersion.GL_41, PixelFormat.RGB),
RGB10_A2(GL11C.GL_RGB10_A2, GlVersion.GL_11, PixelFormat.RGBA),
RGB10_A2UI(GL33C.GL_RGB10_A2UI, GlVersion.GL_33, PixelFormat.RGBA),
R11F_G11F_B10F(GL30C.GL_R11F_G11F_B10F, GlVersion.GL_30, PixelFormat.RGB),
RGB9_E5(GL30C.GL_RGB9_E5, GlVersion.GL_30, PixelFormat.RGB);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public enum PixelType {
UNSIGNED_INT_8_8_8_8(4, GL12C.GL_UNSIGNED_INT_8_8_8_8, GlVersion.GL_12),
UNSIGNED_INT_8_8_8_8_REV(4, GL12C.GL_UNSIGNED_INT_8_8_8_8_REV, GlVersion.GL_12),
UNSIGNED_INT_10_10_10_2(4, GL12C.GL_UNSIGNED_INT_10_10_10_2, GlVersion.GL_12),
UNSIGNED_INT_2_10_10_10_REV(4, GL12C.GL_UNSIGNED_INT_2_10_10_10_REV, GlVersion.GL_12);
UNSIGNED_INT_2_10_10_10_REV(4, GL12C.GL_UNSIGNED_INT_2_10_10_10_REV, GlVersion.GL_12),
UNSIGNED_INT_10F_11F_11F_REV(4, GL30C.GL_UNSIGNED_INT_10F_11F_11F_REV, GlVersion.GL_30),
UNSIGNED_INT_5_9_9_9_REV(4, GL30C.GL_UNSIGNED_INT_5_9_9_9_REV, GlVersion.GL_30);

private final int byteSize;
private final int glFormat;
Expand Down

0 comments on commit c554eff

Please sign in to comment.