SHARE
TWEET

Untitled

a guest Jan 7th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/Makefile b/Makefile
  2. index 86ab89e..b3f63bd 100644
  3. --- a/Makefile
  4. +++ b/Makefile
  5. @@ -1,19 +1,19 @@
  6.  DESTDIR      ?=
  7. -PREFIX        = $(DESTDIR)/usr/local
  8. +PREFIX        = $(DESTDIR)/usr
  9.  INSTALL       = /usr/bin/install
  10.  override INSTALL += -D
  11.  MSGFMT        = /usr/bin/msgfmt
  12.  SED           = /bin/sed
  13.  LN            = /bin/ln
  14.  bindir        = $(PREFIX)/bin
  15. -libdir        = $(PREFIX)/lib
  16. -sysconfdir    = $(PREFIX)/etc
  17. +libdir        = $(PREFIX)/local/lib
  18. +sysconfdir    = /etc
  19.  datarootdir   = ${PREFIX}/share
  20.  datadir       = ${datarootdir}
  21.  
  22.  override CXXFLAGS += --std=gnu++11 -g3
  23.  
  24. -all: libprimus_vk.so libnv_vulkan_wrapper.so
  25. +all: libprimus_vk.so libnv_vulkan_wrapper.so primus_vk_diag
  26.  
  27.  libprimus_vk.so: primus_vk.cpp
  28.     $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I/usr/include/vulkan -shared -fPIC $^ -o $@ -Wl,-soname,libprimus_vk.so.1 -ldl -lpthread $(LDFLAGS)
  29. @@ -33,7 +33,7 @@ primus_vk_diag: primus_vk_diag.o
  30.     $(CXX) -g3 -o $@ $^ -lX11 -lvulkan -ldl $(LDFLAGS)
  31.  
  32.  clean:
  33. -   rm -f libnv_vulkan_wrapper.so libprimus_vk.so
  34. +   rm -f libnv_vulkan_wrapper.so libprimus_vk.so primus_vk_diag primus_vk_diag.so
  35.  
  36.  install: all
  37.     $(INSTALL) "libnv_vulkan_wrapper.so" "$(libdir)/libnv_vulkan_wrapper.so.1"
  38. @@ -41,5 +41,12 @@ install: all
  39.     $(INSTALL) "libprimus_vk.so"  "$(libdir)/libprimus_vk.so.1"
  40.     $(LN) -s "libprimus_vk.so.1" "$(libdir)/libprimus_vk.so"
  41.     $(INSTALL) -m644 "primus_vk.json" -t "$(datadir)/vulkan/implicit_layer.d/"
  42. -   $(INSTALL) -m644 "nv_vulkan_wrapper.json" -t "$(datadir)/vulkan/icd.d/"
  43. +   $(INSTALL) -m644 "nv_vulkan_wrapper.json" -t "$(sysconfdir)/vulkan/icd.d/"
  44. +   mv -f "$(sysconfdir)/vulkan/icd.d/nvidia_icd.json" "$(sysconfdir)/vulkan/icd.d/nvidia_icd.json.primus_vk.bak"
  45.     $(INSTALL) -m755 "pvkrun.in.sh" "$(bindir)/pvkrun"
  46. +   $(INSTALL) -m755 "primus_vk_diag" "$(bindir)/primus_vk_diag"
  47. +
  48. +uninstall:
  49. +   rm -f "$(libdir)/libnv_vulkan_wrapper.so.1" "$(libdir)/libnv_vulkan_wrapper.so" "$(libdir)/libprimus_vk.so.1" "$(libdir)/libprimus_vk.so" "$(datadir)/vulkan/implicit_layer.d/primus_vk.json" "$(sysconfdir)/vulkan/icd.d/nv_vulkan_wrapper.json" "$(bindir)/pvkrun" "$(bindir)/primus_vk_diag"
  50. +   mv -uf "$(sysconfdir)/vulkan/icd.d/nvidia_icd.json.primus_vk.bak" "$(sysconfdir)/vulkan/icd.d/nvidia_icd.json"
  51. +   rm -f "$(sysconfdir)/vulkan/icd.d/nvidia_icd.json.primus_vk.bak"
  52. diff --git a/nv_vulkan_wrapper.cpp b/nv_vulkan_wrapper.cpp
  53. index b186aac..39473cd 100644
  54. --- a/nv_vulkan_wrapper.cpp
  55. +++ b/nv_vulkan_wrapper.cpp
  56. @@ -8,7 +8,7 @@ extern "C" VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersi
  57.  
  58.  
  59.  #ifndef NV_DRIVER_PATH
  60. -#define NV_DRIVER_PATH "/usr/lib/x86_64-linux-gnu/nvidia/current/libGL.so.1"
  61. +#define NV_DRIVER_PATH "/usr/lib64/opengl/nvidia/lib/libGLX_nvidia.so.0"
  62.  #endif
  63.  
  64.  class StaticInitialize {
  65. diff --git a/primus_vk.cpp b/primus_vk.cpp
  66. index ba5a69e..31254a3 100644
  67. --- a/primus_vk.cpp
  68. +++ b/primus_vk.cpp
  69. @@ -1,6 +1,7 @@
  70.  #include "vulkan.h"
  71.  #include "vk_layer.h"
  72.  #include "vk_layer_dispatch_table.h"
  73. +#include "vk_layer_utils.h"
  74.  
  75.  #include <cassert>
  76.  #include <cstring>
  77. diff --git a/primus_vk.json b/primus_vk.json
  78. index 7b0771c..6c0977e 100644
  79. --- a/primus_vk.json
  80. +++ b/primus_vk.json
  81. @@ -3,7 +3,7 @@
  82.    "layer" : {
  83.      "name": "VK_LAYER_PRIMUS_PrimusVK",
  84.      "type": "GLOBAL",
  85. -    "library_path": "libprimus_vk.so",
  86. +    "library_path": "/usr/local/lib/libprimus_vk.so",
  87.      "api_version": "1.1.0",
  88.      "implementation_version": "1",
  89.      "description": "Primus-vk - https://github.com/felixdoerre/primus_vk",
  90. diff --git a/pvkrun.in.sh b/pvkrun.in.sh
  91. index 4767033..16b3a7f 100644
  92. --- a/pvkrun.in.sh
  93. +++ b/pvkrun.in.sh
  94. @@ -1,2 +1,2 @@
  95.  #!/bin/sh
  96. -ENABLE_PRIMUS_LAYER=1 exec primusrun "$@"
  97. +ENABLE_PRIMUS_LAYER=1 exec optirun "$@"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top