zink: NV_compute_shader_derivatives

nothing complicated here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12120>
This commit is contained in:
Mike Blumenkrantz 2021-05-26 11:25:21 -04:00 committed by Marge Bot
parent c71287e70c
commit 7f0e213a57
3 changed files with 15 additions and 0 deletions

View file

@ -4654,6 +4654,14 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
spirv_builder_emit_name(&ctx.builder, ctx.local_group_size_var, "gl_LocalGroupSize");
spirv_builder_emit_builtin(&ctx.builder, ctx.local_group_size_var, SpvBuiltInWorkgroupSize);
}
if (s->info.cs.derivative_group) {
SpvCapability caps[] = { 0, SpvCapabilityComputeDerivativeGroupQuadsNV, SpvCapabilityComputeDerivativeGroupLinearNV };
SpvExecutionMode modes[] = { 0, SpvExecutionModeDerivativeGroupQuadsNV, SpvExecutionModeDerivativeGroupLinearNV };
spirv_builder_emit_extension(&ctx.builder, "SPV_NV_compute_shader_derivatives");
spirv_builder_emit_cap(&ctx.builder, caps[s->info.cs.derivative_group]);
spirv_builder_emit_exec_mode(&ctx.builder, entry_point, modes[s->info.cs.derivative_group]);
ctx.explicit_lod = false;
}
break;
default:
break;

View file

@ -224,6 +224,10 @@ EXTENSIONS = [
alias="portability_subset",
features=True,
guard=True),
Extension("VK_NV_compute_shader_derivatives",
alias="shader_derivs",
features=True,
conditions=["$feats.computeDerivativeGroupQuads", "$feats.computeDerivativeGroupLinear"]),
Extension("VK_KHR_timeline_semaphore",
alias="timeline",
features=True),

View file

@ -618,6 +618,9 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_VERTEX_STREAMS:
return screen->info.tf_props.maxTransformFeedbackStreams;
case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
return screen->info.have_NV_compute_shader_derivatives;
case PIPE_CAP_INT64:
case PIPE_CAP_INT64_DIVMOD:
case PIPE_CAP_DOUBLES: