Skip to content

Commit cca37ba

Browse files
committed
constrain depth and stencil bits to requested values, use capabilities
to obtain current values
1 parent c6b649a commit cca37ba

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

core/src/processing/opengl/PGL.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ protected void createFBOLayer() {
527527
boolean multisample = 1 < numSamples;
528528

529529
boolean packed = ext.indexOf("packed_depth_stencil") != -1;
530-
int depthBits = getDepthBits();
531-
int stencilBits = getStencilBits();
530+
int depthBits = PApplet.min(REQUESTED_DEPTH_BITS, getDepthBits());
531+
int stencilBits = PApplet.min(REQUESTED_STENCIL_BITS, getStencilBits());
532532

533533
genTextures(2, glColorTex);
534534
for (int i = 0; i < 2; i++) {

core/src/processing/opengl/PJOGL.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,13 @@ protected boolean isFBOBacked() {
452452

453453
@Override
454454
protected int getDepthBits() {
455-
if (USE_JOGL_FBOLAYER) return capabilities.getDepthBits();
456-
else return super.getDepthBits();
455+
return capabilities.getDepthBits();
457456
}
458457

459458

460459
@Override
461460
protected int getStencilBits() {
462-
if (USE_JOGL_FBOLAYER) return capabilities.getStencilBits();
463-
else return super.getStencilBits();
461+
return capabilities.getStencilBits();
464462
}
465463

466464

0 commit comments

Comments
 (0)