gallivm: Use an accurate log2 implementation for lodq

The fast implementation can be off by a lot for small values.

Fixes:

dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.compute.lod_op.query.linear.16_1_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.compute.lod_op.query.linear.16_1_1.mip_1
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.compute.lod_op.query.linear.4_4_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.compute.lod_op.query.linear.4_4_1.mip_1
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.lod_op.query.linear.16_1_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.lod_op.query.linear.16_1_1.mip_1
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.lod_op.query.linear.4_4_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.lod_op.query.linear.4_4_1.mip_1
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.task.lod_op.query.linear.16_1_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.task.lod_op.query.linear.16_1_1.mip_1
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.task.lod_op.query.linear.4_4_1.mip_0
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.task.lod_op.query.linear.4_4_1.mip_1

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31056>
This commit is contained in:
Konstantin Seurer 2024-09-06 10:55:39 +02:00 committed by Marge Bot
parent fcebbfc399
commit eac613bc70
2 changed files with 6 additions and 14 deletions

View file

@ -924,14 +924,14 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
}
}
if (0) {
/* get more accurate results if we just sqaure rho always */
if (!rho_squared)
rho = lp_build_mul(lodf_bld, rho, rho);
if (is_lodq)
lod = lp_build_log2(lodf_bld, rho);
} else {
/* get more accurate results if we just sqaure rho always */
if (!rho_squared)
rho = lp_build_mul(lodf_bld, rho, rho);
else
lod = lp_build_fast_log2(lodf_bld, rho);
}
/* log2(x^2) == 0.5*log2(x) */
lod = lp_build_mul(lodf_bld, lod,

View file

@ -820,9 +820,6 @@ dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8b8a8_unorm.
dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8b8a8_unorm.input.load.dont_care.clear_draw,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.unused_attachment.loadopclear.storeopdontcare.stencilloadopdontcare.stencilstoreopdontcare,Fail
dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1d_fixed_fragment,Fail
dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1darray_fixed_fragment,Fail
dEQP-VK.ray_query.builtin.instanceid.frag.aabbs,Crash
dEQP-VK.ray_query.builtin.primitiveid.frag.triangles,Crash
dEQP-VK.ray_query.multiple_ray_queries.fragment_shader,Crash
@ -865,11 +862,6 @@ nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8
nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.formats.r8g8_unorm.input.load.dont_care.draw,Fail
nir-stress=dEQP-VK.dynamic_rendering.primary_cmd_buff.suballocation.unused_attachment.loadopdontcare.storeopdontcare.stencilloadopdontcare.stencilstoreopdontcare,Fail
# Regression from a commit in ed64ecca...e1a53d41
dEQP-VK.glsl.texture_functions.query.texturequerylod.isampler1d_fragment,Fail
dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1d_float_fragment,Fail
dEQP-VK.glsl.texture_functions.query.texturequerylod.usampler1d_fragment,Fail
# New fails in 1.3.10.0
dEQP-VK.ray_query.builtin.instancecustomindex.frag.aabbs,Crash
dEQP-VK.ray_query.builtin.objecttoworld.frag.aabbs,Crash