gallium/swr: Fix crashes and failures in vertex fetch

This commit fixes two problems:
- In some cases SWR does not correctly report to Gallium
  which formats are supported.
- Incorrect LLVM instructions are used in vertex fetch in some situations

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4788>
This commit is contained in:
Jan Zielinski 2020-04-28 21:05:46 +02:00 committed by Marge Bot
parent de0d3d1726
commit a93b728bc6
2 changed files with 7 additions and 3 deletions

View file

@ -874,10 +874,8 @@ void FetchJit::JitGatherVertices(const FETCH_COMPILE_STATE& fetchState,
Value* pGatherHi =
GATHERPD(vZeroDouble, pStreamBaseGFX, vOffsetsHi, vMaskHi);
pGatherLo = VCVTPD2PS(pGatherLo);
pGatherHi = VCVTPD2PS(pGatherHi);
Value* pGather = VSHUFFLE(pGatherLo, pGatherHi, vShufAll);
pGather = FP_TRUNC(pGather, mSimdFP32Ty);
vVertexElements[currentVertexElement++] = pGather;
}

View file

@ -141,6 +141,12 @@ swr_is_format_supported(struct pipe_screen *_screen,
return false;
}
if (bind & PIPE_BIND_VERTEX_BUFFER) {
if (mesa_to_swr_format(format) == (SWR_FORMAT)-1) {
return false;
}
}
if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC ||
format_desc->layout == UTIL_FORMAT_LAYOUT_FXT1)
{