maint: updated aline

This commit is contained in:
Chris
2025-09-08 17:17:12 -04:00
parent 7a0499f36a
commit 6c1cb44d18
64 changed files with 591 additions and 460 deletions

View File

@@ -32,19 +32,26 @@ namespace Drawing {
#if MODULE_RENDER_PIPELINES_UNIVERSAL_17_0_0_OR_NEWER
private class PassData {
public Camera camera;
public bool allowDisablingWireframe;
}
public override void RecordRenderGraph (RenderGraph renderGraph, ContextContainer frameData) {
var cameraData = frameData.Get<UniversalCameraData>();
var resourceData = frameData.Get<UniversalResourceData>();
// This could happen if the camera does not have a color target or depth target set.
// In that case we are probably rendering some kind of special effect. Skip ALINE rendering in that case.
if (!resourceData.activeColorTexture.IsValid() || !resourceData.activeDepthTexture.IsValid()) {
return;
}
using (IRasterRenderGraphBuilder builder = renderGraph.AddRasterRenderPass<PassData>("ALINE", out PassData passData, profilingSampler)) {
bool allowDisablingWireframe = false;
passData.allowDisablingWireframe = false;
if (Application.isEditor && (cameraData.cameraType & (CameraType.SceneView | CameraType.Preview)) != 0) {
// We need this to be able to disable wireframe rendering in the scene view
builder.AllowGlobalStateModification(true);
allowDisablingWireframe = true;
passData.allowDisablingWireframe = true;
}
builder.SetRenderAttachment(resourceData.activeColorTexture, 0);
@@ -53,7 +60,7 @@ namespace Drawing {
builder.SetRenderFunc<PassData>(
(PassData data, RasterGraphContext context) => {
DrawingManager.instance.ExecuteCustomRenderGraphPass(new DrawingData.CommandBufferWrapper { cmd2 = context.cmd, allowDisablingWireframe = allowDisablingWireframe }, data.camera);
DrawingManager.instance.ExecuteCustomRenderGraphPass(new DrawingData.CommandBufferWrapper { cmd2 = context.cmd, allowDisablingWireframe = data.allowDisablingWireframe }, data.camera);
}
);
}