mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-15 16:18:39 +00:00
[spir-v] Include more cases for ColorArray1D
This commit is contained in:
@@ -370,18 +370,29 @@ void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (info.type) {
|
switch (info.type) {
|
||||||
case TextureType::Color1D:
|
case TextureType::Color1D: {
|
||||||
// Convert scalar → vec2(x, 0.0)
|
// Convert scalar → vec2(x, 0.0)
|
||||||
return ctx.OpCompositeConstruct(ctx.F32[2], coords, ctx.f32_zero_value);
|
return ctx.OpCompositeConstruct(ctx.F32[2], coords, ctx.f32_zero_value);
|
||||||
case TextureType::ColorArray1D:
|
}
|
||||||
|
case TextureType::ColorArray1D: {
|
||||||
// Convert vec2(x, layer) → vec3(x, 0.0, layer)
|
// Convert vec2(x, layer) → vec3(x, 0.0, layer)
|
||||||
// ColorArray1D coords are always vec2 in IR
|
// ColorArray1D coords are always vec2 in IR
|
||||||
const Id x = ctx.OpCompositeExtract(ctx.F32[1], coords, 0);
|
const Id x = ctx.OpCompositeExtract(ctx.F32[1], coords, 0);
|
||||||
const Id layer = ctx.OpCompositeExtract(ctx.F32[1], coords, 1);
|
const Id layer = ctx.OpCompositeExtract(ctx.F32[1], coords, 1);
|
||||||
return ctx.OpCompositeConstruct(ctx.F32[3], x, ctx.f32_zero_value, layer);
|
return ctx.OpCompositeConstruct(ctx.F32[3], x, ctx.f32_zero_value, layer);
|
||||||
default:
|
}
|
||||||
|
case TextureType::Color2D:
|
||||||
|
case TextureType::ColorArray2D:
|
||||||
|
case TextureType::Color3D:
|
||||||
|
case TextureType::ColorCube:
|
||||||
|
case TextureType::ColorArrayCube:
|
||||||
|
case TextureType::Buffer:
|
||||||
|
case TextureType::Color2DRect:
|
||||||
|
// No adjustment needed for non-1D textures
|
||||||
return coords;
|
return coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return coords; // Unreachable, but silences -Werror=return-type
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user