Skip to content

Commit

Permalink
fixing URP UniversalResourceData resource setters that should not be …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
UnityAljosha authored and Evergreen committed Apr 25, 2024
1 parent f716ea0 commit fd23c47
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public bool isActiveTargetBackBuffer
public TextureHandle backBufferColor
{
get => CheckAndGetTextureHandle(ref _backBufferColor);
set => CheckAndSetTextureHandle(ref _backBufferColor, value);
internal set => CheckAndSetTextureHandle(ref _backBufferColor, value);
}
private TextureHandle _backBufferColor;

Expand All @@ -100,7 +100,7 @@ public TextureHandle backBufferColor
public TextureHandle backBufferDepth
{
get => CheckAndGetTextureHandle(ref _backBufferDepth);
set => CheckAndSetTextureHandle(ref _backBufferDepth, value);
internal set => CheckAndSetTextureHandle(ref _backBufferDepth, value);
}
private TextureHandle _backBufferDepth;

Expand Down Expand Up @@ -170,7 +170,7 @@ public TextureHandle[] gBuffer
public TextureHandle cameraOpaqueTexture
{
get => CheckAndGetTextureHandle(ref _cameraOpaqueTexture);
set => CheckAndSetTextureHandle(ref _cameraOpaqueTexture, value);
internal set => CheckAndSetTextureHandle(ref _cameraOpaqueTexture, value);
}
private TextureHandle _cameraOpaqueTexture;

Expand All @@ -180,7 +180,7 @@ public TextureHandle cameraOpaqueTexture
public TextureHandle cameraDepthTexture
{
get => CheckAndGetTextureHandle(ref _cameraDepthTexture);
set => CheckAndSetTextureHandle(ref _cameraDepthTexture, value);
internal set => CheckAndSetTextureHandle(ref _cameraDepthTexture, value);
}
private TextureHandle _cameraDepthTexture;

Expand All @@ -190,7 +190,7 @@ public TextureHandle cameraDepthTexture
public TextureHandle cameraNormalsTexture
{
get => CheckAndGetTextureHandle(ref _cameraNormalsTexture);
set => CheckAndSetTextureHandle(ref _cameraNormalsTexture, value);
internal set => CheckAndSetTextureHandle(ref _cameraNormalsTexture, value);
}
private TextureHandle _cameraNormalsTexture;

Expand Down Expand Up @@ -257,7 +257,7 @@ internal TextureHandle debugScreenDepth
public TextureHandle afterPostProcessColor
{
get => CheckAndGetTextureHandle(ref _afterPostProcessColor);
set => CheckAndSetTextureHandle(ref _afterPostProcessColor, value);
internal set => CheckAndSetTextureHandle(ref _afterPostProcessColor, value);
}
private TextureHandle _afterPostProcessColor;

Expand All @@ -267,7 +267,7 @@ public TextureHandle afterPostProcessColor
public TextureHandle overlayUITexture
{
get => CheckAndGetTextureHandle(ref _overlayUITexture);
set => CheckAndSetTextureHandle(ref _overlayUITexture, value);
internal set => CheckAndSetTextureHandle(ref _overlayUITexture, value);
}
private TextureHandle _overlayUITexture;

Expand All @@ -279,7 +279,7 @@ public TextureHandle overlayUITexture
public TextureHandle renderingLayersTexture
{
get => CheckAndGetTextureHandle(ref _renderingLayersTexture);
set => CheckAndSetTextureHandle(ref _renderingLayersTexture, value);
internal set => CheckAndSetTextureHandle(ref _renderingLayersTexture, value);
}
private TextureHandle _renderingLayersTexture;

Expand Down Expand Up @@ -311,7 +311,7 @@ public TextureHandle dBufferDepth
public TextureHandle ssaoTexture
{
get => CheckAndGetTextureHandle(ref _ssaoTexture);
set => CheckAndSetTextureHandle(ref _ssaoTexture, value);
internal set => CheckAndSetTextureHandle(ref _ssaoTexture, value);
}
private TextureHandle _ssaoTexture;

Expand Down

0 comments on commit fd23c47

Please sign in to comment.