Revert "Implement vertex swizzle"

This reverts commit f4b52cea2b.
This commit is contained in:
nmzik
2026-07-18 06:21:00 +02:00
parent 62a92abc66
commit da6cee924b
10 changed files with 195 additions and 282 deletions
@@ -450,25 +450,7 @@ uint32_t EmitVertexParameterComponentU32(EmitterState* state, const InputBinding
uint32_t component) {
const auto count = VertexParameterComponentCount(*state, input);
const auto kind = VertexParameterScalarKind(*state, input.location);
uint32_t source_component = component;
if (input.location < ShaderVertexInputInfo::RES_MAX &&
input.location < static_cast<uint32_t>(state->vertex_input_info->resources_num)) {
const auto& descriptor = state->vertex_input_info->resources[input.location];
const auto selection =
DecodeVertexDstSelector(GetDstSel(descriptor.DstSelXYZW(), component & 3u));
if (selection.kind == VertexDstSelectKind::Zero) {
return ConstantU32(state, 0u);
}
if (selection.kind == VertexDstSelectKind::One) {
return ConstantU32(state,
kind == VertexInputScalarKind::Float ? 0x3f800000u : 1u);
}
if (selection.kind == VertexDstSelectKind::Reserved) {
EXIT("reserved vertex destination selector\n");
}
source_component = selection.source_component;
}
if (source_component >= count) {
if (component >= count) {
return VertexInputDefaultComponentU32(state, kind, component);
}
@@ -480,7 +462,7 @@ uint32_t EmitVertexParameterComponentU32(EmitterState* state, const InputBinding
const auto pointer_type = VertexParameterScalarPointerType(*state, kind);
const auto pointer = state->builder.AllocateId();
state->builder.AddFunction({OpAccessChain, pointer_type, pointer, input.variable_id,
ConstantU32(state, source_component)});
ConstantU32(state, component)});
state->builder.AddFunction({OpLoad, scalar_type, raw, pointer});
}