Skip to content

Commit fd23c47

Browse files
UnityAljoshaEvergreen
authored andcommitted
fixing URP UniversalResourceData resource setters that should not be public
Fixing URP frame resource setters that should not be public. This avoids many kinds of user errors and bugs due to unexpected behavior. It also minimizes the issue of frame resource handles and global texture reference becoming out-of-sync. This is a partial fix to https://jira.unity3d.com/browse/UUM-69948 This is new API that landed in 23.3 but that accidently made setters public that should not be, since it's incorrect user behavior to set these. This PR adds guardrails to guide users better. Since this is new API, and a very advanced use case, this should only impact a handful of users at most.
1 parent f716ea0 commit fd23c47

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Packages/com.unity.render-pipelines.universal/Runtime/FrameData/UniversalResourceData.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public bool isActiveTargetBackBuffer
8989
public TextureHandle backBufferColor
9090
{
9191
get => CheckAndGetTextureHandle(ref _backBufferColor);
92-
set => CheckAndSetTextureHandle(ref _backBufferColor, value);
92+
internal set => CheckAndSetTextureHandle(ref _backBufferColor, value);
9393
}
9494
private TextureHandle _backBufferColor;
9595

@@ -100,7 +100,7 @@ public TextureHandle backBufferColor
100100
public TextureHandle backBufferDepth
101101
{
102102
get => CheckAndGetTextureHandle(ref _backBufferDepth);
103-
set => CheckAndSetTextureHandle(ref _backBufferDepth, value);
103+
internal set => CheckAndSetTextureHandle(ref _backBufferDepth, value);
104104
}
105105
private TextureHandle _backBufferDepth;
106106

@@ -170,7 +170,7 @@ public TextureHandle[] gBuffer
170170
public TextureHandle cameraOpaqueTexture
171171
{
172172
get => CheckAndGetTextureHandle(ref _cameraOpaqueTexture);
173-
set => CheckAndSetTextureHandle(ref _cameraOpaqueTexture, value);
173+
internal set => CheckAndSetTextureHandle(ref _cameraOpaqueTexture, value);
174174
}
175175
private TextureHandle _cameraOpaqueTexture;
176176

@@ -180,7 +180,7 @@ public TextureHandle cameraOpaqueTexture
180180
public TextureHandle cameraDepthTexture
181181
{
182182
get => CheckAndGetTextureHandle(ref _cameraDepthTexture);
183-
set => CheckAndSetTextureHandle(ref _cameraDepthTexture, value);
183+
internal set => CheckAndSetTextureHandle(ref _cameraDepthTexture, value);
184184
}
185185
private TextureHandle _cameraDepthTexture;
186186

@@ -190,7 +190,7 @@ public TextureHandle cameraDepthTexture
190190
public TextureHandle cameraNormalsTexture
191191
{
192192
get => CheckAndGetTextureHandle(ref _cameraNormalsTexture);
193-
set => CheckAndSetTextureHandle(ref _cameraNormalsTexture, value);
193+
internal set => CheckAndSetTextureHandle(ref _cameraNormalsTexture, value);
194194
}
195195
private TextureHandle _cameraNormalsTexture;
196196

@@ -257,7 +257,7 @@ internal TextureHandle debugScreenDepth
257257
public TextureHandle afterPostProcessColor
258258
{
259259
get => CheckAndGetTextureHandle(ref _afterPostProcessColor);
260-
set => CheckAndSetTextureHandle(ref _afterPostProcessColor, value);
260+
internal set => CheckAndSetTextureHandle(ref _afterPostProcessColor, value);
261261
}
262262
private TextureHandle _afterPostProcessColor;
263263

@@ -267,7 +267,7 @@ public TextureHandle afterPostProcessColor
267267
public TextureHandle overlayUITexture
268268
{
269269
get => CheckAndGetTextureHandle(ref _overlayUITexture);
270-
set => CheckAndSetTextureHandle(ref _overlayUITexture, value);
270+
internal set => CheckAndSetTextureHandle(ref _overlayUITexture, value);
271271
}
272272
private TextureHandle _overlayUITexture;
273273

@@ -279,7 +279,7 @@ public TextureHandle overlayUITexture
279279
public TextureHandle renderingLayersTexture
280280
{
281281
get => CheckAndGetTextureHandle(ref _renderingLayersTexture);
282-
set => CheckAndSetTextureHandle(ref _renderingLayersTexture, value);
282+
internal set => CheckAndSetTextureHandle(ref _renderingLayersTexture, value);
283283
}
284284
private TextureHandle _renderingLayersTexture;
285285

@@ -311,7 +311,7 @@ public TextureHandle dBufferDepth
311311
public TextureHandle ssaoTexture
312312
{
313313
get => CheckAndGetTextureHandle(ref _ssaoTexture);
314-
set => CheckAndSetTextureHandle(ref _ssaoTexture, value);
314+
internal set => CheckAndSetTextureHandle(ref _ssaoTexture, value);
315315
}
316316
private TextureHandle _ssaoTexture;
317317

0 commit comments

Comments
 (0)