[Mesa-dev] [PATCH 2/2] radeonsi: Use pointers rather than resource descriptors for shader constants v3

Laurent Carlier lordheavym at gmail.com
Mon Aug 5 16:11:44 PDT 2013


Le lundi 5 août 2013 14:58:44 Tom Stellard a écrit :
> From: Tom Stellard <thomas.stellard at amd.com>
> 
> The TGSI->LLVM pass for radeonsi preloads constants and relies on LLVM's
> sinking pass to reduce SGPR usage by lowering constant reads to an
> optimal place in the code.  However, LLVM's machine sink pass will not
> lower instructions that have been selected from llvm.SI.load.const
> intrinsics, because these instructions do not have a MachineMemOperand,
> which LLVM needs in order to determine whether or not it is safe to sink
> a load.  Replacing this intrinsic with a real load instruction will
> enable the sinking optimization and probably a few others.
> 
> The other advantages of using pointers are:
> + Reduced register usage (pointers take 2 registers, descriptors take 4)
> + More code sharing with compute
> 
> This should also fix some crashes due to the compiler running out of
> registers like in this bug:
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=66805
> 
> v2:
>   - Mark constant loads as invariant, so the machine sink pass will
>     actually lower them.
> 
> v3:
>   - Correctly specify the invariant.load metadata
> ---

Both patches are working  properly with Portal, but got these with Dungeon 
Defenders (game segfault before the game menu):

si_state_draw.c:242:si_pipe_shader_ps: Assertion `num_sgprs <= 104' failed.
si_state_draw.c:242:si_pipe_shader_ps: Assertion `num_sgprs <= 104' failed.
Steam: An X Error occurred
X Error of failed request:  BadWindow (invalid Window parameter)
Major opcode of failed request:  40 (X_TranslateCoords)
Resource id in failed request:  0x1cfa9cb
Serial number of failed request:  116812
xerror_handler: X failed, continuing
Game removed: AppID 65800 "Dungeon Defenders", ProcID 1078 

-- 
Laurent Carlier
ArchLinux Developer
http://www.archlinux.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130806/92b67cb9/attachment.pgp>


More information about the mesa-dev mailing list