比较提交
合并到: unity-tech-cn:main
unity-tech-cn:/main
unity-tech-cn:/scriptablerenderloop-materialgraph
unity-tech-cn:/batch_rendering
unity-tech-cn:/vr_sandbox
unity-tech-cn:/Branch_Batching2
unity-tech-cn:/mikko-renderpass
unity-tech-cn:/fptl_cleanup
unity-tech-cn:/vr_fptl_sandbox
unity-tech-cn:/Branch_batcher
unity-tech-cn:/MobileDeferredRenderPass
unity-tech-cn:/vr_api_testbed
unity-tech-cn:/RenderPassXR_Sandbox
unity-tech-cn:/classicDeferredMobile
unity-tech-cn:/EnableVulkanAndES3
unity-tech-cn:/OnTileRenderPass2
unity-tech-cn:/sample_game
unity-tech-cn:/culling
unity-tech-cn:/OTDRP-develop
unity-tech-cn:/Add-support-for-light-specular-color-tint
unity-tech-cn:/stochastic_alpha_test
unity-tech-cn:/Yibing-Project-2
unity-tech-cn:/xr-hdrp-rt-test
unity-tech-cn:/system-shock-transitional-shader
unity-tech-cn:/feature-runtimeTextureCache
unity-tech-cn:/shader-library-include-paths
unity-tech-cn:/asmdef
unity-tech-cn:/namespace
unity-tech-cn:/feature-ReflectionProbeFit
unity-tech-cn:/prototype-decals
unity-tech-cn:/DrawSettings
unity-tech-cn:/projects-TheLastStand
unity-tech-cn:/iridesence
unity-tech-cn:/lw-nolightlist
unity-tech-cn:/Add-physical-light-unity-support
unity-tech-cn:/LightweightPipelineExperimental
unity-tech-cn:/switch_support
unity-tech-cn:/feature-ScreenSpaceProjection
unity-tech-cn:/use-roughness
unity-tech-cn:/LW-BakedIndirect
unity-tech-cn:/Branch_FixObjectMotion
unity-tech-cn:/srp_batcher
unity-tech-cn:/LW-LightOptimizations
unity-tech-cn:/Branch_ScriptableCulling
unity-tech-cn:/LW-LowEnd
unity-tech-cn:/feature-ReflectionProbeBaking
unity-tech-cn:/Improve-shader-generator
unity-tech-cn:/improve-shader-generator-data
unity-tech-cn:/2018.1
unity-tech-cn:/lwr-xr-shader-fixes-sandbox
unity-tech-cn:/uifoldout-fix
unity-tech-cn:/lw-callbacktests
unity-tech-cn:/lwrp-xr-sssm-DrawProc
unity-tech-cn:/lwrp-xr-tim-hacks
unity-tech-cn:/ss3HDRP
unity-tech-cn:/build-automation
unity-tech-cn:/HDRP_SurfaceShader
unity-tech-cn:/tag-1.1.0-beta
unity-tech-cn:/xr-hdrp-pyramids
unity-tech-cn:/lw-bias_per_cascade
unity-tech-cn:/040SimpleLighting
unity-tech-cn:/lw-tangentspacelightingtest
unity-tech-cn:/Lux-for-HDRI
unity-tech-cn:/HDRP_GraphicTests
unity-tech-cn:/projects-system-shock-2018.1
unity-tech-cn:/Change-cluster-Tile-to-dynamic-branch
unity-tech-cn:/Reduce-shader-variant
unity-tech-cn:/lw-shadow-optimization
unity-tech-cn:/LW-DistortionPass
unity-tech-cn:/lw-shader-optimization
unity-tech-cn:/Branch_RemoveCascadeBordersInUI
unity-tech-cn:/Branch_EnableLastSplitFade
unity-tech-cn:/Branch_DebugExposure
unity-tech-cn:/Documentation
unity-tech-cn:/lw-bugfixes
unity-tech-cn:/Branch_DebugExposure2
unity-tech-cn:/Branch_DebugWindowFix
unity-tech-cn:/lw-shadow-keyword
unity-tech-cn:/backport-shader-optimization
unity-tech-cn:/tag-1.1.4-preview
unity-tech-cn:/StackLitWork
unity-tech-cn:/tag-1.1.5-preview
unity-tech-cn:/tag-1.1.6-preview
unity-tech-cn:/stacklit
unity-tech-cn:/StackLit2
unity-tech-cn:/hdrp-staging
拉取从: unity-tech-cn:feature-runtimeTextureCache
unity-tech-cn:/main
unity-tech-cn:/scriptablerenderloop-materialgraph
unity-tech-cn:/batch_rendering
unity-tech-cn:/vr_sandbox
unity-tech-cn:/Branch_Batching2
unity-tech-cn:/mikko-renderpass
unity-tech-cn:/fptl_cleanup
unity-tech-cn:/vr_fptl_sandbox
unity-tech-cn:/Branch_batcher
unity-tech-cn:/MobileDeferredRenderPass
unity-tech-cn:/vr_api_testbed
unity-tech-cn:/RenderPassXR_Sandbox
unity-tech-cn:/classicDeferredMobile
unity-tech-cn:/EnableVulkanAndES3
unity-tech-cn:/OnTileRenderPass2
unity-tech-cn:/sample_game
unity-tech-cn:/culling
unity-tech-cn:/OTDRP-develop
unity-tech-cn:/Add-support-for-light-specular-color-tint
unity-tech-cn:/stochastic_alpha_test
unity-tech-cn:/Yibing-Project-2
unity-tech-cn:/xr-hdrp-rt-test
unity-tech-cn:/system-shock-transitional-shader
unity-tech-cn:/feature-runtimeTextureCache
unity-tech-cn:/shader-library-include-paths
unity-tech-cn:/asmdef
unity-tech-cn:/namespace
unity-tech-cn:/feature-ReflectionProbeFit
unity-tech-cn:/prototype-decals
unity-tech-cn:/DrawSettings
unity-tech-cn:/projects-TheLastStand
unity-tech-cn:/iridesence
unity-tech-cn:/lw-nolightlist
unity-tech-cn:/Add-physical-light-unity-support
unity-tech-cn:/LightweightPipelineExperimental
unity-tech-cn:/switch_support
unity-tech-cn:/feature-ScreenSpaceProjection
unity-tech-cn:/use-roughness
unity-tech-cn:/LW-BakedIndirect
unity-tech-cn:/Branch_FixObjectMotion
unity-tech-cn:/srp_batcher
unity-tech-cn:/LW-LightOptimizations
unity-tech-cn:/Branch_ScriptableCulling
unity-tech-cn:/LW-LowEnd
unity-tech-cn:/feature-ReflectionProbeBaking
unity-tech-cn:/Improve-shader-generator
unity-tech-cn:/improve-shader-generator-data
unity-tech-cn:/2018.1
unity-tech-cn:/lwr-xr-shader-fixes-sandbox
unity-tech-cn:/uifoldout-fix
unity-tech-cn:/lw-callbacktests
unity-tech-cn:/lwrp-xr-sssm-DrawProc
unity-tech-cn:/lwrp-xr-tim-hacks
unity-tech-cn:/ss3HDRP
unity-tech-cn:/build-automation
unity-tech-cn:/HDRP_SurfaceShader
unity-tech-cn:/tag-1.1.0-beta
unity-tech-cn:/xr-hdrp-pyramids
unity-tech-cn:/lw-bias_per_cascade
unity-tech-cn:/040SimpleLighting
unity-tech-cn:/lw-tangentspacelightingtest
unity-tech-cn:/Lux-for-HDRI
unity-tech-cn:/HDRP_GraphicTests
unity-tech-cn:/projects-system-shock-2018.1
unity-tech-cn:/Change-cluster-Tile-to-dynamic-branch
unity-tech-cn:/Reduce-shader-variant
unity-tech-cn:/lw-shadow-optimization
unity-tech-cn:/LW-DistortionPass
unity-tech-cn:/lw-shader-optimization
unity-tech-cn:/Branch_RemoveCascadeBordersInUI
unity-tech-cn:/Branch_EnableLastSplitFade
unity-tech-cn:/Branch_DebugExposure
unity-tech-cn:/Documentation
unity-tech-cn:/lw-bugfixes
unity-tech-cn:/Branch_DebugExposure2
unity-tech-cn:/Branch_DebugWindowFix
unity-tech-cn:/lw-shadow-keyword
unity-tech-cn:/backport-shader-optimization
unity-tech-cn:/tag-1.1.4-preview
unity-tech-cn:/StackLitWork
unity-tech-cn:/tag-1.1.5-preview
unity-tech-cn:/tag-1.1.6-preview
unity-tech-cn:/stacklit
unity-tech-cn:/StackLit2
unity-tech-cn:/hdrp-staging
此合并请求有变更与目标分支冲突。
/ScriptableRenderPipeline/Core/TextureCache.cs
/Tests/CoreTests.meta
/Tests/CoreTests
1 次代码提交
作者 | SHA1 | 备注 | 提交日期 |
---|---|---|---|
Frédéric Vauchelles | eb462aff | Updated texture cache with texture update count property | 7 年前 |
共有 7 个文件被更改,包括 98 次插入 和 34 次删除
-
44ScriptableRenderPipeline/Core/TextureCache.cs
-
8Tests/CoreTests.meta
-
8Tests/CoreTests/Editor.meta
-
61Tests/CoreTests/Editor/TextureCacheTests.cs
-
11Tests/CoreTests/Editor/TextureCacheTests.cs.meta
|
|||
fileFormatVersion: 2 |
|||
guid: f7dbbd5a5c998eb45af5af9e5702fc0c |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: aedf4443dd1f470469570e170988015e |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using NUnit.Framework; |
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering; |
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
public class TextureCacheCounter : TextureCache |
|||
{ |
|||
public int transferToSliceCallCount { get; private set; } |
|||
public TextureCacheCounter() |
|||
{ |
|||
AllocTextureArray(8); |
|||
} |
|||
public override void TransferToSlice(int sliceIndex, Texture texture) |
|||
{ |
|||
++transferToSliceCallCount; |
|||
} |
|||
} |
|||
|
|||
[TestFixture] |
|||
public class TextureCacheTests |
|||
{ |
|||
Texture2D m_Tex; |
|||
const int k_TextureSize = 8; |
|||
static readonly Color[] s_Pixels = new Color[k_TextureSize * k_TextureSize]; |
|||
[OneTimeSetUp] |
|||
public void Setup() |
|||
{ |
|||
m_Tex = new Texture2D(k_TextureSize, k_TextureSize, TextureFormat.ARGB32, false, true); |
|||
|
|||
SetTextureColor(Color.blue);
} |
|||
|
|||
[Test] |
|||
public void TextureCacheAddSlice() |
|||
{ |
|||
var cache = new TextureCacheCounter(); |
|||
var slice = cache.FetchSlice(m_Tex); |
|||
|
|||
Assert.True(slice >= 0); |
|||
Assert.AreEqual(1, cache.transferToSliceCallCount); |
|||
|
|||
var slice2 = cache.FetchSlice(m_Tex); |
|||
|
|||
Assert.AreEqual(slice, slice2); |
|||
Assert.AreEqual(1, cache.transferToSliceCallCount); |
|||
|
|||
SetTextureColor(Color.red); |
|||
|
|||
var slice3 = cache.FetchSlice(m_Tex); |
|||
|
|||
Assert.AreEqual(slice, slice3); |
|||
Assert.AreEqual(2, cache.transferToSliceCallCount);
} |
|||
void SetTextureColor(Color col) |
|||
{ |
|||
for (var i = 0; i < s_Pixels.Length; ++i) |
|||
s_Pixels[i] = Color.blue; |
|||
m_Tex.SetPixels(s_Pixels); |
|||
m_Tex.Apply(); |
|||
} |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: ac8bd2a0373f2d24782ffb8d77e7512d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue