Trying to fix invalid descriptorlayout

This commit is contained in:
Dynamitos
2020-10-03 11:00:10 +02:00
parent 79388bf41a
commit ceee96b462
69 changed files with 1087 additions and 393 deletions
+14 -3
View File
@@ -2,17 +2,28 @@ const static float PI = 3.1415926535897932f;
const static uint MAX_PARTICLES = 65536;
const static uint BLOCK_SIZE = 8;
cbuffer ScreenToViewParams
struct ViewParameter
{
float4x4 viewMatrix;
float4x4 projectionMatrix;
float4 cameraPos_WS;
}
layout(set = 1, binding = 0, std430)
ConstantBuffer<ViewParameter> gViewParams;
struct ScreenToViewParams
{
float4x4 inverseProjection;
float2 screenDimensions;
}
layout(set = 1, binding = 1, std430)
ConstantBuffer<ScreenToViewParams> gScreenToViewParams;
// Convert clip space coordinates to view space
float4 clipToView( float4 clip )
{
// View space position.
float4 view = mul( inverseProjection, clip );
float4 view = mul( gScreenToViewParams.inverseProjection, clip );
// Perspective projection.
view = view / view.w;
@@ -23,7 +34,7 @@ float4 clipToView( float4 clip )
float4 screenToView( float4 screen )
{
// Convert to normalized texture coordinates
float2 texCoord = screen.xy / screenDimensions;
float2 texCoord = screen.xy / gScreenToViewParams.screenDimensions;
// Convert to clip space
float4 clip = float4( float2( texCoord.x, -texCoord.y ) * 2.0f - 1.0f, screen.z, screen.w );