added deferred shading foreach_tile
This commit is contained in:
@@ -191,7 +191,6 @@ IntersectLightsWithTileMinMax(
|
||||
|
||||
foreach (lightIndex = 0 ... numLights)
|
||||
{
|
||||
|
||||
float light_positionView_z = light_positionView_z_array[lightIndex];
|
||||
float light_attenuationEnd = light_attenuationEnd_array[lightIndex];
|
||||
float light_attenuationEndNeg = -light_attenuationEnd;
|
||||
@@ -309,7 +308,7 @@ ShadeTile(
|
||||
uniform float twoOverGBufferWidth = 2.0f / gBufferWidth;
|
||||
uniform float twoOverGBufferHeight = 2.0f / gBufferHeight;
|
||||
|
||||
foreach_tiled(y = tileStartY ... tileEndY, x = tileStartX ... tileEndX)
|
||||
foreach_tiled (y = tileStartY ... tileEndY, x = tileStartX ... tileEndX)
|
||||
{
|
||||
float positionScreen_y = -(((0.5f + y) * twoOverGBufferHeight) - 1.f);
|
||||
int32 gBufferOffset = y * gBufferWidth + x;
|
||||
|
||||
@@ -116,6 +116,10 @@ void createContext(const int deviceId = 0)
|
||||
|
||||
// Create driver context
|
||||
checkCudaErrors(cuCtxCreate(&context, 0, device));
|
||||
const size_t stackLimit = 4*1024;
|
||||
// const size_t heapLimit = 1024*1024*1024;
|
||||
checkCudaErrors(cuCtxSetLimit(CU_LIMIT_STACK_SIZE,stackLimit));
|
||||
// checkCudaErrors(cuCtxSetLimit(CU_LIMIT_MALLOC_HEAP_SIZE,heapLimit));
|
||||
}
|
||||
void destroyContext()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user