浏览代码

Renamed TexturePadding _Source to _InOutTexture

/main
Frédéric Vauchelles 7 年前
当前提交
db6e0385
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 4
      ScriptableRenderPipeline/Core/CoreRP/CoreResources/TexturePadding.compute
  2. 10
      ScriptableRenderPipeline/Core/CoreRP/CoreResources/TexturePadding.cs

4
ScriptableRenderPipeline/Core/CoreRP/CoreResources/TexturePadding.compute


// Texture buffers
// ------------------------------------------------
RW_TEXTURE2D(float4, _Source);
RW_TEXTURE2D(float4, _InOutTexture);
// ------------------------------------------------
// Constant buffers

const int2 loadId = targetId - int2(1 + dispatchThreadId.x, 0);
#endif
_Source[targetId] = _Source[loadId];
_InOutTexture[targetId] = _InOutTexture[loadId];
}

10
ScriptableRenderPipeline/Core/CoreRP/CoreResources/TexturePadding.cs


public class TexturePadding
{
static readonly int _RectOffset = Shader.PropertyToID("_RectOffset");
static readonly int _Source = Shader.PropertyToID("_Source");
static readonly int _InOutTexture = Shader.PropertyToID("_InOutTexture");
ComputeShader m_CS;
int m_KMainTopRight;

m_KMainTop = m_CS.FindKernel("KMainTop");
m_KMainRight = m_CS.FindKernel("KMainRight");
}
public void Pad(CommandBuffer cmd, RenderTexture source, RectInt from, RectInt to)
public void Pad(CommandBuffer cmd, RenderTexture inOutTexture, RectInt from, RectInt to)
cmd.SetComputeTextureParam(m_CS, m_KMainRight, _Source, source);
cmd.SetComputeTextureParam(m_CS, m_KMainRight, _InOutTexture, inOutTexture);
cmd.SetComputeTextureParam(m_CS, m_KMainTop, _Source, source);
cmd.SetComputeTextureParam(m_CS, m_KMainTop, _InOutTexture, inOutTexture);
cmd.SetComputeTextureParam(m_CS, m_KMainTopRight, _Source, source);
cmd.SetComputeTextureParam(m_CS, m_KMainTopRight, _InOutTexture, inOutTexture);
cmd.DispatchCompute(m_CS, m_KMainTopRight, to.width - from.width, to.height - from.height, 1);
}
}
正在加载...
取消
保存