More GLSM Tests (#282)

* Properly Cache GL_SHADE_MODEL and make it a stack

* Add opengl_32_core to docs, so we can easily see what is needed to be deprecated/emulated
Add some stub functions to be fleshed out later
This commit is contained in:
Jason Mitchell authored and GitHub committed 2024-02-11 12:13:51 -08:00
1 parent f1394382ab
commit 8a50ed036d
5 files changed
+1070 -24

No files matched your search

@@ -155,7 +155,7 @@ public class Feature {
// Ambient, diffuse, specular, and emissive color for each material
// Ambient, diffuse, and specular color indices for each material
// Specular exponent for each material
// GL_SHADE_MODEL setting
, GLStateManager.shadeModelState // GL_SHADE_MODEL setting
));
attribToFeatures.put(GL11.GL_LINE_BIT, ImmutableSet.of(
// GL_LINE_SMOOTH flag
@@ -86,8 +86,11 @@ public class GLStateManager {
// GLStateManager State Trackers
private static final IntStack attribs = new IntArrayList(MAX_ATTRIB_STACK_DEPTH);
protected static final IntegerStateStack activeTextureUnit = new IntegerStateStack();
protected static final IntegerStateStack shadeModelState = new IntegerStateStack();
static {
activeTextureUnit.setValue(0); // GL_TEXTURE0
shadeModelState.setValue(GL11.GL_SMOOTH);
}
@Getter protected static final TextureUnitArray textures = new TextureUnitArray();
@Getter protected static final BlendStateStack blendState = new BlendStateStack();
@@ -116,7 +119,6 @@ public class GLStateManager {
@Getter protected static final ViewPortStateStack viewportState = new ViewPortStateStack();
private static int modelShadeMode;
// Iris Listeners
private static Runnable blendFuncListener = null;
@@ -313,6 +315,7 @@ public class GLStateManager {
case GL11.GL_DEPTH_FUNC -> depthState.getFunc();
case GL11.GL_LIST_MODE -> glListMode;
case GL11.GL_MATRIX_MODE -> matrixMode.getMode();
case GL11.GL_SHADE_MODEL -> shadeModelState.getValue();
case GL11.GL_TEXTURE_BINDING_2D -> getBoundTexture();
case GL14.GL_BLEND_DST_ALPHA -> blendState.getDstAlpha();
case GL14.GL_BLEND_DST_RGB -> blendState.getDstRgb();
@@ -960,8 +963,8 @@ public class GLStateManager {
}
public static void glShadeModel(int mode) {
if (shouldBypassCache() || modelShadeMode != mode) {
modelShadeMode = mode;
if (shouldBypassCache() || shadeModelState.getValue() != mode) {
shadeModelState.setValue(mode);
GL11.glShadeModel(mode);
}
}
@@ -1349,4 +1352,30 @@ public class GLStateManager {
default -> GL11.glGetTexLevelParameteri(target, level, pname);
};
}
public static void glLight(int light, int pname, FloatBuffer params) {
GL11.glLight(light, pname, params);
}
public static void glLight(int light, int pname, IntBuffer params) {
GL11.glLight(light, pname, params);
}
public static void glLightModel(int pname, FloatBuffer params) {
GL11.glLightModel(pname, params);
}
public static void glLightModel(int pname, IntBuffer params) {
GL11.glLightModel(pname, params);
}
public static void glLightModelf(int pname, float param) {
GL11.glLightModelf(pname, param);
}
public static void glLightModeli(int pname, int param) {
GL11.glLightModeli(pname, param);
}
public static void glColorMaterial(int face, int mode) {
GL11.glColorMaterial(face, mode);
}
}
@@ -117,6 +117,7 @@ public class RedirectorTransformer implements IClassTransformer {
.add("glColor4f")
.add("glColor4ub")
.add("glColorMask")
.add("glColorMaterial")
.add("glDeleteTextures")
.add("glDepthFunc")
.add("glDepthMask")
@@ -136,6 +137,10 @@ public class RedirectorTransformer implements IClassTransformer {
.add("glGetTexParameterf")
.add("glGetTexParameteri")
.add("glIsEnabled")
.add("glLight")
.add("glLightModel")
.add("glLightModelf")
.add("glLightModeli")
.add("glLoadIdentity")
.add("glLoadMatrix")
.add("glLogicOp")
@@ -151,32 +156,32 @@ public class RedirectorTransformer implements IClassTransformer {
.add("glPopMatrix")
.add("glPushAttrib")
.add("glPushMatrix")
.add("glRasterPos2f")
.add("glRasterPos2d")
.add("glRasterPos2f")
.add("glRasterPos2i")
.add("glRasterPos3f")
.add("glRasterPos3d")
.add("glRasterPos3f")
.add("glRasterPos3i")
.add("glRasterPos4f")
.add("glRasterPos4d")
.add("glRasterPos4f")
.add("glRasterPos4i")
.add("glRotated")
.add("glRotatef")
.add("glScaled")
.add("glScalef")
.add("glTexCoord1f")
.add("glShadeModel")
.add("glTexCoord1d")
.add("glTexCoord2f")
.add("glTexCoord1f")
.add("glTexCoord2d")
.add("glTexCoord3f")
.add("glTexCoord2f")
.add("glTexCoord3d")
.add("glTexCoord4f")
.add("glTexCoord3f")
.add("glTexCoord4d")
.add("glTexCoord4f")
.add("glTexImage2D")
.add("glTexParameter")
.add("glTexParameterf")
.add("glTexParameteri")
.add("glShadeModel")
.add("glTexImage2D")
.add("glTexParameteri")
.add("glTranslated")
.add("glTranslatef")