mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-11-26 01:48:03 +00:00
shader_recompiler: fix non-const offset for arrayed image types
This commit is contained in:
parent
cb29aa0473
commit
462ea921e3
1 changed files with 10 additions and 4 deletions
|
@ -321,17 +321,23 @@ void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, I
|
||||||
Id result_type{};
|
Id result_type{};
|
||||||
switch (info.type) {
|
switch (info.type) {
|
||||||
case TextureType::Buffer:
|
case TextureType::Buffer:
|
||||||
case TextureType::Color1D:
|
case TextureType::Color1D: {
|
||||||
case TextureType::ColorArray1D: {
|
|
||||||
result_type = ctx.U32[1];
|
result_type = ctx.U32[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TextureType::ColorArray1D:
|
||||||
|
offset = ctx.OpCompositeConstruct(ctx.U32[2], offset, ctx.u32_zero_value);
|
||||||
|
[[fallthrough]];
|
||||||
case TextureType::Color2D:
|
case TextureType::Color2D:
|
||||||
case TextureType::Color2DRect:
|
case TextureType::Color2DRect: {
|
||||||
case TextureType::ColorArray2D: {
|
|
||||||
result_type = ctx.U32[2];
|
result_type = ctx.U32[2];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case TextureType::ColorArray2D:
|
||||||
|
offset = ctx.OpCompositeConstruct(ctx.U32[3], ctx.OpCompositeExtract(ctx.U32[1], coords, 0),
|
||||||
|
ctx.OpCompositeExtract(ctx.U32[1], coords, 1),
|
||||||
|
ctx.u32_zero_value);
|
||||||
|
[[fallthrough]];
|
||||||
case TextureType::Color3D: {
|
case TextureType::Color3D: {
|
||||||
result_type = ctx.U32[3];
|
result_type = ctx.U32[3];
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue