texture method renaming

This commit is contained in:
James Seibel
2026-03-09 12:09:10 -05:00
parent 458cc9b505
commit 385d6919fb
9 changed files with 39 additions and 20 deletions
@@ -300,8 +300,8 @@ public class McLodRenderer implements IMcLodRenderer
}
// textures
this.dhDepthTextureWrapper.trySetup();
this.dhColorTextureWrapper.trySetup();
this.dhDepthTextureWrapper.tryCreateOrResize();
this.dhColorTextureWrapper.tryCreateOrResize();
{
profiler.popPush("setup");
@@ -132,10 +132,10 @@ public class DhApplyRenderer
this.createPipeline();
this.vboGpuBuffer = BlazePostProcessUtil.createAndUploadScreenVertexData(this.name);
this.sourceColorTextureViewWrapper.trySetup(sourceColorTexture);
this.sourceDepthTextureViewWrapper.trySetup(sourceDepthTexture);
this.sourceColorTextureViewWrapper.tryWrap(sourceColorTexture);
this.sourceDepthTextureViewWrapper.tryWrap(sourceDepthTexture);
this.destinationColorTextureViewWrapper.trySetup(destinationColorTexture);
this.destinationColorTextureViewWrapper.tryWrap(destinationColorTexture);
}
private void createPipeline()
@@ -157,8 +157,8 @@ public class McFarFadeRenderer implements IMcFarFadeRenderer
// textures
this.dhFadeColorTextureWrapper.trySetup();
this.mcColorTextureViewWrapper.trySetup(Minecraft.getInstance().getMainRenderTarget().getColorTexture());
this.dhFadeColorTextureWrapper.tryCreateOrResize();
this.mcColorTextureViewWrapper.tryWrap(Minecraft.getInstance().getMainRenderTarget().getColorTexture());
{
int uniformBufferSize = new Std140SizeCalculator()
@@ -170,7 +170,7 @@ public class McFogRenderer implements IMcFogRenderer
this.fogColorTextureWrapper.trySetup();
this.fogColorTextureWrapper.tryCreateOrResize();
{
@@ -163,7 +163,7 @@ public class McSsaoRenderer implements IMcSsaoRenderer
// textures
this.ssaoColorTextureWrapper.trySetup();
this.ssaoColorTextureWrapper.tryCreateOrResize();
// frag uniforms
{
@@ -158,10 +158,10 @@ public class McVanillaFadeRenderer implements IMcVanillaFadeRenderer
// textures
this.fadeColorTextureWrapper.trySetup();
this.fadeColorTextureWrapper.tryCreateOrResize();
this.mcDepthTextureWrapper.trySetup(Minecraft.getInstance().getMainRenderTarget().getDepthTexture());
this.mcColorTextureWrapper.trySetup(Minecraft.getInstance().getMainRenderTarget().getColorTexture());
this.mcDepthTextureWrapper.tryWrap(Minecraft.getInstance().getMainRenderTarget().getDepthTexture());
this.mcColorTextureWrapper.tryWrap(Minecraft.getInstance().getMainRenderTarget().getColorTexture());
{
@@ -17,13 +17,18 @@ public class BlazeTextureViewWrapper
private static final CommandEncoder COMMAND_ENCODER = GPU_DEVICE.createCommandEncoder();
public GpuTextureView textureView = null;
public GpuSampler textureSampler = null;
public void trySetup(GpuTexture texture)
//=======//
// setup //
//=======//
//region
/** does nothing if the texture is already wrapped */
public void tryWrap(GpuTexture texture)
{
this.tryRecreateTextureView(texture);
this.tryCreateSampler();
@@ -54,6 +59,8 @@ public class BlazeTextureViewWrapper
}
}
//endregion
}
@@ -34,9 +34,10 @@ public class BlazeTextureWrapper
private int height = -1;
//=============//
// constructor //
//=============//
//==============//
// constructors //
//==============//
//region
public static BlazeTextureWrapper createDepth(String name) { return new BlazeTextureWrapper(name, TextureFormat.DEPTH32); }
@@ -73,7 +74,8 @@ public class BlazeTextureWrapper
//=======//
//region
public void trySetup()
/** does nothing if the texture is already created and the correct size */
public void tryCreateOrResize()
{
this.tryCreateTexture();
this.tryCreateSampler();
@@ -126,8 +128,15 @@ public class BlazeTextureWrapper
//==========//
// clearing //
//==========//
//region
/** @see ColorUtil#argbToInt */
/**
* Will throw an exception if not a color texture.
* @see ColorUtil#argbToInt
*/
public void clearColor(int clearArgbColor)
{
if (this.texture != null)
@@ -136,6 +145,7 @@ public class BlazeTextureWrapper
}
}
/** Will throw an exception if not a depth texture. */
public void clearDepth(float depth)
{
if (this.texture != null)
@@ -144,6 +154,8 @@ public class BlazeTextureWrapper
}
}
//endregion
}
@@ -107,7 +107,7 @@ public class LightMapWrapper implements ILightMapWrapper
public void setLightmapGpuTexture(GpuTexture gpuTexture)
{
this.gpuTexture = gpuTexture;
this.lightmapTextureWrapper.trySetup(this.gpuTexture);
this.lightmapTextureWrapper.tryWrap(this.gpuTexture);
}
//endregion