diff options
author | Alejandro Piñeiro <[email protected]> | 2018-03-08 12:43:00 +0100 |
---|---|---|
committer | Alejandro Piñeiro <[email protected]> | 2018-03-15 12:08:25 +0100 |
commit | 50767214a790889120975bf0f598996c4f887dfc (patch) | |
tree | 7801e11655931f4dab04766614d4f78dc1a1814e /src/compiler/spirv | |
parent | adf58e59d3d2639ee214087f94bf7a079f8cd9a8 (diff) |
spirv/radv: add AMD_gcn_shader capability, remove current extensions
So now, during spirv_to_nir, it uses the capability instead of the
extension. Note that we are really doing here is treating
SPV_AMD_gcn_shader as other supported extensions. SPV_AMD_gcn_shader
is not the first SPV extension supported. For example, the capability
draw_parameters infers if the extension SPV_KHR_shader_draw_parameters
is supported or not.
This could be seen as counter-intuitive, and that it would be easier
to define which extensions are supported, and based our checks on
that, but we need to take into account that some capabilities are
optional from core, and others came from new extensions.
Also this commit would make the implementation of ARB_spirv_extensions
easier.
v2: AMD_gcn_shader capability renamed to gcn_shader (Daniel Schürmann)
Reviewed-by: Daniel Schürmann <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r-- | src/compiler/spirv/nir_spirv.h | 1 | ||||
-rw-r--r-- | src/compiler/spirv/spirv_to_nir.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h index 2b0bdaec013..a2c40e57d18 100644 --- a/src/compiler/spirv/nir_spirv.h +++ b/src/compiler/spirv/nir_spirv.h @@ -59,7 +59,6 @@ struct spirv_to_nir_options { bool lower_workgroup_access_to_offsets; struct spirv_supported_capabilities caps; - struct spirv_supported_extensions exts; struct { void (*func)(void *private_data, diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index df01f4ff4a3..f06dca90efd 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -376,7 +376,7 @@ vtn_handle_extension(struct vtn_builder *b, SpvOp opcode, if (strcmp((const char *)&w[2], "GLSL.std.450") == 0) { val->ext_handler = vtn_handle_glsl450_instruction; } else if ((strcmp((const char *)&w[2], "SPV_AMD_gcn_shader") == 0) - && (b->options && b->options->exts.AMD_gcn_shader)) { + && (b->options && b->options->caps.gcn_shader)) { val->ext_handler = vtn_handle_amd_gcn_shader_instruction; } else { vtn_fail("Unsupported extension"); |