mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 08:44:08 +00:00
3a6814770a
* Allow unconsumed inputs in fragment shaders by removing them from vertex outputs when generating HLSL. Fixes https://github.com/gfx-rs/wgpu/issues/3748 * Add naga:🔙:hlsl::FragmentEntryPoint for providing information about the fragment entry point when generating vertex entry points via naga:🔙:hlsl::Writer::write. Vertex outputs not consumed by the fragment entry point are omitted in the final output struct. * Add naga snapshot test for this new feature, * Remove Features::SHADER_UNUSED_VERTEX_OUTPUT, StageError::InputNotConsumed, and associated validation logic. * Make wgpu dx12 backend pass fragment shader info when generating vertex HLSL. * Add wgpu regression test for allowing unconsumed inputs. * Address review * Add note that nesting structs for the inter-stage interface can't happen. * Remove new TODO notes (some addressed and some transferred to an issue https://github.com/gfx-rs/wgpu/issues/5577) * Changed issue that regression test refers to 3748 -> 5553 * Add debug_assert that binding.is_some() in hlsl writer * Fix typos caught in CI Also, fix compiling snapshot test when hlsl-out feature is not enabled.
18 lines
500 B
HLSL
18 lines
500 B
HLSL
struct FragmentIn {
|
|
float value : LOC1;
|
|
float value2_ : LOC3;
|
|
float4 position : SV_Position;
|
|
};
|
|
|
|
struct FragmentInput_fs_main {
|
|
float value : LOC1;
|
|
float value2_ : LOC3;
|
|
float4 position : SV_Position;
|
|
};
|
|
|
|
float4 fs_main(FragmentInput_fs_main fragmentinput_fs_main) : SV_Target0
|
|
{
|
|
FragmentIn v_out = { fragmentinput_fs_main.value, fragmentinput_fs_main.value2_, fragmentinput_fs_main.position };
|
|
return float4(v_out.value, v_out.value, v_out.value2_, v_out.value2_);
|
|
}
|