diff options
author | Timothy Arceri <[email protected]> | 2017-12-11 16:16:30 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-01-09 10:21:32 +1100 |
commit | 19f3141e6ab34dc7389b5e1fa9f3dca5e23b2191 (patch) | |
tree | 2103bbb46e16c6e442129de87f9faa9e55482bca /src/gallium | |
parent | 2bd7ab32cfe8ad2ee7469ecb83d9077cd520c537 (diff) |
ac: add load_tess_level() to the abi
Fixes the following piglit tests in radeonsi:
vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
vs-tes-tessinner-tessouter-inputs-quads.shader_test
vs-tes-tessinner-tessouter-inputs-tris.shader_test
v2: make use of si_shader_io_get_unique_index_patch()
via the helper in the previous patch rather than
shader_io_get_unique_index()
Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index e579916359e..86f3f7a8ba2 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1934,6 +1934,27 @@ static LLVMValueRef load_tess_level(struct si_shader_context *ctx, } +static LLVMValueRef si_load_tess_level(struct ac_shader_abi *abi, + unsigned varying_id) +{ + struct si_shader_context *ctx = si_shader_context_from_abi(abi); + unsigned semantic_name; + + switch (varying_id) { + case VARYING_SLOT_TESS_LEVEL_INNER: + semantic_name = TGSI_SEMANTIC_TESSINNER; + break; + case VARYING_SLOT_TESS_LEVEL_OUTER: + semantic_name = TGSI_SEMANTIC_TESSOUTER; + break; + default: + unreachable("unknown tess level"); + } + + return load_tess_level(ctx, semantic_name); + +} + void si_load_system_value(struct si_shader_context *ctx, unsigned index, const struct tgsi_full_declaration *decl) @@ -5971,6 +5992,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx, bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_tes; ctx->abi.load_tess_inputs = si_nir_load_input_tes; ctx->abi.load_tess_coord = si_load_tess_coord; + ctx->abi.load_tess_level = si_load_tess_level; if (shader->key.as_es) ctx->abi.emit_outputs = si_llvm_emit_es_epilogue; else |