/graphics/MesaLib/patches/patch-src_mesa_main_shader__query.cpp

https://github.com/NetBSD/pkgsrc · C++ · 58 lines · 48 code · 10 blank · 0 comment · 4 complexity · e47056a4bf1b27c1321abc1f2cb50804 MD5 · raw file

  1. $NetBSD: patch-src_mesa_main_shader__query.cpp,v 1.2 2019/08/21 13:35:28 nia Exp $
  2. https://bugs.freedesktop.org/show_bug.cgi?id=66346
  3. From c4a1fec68d2508ff0c4fc2831465aca8c4ca783a Mon Sep 17 00:00:00 2001
  4. From: Julien Isorce <j.isorce@samsung.com>
  5. Date: Wed, 22 Apr 2015 23:04:42 +0100
  6. Subject: [PATCH 1/2] shader_query: convert GLhandleARB to uintptr_t before
  7. troncating to GLuint
  8. Fixes compiler error on OSX as GLhandleARB is defined as void* if __APPLE__.
  9. https://bugs.freedesktop.org/show_bug.cgi?id=66346
  10. ---
  11. src/mesa/main/shader_query.cpp | 6 +++---
  12. 1 file changed, 3 insertions(+), 3 deletions(-)
  13. --- src/mesa/main/shader_query.cpp.orig 2016-11-10 22:05:17.000000000 +0000
  14. +++ src/mesa/main/shader_query.cpp
  15. @@ -70,7 +70,12 @@ _mesa_BindAttribLocation(GLuint program,
  16. GET_CURRENT_CONTEXT(ctx);
  17. struct gl_shader_program *const shProg =
  18. +#if defined(__APPLE__)
  19. + _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glBindAttribLocation");
  20. +#else
  21. _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
  22. +#endif
  23. +
  24. if (!shProg)
  25. return;
  26. @@ -114,7 +119,12 @@ _mesa_GetActiveAttrib(GLuint program, GL
  27. return;
  28. }
  29. +#if defined(__APPLE__)
  30. + shProg = _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetActiveAttrib");
  31. +#else
  32. shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
  33. +#endif
  34. +
  35. if (!shProg)
  36. return;
  37. @@ -159,7 +169,12 @@ _mesa_GetAttribLocation(GLuint program,
  38. {
  39. GET_CURRENT_CONTEXT(ctx);
  40. struct gl_shader_program *const shProg =
  41. +
  42. +#if defined(__APPLE__)
  43. + _mesa_lookup_shader_program_err(ctx, (GLuint)(uintptr_t)program, "glGetAttribLocation");
  44. +#else
  45. _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
  46. +#endif
  47. if (!shProg) {
  48. return -1;