@@ -175,26 +175,24 @@ void BuildGraph()
175
175
ctxPass . firstFragment = ctx . fragmentData . Length ;
176
176
177
177
// Depth attachment is always at index 0
178
- if ( inputPass . depthBuffer . handle . IsValid ( ) )
178
+ if ( inputPass . depthAccess . textureHandle . handle . IsValid ( ) )
179
179
{
180
180
ctxPass . fragmentInfoHasDepth = true ;
181
181
182
- var resource = inputPass . depthBuffer . handle ;
183
- if ( ctx . AddToFragmentList ( resource , inputPass . depthBufferAccessFlags , ctxPass . firstFragment , ctxPass . numFragments ) )
182
+ if ( ctx . AddToFragmentList ( inputPass . depthAccess , ctxPass . firstFragment , ctxPass . numFragments ) )
184
183
{
185
- ctxPass . AddFragment ( resource , ctx ) ;
184
+ ctxPass . AddFragment ( inputPass . depthAccess . textureHandle . handle , ctx ) ;
186
185
}
187
186
}
188
187
189
188
for ( var ci = 0 ; ci < inputPass . colorBufferMaxIndex + 1 ; ++ ci )
190
189
{
191
190
// Skip unused color slots
192
- if ( ! inputPass . colorBuffers [ ci ] . handle . IsValid ( ) ) continue ;
191
+ if ( ! inputPass . colorBufferAccess [ ci ] . textureHandle . handle . IsValid ( ) ) continue ;
193
192
194
- var resource = inputPass . colorBuffers [ ci ] . handle ;
195
- if ( ctx . AddToFragmentList ( resource , inputPass . colorBufferAccessFlags [ ci ] , ctxPass . firstFragment , ctxPass . numFragments ) )
193
+ if ( ctx . AddToFragmentList ( inputPass . colorBufferAccess [ ci ] , ctxPass . firstFragment , ctxPass . numFragments ) )
196
194
{
197
- ctxPass . AddFragment ( resource , ctx ) ;
195
+ ctxPass . AddFragment ( inputPass . colorBufferAccess [ ci ] . textureHandle . handle , ctx ) ;
198
196
}
199
197
}
200
198
@@ -203,14 +201,13 @@ void BuildGraph()
203
201
204
202
for ( var ci = 0 ; ci < inputPass . fragmentInputMaxIndex + 1 ; ++ ci )
205
203
{
206
- ref var currInpFragment = ref inputPass . fragmentInputs [ ci ] . handle ;
207
204
// Skip unused fragment input slots
208
- if ( ! currInpFragment . IsValid ( ) ) continue ;
205
+ if ( ! inputPass . fragmentInputAccess [ ci ] . textureHandle . IsValid ( ) ) continue ;
209
206
210
- var resource = inputPass . fragmentInputs [ ci ] . handle ;
211
- if ( ctx . AddToFragmentList ( resource , inputPass . fragmentInputAccessFlags [ ci ] , ctxPass . firstFragmentInput , ctxPass . numFragmentInputs ) )
207
+ var resource = inputPass . fragmentInputAccess [ ci ] . textureHandle ;
208
+ if ( ctx . AddToFragmentList ( inputPass . fragmentInputAccess [ ci ] , ctxPass . firstFragmentInput , ctxPass . numFragmentInputs ) )
212
209
{
213
- ctxPass . AddFragmentInput ( resource , ctx ) ;
210
+ ctxPass . AddFragmentInput ( inputPass . fragmentInputAccess [ ci ] . textureHandle . handle , ctx ) ;
214
211
}
215
212
}
216
213
@@ -885,6 +882,8 @@ void PrepareNativeRenderPass(ref NativePassData nativePass)
885
882
ref var currStoreAudit = ref nativePass . storeAudit [ idx ] ;
886
883
#endif
887
884
currAttachment . handle = fragment . resource ;
885
+ currAttachment . mipLevel = fragment . mipLevel ;
886
+ currAttachment . depthSlice = fragment . depthSlice ;
888
887
889
888
// Don't care by default
890
889
currAttachment . loadAction = UnityEngine . Rendering . RenderBufferLoadAction . DontCare ;
@@ -1212,7 +1211,7 @@ internal unsafe void ExecuteBeginRenderPass(InternalRenderGraphContext rgContext
1212
1211
//but that is why we mark this as a hack and future work to fix.
1213
1212
//The proper (and planned) solution would be to move away from the render texture duality.
1214
1213
RenderTargetIdentifier rtidAllSlices = rtHandle ;
1215
- currBeginAttachment . loadStoreTarget = new RenderTargetIdentifier ( rtidAllSlices , 0 , CubemapFace . Unknown , - 1 ) ;
1214
+ currBeginAttachment . loadStoreTarget = new RenderTargetIdentifier ( rtidAllSlices , attachments [ i ] . mipLevel , CubemapFace . Unknown , attachments [ i ] . depthSlice ) ;
1216
1215
1217
1216
if ( attachments [ i ] . storeAction == RenderBufferStoreAction . Resolve ||
1218
1217
attachments [ i ] . storeAction == RenderBufferStoreAction . StoreAndResolve )
@@ -1231,7 +1230,7 @@ internal unsafe void ExecuteBeginRenderPass(InternalRenderGraphContext rgContext
1231
1230
currBeginAttachment . clearColor = Color . red ;
1232
1231
currBeginAttachment . clearDepth = 1.0f ;
1233
1232
currBeginAttachment . clearStencil = 0 ;
1234
- var desc = resources . GetTextureResourceDesc ( currAttachmentHandle ) ;
1233
+ var desc = resources . GetTextureResourceDesc ( currAttachmentHandle , true ) ;
1235
1234
if ( i == 0 && nativePass . hasDepth )
1236
1235
{
1237
1236
// TODO: There seems to be no clear depth specified ?!?!
0 commit comments