summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-09-03 06:45:04 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-09-03 06:45:04 +0000
commit503988bc5f236336c432bb16698c4687e482ce16 (patch)
tree23734db9fb1a7017821b1491d76138b635687252 /lib/mesa/src/gallium/drivers/radeonsi
parent526c85132de0a63a11dddc6e59ac67c94d2e0959 (diff)
Import Mesa 20.1.7
Diffstat (limited to 'lib/mesa/src/gallium/drivers/radeonsi')
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_debug_options.h1
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_get.c1
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm.c1
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c8
4 files changed, 10 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_debug_options.h b/lib/mesa/src/gallium/drivers/radeonsi/si_debug_options.h
index 83c7425e0..febb31357 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_debug_options.h
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_debug_options.h
@@ -7,5 +7,6 @@ OPT_BOOL(halt_shaders, false, "Halt shaders at the start (will hang)")
OPT_BOOL(vs_fetch_always_opencode, false,
"Always open code vertex fetches (less efficient, purely for testing)")
OPT_BOOL(prim_restart_tri_strips_only, false, "Only enable primitive restart for triangle strips")
+OPT_BOOL(clamp_div_by_zero, false, "Clamp div by zero (x / 0 becomes FLT_MAX instead of NaN)")
#undef OPT_BOOL
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_get.c b/lib/mesa/src/gallium/drivers/radeonsi/si_get.c
index 9a10a82e0..9b47fe236 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_get.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_get.c
@@ -162,6 +162,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES:
case PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL:
case PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE:
+ case PIPE_CAP_NO_CLIP_ON_COPY_TEX:
return 1;
case PIPE_CAP_QUERY_SO_OVERFLOW:
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm.c b/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm.c
index 63c9c033a..e200114ef 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm.c
@@ -452,6 +452,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
ctx->abi.inputs = &ctx->inputs[0];
ctx->abi.clamp_shadow_reference = true;
ctx->abi.robust_buffer_access = true;
+ ctx->abi.clamp_div_by_zero = ctx->screen->options.clamp_div_by_zero;
if (ctx->shader->selector->info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE]) {
assert(gl_shader_stage_is_compute(nir->info.stage));
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
index 5dba98599..26b0d0cb5 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
@@ -513,7 +513,7 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_
{
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
struct si_shader_info *info = &ctx->shader->selector->info;
- const unsigned component = var->data.location_frac;
+ unsigned component = var->data.location_frac;
unsigned driver_location = var->data.driver_location;
LLVMValueRef dw_addr, stride;
LLVMValueRef buffer, base, addr;
@@ -521,6 +521,12 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_
bool skip_lds_store;
bool is_tess_factor = false, is_tess_inner = false;
+ if (var->data.compact) {
+ component += const_index;
+ writemask <<= const_index;
+ const_index = 0;
+ }
+
driver_location = driver_location / 4;
ubyte name = info->output_semantic_name[driver_location];
ubyte index = info->output_semantic_index[driver_location];