UI: avoid shader handle->name->handle round trips#3347
UI: avoid shader handle->name->handle round trips#3347slipher merged 2 commits intoUnvanquished:masterfrom
Conversation
For some UI elements (e.g. weapon and upgrade icons) a round trip of trap_R_RegisterShader( trap_R_ShaderNameFromHandle( handle ) ) was done each time the shader was used, incurring 2 IPC calls. Avoid this by introducing a magic syntax for RML image paths, for example "/$handle/123", which allows a handle to be plumbed through RmlUi. NUKE CG_GetShaderNameFromHandle.
DolceTriade
left a comment
There was a problem hiding this comment.
Can we document this somewhere? high level idea seems ok to me, but the magic will be confusing without sufficient bread crumbs
I don't see why it would be difficult to figure out. Easy to grep for |
Yes, but that will result in all usages of $handle too and you need to identify the source. At the very least, I'd like this documented in |
Done. |
|
As a side remark, and this also applies to the already existing The idea is good though. |
It's not like a variable. More of a magic directory like Unix |
For some UI elements (e.g. weapon and upgrade icons) a round trip of trap_R_RegisterShader( trap_R_ShaderNameFromHandle( handle ) ) was done each time the shader was used, incurring 2 IPC calls. Avoid this by introducing a magic syntax for RML image paths, for example "/$handle/123", which allows a handle to be plumbed through RmlUi.
This gets rid of one of the IPC calls listed in #3157.