mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
ac/llvm: fix image_samples with null descriptors
Fixes various dEQP-VK.robustness.robustness2.* tests. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13251>
This commit is contained in:
parent
ee1f0451a8
commit
2564fbfc57
1 changed files with 12 additions and 0 deletions
|
|
@ -2837,6 +2837,18 @@ static LLVMValueRef visit_image_samples(struct ac_nir_context *ctx, nir_intrinsi
|
|||
LLVMValueRef rsrc = get_image_descriptor(ctx, instr, dynamic_index, AC_DESC_IMAGE, false);
|
||||
|
||||
LLVMValueRef ret = ac_build_image_get_sample_count(&ctx->ac, rsrc);
|
||||
if (ctx->abi->robust_buffer_access) {
|
||||
LLVMValueRef dword1, is_null_descriptor;
|
||||
|
||||
/* Extract the second dword of the descriptor, if it's
|
||||
* all zero, then it's a null descriptor.
|
||||
*/
|
||||
dword1 =
|
||||
LLVMBuildExtractElement(ctx->ac.builder, rsrc, LLVMConstInt(ctx->ac.i32, 1, false), "");
|
||||
is_null_descriptor = LLVMBuildICmp(ctx->ac.builder, LLVMIntEQ, dword1,
|
||||
LLVMConstInt(ctx->ac.i32, 0, false), "");
|
||||
ret = LLVMBuildSelect(ctx->ac.builder, is_null_descriptor, ctx->ac.i32_0, ret, "");
|
||||
}
|
||||
|
||||
return exit_waterfall(ctx, &wctx, ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue