aresrpg / aresrpg-engine

Voxel rendering engine
1 stars 0 forks source link

Terrain: optimize WebGPU compute shader by fixing patch size #20

Closed piellardj closed 2 months ago

piellardj commented 6 months ago

Now that the map is infinite, patch size should be constant everywhere, which could allow for some optimizations in the WebGPU compute shader.

Instead of apssing the cache size as a storage struct variable:

struct LocalMapCacheBuffer {
            size: vec3i,
            data: array<u32>,
        };

it becomes a compile-time constant, which could directly be injected into the shader.

piellardj commented 2 months ago

No longer needed since we now compute patches on CPU. Moreover, in my test this change did not improve performances.