Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msaa && memoryless #15604

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3076673
add PipelineRuntime document
star-e Jun 25, 2023
c6116a1
update comment
star-e Jun 25, 2023
1cae692
adding enum comments
star-e Jun 25, 2023
06488b1
change beta and experimental
star-e Jun 25, 2023
02dccbc
PipelineType added
star-e Jun 25, 2023
de09902
update PipelineType
star-e Jun 25, 2023
593f963
add doc
star-e Jun 27, 2023
defd1d1
QueueHint updated
star-e Jun 27, 2023
102294e
Basic Pipeline added
star-e Jun 28, 2023
8e28c0c
api documents added
star-e Jun 28, 2023
0641afb
fix wording
star-e Jun 28, 2023
2901f23
update doc
star-e Jun 29, 2023
ba8e936
add multisample render pass builder
star-e Jun 29, 2023
db9f9f9
add MultisampleRenderPassBuilder
star-e Jun 29, 2023
130449d
refactor interface, adding gpu-driven
star-e Jun 30, 2023
2eba09a
cleanup
star-e Jun 30, 2023
2874bab
add resource added
star-e Jul 5, 2023
d5602d0
add sortedVertices for GPU driven
star-e Jul 5, 2023
2873ca7
use depth first visit on sorted vertices
star-e Jul 5, 2023
8b7b299
go through msaa on metal & vk (#148)
hana-alice Jul 7, 2023
dc0c942
V3.8.0 pipeline api document (#15529)
star-e Jun 29, 2023
b65fa11
fix native pipeline instancing implementation (#15647)
star-e Jul 7, 2023
d9f6ede
3.8.0 msaa update (#149)
hana-alice Jul 7, 2023
7f38219
update blit resolve command.
bluesky013 Jun 20, 2023
b5a7969
add restrict to GLES3 resolve framebuffer.
bluesky013 Jun 25, 2023
fac6ada
print gles msaa feature.
bluesky013 Jun 25, 2023
12e0846
refactor gles3 framebuffer.
bluesky013 Jun 29, 2023
99c2690
update vulkan framebuffer.
bluesky013 Jun 29, 2023
b2e76a7
fix tidy.
bluesky013 Jun 30, 2023
fa47a1f
added Texture lazily allocated flag.
bluesky013 Jun 30, 2023
9d8d43d
metal depth stencil resolve && memoryless.
bluesky013 Jul 3, 2023
a6c1d30
fix android compile warning.
bluesky013 Jul 3, 2023
0b438c5
comment on allocateMemory.
bluesky013 Jun 29, 2023
a892b6a
Update SampleCount in gfx device.
bluesky013 Jul 4, 2023
386ea5b
fix tidy
bluesky013 Jul 4, 2023
88d163b
fix vulkan depth resolve issue.
bluesky013 Jul 5, 2023
9dd7a2c
fix gles msaa issue.
bluesky013 Jul 5, 2023
03c3b21
metal sample count.
bluesky013 Jun 20, 2023
917833d
fix compile issue.
bluesky013 Jul 7, 2023
a973daf
msaa gles3 renderpass.
bluesky013 Jul 7, 2023
0c820a8
msaa gles3 renderpass.
bluesky013 Jul 7, 2023
2f62269
msaa gles3 renderpass.
bluesky013 Jul 7, 2023
d6dc7a0
update memoryless for rdg.
bluesky013 Jul 10, 2023
c855689
missing barrier fix
hana-alice Jul 10, 2023
d49b850
fix tidy.
bluesky013 Jul 10, 2023
acc8a6e
add transfer flag for ResourceFlags.
bluesky013 Jul 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cocos/gfx/base/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ export enum TextureFlagBit {
GENERAL_LAYOUT = 0x2, // For inout framebuffer attachments
EXTERNAL_OES = 0x4, // External oes texture
EXTERNAL_NORMAL = 0x8, // External normal texture
LAZILY_ALLOCATED = 0x10 // Try lazily allocated mode.
}

export enum FormatFeatureBit {
Expand All @@ -417,10 +418,13 @@ export enum FormatFeatureBit {
}

export enum SampleCount {
ONE, // Single sample
MULTIPLE_PERFORMANCE, // Multiple samples prioritizing performance over quality
MULTIPLE_BALANCE, // Multiple samples leveraging both quality and performance
MULTIPLE_QUALITY, // Multiple samples prioritizing quality over performance
X1 = 0x01,
X2 = 0x02,
X4 = 0x04,
X8 = 0x08,
X16 = 0x10,
X32 = 0x20,
X64 = 0x40
}

export enum VsyncMode {
Expand Down Expand Up @@ -1171,7 +1175,7 @@ export class TextureInfo {
public flags: TextureFlags = TextureFlagBit.NONE,
public layerCount: number = 1,
public levelCount: number = 1,
public samples: SampleCount = SampleCount.ONE,
public samples: SampleCount = SampleCount.X1,
public depth: number = 1,
public externalRes: number = 0,
) {}
Expand Down Expand Up @@ -1513,7 +1517,7 @@ export class ColorAttachment {

constructor (
public format: Format = Format.UNKNOWN,
public sampleCount: SampleCount = SampleCount.ONE,
public sampleCount: SampleCount = SampleCount.X1,
public loadOp: LoadOp = LoadOp.CLEAR,
public storeOp: StoreOp = StoreOp.STORE,
public barrier: GeneralBarrier = null!,
Expand All @@ -1534,7 +1538,7 @@ export class DepthStencilAttachment {

constructor (
public format: Format = Format.UNKNOWN,
public sampleCount: SampleCount = SampleCount.ONE,
public sampleCount: SampleCount = SampleCount.X1,
public depthLoadOp: LoadOp = LoadOp.CLEAR,
public depthStoreOp: StoreOp = StoreOp.STORE,
public stencilLoadOp: LoadOp = LoadOp.CLEAR,
Expand Down
15 changes: 13 additions & 2 deletions cocos/gfx/base/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
ShaderInfo, InputAssemblerInfo, RenderPassInfo, FramebufferInfo, DescriptorSetLayoutInfo, PipelineLayoutInfo,
QueueInfo, BufferTextureCopy, DeviceInfo, DeviceCaps, GeneralBarrierInfo, TextureBarrierInfo, BufferBarrierInfo,
SwapchainInfo, BindingMappingInfo, Format, FormatFeature, TextureType, TextureUsageBit,
TextureFlagBit, Offset, Extent, SampleCount, TextureSubresLayers,
TextureFlagBit, Offset, Extent, SampleCount, TextureSubresLayers, TextureUsage, TextureFlags,
} from './define';
import { Buffer } from './buffer';
import { CommandBuffer } from './command-buffer';
Expand Down Expand Up @@ -359,6 +359,17 @@ export abstract class Device {
* @param format The GFX format to be queried.
*/
public enableAutoBarrier (en: boolean): void {}

/**
* @en Get maximum supported sample count.
* @zh 获取最大可支持的 Samples 参数
* @param format The GFX texture format.
* @param usage The GFX texture usage.
* @param flags The GFX texture create flags.
*/
public getMaxSampleCount (format: Format, usage: TextureUsage, flags: TextureFlags): SampleCount {
return SampleCount.X1;
}
}

export class DefaultResource {
Expand Down Expand Up @@ -413,7 +424,7 @@ export class DefaultResource {
2, 2,
TextureFlagBit.NONE,
1, 1,
SampleCount.ONE,
SampleCount.X1,
2,
));
const copyRegion = new BufferTextureCopy(0, 0, 0, new Offset(0, 0, 0), new Extent(2, 2, 2), new TextureSubresLayers(0, 0, 1));
Expand Down
4 changes: 2 additions & 2 deletions cocos/gfx/webgl2/webgl2-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
case Format.ASTC_SRGBA_12X12: return WebGL2EXT.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;

default: {
console.error('Unsupported Format, convert to WebGL internal format failed.');

Check failure on line 307 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
return gl.RGBA;
}
}
Expand Down Expand Up @@ -423,7 +423,7 @@
case Format.ASTC_SRGBA_12X12: return WebGL2EXT.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;

default: {
console.error('Unsupported Format, convert to WebGL format failed.');

Check failure on line 426 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
return gl.RGBA;
}
}
Expand Down Expand Up @@ -458,7 +458,7 @@
case Type.SAMPLER3D: return gl.SAMPLER_3D;
case Type.SAMPLER_CUBE: return gl.SAMPLER_CUBE;
default: {
console.error('Unsupported GLType, convert to GL type failed.');

Check failure on line 461 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
return Type.UNKNOWN;
}
}
Expand Down Expand Up @@ -496,7 +496,7 @@
case gl.SAMPLER_3D: return Type.SAMPLER3D;
case gl.SAMPLER_CUBE: return Type.SAMPLER_CUBE;
default: {
console.error('Unsupported GLType, convert to Type failed.');

Check failure on line 499 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
return Type.UNKNOWN;
}
}
Expand Down Expand Up @@ -543,7 +543,7 @@
case gl.UNSIGNED_INT_SAMPLER_3D: return 4;
case gl.UNSIGNED_INT_SAMPLER_CUBE: return 4;
default: {
console.error('Unsupported GLType, get type failed.');

Check failure on line 546 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
return 0;
}
}
Expand Down Expand Up @@ -855,7 +855,7 @@
} else if (gpuBuffer.usage & BufferUsageBit.TRANSFER_SRC) {
gpuBuffer.glTarget = gl.NONE;
} else {
console.error('Unsupported BufferType, create buffer failed.');

Check failure on line 858 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
gpuBuffer.glTarget = gl.NONE;
}
}
Expand Down Expand Up @@ -962,7 +962,7 @@
|| (gpuBuffer.usage & BufferUsageBit.TRANSFER_SRC)) {
gpuBuffer.glTarget = gl.NONE;
} else {
console.error('Unsupported BufferType, create buffer failed.');

Check failure on line 965 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
gpuBuffer.glTarget = gl.NONE;
}
}
Expand Down Expand Up @@ -1037,7 +1037,7 @@
break;
}
default: {
console.error('Unsupported BufferType, update buffer failed.');

Check failure on line 1040 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
}
}
}
Expand All @@ -1064,7 +1064,7 @@
errorID(9100, maxSize, device.capabilities.maxTextureSize);
}

