On 19.12.2016 23:26, Christian Inci wrote:
Hashcat needs MAX_GLOBAL_BUFFERS to be 21 or even 22 for some modes. It'll 
crash otherwise.
I'm adding an assert to see if programs need it to be even higher.

Signed-off-by: Christian Inci <chris.bug...@broke-the-inter.net>

I'm not too familiar with OpenCL, but shouldn't there be some propagation of the number of bindings to the caller and appropriate error handling? Or is the number of bindings supposed to be adjusted dynamically based on application need?

Either way, this can only serve as a temporary fix. The real bug is still out there somewhere else.


---
 src/gallium/drivers/radeonsi/si_compute.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c 
b/src/gallium/drivers/radeonsi/si_compute.c
index 9d83cb3a..9bad34ed 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -32,7 +32,7 @@
 #include "si_pipe.h"
 #include "sid.h"

-#define MAX_GLOBAL_BUFFERS 20
+#define MAX_GLOBAL_BUFFERS 22

 struct si_compute {
        unsigned ir_type;
@@ -195,6 +195,7 @@ static void si_set_global_binding(
        unsigned i;
        struct si_context *sctx = (struct si_context*)ctx;
        struct si_compute *program = sctx->cs_shader_state.program;
+       assert(n <= MAX_GLOBAL_BUFFERS);

This should check for first + n. I'm going to change this before pushing.

Nicolai


        if (!resources) {
                for (i = first; i < first + n; i++) {

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

Reply via email to