[Mesa-dev] [RFC PATCH 04/17] include/pipe: Store the byte-size of a SPIR-V binary

Francisco Jerez currojerez at riseup.net
Fri May 5 19:17:46 UTC 2017


Pierre Moreau <pierre.morrow at free.fr> writes:

> Besides parsing all the opcodes until reaching the EOF character, there
> is no way to compute the size of a SPIR-V binary. Therefore, it is
> easier to pass it along the SPIR-V binary in pipe_compute_state.
>

LLVM IR programs use pipe_llvm_program_header in order to provide the
same information.  Not necessarily opposed to doing it this way but I
think it would make sense for the SPIR-V and LLVM paths to use the same
mechanism.

> Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
>  src/gallium/include/pipe/p_state.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
> index ce9ca34d29..1f8fdf530f 100644
> --- a/src/gallium/include/pipe/p_state.h
> +++ b/src/gallium/include/pipe/p_state.h
> @@ -810,6 +810,7 @@ struct pipe_compute_state
>  {
>     enum pipe_shader_ir ir_type; /**< IR type contained in prog. */
>     const void *prog; /**< Compute program to be executed. */
> +   unsigned prog_num_bytes; /**< Program size in bytes, used by SPIR-V. */
>     unsigned req_local_mem; /**< Required size of the LOCAL resource. */
>     unsigned req_private_mem; /**< Required size of the PRIVATE resource. */
>     unsigned req_input_mem; /**< Required size of the INPUT resource. */
> -- 
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170505/71a75e29/attachment.sig>


More information about the mesa-dev mailing list