Refactor ShaderBuffer

This commit is contained in:
Dynamitos
2023-08-28 21:23:13 +02:00
parent dcbce27fb2
commit fcc4fc12d4
35 changed files with 99 additions and 564 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ cbuffer DispatchParams
uint pad1;
}
layout(set = 0, binding = 2, std430)
RWStructuredBuffer<Frustum> out_Frustums;
RWShaderBuffer<Frustum> out_Frustums;
[numthreads(BLOCK_SIZE, BLOCK_SIZE, 1)]
+1 -1
View File
@@ -8,7 +8,7 @@ import PrimitiveSceneData;
import MaterialParameter;
layout(set = INDEX_LIGHT_ENV, binding = 4)
StructuredBuffer<uint> lightIndexList;
ShaderBuffer<uint> lightIndexList;
layout(set = INDEX_LIGHT_ENV, binding = 5)
RWTexture2D<uint2> lightGrid;
+5 -5
View File
@@ -21,14 +21,14 @@ layout(set = INDEX_VIEW_PARAMS, binding = 2)
Texture2D depthTextureVS;
layout(set = INDEX_VIEW_PARAMS, binding = 3)
globallycoherent RWStructuredBuffer<uint> oLightIndexCounter;
globallycoherent RWShaderBuffer<uint> oLightIndexCounter;
layout(set = INDEX_VIEW_PARAMS, binding = 4)
globallycoherent RWStructuredBuffer<uint> tLightIndexCounter;
globallycoherent RWShaderBuffer<uint> tLightIndexCounter;
layout(set = INDEX_VIEW_PARAMS, binding = 5)
RWStructuredBuffer<uint> oLightIndexList;
RWShaderBuffer<uint> oLightIndexList;
layout(set = INDEX_VIEW_PARAMS, binding = 6)
RWStructuredBuffer<uint> tLightIndexList;
RWShaderBuffer<uint> tLightIndexList;
layout(set = INDEX_VIEW_PARAMS, binding = 7)
RWTexture2D<uint2> oLightGrid;
@@ -36,7 +36,7 @@ layout(set = INDEX_VIEW_PARAMS, binding = 8)
RWTexture2D<uint2> tLightGrid;
layout(set = INDEX_VIEW_PARAMS, binding = 9)
StructuredBuffer<Frustum> frustums;
ShaderBuffer<Frustum> frustums;
// Debug
//layout(set = INDEX_VIEW_PARAMS, binding = 10)
+1 -1
View File
@@ -17,7 +17,7 @@ ConstantBuffer<ViewData> viewData;
layout(set = 0, binding = 1)
SamplerState glyphSampler;
//layout(set = 1)
//StructuredBuffer<GlyphData> glyphData;
//ShaderBuffer<GlyphData> glyphData;
layout(set = 1)
Texture2D<uint> glyphTextures[];
layout(push_constant)
+2 -2
View File
@@ -62,10 +62,10 @@ struct PointLight : ILightEnv
};
layout(set = INDEX_LIGHT_ENV, binding = 0, std430)
StructuredBuffer<DirectionalLight> directionalLights;
ShaderBuffer<DirectionalLight> directionalLights;
layout(set = INDEX_LIGHT_ENV, binding = 1, std430)
ConstantBuffer<uint> numDirectionalLights;
layout(set = INDEX_LIGHT_ENV, binding = 2, std430)
StructuredBuffer<PointLight> pointLights;
ShaderBuffer<PointLight> pointLights;
layout(set = INDEX_LIGHT_ENV, binding = 3, std430)
ConstantBuffer<uint> numPointLights;
+1 -1
View File
@@ -6,7 +6,7 @@ struct PrimitiveSceneData
};
layout(set = INDEX_SCENE_DATA, binding = 0, std430)
StructuredBuffer<PrimitiveSceneData> gSceneData;
ShaderBuffer<PrimitiveSceneData> gSceneData;
[[vk::push_constant]]
ConstantBuffer<uint> gSceneDataIndex;