Re: [Mesa-dev] [PATCH] radv: Fix using more than 4 bound descriptor sets

2017-03-17 Thread Bas Nieuwenhuizen
Pushed, but see my new patch for caveats.

On Thu, Mar 16, 2017 at 6:48 PM, James Legg  wrote:
> Avoid a buffer overflow in ac_nir_to_llvm.c's create_function when
> using more than 4 descriptor sets. radv claims support for 8.
>
> Cc: 17.0 
> ---
>  src/amd/common/ac_nir_to_llvm.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
> index 6c2b78b..bb860e5 100644
> --- a/src/amd/common/ac_nir_to_llvm.h
> +++ b/src/amd/common/ac_nir_to_llvm.h
> @@ -27,6 +27,7 @@
>  #include "llvm-c/Core.h"
>  #include "llvm-c/TargetMachine.h"
>  #include "amd_family.h"
> +#include "../vulkan/radv_descriptor_set.h"
>
>  struct ac_shader_binary;
>  struct ac_shader_config;
> @@ -81,7 +82,8 @@ enum ac_ud_index {
> AC_UD_MAX_UD = AC_UD_VS_MAX_UD,
>  };
>
> -#define AC_UD_MAX_SETS 4
> +// Match MAX_SETS from radv_descriptor_set.h
> +#define AC_UD_MAX_SETS MAX_SETS
>
>  struct ac_userdata_locations {
> struct ac_userdata_info descriptor_sets[AC_UD_MAX_SETS];
> --
> 2.9.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] radv: Fix using more than 4 bound descriptor sets

2017-03-16 Thread James Legg
Avoid a buffer overflow in ac_nir_to_llvm.c's create_function when
using more than 4 descriptor sets. radv claims support for 8.

Cc: 17.0 
---
 src/amd/common/ac_nir_to_llvm.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 6c2b78b..bb860e5 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -27,6 +27,7 @@
 #include "llvm-c/Core.h"
 #include "llvm-c/TargetMachine.h"
 #include "amd_family.h"
+#include "../vulkan/radv_descriptor_set.h"
 
 struct ac_shader_binary;
 struct ac_shader_config;
@@ -81,7 +82,8 @@ enum ac_ud_index {
AC_UD_MAX_UD = AC_UD_VS_MAX_UD,
 };
 
-#define AC_UD_MAX_SETS 4
+// Match MAX_SETS from radv_descriptor_set.h
+#define AC_UD_MAX_SETS MAX_SETS
 
 struct ac_userdata_locations {
struct ac_userdata_info descriptor_sets[AC_UD_MAX_SETS];
-- 
2.9.3

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