<commit_before>//NOT_CREATE_META_DATA

#ifndef __SOC_LIGHT_CULLING_CS_COMPARE_PARALLEL_H__
#define __SOC_LIGHT_CULLING_CS_COMPARE_PARALLEL_H__

#include "LightCullingCommonCS.h"

#define THREAD_COUNT TILE_RES_HALF*TILE_RES_HALF

groupshared float	s_depthMaxDatas[TILE_RES_HALF * TILE_RES_HALF];
groupshared float	s_depthMinDatas[TILE_RES_HALF * TILE_RES_HALF];

#if defined(USE_EDGE_CHECK_COMPARE_DISTANCE)
groupshared bool	s_isDetectedEdge[LIGHT_CULLING_TILE_RES * LIGHT_CULLING_TILE_RES];
#endif

#if (MSAA_SAMPLES_COUNT > 1) && defined(USE_EDGE_CHECK_COMPARE_DISTANCE)
struct CornerMinMax
{
	float min_tl, max_tl;
	float min_tr, max_tr;
	float min_bl, max_bl;
	float min_br, max_br;
};
void CalcMinMax(uint2 halfGlobalIdx, uint2 halfLocalIdx, uint idxInTile, uint depthBufferSamplerIdx, out float outMin, out float outMax, inout CornerMinMax ioCornerMinMax)
#else
void CalcMinMax(uint2 halfGlobalIdx, uint2 halfLocalIdx, uint idxInTile, uint depthBufferSamplerIdx, out float outMin, out float outMax)
#endif
{
	uint2 idx = halfGlobalIdx * 2;
	
#if (MSAA_SAMPLES_COUNT > 1)
	float depth_tl = Depth.Load( uint2(idx.x,	idx.y),		depthBufferSamplerIdx ).x;
	float depth_tr = Depth.Load( uint2(idx.x+1,	idx.y),		depthBufferSamplerIdx ).x;
	float depth_bl = Depth.Load( uint2(idx.x,	idx.y+1),	depthBufferSamplerIdx ).x;
	float depth_br = Depth.Load( uint2(idx.x+1,	idx.y+1),	depthBufferSamplerIdx ).x;

#if defined(ENABLE_BLEND)
	float blendedDepth_tl = BlendedDepth.Load( uint2(idx.x,		idx.y),		depthBufferSamplerIdx ).x;
	float blendedDepth_tr = BlendedDepth.Load( uint2(idx.x+1, 	idx.y),		depthBufferSamplerIdx ).x;
	float blendedDepth_br = BlendedDepth.Load( uint2(idx.x+1, 	idx.y+1),	depthBufferSamplerIdx ).x;
	float blendedDepth_bl = BlendedDepth.Load( uint2(idx.x,		idx.y+1),	depthBufferSamplerIdx ).x;
#endif

#else
	float depth_tl = Depth.Load( uint3(idx.x,	idx.y,		0) ).x;
	float depth_tr = Depth.Load( uint3(idx.x+1,	idx.y,		0) ).x;
	float depth_bl = Depth.Load( uint3(idx.x,	idx.y+1,	0) ).x;
	float depth_br = Depth.Load( uint3(idx.x+1,	idx.y+1,	0) ).x;

#if defined(ENABLE_BLEND)
	float blendedDepth_tl = BlendedDepth.Load( uint3(idx.x,		idx.y,		0) ).x;
	float blendedDepth_tr = BlendedDepth.Load( uint3(idx.x+1	idx.y,		0) ).x;
	float blendedDepth_br = BlendedDepth.Load( uint3(idx.x+1, 	idx.y+1,	0) ).x;
	float blendedDepth_bl = BlendedDepth.Load( uint3(idx.x	,	idx.y+1,	0) ).x;
#endif

#endif

	float viewDepth_tl = InvertProjDepthToView(depth_tl);
	float viewDepth_tr = InvertProjDepthToView(depth_tr);
	float viewDepth_bl = InvertProjDepthToView(depth_bl);
	float viewDepth_br = InvertProjDepthToView(depth_br);

#if defined(ENABLE_BLEND)
	float viewBlendedDepth_tl = InvertProjDepthToView(blendedDepth_tl);
	float viewBlendedDepth_tr = InvertProjDepthToView(blendedDepth_tr);
	float viewBlendedDepth_br = InvertProjDepthToView(blendedDepth_br);
	float viewBlendedDepth_bl = InvertProjDepthToView(blendedDepth_bl);

	float minDepth_tl = (blendedDepth_tl != 0.0f) ? viewBlendedDepth_tl : FLOAT_MAX;
	float minDepth_tr = (blendedDepth_tr != 0.0f) ? viewBlendedDepth_tr : FLOAT_MAX;
	float minDepth_br = (blendedDepth_br != 0.0f) ? viewBlendedDepth_br : FLOAT_MAX;
	float minDepth_bl = (blendedDepth_bl != 0.0f) ? viewBlendedDepth_bl : FLOAT_MAX;
#else
	float minDepth_tl = (depth_tl != 0.0f) ? viewDepth_tl : FLOAT_MAX;
	float minDepth_tr = (depth_tr != 0.0f) ? viewDepth_tr : FLOAT_MAX;
	float minDepth_bl = (depth_bl != 0.0f) ? viewDepth_bl : FLOAT_MAX;
	float minDepth_br = (depth_br != 0.0f) ? viewDepth_br : FLOAT_MAX;
#endif

	float maxDepth_tl = (depth_tl != 0.0f) ? viewDepth_tl : 0.0f;
	float maxDepth_tr = (depth_tr != 0.0f) ? viewDepth_tr : 0.0f;<commit_msg>Update LightCullingCompareParallelCS.h<commit_after>//NOT_CREATE_META_DATA

#ifndef __SOC_LIGHT_CULLING_CS_COMPARE_PARALLEL_H__
#define __SOC_LIGHT_CULLING_CS_COMPARE_PARALLEL_H__

#include "LightCullingCommonCS.h"

#define THREAD_COUNT TILE_RES_HALF*TILE_RES_HALF

groupshared float	s_depthMaxDatas[TILE_RES_HALF * TILE_RES_HALF];
groupshared float	s_depthMinDatas[TILE_RES_HALF * TILE_RES_HALF];

#if defined(USE_EDGE_CHECK_COMPARE_DISTANCE)
groupshared bool	s_isDetectedEdge[LIGHT_CULLING_TILE_RES * LIGHT_CULLING_TILE_RES];
#endif

#if (MSAA_SAMPLES_COUNT > 1) && defined(USE_EDGE_CHECK_COMPARE_DISTANCE)
struct CornerMinMax
{
	float min_tl, max_tl;
	float min_tr, max_tr;
	float min_bl, max_bl;
	float min_br, max_br;
};
void CalcMinMax(uint2 halfGlobalIdx, uint2 halfLocalIdx, uint idxInTile, uint depthBufferSamplerIdx, out float outMin, out float outMax, inout CornerMinMax ioCornerMinMax)
#else
void CalcMinMax(uint2 halfGlobalIdx, uint2 halfLocalIdx, uint idxInTile, uint depthBufferSamplerIdx, out float outMin, out float outMax)
#endif
{
	uint2 idx = halfGlobalIdx * 2;
	
#if (MSAA_SAMPLES_COUNT > 1)
	float depth_tl = DepthBuffer.Load( uint2(idx.x,		idx.y),		depthBufferSamplerIdx ).x;
	float depth_tr = DepthBuffer.Load( uint2(idx.x+1,	idx.y),		depthBufferSamplerIdx ).x;
	float depth_bl = DepthBuffer.Load( uint2(idx.x,		idx.y+1),	depthBufferSamplerIdx ).x;
	float depth_br = DepthBuffer.Load( uint2(idx.x+1,	idx.y+1),	depthBufferSamplerIdx ).x;

#if defined(ENABLE_BLEND)
	float blendedDepth_tl = BlendedDepthBuffer.Load( uint2(idx.x,		idx.y),		depthBufferSamplerIdx ).x;
	float blendedDepth_tr = BlendedDepthBuffer.Load( uint2(idx.x+1, 	idx.y),		depthBufferSamplerIdx ).x;
	float blendedDepth_br = BlendedDepthBuffer.Load( uint2(idx.x+1, 	idx.y+1),	depthBufferSamplerIdx ).x;
	float blendedDepth_bl = BlendedDepthBuffer.Load( uint2(idx.x,		idx.y+1),	depthBufferSamplerIdx ).x;
#endif

#else
	float depth_tl = DepthBuffer.Load( uint3(idx.x,		idx.y,		0) ).x;
	float depth_tr = DepthBuffer.Load( uint3(idx.x+1,	idx.y,		0) ).x;
	float depth_bl = DepthBuffer.Load( uint3(idx.x,		idx.y+1,	0) ).x;
	float depth_br = DepthBuffer.Load( uint3(idx.x+1,	idx.y+1,	0) ).x;

#if defined(ENABLE_BLEND)
	float blendedDepth_tl = BlendedDepthBuffer.Load( uint3(idx.x,	idx.y,		0) ).x;
	float blendedDepth_tr = BlendedDepthBuffer.Load( uint3(idx.x+1	idx.y,		0) ).x;
	float blendedDepth_br = BlendedDepthBuffer.Load( uint3(idx.x+1, idx.y+1,	0) ).x;
	float blendedDepth_bl = BlendedDepthBuffer.Load( uint3(idx.x,	idx.y+1,	0) ).x;
#endif

#endif

	float viewDepth_tl = InvertProjDepthToView(depth_tl);
	float viewDepth_tr = InvertProjDepthToView(depth_tr);
	float viewDepth_bl = InvertProjDepthToView(depth_bl);
	float viewDepth_br = InvertProjDepthToView(depth_br);

#if defined(ENABLE_BLEND)
	float viewBlendedDepth_tl = InvertProjDepthToView(blendedDepth_tl);
	float viewBlendedDepth_tr = InvertProjDepthToView(blendedDepth_tr);
	float viewBlendedDepth_br = InvertProjDepthToView(blendedDepth_br);
	float viewBlendedDepth_bl = InvertProjDepthToView(blendedDepth_bl);

	float minDepth_tl = (blendedDepth_tl != 0.0f) ? viewBlendedDepth_tl : FLOAT_MAX;
	float minDepth_tr = (blendedDepth_tr != 0.0f) ? viewBlendedDepth_tr : FLOAT_MAX;
	float minDepth_br = (blendedDepth_br != 0.0f) ? viewBlendedDepth_br : FLOAT_MAX;
	float minDepth_bl = (blendedDepth_bl != 0.0f) ? viewBlendedDepth_bl : FLOAT_MAX;
#else
	float minDepth_tl = (depth_tl != 0.0f) ? viewDepth_tl : FLOAT_MAX;
	float minDepth_tr = (depth_tr != 0.0f) ? viewDepth_tr : FLOAT_MAX;
	float minDepth_bl = (depth_bl != 0.0f) ? viewDepth_bl : FLOAT_MAX;
	float minDepth_br = (depth_br != 0.0f) ? viewDepth_br : FLOAT_MAX;
#endif

	float maxDepth_tl = (depth_tl != 0.0f) ? viewDepth_tl : 0.0f;
	float maxDepth_tr = (depth_tr != 0.0f) ? viewDepth_tr : 0.0f;
{'fraction_non_alphanumeric': 0.1121058257616248, 'fraction_numerical': 0.019241047568145375, 'mean_word_length': 6.224903474903475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5395073', 'n_tokens_mistral': 3178, 'n_tokens_neox': 3117, 'n_words': 586}