Mesa (master): clover: Use Clang's diagnostics

2016-12-24 Thread Francisco Jerez
Module: Mesa
Branch: master
Commit: d9fef848a651b47520cbeb72c38b93d4fbf842a8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9fef848a651b47520cbeb72c38b93d4fbf842a8

Author: Vedran Miletić 
Date:   Wed Dec 21 13:49:36 2016 +0100

clover: Use Clang's diagnostics

Presently errors from frontend are handled only if they occur in
clang::CompilerInvocation::CreateFromArgs(). This patch uses
clang::DiagnosticsEngine to detect errors such as invalid values for
Clang frontend arguments.

Fixes Piglit's cl/program/build/fail/invalid-version-declaration.cl
test.

v2: fix inconsistent code formatting

Signed-off-by: Vedran Miletić 
Reviewed-by: Francisco Jerez 
Tested-by: Aaron Watry 

---

 src/gallium/state_trackers/clover/llvm/invocation.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 675cf19..f63ff3d 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -98,8 +98,9 @@ namespace {
 const std::vector &opts,
 std::string &r_log) {
   std::unique_ptr c { new clang::CompilerInstance 
};
+  clang::TextDiagnosticBuffer *diag_buffer = new 
clang::TextDiagnosticBuffer;
   clang::DiagnosticsEngine diag { new clang::DiagnosticIDs,
-new clang::DiagnosticOptions, new clang::TextDiagnosticBuffer };
+new clang::DiagnosticOptions, diag_buffer };
 
   // Parse the compiler options.  A file name should be present at the end
   // and must have the .cl extension in order for the CompilerInvocation
@@ -111,6 +112,10 @@ namespace {
  c->getInvocation(), copts.data(), copts.data() + copts.size(), 
diag))
  throw invalid_build_options_error();
 
+  diag_buffer->FlushDiagnostics(diag);
+  if (diag.hasErrorOccurred())
+ throw invalid_build_options_error();
+
   c->getTargetOpts().CPU = target.cpu;
   c->getTargetOpts().Triple = target.triple;
   c->getLangOpts().NoBuiltin = true;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): radv: return count of queue families written

2016-12-24 Thread Bas Nieuwenhuizen
Module: Mesa
Branch: master
Commit: 3a30b1a556b1ed7dc60befcec16343e80a3bd77e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a30b1a556b1ed7dc60befcec16343e80a3bd77e

Author: Damien Grassart 
Date:   Sun Dec 25 00:41:45 2016 +0100

radv: return count of queue families written

The Vulkan spec indicates that
vkGetPhysicalDeviceQueueFamilyProperties() should overwrite
pQueueFamilyPropertyCount with the number of structures actually
written to pQueueFamilyProperties.

Signed-off-by: Damien Grassart 
Reviewed-by: Bas Nieuwenhuizen 

---

 src/amd/vulkan/radv_device.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 47be5f7..dcbb015 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -583,8 +583,10 @@ void radv_GetPhysicalDeviceQueueFamilyProperties(
idx++;
}
 
-   if (!all_queues)
+   if (!all_queues) {
+   *pCount = idx;
return;
+   }
 
if (pdevice->rad_info.compute_rings > 0 && pdevice->rad_info.chip_class 
>= CIK) {
if (*pCount > idx) {
@@ -597,6 +599,7 @@ void radv_GetPhysicalDeviceQueueFamilyProperties(
idx++;
}
}
+   *pCount = idx;
 }
 
 void radv_GetPhysicalDeviceMemoryProperties(

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit