Fix Vulkan performance warnings
This commit is contained in:
@@ -20,7 +20,7 @@ external
|
||||
|
||||
struct FragIn
|
||||
{
|
||||
[builtin(fragcoord)] fragcoord: vec4<f32>
|
||||
[location(0)] uv: vec2<f32>,
|
||||
}
|
||||
|
||||
struct FragOut
|
||||
@@ -30,11 +30,13 @@ struct FragOut
|
||||
|
||||
struct VertIn
|
||||
{
|
||||
[location(0)] pos: vec2<f32>
|
||||
[location(0)] pos: vec2<f32>,
|
||||
[location(1)] uv: vec2<f32>,
|
||||
}
|
||||
|
||||
struct VertOut
|
||||
{
|
||||
[location(0)] uv: vec2<f32>,
|
||||
[builtin(position)] position: vec4<f32>
|
||||
}
|
||||
|
||||
@@ -43,9 +45,7 @@ fn main(input: FragIn) -> FragOut
|
||||
{
|
||||
let exposure = 0.8;
|
||||
|
||||
let fragcoord = input.fragcoord.xy * viewerData.invRenderTargetSize;
|
||||
|
||||
let hdrColor = inputTexture.Sample(fragcoord).rgb;
|
||||
let hdrColor = inputTexture.Sample(input.uv).rgb;
|
||||
|
||||
// reinhard tone mapping
|
||||
let mapped = vec3<f32>(1.0, 1.0, 1.0) - exp(-hdrColor * exposure);
|
||||
@@ -61,6 +61,7 @@ fn main(input: VertIn) -> VertOut
|
||||
{
|
||||
let output: VertOut;
|
||||
output.position = vec4<f32>(input.pos, 0.0, 1.0);
|
||||
output.uv = input.uv;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user