add useViewportDims

This commit is contained in:
mcrcortex
2025-09-07 12:01:58 +10:00
parent dc94b60121
commit 8615f29132
3 changed files with 13 additions and 0 deletions

View File

@@ -109,6 +109,10 @@ public class IrisVoxyRenderPipeline extends AbstractRenderPipeline {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
} }
if (this.data.useViewportDims) {
srcWidth = viewport.width;
srcHeight = viewport.height;
}
this.initDepthStencil(sourceFramebuffer, this.fb.framebuffer.id, srcWidth, srcHeight, viewport.width, viewport.height); this.initDepthStencil(sourceFramebuffer, this.fb.framebuffer.id, srcWidth, srcHeight, viewport.width, viewport.height);
return this.fb.getDepthTex().id; return this.fb.getDepthTex().id;
} }

View File

@@ -26,6 +26,7 @@ public class IrisShaderPatch {
public static final boolean IMPERSONATE_DISTANT_HORIZONS = System.getProperty("voxy.impersonateDHShader", "false").equalsIgnoreCase("true"); public static final boolean IMPERSONATE_DISTANT_HORIZONS = System.getProperty("voxy.impersonateDHShader", "false").equalsIgnoreCase("true");
private static final class SSBODeserializer implements JsonDeserializer<Int2ObjectOpenHashMap<String>> { private static final class SSBODeserializer implements JsonDeserializer<Int2ObjectOpenHashMap<String>> {
@Override @Override
public Int2ObjectOpenHashMap<String> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { public Int2ObjectOpenHashMap<String> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
@@ -157,6 +158,7 @@ public class IrisShaderPatch {
public String taaOffset; public String taaOffset;
public boolean excludeLodsFromVanillaDepth; public boolean excludeLodsFromVanillaDepth;
public float[] renderScale; public float[] renderScale;
public boolean useViewportDims;
public boolean checkValid() { public boolean checkValid() {
return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null; return this.opaqueDrawBuffers != null && this.translucentDrawBuffers != null && this.uniforms != null && this.opaquePatchData != null;
} }
@@ -178,6 +180,10 @@ public class IrisShaderPatch {
} }
} }
public boolean useViewportDims() {
return this.patchData.useViewportDims;
}
public Int2ObjectMap<String> getSSBOs() { public Int2ObjectMap<String> getSSBOs() {
return new Int2ObjectLinkedOpenHashMap<>(this.ssbos); return new Int2ObjectLinkedOpenHashMap<>(this.ssbos);
} }

View File

@@ -49,6 +49,8 @@ public class IrisVoxyRenderPipelineData {
public final boolean renderToVanillaDepth; public final boolean renderToVanillaDepth;
public final float[] resolutionScale; public final float[] resolutionScale;
public final String TAA; public final String TAA;
public final boolean useViewportDims;
private IrisVoxyRenderPipelineData(IrisShaderPatch patch, int[] opaqueDrawTargets, int[] translucentDrawTargets, StructLayout uniformSet, Runnable blendingSetup, ImageSet imageSet, SSBOSet ssboSet) { private IrisVoxyRenderPipelineData(IrisShaderPatch patch, int[] opaqueDrawTargets, int[] translucentDrawTargets, StructLayout uniformSet, Runnable blendingSetup, ImageSet imageSet, SSBOSet ssboSet) {
this.opaqueDrawTargets = opaqueDrawTargets; this.opaqueDrawTargets = opaqueDrawTargets;
this.translucentDrawTargets = translucentDrawTargets; this.translucentDrawTargets = translucentDrawTargets;
@@ -61,6 +63,7 @@ public class IrisVoxyRenderPipelineData {
this.renderToVanillaDepth = patch.emitToVanillaDepth(); this.renderToVanillaDepth = patch.emitToVanillaDepth();
this.TAA = patch.getTAAShift(); this.TAA = patch.getTAAShift();
this.resolutionScale = patch.getRenderScale(); this.resolutionScale = patch.getRenderScale();
this.useViewportDims = patch.useViewportDims();
} }
public SSBOSet getSsboSet() { public SSBOSet getSsboSet() {