summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-06-14 03:19:26 +0200
committerMarek Olšák <[email protected]>2014-06-19 00:17:36 +0200
commit1df7199fc933facf2e74304976c3798e474929a1 (patch)
tree207d31eb6a4406f0183c579f2dcf68baded74abb /src/gallium
parent552c70a837b68124a8cd85873d45075fa17659f4 (diff)
gallium: implement ARB_texture_query_levels
The extension is always supported if GLSL 1.30 is supported. Softpipe and llvmpipe support is also added (trivial). Radeon and nouveau support is already done. Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c2
-rw-r--r--src/gallium/docs/source/tgsi.rst6
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 0eaa0204a7f..3d7df3ec912 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2445,7 +2445,7 @@ emit_size_query( struct lp_build_tgsi_soa_context *bld,
bld->bld_base.base.gallivm,
bld->bld_base.int_bld.type,
unit, pipe_target,
- is_sviewinfo,
+ TRUE,
lod_property,
explicit_lod,
sizes_out);
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 2ca3c3bbb5d..2130e0893f8 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -964,7 +964,9 @@ XXX doesn't look like most of the opcodes really belong here.
As per NV_gpu_program4, retrieve the dimensions of the texture depending on
the target. For 1D (width), 2D/RECT/CUBE (width, height), 3D (width, height,
- depth), 1D array (width, layers), 2D array (width, height, layers)
+ depth), 1D array (width, layers), 2D array (width, height, layers).
+ Also return the number of accessible levels (last_level - first_level + 1)
+ in W.
.. math::
@@ -976,6 +978,8 @@ XXX doesn't look like most of the opcodes really belong here.
dst.z = texture\_depth(unit, lod)
+ dst.w = texture\_levels(unit)
+
.. opcode:: TG4 - Texture Gather
As per ARB_texture_gather, gathers the four texels to be used in a bi-linear
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 274e56b40c7..6d97664f97f 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2911,6 +2911,9 @@ sp_get_dims(struct sp_sampler_view *sp_sview, int level,
if (level > view->u.tex.last_level)
return;
+ if (texture->target != PIPE_BUFFER)
+ dims[3] = view->u.tex.last_level - view->u.tex.first_level + 1;
+
dims[0] = u_minify(texture->width0, level);
switch(texture->target) {