Skip to content

Commit 4c56d0c

Browse files
committed
WIP ops
1 parent 809f10a commit 4c56d0c

4 files changed

Lines changed: 30 additions & 24 deletions

File tree

extensions/pl_renderer_ext.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,11 +3020,11 @@ pl_renderer_render_view(plView* ptView, plCamera* ptCamera, plCamera* ptCullCame
30203020
uJumpSteps = 1;
30213021

30223022
const plDispatch tDispach = {
3023-
.uGroupCountX = (uint32_t)ceilf(tDimensions.x / 8.0f),
3024-
.uGroupCountY = (uint32_t)ceilf(tDimensions.y / 8.0f),
3023+
.uGroupCountX = (uint32_t)ceilf(tDimensions.x / 32.0f),
3024+
.uGroupCountY = (uint32_t)ceilf(tDimensions.y / 32.0f),
30253025
.uGroupCountZ = 1,
3026-
.uThreadPerGroupX = 8,
3027-
.uThreadPerGroupY = 8,
3026+
.uThreadPerGroupX = 32,
3027+
.uThreadPerGroupY = 32,
30283028
.uThreadPerGroupZ = 1
30293029
};
30303030

@@ -3210,11 +3210,11 @@ pl_renderer_render_view(plView* ptView, plCamera* ptCamera, plCamera* ptCullCame
32103210
plTexture* ptFinalTexture = gptGfx->get_texture(gptData->ptDevice, ptView->tFinalTexture);
32113211

32123212
plDispatch tTonemapDispatch = {
3213-
.uGroupCountX = (uint32_t)(ceilf(ptFinalTexture->tDesc.tDimensions.x / 8.0f)),
3214-
.uGroupCountY = (uint32_t)(ceilf(ptFinalTexture->tDesc.tDimensions.y / 8.0f)),
3213+
.uGroupCountX = (uint32_t)(ceilf(ptFinalTexture->tDesc.tDimensions.x / 32.0f)),
3214+
.uGroupCountY = (uint32_t)(ceilf(ptFinalTexture->tDesc.tDimensions.y / 32.0f)),
32153215
.uGroupCountZ = 1,
3216-
.uThreadPerGroupX = 8,
3217-
.uThreadPerGroupY = 8,
3216+
.uThreadPerGroupX = 32,
3217+
.uThreadPerGroupY = 32,
32183218
.uThreadPerGroupZ = 1
32193219
};
32203220
gptGfx->dispatch(ptPostEncoder, 1, &tTonemapDispatch);

shaders/jumpfloodalgo.comp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ jump(vec3 minSeed, ivec2 current, ivec2 offset)
5151
// [SECTION] entry
5252
//-----------------------------------------------------------------------------
5353

54-
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
54+
layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
5555

5656
void main()
5757
{
58-
const int iXCoord = int(gl_WorkGroupID.x * 8 + gl_LocalInvocationID.x);
59-
const int iYCoord = int(gl_WorkGroupID.y * 8 + gl_LocalInvocationID.y);
58+
const int iXCoord = int(gl_WorkGroupID.x * 32 + gl_LocalInvocationID.x);
59+
const int iYCoord = int(gl_WorkGroupID.y * 32 + gl_LocalInvocationID.y);
6060

6161
if(iXCoord >= tDynamicData.tJumpDistance.x || iYCoord >= tDynamicData.tJumpDistance.y)
6262
return;

shaders/lighting.glsl

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,19 @@ filterPCF(vec4 sc, vec2 offset, int textureIndex)
113113
float dy = scale * 1.0 / (float(texDim.y));
114114

115115
float shadowFactor = 0.0;
116-
int count = 0;
116+
// int count = 0;
117117
int range = 1;
118118

119-
for (int x = -range; x <= range; x++) {
120-
for (int y = -range; y <= range; y++) {
119+
for (int x = -range; x <= range; x++)
120+
{
121+
for (int y = -range; y <= range; y++)
122+
{
121123
shadowFactor += textureProj(sc, vec2(dx*x, dy*y) + offset, textureIndex);
122-
count++;
124+
// count++;
123125
}
124126
}
125-
return shadowFactor / count;
127+
// return shadowFactor / count;
128+
return shadowFactor / 4.0;
126129
}
127130

128131
float
@@ -134,16 +137,19 @@ filterPCF2(vec4 sc, vec2 offset, int textureIndex)
134137
float dy = scale * 1.0 / (float(texDim.y));
135138

136139
float shadowFactor = 0.0;
137-
int count = 0;
140+
// int count = 0;
138141
int range = 1;
139142

140-
for (int x = -range; x <= range; x++) {
141-
for (int y = -range; y <= range; y++) {
143+
for (int x = -range; x <= range; x++)
144+
{
145+
for (int y = -range; y <= range; y++)
146+
{
142147
shadowFactor += textureProj2(sc, vec2(dx*x, dy*y) + offset, textureIndex);
143-
count++;
148+
// count++;
144149
}
145150
}
146-
return shadowFactor / count;
151+
// return shadowFactor / count;
152+
return shadowFactor / 4.0;
147153
}
148154

149155
#endif // LIGHTING_GLSL

shaders/tonemap.comp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ layout(set = 3, binding = 0) uniform PL_DYNAMIC_DATA
8888
// [SECTION] entry
8989
//-----------------------------------------------------------------------------
9090

91-
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
91+
layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
9292

9393
void
9494
main()
9595
{
9696

97-
const int iXCoord = int(gl_WorkGroupID.x * 8 + gl_LocalInvocationID.x);
98-
const int iYCoord = int(gl_WorkGroupID.y * 8 + gl_LocalInvocationID.y);
97+
const int iXCoord = int(gl_WorkGroupID.x * 32 + gl_LocalInvocationID.x);
98+
const int iYCoord = int(gl_WorkGroupID.y * 32 + gl_LocalInvocationID.y);
9999

100100
const ivec2 tImageSize = imageSize(inputImage);
101101

0 commit comments

Comments
 (0)