d3d11: set the proper sampler for each pass input

This commit is contained in:
chyyran 2023-01-29 22:19:08 -05:00
parent b861ba6711
commit abcd3bdc24
6 changed files with 38 additions and 3 deletions

View file

@ -17,7 +17,6 @@ impl From<FilterMode> for Direct3D11::D3D11_FILTER {
match value { match value {
FilterMode::Linear => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_LINEAR, FilterMode::Linear => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_LINEAR,
FilterMode::Nearest => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_POINT, FilterMode::Nearest => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_POINT,
_ => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_LINEAR,
} }
} }
} }

View file

@ -527,8 +527,8 @@ impl FilterChainD3D11 {
handle: target.create_shader_resource_view()?, handle: target.create_shader_resource_view()?,
size, size,
}, },
filter, filter: pass.config.filter,
wrap_mode, wrap_mode: pass.config.wrap_mode,
}; };
self.common.output_textures[index] = Some(source.clone()); self.common.output_textures[index] = Some(source.clone());
} }

29
test/null.slang Normal file
View file

@ -0,0 +1,29 @@
#version 450
// 450 or 310 es are recommended
layout(set = 0, binding = 0, std140) uniform UBO
{
mat4 MVP;
};
#pragma name StockShader
#pragma format R8G8B8A8_UNORM
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = MVP * Position;
vTexCoord = TexCoord;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform sampler2D Source;
void main()
{
FragColor = texture(Source, vTexCoord);
}

7
test/null.slangp Normal file
View file

@ -0,0 +1,7 @@
shaders = "1"
shader0 = "null.slang"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"

BIN
test/sf2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
triangle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB