v3dv: implement nir_texop_texture_samples
Fixes: dEQP-VK.glsl.texture_functions.query.texturesamples.* Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:

committed by
Marge Bot

parent
6ee88f0acd
commit
644a15e69e
@@ -609,6 +609,10 @@ ntq_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
|
|||||||
ntq_store_dest(c, &instr->dest, 0,
|
ntq_store_dest(c, &instr->dest, 0,
|
||||||
vir_uniform(c, QUNIFORM_TEXTURE_LEVELS, unit));
|
vir_uniform(c, QUNIFORM_TEXTURE_LEVELS, unit));
|
||||||
return;
|
return;
|
||||||
|
case nir_texop_texture_samples:
|
||||||
|
ntq_store_dest(c, &instr->dest, 0,
|
||||||
|
vir_uniform(c, QUNIFORM_TEXTURE_SAMPLES, unit));
|
||||||
|
return;
|
||||||
case nir_texop_txs:
|
case nir_texop_txs:
|
||||||
ntq_emit_txs(c, instr);
|
ntq_emit_txs(c, instr);
|
||||||
return;
|
return;
|
||||||
@@ -3022,7 +3026,6 @@ vir_check_payload_w(struct v3d_compile *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -241,6 +241,7 @@ enum quniform_contents {
|
|||||||
QUNIFORM_TEXTURE_DEPTH,
|
QUNIFORM_TEXTURE_DEPTH,
|
||||||
QUNIFORM_TEXTURE_ARRAY_SIZE,
|
QUNIFORM_TEXTURE_ARRAY_SIZE,
|
||||||
QUNIFORM_TEXTURE_LEVELS,
|
QUNIFORM_TEXTURE_LEVELS,
|
||||||
|
QUNIFORM_TEXTURE_SAMPLES,
|
||||||
|
|
||||||
QUNIFORM_UBO_ADDR,
|
QUNIFORM_UBO_ADDR,
|
||||||
|
|
||||||
|
@@ -254,6 +254,9 @@ get_texture_size_from_image_view(struct v3dv_image_view *image_view,
|
|||||||
}
|
}
|
||||||
case QUNIFORM_TEXTURE_LEVELS:
|
case QUNIFORM_TEXTURE_LEVELS:
|
||||||
return image_view->max_level - image_view->base_level + 1;
|
return image_view->max_level - image_view->base_level + 1;
|
||||||
|
case QUNIFORM_TEXTURE_SAMPLES:
|
||||||
|
assert(image_view->image);
|
||||||
|
return image_view->image->samples;
|
||||||
default:
|
default:
|
||||||
unreachable("Bad texture size field");
|
unreachable("Bad texture size field");
|
||||||
}
|
}
|
||||||
@@ -395,6 +398,7 @@ v3dv_write_uniforms_wg_offsets(struct v3dv_cmd_buffer *cmd_buffer,
|
|||||||
case QUNIFORM_TEXTURE_DEPTH:
|
case QUNIFORM_TEXTURE_DEPTH:
|
||||||
case QUNIFORM_TEXTURE_ARRAY_SIZE:
|
case QUNIFORM_TEXTURE_ARRAY_SIZE:
|
||||||
case QUNIFORM_TEXTURE_LEVELS:
|
case QUNIFORM_TEXTURE_LEVELS:
|
||||||
|
case QUNIFORM_TEXTURE_SAMPLES:
|
||||||
cl_aligned_u32(&uniforms,
|
cl_aligned_u32(&uniforms,
|
||||||
get_texture_size(cmd_buffer,
|
get_texture_size(cmd_buffer,
|
||||||
pipeline,
|
pipeline,
|
||||||
|
Reference in New Issue
Block a user