if (gpuTexture.samples === SampleCount.ONE) {
if (gpuTexture.samples === SampleCount.X1) {
gpuTexture.glTexture = gl.createTexture();
if (gpuTexture.size > 0) {
const glTexUnit = device.stateCache.glTexUnits[device.stateCache.texUnit];
Expand Down Expand Up @@ -1199,7 +1199,7 @@
break;
}
default: {
console.error('Unsupported TextureType, create texture failed.');

Check failure on line 1202 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
gpuTexture.type = TextureType.TEX2D;
gpuTexture.glTarget = gl.TEXTURE_2D;
}
Expand Down Expand Up @@ -1254,7 +1254,7 @@
errorID(9100, maxSize, device.capabilities.maxTextureSize);
}

if (gpuTexture.samples === SampleCount.ONE) {
if (gpuTexture.samples === SampleCount.X1) {
const glTexUnit = device.stateCache.glTexUnits[device.stateCache.texUnit];

if (glTexUnit.glTexture !== gpuTexture.glTexture) {
Expand Down Expand Up @@ -1387,7 +1387,7 @@
break;
}
default: {
console.error('Unsupported TextureType, create texture failed.');

Check failure on line 1390 in cocos/gfx/webgl2/webgl2-commands.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected console statement
gpuTexture.type = TextureType.TEX2D;
gpuTexture.glTarget = gl.TEXTURE_2D;
}
Expand Down
17 changes: 13 additions & 4 deletions cocos/render-scene/core/pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ import { TextureBase } from '../../asset/assets/texture-base';
import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr';
import { getPhaseID } from '../../rendering/pass-phase';
import { murmurhash2_32_gc, errorID, assertID, cclegacy, warnID } from '../../core';
import { BufferUsageBit, DynamicStateFlagBit, DynamicStateFlags, Feature, GetTypeSize, MemoryUsageBit, PrimitiveMode, Type, Color,
import {
BufferUsageBit, DynamicStateFlagBit, DynamicStateFlags, Feature, GetTypeSize, MemoryUsageBit, PrimitiveMode, Type, Color,
BlendState, BlendTarget, Buffer, BufferInfo, BufferViewInfo, DepthStencilState, DescriptorSet,
DescriptorSetInfo, DescriptorSetLayout, Device, RasterizerState, Sampler, Texture, Shader, PipelineLayout, deviceManager, UniformBlock,
} from '../../gfx';
import { EffectAsset } from '../../asset/assets/effect-asset';
import { IProgramInfo, programLib } from './program-lib';
import { MacroRecord, MaterialProperty, customizeType, getBindingFromHandle, getDefaultFromType, getStringFromType,
import {
MacroRecord, MaterialProperty, customizeType, getBindingFromHandle, getDefaultFromType, getStringFromType,
getOffsetFromHandle, getTypeFromHandle, type2reader, type2writer, getCountFromHandle, type2validator,
} from './pass-utils';
import { RenderPassStage, RenderPriority } from '../../rendering/define';
Expand Down Expand Up @@ -190,6 +192,7 @@ export class Pass {
protected _stage: RenderPassStage = RenderPassStage.DEFAULT;
protected _phase = getPhaseID('default');
protected _passID = 0xFFFFFFFF;
protected _subpassID = 0xFFFFFFFF;
protected _phaseID = 0xFFFFFFFF;
protected _primitive: PrimitiveMode = PrimitiveMode.TRIANGLE_LIST;
protected _batchingScheme: BatchingSchemes = BatchingSchemes.NONE;
Expand Down Expand Up @@ -576,11 +579,17 @@ export class Pass {
const r = cclegacy.rendering;
if (typeof info.phase === 'number') {
this._passID = (info as Pass)._passID;
this._subpassID = (info as Pass)._subpassID;
this._phaseID = (info as Pass)._phaseID;
} else {
this._passID = r.getPassID(info.pass);
if (this._passID !== r.INVALID_ID) {
this._phaseID = r.getPhaseID(this._passID, info.phase);
if (info.subpass) {
this._subpassID = r.getSubpassID(this._passID, info.subpass);
this._phaseID = r.getPhaseID(this._subpassID, info.phase);
} else {
this._phaseID = r.getPhaseID(this._passID, info.phase);
}
}
}
if (this._passID === r.INVALID_ID) {
Expand Down Expand Up @@ -778,7 +787,7 @@ export class Pass {

this._blocks = target._blocks;
this._blocksInt = target._blocksInt;
this._dynamics = target._dynamics;
this._dynamics = target._dynamics;

this._shader = target._shader;

Expand Down
94 changes: 85 additions & 9 deletions cocos/rendering/custom/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
****************************************************************************/

/**
* ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
Expand All @@ -32,9 +32,41 @@ import { getPhaseID, InstancedBuffer, PipelineStateManager } from '..';
import { assert, cclegacy, RecyclePool } from '../../core';
import intersect from '../../core/geometry/intersect';
import { Sphere } from '../../core/geometry/sphere';
import { AccessFlagBit, Attribute, Buffer, BufferInfo, BufferUsageBit, BufferViewInfo, Color, ColorAttachment, CommandBuffer, DepthStencilAttachment, DescriptorSet, DescriptorSetInfo, Device, deviceManager, Format, Framebuffer,
FramebufferInfo, GeneralBarrierInfo, InputAssemblerInfo, LoadOp, MemoryUsageBit, PipelineState, Rect, RenderPass, RenderPassInfo, Sampler, SamplerInfo, StoreOp, SurfaceTransform, Swapchain, Texture, TextureInfo,
TextureType, TextureUsageBit, Viewport } from '../../gfx';
import {
AccessFlagBit,
Attribute,
Buffer,
BufferInfo,
BufferUsageBit,
BufferViewInfo,
Color,
ColorAttachment,
CommandBuffer,
DepthStencilAttachment,
DescriptorSet,
DescriptorSetInfo,
Device,
deviceManager,
Format,
Framebuffer,
FramebufferInfo,
GeneralBarrierInfo,
InputAssemblerInfo,
LoadOp,
MemoryUsageBit,
PipelineState,
Rect,
RenderPass,
RenderPassInfo,
StoreOp,
SurfaceTransform,
Swapchain,
Texture,
TextureInfo,
TextureType,
TextureUsageBit,
Viewport,
} from '../../gfx';
import { legacyCC } from '../../core/global-exports';
import { Vec3 } from '../../core/math/vec3';
import { Vec4 } from '../../core/math/vec4';
Expand All @@ -47,10 +79,45 @@ import { PipelineSceneData } from '../pipeline-scene-data';
import { PipelineInputAssemblerData } from '../render-pipeline';
import { DescriptorSetData, LayoutGraphData, PipelineLayoutData, RenderPhaseData, RenderStageData } from './layout-graph';
import { BasicPipeline, SceneVisitor } from './pipeline';
import { Blit, ClearView, ComputePass, ComputeSubpass, CopyPass, Dispatch, FormatView, ManagedBuffer, ManagedResource, ManagedTexture, MovePass,
RasterPass, RasterSubpass, RaytracePass, RenderData, RenderGraph, RenderGraphVisitor, RenderQueue, RenderSwapchain, ResolvePass, ResourceDesc,
ResourceGraph, ResourceGraphVisitor, ResourceTraits, SceneData, SubresourceView, ComputeView, RasterView } from './render-graph';
import { AttachmentType, QueueHint, ResourceDimension, ResourceFlags, ResourceResidency, SceneFlags, UpdateFrequency } from './types';
import {
Blit,
ClearView,
ComputePass,
ComputeSubpass,
ComputeView,
CopyPass,
Dispatch,
FormatView,
ManagedBuffer,
ManagedResource,
ManagedTexture,
MovePass,
RasterPass,
RasterSubpass,
RasterView,
RaytracePass,
RenderData,
RenderGraph,
RenderGraphVisitor,
RenderQueue,
RenderSwapchain,
ResolvePass,
ResourceDesc,
ResourceGraph,
ResourceGraphVisitor,
ResourceTraits,
SceneData,
SubresourceView,
} from './render-graph';
import {
AttachmentType,
QueueHint,
ResourceDimension,
ResourceFlags,
ResourceResidency,
SceneFlags,
UpdateFrequency,
} from './types';
import { PipelineUBO } from '../pipeline-ubo';
import { RenderInfo, RenderObject, WebSceneTask, WebSceneTransversal } from './web-scene';
import { WebSceneVisitor } from './web-scene-visitor';
Expand All @@ -59,7 +126,14 @@ import { RenderShadowMapBatchedQueue } from '../render-shadow-map-batched-queue'
import { PlanarShadowQueue } from '../planar-shadow-queue';
import { DefaultVisitor, depthFirstSearch, ReferenceGraphView } from './graph';
import { VectorGraphColorMap } from './effect';
import { getDescBindingFromName, getDescriptorSetDataFromLayout, getDescriptorSetDataFromLayoutId, getRenderArea, mergeSrcToTargetDesc, updateGlobalDescBinding } from './define';
import {
getDescBindingFromName,
getDescriptorSetDataFromLayout,
getDescriptorSetDataFromLayoutId,
getRenderArea,
mergeSrcToTargetDesc,
updateGlobalDescBinding,
} from './define';
import { RenderReflectionProbeQueue } from '../render-reflection-probe-queue';
import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr';
import { Texture2D } from '../../asset/assets/texture-2d';
Expand Down Expand Up @@ -177,6 +251,8 @@ class DeviceTexture extends DeviceResource {
if (info.flags & ResourceFlags.INPUT_ATTACHMENT) usageFlags |= TextureUsageBit.INPUT_ATTACHMENT;
if (info.flags & ResourceFlags.SAMPLED) usageFlags |= TextureUsageBit.SAMPLED;
if (info.flags & ResourceFlags.STORAGE) usageFlags |= TextureUsageBit.STORAGE;
if (info.flags & ResourceFlags.TRANSFER_SRC) usageFlags |= TextureUsageBit.TRANSFER_SRC;
if (info.flags & ResourceFlags.TRANSFER_DST) usageFlags |= TextureUsageBit.TRANSFER_DST;

this._texture = context.device.createTexture(new TextureInfo(
type,
Expand Down
6 changes: 5 additions & 1 deletion cocos/rendering/custom/index.jsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ export function getPassID (name: string | undefined): number {
return _renderModule.getPassID(name);
}

export function getSubpassID (passID: number, name: string): number {
return _renderModule.getSubpassID(passID, name);
}

export function getPhaseID (passID: number, name: string | number | undefined): number {
if (name === undefined) {
return _renderModule.getPhaseID(passID, 'default');
}
if (typeof(name) === 'number') {
if (typeof (name) === 'number') {
return _renderModule.getPhaseID(passID, name.toString());
}
return _renderModule.getPhaseID(passID, name);
Expand Down
6 changes: 5 additions & 1 deletion cocos/rendering/custom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { LayoutGraphData, loadLayoutGraphData } from './layout-graph';
import { BinaryInputArchive } from './binary-archive';
import { WebProgramLibrary } from './web-program-library';
import { Device } from '../../gfx';
import { initializeLayoutGraphData, terminateLayoutGraphData, getCustomPassID, getCustomPhaseID } from './layout-graph-utils';
import { initializeLayoutGraphData, terminateLayoutGraphData, getCustomPassID, getCustomPhaseID, getCustomSubpassID } from './layout-graph-utils';
import { ProgramLibrary } from './private';
import { PostProcessBuilder } from '../post-process/post-process-builder';

Expand Down Expand Up @@ -101,6 +101,10 @@ export function getPassID (name: string | undefined): number {
return getCustomPassID(defaultLayoutGraph, name);
}

export function getSubpassID (passID: number, name: string): number {
return getCustomSubpassID(defaultLayoutGraph, passID, name);
}

export function getPhaseID (passID: number, name: string | number | undefined): number {
return getCustomPhaseID(defaultLayoutGraph, passID, name);
}
Expand Down
20 changes: 17 additions & 3 deletions cocos/rendering/custom/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@
/* eslint-disable max-len */
import { Material } from '../../asset/assets';
import { Camera } from '../../render-scene/scene/camera';
import { DirectionalLight } from '../../render-scene/scene/directional-light';
import { GeometryRenderer } from '../geometry-renderer';
import { Buffer, BufferInfo, ClearFlagBit, Color, CommandBuffer, DescriptorSet, DescriptorSetLayout, Device, DrawInfo, Format, InputAssembler, LoadOp, PipelineState, Rect, ResolveMode, Sampler, ShaderStageFlagBit, StoreOp, Swapchain, Texture, TextureInfo, Viewport } from '../../gfx';
import { Buffer, BufferInfo, ClearFlagBit, Color, CommandBuffer, DescriptorSet, DescriptorSetLayout, Device, DrawInfo, Format, InputAssembler, LoadOp, PipelineState, Rect, ResolveMode, SampleCount, Sampler, ShaderStageFlagBit, StoreOp, Swapchain, Texture, TextureInfo, Viewport } from '../../gfx';
import { GlobalDSManager } from '../global-descriptor-set-manager';
import { Mat4, Quat, Vec2, Vec4 } from '../../core/math';
import { MacroRecord } from '../../render-scene/core/pass-utils';
import { PipelineSceneData } from '../pipeline-scene-data';
import { AccessType, CopyPair, LightInfo, MovePair, QueueHint, ResolvePair, ResourceResidency, SceneFlags, TaskType, UpdateFrequency, UploadPair } from './types';
import { AccessType, CopyPair, LightInfo, MovePair, QueueHint, ResolvePair, ResourceDimension, ResourceFlags, ResourceResidency, SceneFlags, TaskType, UpdateFrequency, UploadPair } from './types';
import { RenderWindow } from '../../render-scene/core/render-window';
import { Model } from '../../render-scene/scene';
import { SpotLight } from '../../render-scene/scene/spot-light';

/**
* @engineInternal
Expand Down Expand Up @@ -249,6 +251,11 @@
* @zh 支持读取当前像素任意颜色值
*/
INPUT_COLOR_MRT = 1 << 2,
/**
* @en Each subpass has its own sample count.
* @zh 每个Subpass拥有不同的采样数
*/
HETEROGENEOUS_SAMPLE_COUNT = 1 << 3,
}

/**
Expand Down Expand Up @@ -368,6 +375,10 @@
* @param name @en descriptor name in shader. @zh 填写着色器中的描述符(descriptor)名字
*/
setSampler (name: string, sampler: Sampler): void;
setBuiltinCameraConstants (camera: Camera): void;
setBuiltinShadowMapConstants (light: DirectionalLight): void;
setBuiltinDirectionalLightViewConstants (light: DirectionalLight, level?: number): void;
setBuiltinSpotLightViewConstants (light: SpotLight): void;
}

/**
Expand Down Expand Up @@ -690,7 +701,10 @@
height: number,
count: number,
quality: number,
passName?: string): BasicRenderPassBuilder;
passName?: string): BasicMultisampleRenderPassBuilder;

Check failure on line 704 in cocos/rendering/custom/pipeline.ts

View workflow job for this annotation

GitHub Actions / npm_test

Cannot find name 'BasicMultisampleRenderPassBuilder'.
/**
* @deprecated Method will be removed in 3.9.0
*/
/**
* @deprecated Method will be removed in 3.9.0
*/
Expand Down
Loading
Loading