plonk
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#version 460 core
|
||||
#extension GL_ARB_gpu_shader_int64 : enable
|
||||
#define VISIBILITY_ACCESS writeonly
|
||||
#import <voxy:lod/gl46mesh/bindings.glsl>
|
||||
layout(early_fragment_tests) in;
|
||||
|
||||
@@ -35,8 +35,8 @@ bool testHiZ(PosHeader secPos, AABBHeader aabb) {
|
||||
minBB = minBB*0.5+0.5;
|
||||
maxBB = maxBB*0.5+0.5;
|
||||
|
||||
vec2 size = (maxBB.xy - minBB.xy) * vec2(screensize);
|
||||
float miplevel = ceil(log2(max(size.x, size.y)));//NOTE: the /2 is cause the mipmaps dont include bottom level depth
|
||||
vec2 size = (maxBB.xy - minBB.xy) * vec2(ivec2(screensize));
|
||||
float miplevel = ceil(log2(max(max(size.x, size.y),1)));
|
||||
|
||||
float a = textureLod(hizSampler,minBB.xy,miplevel).r;
|
||||
float b = textureLod(hizSampler,vec2(minBB.x,maxBB.y),miplevel).r;
|
||||
@@ -63,7 +63,7 @@ void main() {
|
||||
PosHeader pos = geometryPool[meshletId*MESHLET_SIZE];
|
||||
AABBHeader aabb = geometryPool[meshletId*MESHLET_SIZE+1];
|
||||
|
||||
if (testHiZ(pos, aabb) || true) {//If didnt cull, insert it back into the stream
|
||||
if (testHiZ(pos, aabb)) {//If didnt cull, insert it back into the stream
|
||||
meshlets[atomicAdd(drawCmd.instanceCount, 1)+fullMeshletCount] = meshletId;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
#version 450
|
||||
#extension GL_ARB_gpu_shader_int64 : enable
|
||||
#extension GL_ARB_shader_draw_parameters : require
|
||||
|
||||
#import <voxy:lod/quad_format.glsl>
|
||||
#import <voxy:lod/gl46mesh/bindings.glsl>
|
||||
@@ -12,7 +13,7 @@ Quad quad;
|
||||
bool setupMeshlet() {
|
||||
gl_CullDistance[0] = 1;
|
||||
//TODO: replace with vertexAttribute that has a divisor of 1
|
||||
uint data = meshlets[gl_InstanceID];
|
||||
uint data = meshlets[gl_InstanceID + gl_BaseInstanceARB];
|
||||
if (data == uint(-1)) {//Came across a culled meshlet
|
||||
gl_CullDistance[0] = -1;
|
||||
//Since the primative is culled, dont need to do any more work or set any values as the primative is discarded
|
||||
|
||||
Reference in New Issue
Block a user