struct gallivm_state;
struct lp_derivatives;
struct lp_build_tgsi_gs_iface;
-
+struct lp_build_coro_suspend_info;
enum lp_build_tex_modifier {
LP_BLD_TEX_MODIFIER_NONE = 0,
LLVMValueRef ssbo_sizes_ptr;
const struct lp_build_image_soa *image;
LLVMValueRef shared_ptr;
+ const struct lp_build_coro_suspend_info *coro;
};
void
LLVMValueRef shared_ptr;
+ const struct lp_build_coro_suspend_info *coro;
+
const struct lp_build_sampler_soa *sampler;
const struct lp_build_image_soa *image;
#include "lp_bld_misc.h"
#include "lp_bld_swizzle.h"
#include "lp_bld_flow.h"
+#include "lp_bld_coro.h"
#include "lp_bld_quad.h"
#include "lp_bld_tgsi.h"
#include "lp_bld_limits.h"
}
}
+static void
+barrier_emit(
+ const struct lp_build_tgsi_action * action,
+ struct lp_build_tgsi_context * bld_base,
+ struct lp_build_emit_data * emit_data)
+{
+ struct lp_build_tgsi_soa_context *bld = lp_soa_context(bld_base);
+ struct gallivm_state * gallivm = bld_base->base.gallivm;
+
+ LLVMBasicBlockRef resume = lp_build_insert_new_block(gallivm, "resume");
+
+ lp_build_coro_suspend_switch(gallivm, bld->coro, resume, false);
+ LLVMPositionBuilderAtEnd(gallivm->builder, resume);
+}
+
static void
membar_emit(
const struct lp_build_tgsi_action * action,
bld.thread_data_ptr = params->thread_data_ptr;
bld.image = params->image;
bld.shared_ptr = params->shared_ptr;
+ bld.coro = params->coro;
/*
* If the number of temporaries is rather large then we just
bld.bld_base.op_actions[TGSI_OPCODE_ATOMIMAX].emit = atomic_emit;
bld.bld_base.op_actions[TGSI_OPCODE_MEMBAR].emit = membar_emit;
+ bld.bld_base.op_actions[TGSI_OPCODE_BARRIER].emit = barrier_emit;
+
if (params->gs_iface) {
/* There's no specific value for this because it should always
* be set, but apps using ext_geometry_shader4 quite often