Mesa (main): clover/il: return IL only for spirv and correct length

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 20 00:48:54 UTC 2021


Module: Mesa
Branch: main
Commit: 66213ab2de023250ceb6ea98270065ee9de02f79
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=66213ab2de023250ceb6ea98270065ee9de02f79

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jul 14 11:32:54 2021 +1000

clover/il: return IL only for spirv and correct length

This is specified as  char[] and I don't think requires null termination,
Also we should only return IL based programs.

Fixes CTS spirv_new get_program_il

Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11868>

---

 src/gallium/frontends/clover/api/program.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/frontends/clover/api/program.cpp b/src/gallium/frontends/clover/api/program.cpp
index e97705bd3ac..d67613f1883 100644
--- a/src/gallium/frontends/clover/api/program.cpp
+++ b/src/gallium/frontends/clover/api/program.cpp
@@ -534,8 +534,8 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
       break;
 
    case CL_PROGRAM_IL:
-      if (prog.il_type() != program::il_type::none)
-         buf.as_string() = prog.source();
+      if (prog.il_type() == program::il_type::spirv)
+         buf.as_vector<char>() = prog.source();
       else if (r_size)
          *r_size = 0u;
       break;



More information about the mesa-commit mailing list