Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Nov 15, 2024
1 parent c34d029 commit a1c6c56
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions editor/assets/default_renderpipeline/builtin-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function addCopyToScreenPass(
cameraConfigs: CameraConfigs,
input: string,
): rendering.BasicRenderPassBuilder {
assert(!!cameraConfigs.copyAndTonemapMaterial);
const pass = ppl.addRenderPass(
cameraConfigs.nativeWidth,
cameraConfigs.nativeHeight,
Expand Down Expand Up @@ -518,8 +519,7 @@ export class BuiltinForwardPassBuilder implements rendering.PipelinePassBuilder
pplConfigs: Readonly<PipelineConfigs>,
cameraConfigs: CameraConfigs & ForwardPassConfigs,
camera: renderer.scene.Camera,
context: PipelineContext,
prevRenderPass?: rendering.BasicRenderPassBuilder): rendering.BasicRenderPassBuilder | undefined {
context: PipelineContext): rendering.BasicRenderPassBuilder | undefined {
const id = camera.window.renderWindowId;

const scene = camera.scene!;
Expand Down Expand Up @@ -588,12 +588,14 @@ export class BuiltinForwardPassBuilder implements rendering.PipelinePassBuilder
// ----------------------------------------------------------------
// Dynamic states
// ----------------------------------------------------------------
const width = ppl.pipelineSceneData.shadows.size.x;
const height = ppl.pipelineSceneData.shadows.size.y;
this._viewport.left = 0;
this._viewport.top = 0;
this._viewport.width = width;
this._viewport.height = height;
const shadowSize = ppl.pipelineSceneData.shadows.size;
const width = shadowSize.x;
const height = shadowSize.y;

const viewport = this._viewport;
viewport.left = viewport.top = 0;
viewport.width = width;
viewport.height = height;

// ----------------------------------------------------------------
// CSM Shadow Map
Expand Down Expand Up @@ -1002,10 +1004,7 @@ export class BuiltinBloomPassBuilder implements rendering.PipelinePassBuilder {
ppl: rendering.BasicPipeline,
pplConfigs: Readonly<PipelineConfigs>,
cameraConfigs: CameraConfigs & BloomPassConfigs,
window: renderer.RenderWindow,
camera: renderer.scene.Camera,
nativeWidth: number,
nativeHeight: number): void {
window: renderer.RenderWindow): void {
if (cameraConfigs.enableBloom) {
const id = window.renderWindowId;
let bloomWidth = cameraConfigs.width;
Expand Down Expand Up @@ -1188,12 +1187,9 @@ export class BuiltinToneMappingPassBuilder implements rendering.PipelinePassBuil
windowResize(
ppl: rendering.BasicPipeline,
pplConfigs: Readonly<PipelineConfigs>,
cameraConfigs: CameraConfigs & ToneMappingPassConfigs,
window: renderer.RenderWindow,
camera: renderer.scene.Camera,
nativeWidth: number,
nativeHeight: number): void {
cameraConfigs: CameraConfigs & ToneMappingPassConfigs): void {
if (cameraConfigs.enableColorGrading) {
assert(!!cameraConfigs.settings.colorGrading.material);
cameraConfigs.settings.colorGrading.material.setProperty(
'colorGradingMap',
cameraConfigs.settings.colorGrading.colorGradingMap);
Expand Down Expand Up @@ -1273,6 +1269,7 @@ export class BuiltinToneMappingPassBuilder implements rendering.PipelinePassBuil
pass.addQueue(rendering.QueueHint.OPAQUE)
.addFullscreenQuad(settings.toneMapping.material, 0);
} else {
assert(!!cameraConfigs.copyAndTonemapMaterial);
pass.addQueue(rendering.QueueHint.OPAQUE)
.addFullscreenQuad(cameraConfigs.copyAndTonemapMaterial, 0);
}
Expand Down Expand Up @@ -1324,6 +1321,7 @@ export class BuiltinFXAAPassBuilder implements rendering.PipelinePassBuilder {
: `LdrColor`;
const ldrColorName = getPingPongRenderTarget(context.colorName, ldrColorPrefix, id);

assert(!!cameraConfigs.settings.fxaa.material);
if (cameraConfigs.remainingPasses === 0) {
if (cameraConfigs.enableShadingScale) {
this._addFxaaPass(ppl, pplConfigs,
Expand Down Expand Up @@ -1427,6 +1425,7 @@ export class BuiltinFsrPassBuilder implements rendering.PipelinePassBuilder {
: getPingPongRenderTarget(context.colorName, 'UiColor', cameraConfigs.renderWindowId);
context.colorName = outputColorName;

assert(!!cameraConfigs.settings.fsr.material);
return this._addFsrPass(ppl, pplConfigs, cameraConfigs,
cameraConfigs.settings,
cameraConfigs.settings.fsr.material,
Expand Down Expand Up @@ -1679,7 +1678,6 @@ if (rendering) {
this._setupCameraConfigs(camera, this._configs, this._cameraConfigs);

// Render Window (UI)
const settings = this._cameraConfigs.settings;
const id = window.renderWindowId;

ppl.addRenderWindow(this._cameraConfigs.colorName,
Expand Down

0 comments on commit a1c6c56

Please sign in to comment.