case CHIP_PITCAIRN: return "pitcairn";
case CHIP_VERDE: return "verde";
case CHIP_OLAND: return "oland";
-#if HAVE_LLVM <= 0x0303
- default:
- fprintf(stderr, "%s: Unknown chipset = %i, defaulting to Southern Islands\n",
- __func__, family);
- return "SI";
-#else
case CHIP_HAINAN: return "hainan";
case CHIP_BONAIRE: return "bonaire";
case CHIP_KABINI: return "kabini";
return "kabini";
#endif
default: return "";
-#endif
}
}
7 + /* copy */
(4 + desc->element_dw_size) * util_bitcount(desc->dirty_mask) + /* update */
4; /* pointer update */
-#if LLVM_SUPPORTS_GEOM_SHADERS
+
if (desc->shader_userdata_reg >= R_00B130_SPI_SHADER_USER_DATA_VS_0 &&
desc->shader_userdata_reg < R_00B230_SPI_SHADER_USER_DATA_GS_0)
desc->atom.num_dw += 4; /* second pointer update */
-#endif
+
desc->atom.dirty = true;
/* The descriptors are read with the K cache. */
sctx->b.flags |= R600_CONTEXT_INV_CONST_CACHE;
radeon_emit(cs, va);
radeon_emit(cs, va >> 32);
-#if LLVM_SUPPORTS_GEOM_SHADERS
if (desc->shader_userdata_reg >= R_00B130_SPI_SHADER_USER_DATA_VS_0 &&
desc->shader_userdata_reg < R_00B230_SPI_SHADER_USER_DATA_GS_0) {
radeon_emit(cs, PKT3(PKT3_SET_SH_REG, 2, 0));
radeon_emit(cs, va);
radeon_emit(cs, va >> 32);
}
-#endif
}
static void si_emit_descriptors(struct si_context *sctx,
case PIPE_CAP_TEXTURE_MULTISAMPLE:
/* 2D tiling on CIK is supported since DRM 2.35.0 */
- return HAVE_LLVM >= 0x0304 && (sscreen->b.chip_class < CIK ||
- sscreen->b.info.drm_minor >= 35);
+ return sscreen->b.chip_class < CIK ||
+ sscreen->b.info.drm_minor >= 35;
case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
return R600_MAP_BUFFER_ALIGNMENT;
return 4;
case PIPE_CAP_GLSL_FEATURE_LEVEL:
- return (LLVM_SUPPORTS_GEOM_SHADERS) ? 330 : 140;
+ return 330;
case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
return MIN2(sscreen->b.info.vram_size, 0xFFFFFFFF);
{
case PIPE_SHADER_FRAGMENT:
case PIPE_SHADER_VERTEX:
- break;
case PIPE_SHADER_GEOMETRY:
-#if !(LLVM_SUPPORTS_GEOM_SHADERS)
- return 0;
-#endif
break;
case PIPE_SHADER_COMPUTE:
switch (param) {
}
sscreen->b.has_cp_dma = true;
- sscreen->b.has_streamout = HAVE_LLVM >= 0x0304;
+ sscreen->b.has_streamout = true;
if (debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE))
sscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
#define SI_MAX_DRAW_CS_DWORDS 18
-#define LLVM_SUPPORTS_GEOM_SHADERS \
- ((HAVE_LLVM >= 0x0305) || \
- (HAVE_LLVM == 0x0304 && LLVM_VERSION_PATCH >= 1))
-
struct si_pipe_compute;
struct si_screen {
int param_instance_id;
LLVMValueRef const_md;
LLVMValueRef const_resource[SI_NUM_CONST_BUFFERS];
-#if HAVE_LLVM >= 0x0304
LLVMValueRef ddxy_lds;
-#endif
LLVMValueRef *constants[SI_NUM_CONST_BUFFERS];
LLVMValueRef *resources;
LLVMValueRef *samplers;
}
}
-#if HAVE_LLVM >= 0x0304
-
static void si_llvm_emit_ddxy(
const struct lp_build_tgsi_action * action,
struct lp_build_tgsi_context * bld_base,
emit_data->output[0] = lp_build_gather_values(gallivm, result, 4);
}
-#endif /* HAVE_LLVM >= 0x0304 */
-
/* Emit one vertex from the geometry shader */
static void si_llvm_emit_vertex(
const struct lp_build_tgsi_action *action,
default:
LLVMAddAttribute(P, LLVMInRegAttribute);
break;
-#if HAVE_LLVM >= 0x0304
/* We tell llvm that array inputs are passed by value to allow Sinking pass
* to move load. Inputs are constant so this is fine. */
case SI_PARAM_CONST:
case SI_PARAM_RESOURCE:
LLVMAddAttribute(P, LLVMByValAttribute);
break;
-#endif
}
}
-#if HAVE_LLVM >= 0x0304
if (bld_base->info &&
(bld_base->info->opcode_count[TGSI_OPCODE_DDX] > 0 ||
bld_base->info->opcode_count[TGSI_OPCODE_DDY] > 0))
LLVMArrayType(i32, 64),
"ddxy_lds",
LOCAL_ADDR_SPACE);
-#endif
}
static void preload_constants(struct si_shader_context *si_shader_ctx)
bld_base->op_actions[TGSI_OPCODE_TEX2] = tex_action;
bld_base->op_actions[TGSI_OPCODE_TXB] = tex_action;
bld_base->op_actions[TGSI_OPCODE_TXB2] = tex_action;
-#if HAVE_LLVM >= 0x0304
bld_base->op_actions[TGSI_OPCODE_TXD] = tex_action;
-#endif
bld_base->op_actions[TGSI_OPCODE_TXF] = tex_action;
bld_base->op_actions[TGSI_OPCODE_TXL] = tex_action;
bld_base->op_actions[TGSI_OPCODE_TXL2] = tex_action;
bld_base->op_actions[TGSI_OPCODE_TG4] = tex_action;
bld_base->op_actions[TGSI_OPCODE_LODQ] = tex_action;
-#if HAVE_LLVM >= 0x0304
bld_base->op_actions[TGSI_OPCODE_DDX].emit = si_llvm_emit_ddxy;
bld_base->op_actions[TGSI_OPCODE_DDY].emit = si_llvm_emit_ddxy;
-#endif
bld_base->op_actions[TGSI_OPCODE_EMIT].emit = si_llvm_emit_vertex;
bld_base->op_actions[TGSI_OPCODE_ENDPRIM].emit = si_llvm_emit_primitive;
return FALSE;
if (sample_count > 1) {
- if (HAVE_LLVM < 0x0304)
- return FALSE;
-
/* 2D tiling on CIK is supported since DRM 2.35.0 */
if (sscreen->b.chip_class >= CIK && sscreen->b.info.drm_minor < 35)
return FALSE;
return si_create_shader_state(ctx, state, PIPE_SHADER_FRAGMENT);
}
-#if LLVM_SUPPORTS_GEOM_SHADERS
-
static void *si_create_gs_state(struct pipe_context *ctx,
const struct pipe_shader_state *state)
{
return si_create_shader_state(ctx, state, PIPE_SHADER_GEOMETRY);
}
-#endif
-
static void *si_create_vs_state(struct pipe_context *ctx,
const struct pipe_shader_state *state)
{
sctx->vs_shader = sel;
}
-#if LLVM_SUPPORTS_GEOM_SHADERS
-
static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
sctx->gs_shader = sel;
}
-#endif
-
static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
si_delete_shader_selector(ctx, sel);
}
-#if LLVM_SUPPORTS_GEOM_SHADERS
-
static void si_delete_gs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
si_delete_shader_selector(ctx, sel);
}
-#endif
-
static void si_delete_ps_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
si_set_sampler_states(sctx, pm4, count, states,
&sctx->samplers[PIPE_SHADER_VERTEX],
R_00B130_SPI_SHADER_USER_DATA_VS_0);
-#if LLVM_SUPPORTS_GEOM_SHADERS
si_set_sampler_states(sctx, pm4, count, states,
&sctx->samplers[PIPE_SHADER_VERTEX],
R_00B330_SPI_SHADER_USER_DATA_ES_0);
-#endif
si_pm4_set_state(sctx, vs_sampler, pm4);
}
sctx->b.b.bind_fs_state = si_bind_ps_shader;
sctx->b.b.delete_vs_state = si_delete_vs_shader;
sctx->b.b.delete_fs_state = si_delete_ps_shader;
-#if LLVM_SUPPORTS_GEOM_SHADERS
+
sctx->b.b.create_gs_state = si_create_gs_state;
sctx->b.b.bind_gs_state = si_bind_gs_shader;
sctx->b.b.delete_gs_state = si_delete_gs_shader;
-#endif
sctx->b.b.create_sampler_state = si_create_sampler_state;
sctx->b.b.bind_sampler_states = si_bind_sampler_states;