浏览代码

Sample from correct portion of g_depth_tex

g_depth_tex is a stereo texture, so we need to sample from the correct portion dependent on the eye index

With that, all reads are stereo-aware!
/main
Robert Srinivasiah 6 年前
当前提交
f80efab2
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/lightlistbuild-clustered.compute


// g_fClustBase, g_fNearPlane, g_fFarPlane, g_iLog2NumClusters
#include "ClusteredUtils.hlsl"
// XRTODO: Reading from these textures and buffers must be stereo-ized
// XRTODO - DONE: Reading from these textures and buffers must be stereo-ized
#ifdef MSAA_ENABLED
Texture2DMS<float> g_depth_tex : register( t0 );
#else

for(int idx=t; idx<(TILE_SIZE_CLUSTERED*TILE_SIZE_CLUSTERED); idx+=NR_THREADS)
{
// XRTODO: We need to stereo-ize access to g_depth_tex. This is the only time we use viTilLL
// XRTODO - DONE: We need to stereo-ize access to g_depth_tex. This is the only time we use viTilLL
// an extra uint2 for layer index.
// an extra uint for layer index.
// TODO: For stereo double-wide, I need a proper way to insert the second eye width offset. Right now, I can just
// use g_screenSize.x, but that's kinda cheating.
// Additionally, we're going to have a method to select between a doublewide texture or texture array. Doubling
// the kernels seems like a bad idea. We could branch our texture read to switch between different texture declarations.
uint stereoDWOffset = eyeIndex * g_screenSize.x;
uPixCrd.x += stereoDWOffset;
#ifdef MSAA_ENABLED
for(int i=0; i<g_iNumSamplesMSAA; i++)
{

正在加载...
取消
保存