intel/fs: Add a SCRATCH_HEADER opcode
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 9 Oct 2020 09:13:20 +0000 (04:13 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:59:27 +0000 (21:59 +0000)
commit06ebf23283e11c9abb507a523bd0633a82f7960b
treef0cc261836f4ebbd24c0faa68e99fcd8bbd04c94
parent24b64c8408b3758c198aab90618d69dec093b4ad
intel/fs: Add a SCRATCH_HEADER opcode

This opcode is responsible for setting up the buffer base address and
per-thread scratch space fields of a scratch message header.  For the
most part, it's a copy of g0 but some messages need us to zero out g0.2
and the bottom bits of g0.5.

This may actually fix a bug when nir_load/store_scratch is used.  The
docs say that the DWORD scattered messages respect the per-thread
scratch size specified in gN.3[3:0] in the message header but we've been
leaving it zero.  This may mean that we've been ignoring any scratch
reads/writes from a load/store_scratch intrinsic above the 1KB mark.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7084>
src/intel/compiler/brw_eu_defines.h
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_ir_performance.cpp
src/intel/compiler/brw_shader.cpp