aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/radeon_llvm.h
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2014-10-28 11:28:29 +0900
committerMichel Dänzer <[email protected]>2014-10-29 19:01:25 +0900
commit402ab50bedf9fba7654e63a6f2e808714714284d (patch)
treed7e0802f7fc7ac7eee9d8f8d840bacde9d49de64 /src/gallium/drivers/radeon/radeon_llvm.h
parent0d5f4960a468947f9862bf5de2a71fce63b50cf7 (diff)
radeon/llvm: Dynamically allocate branch/loop stack arrays
This prevents us from silently overflowing the stack arrays, and allows arbitrary stack depths. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85454 Cc: [email protected] Reported-and-Tested-by: Nick Sarnie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/radeon_llvm.h')
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h
index 00714fb6bca..8612ef8daf7 100644
--- a/src/gallium/drivers/radeon/radeon_llvm.h
+++ b/src/gallium/drivers/radeon/radeon_llvm.h
@@ -33,10 +33,10 @@
#define RADEON_LLVM_MAX_INPUTS 32 * 4
#define RADEON_LLVM_MAX_OUTPUTS 32 * 4
-#define RADEON_LLVM_MAX_BRANCH_DEPTH 16
-#define RADEON_LLVM_MAX_LOOP_DEPTH 16
#define RADEON_LLVM_MAX_ARRAYS 16
+#define RADEON_LLVM_INITIAL_CF_DEPTH 4
+
#define RADEON_LLVM_MAX_SYSTEM_VALUES 4
struct radeon_llvm_branch {
@@ -122,11 +122,13 @@ struct radeon_llvm_context {
/*=== Private Members ===*/
- struct radeon_llvm_branch branch[RADEON_LLVM_MAX_BRANCH_DEPTH];
- struct radeon_llvm_loop loop[RADEON_LLVM_MAX_LOOP_DEPTH];
+ struct radeon_llvm_branch *branch;
+ struct radeon_llvm_loop *loop;
unsigned branch_depth;
+ unsigned branch_depth_max;
unsigned loop_depth;
+ unsigned loop_depth_max;
struct tgsi_declaration_range arrays[RADEON_LLVM_MAX_ARRAYS];
unsigned num_arrays;