浏览代码

test RTHanbdle naming

/main
sebastienlagarde 7 年前
当前提交
d416e6e3
共有 1 个文件被更改,包括 24 次插入9 次删除
  1. 33
      ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs

33
ScriptableRenderPipeline/Core/CoreRP/RTHandle.cs


}
}
static string GetAutomaticName(int width, int height, RenderTextureFormat format)
{
return "RenderTarget_" + width + "x" + height + "_" + format.ToString();
}
// This method wraps around regular RenderTexture creation.
// There is no specific logic applied to RenderTextures created this way.
public static RTHandle Alloc(

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool enableMSAA = msaaSamples != MSAASamples.None;

bindTextureMS = bindTextureMS,
useDynamicScale = useDynamicScale,
vrUsage = vrUsage,
memorylessMode = memoryless
memorylessMode = memoryless,
name = name == "" ? GetAutomaticName(width, height, colorFormat) : name
};
rt.Create();

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool allocForMSAA = s_ScaledRTSupportsMSAA ? enableMSAA : false;

bindTextureMS,
useDynamicScale,
vrUsage,
memoryless
memoryless,
name
);
rth.scaleFactor = scaleFactor;

bool bindTextureMS = false,
bool useDynamicScale = false,
VRTextureUsage vrUsage = VRTextureUsage.None,
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None
RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
string name = ""
)
{
bool allocForMSAA = s_ScaledRTSupportsMSAA ? enableMSAA : false;

bindTextureMS,
useDynamicScale,
vrUsage,
memoryless
memoryless,
name
);
rth.scaleFunc = scaleFunc;

// Internal function
static RTHandle AllocAutoSizedRenderTexture(
int width,
int height,

bool bindTextureMS,
bool useDynamicScale,
VRTextureUsage vrUsage,
RenderTextureMemoryless memoryless
RenderTextureMemoryless memoryless,
string name
)
{
// Here user made a mistake in setting up msaa/bindMS, hence the warning

bindTextureMS = bindTextureMS,
useDynamicScale = useDynamicScale,
vrUsage = vrUsage,
memorylessMode = memoryless
memorylessMode = memoryless,
name = name == "" ? GetAutomaticName(width, height, colorFormat) : name
};
rt.Create();

bindTextureMS = false, // Somehow, this can be true even if antiAliasing == 1. Leads to Unity-internal binding errors.
useDynamicScale = refRT.useDynamicScale,
vrUsage = refRT.vrUsage,
memorylessMode = refRT.memorylessMode
memorylessMode = refRT.memorylessMode,
name = refRT.name
};
newRT.Create();

正在加载...
取消
保存