<div dir="ltr">Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 7:43 PM, <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Roland Scheidegger <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>><br>
<br>
Ever since introducing separate sampler and sampler view max this was really<br>
missing.<br>
Every driver but llvmpipe reports the same number as number of samplers for<br>
now, so nothing should break.<br>
---<br>
src/gallium/auxiliary/gallivm/lp_bld_limits.h | 2 ++<br>
src/gallium/docs/source/screen.rst | 4 +++-<br>
src/gallium/drivers/freedreno/freedreno_screen.c | 1 +<br>
src/gallium/drivers/i915/i915_screen.c | 2 ++<br>
src/gallium/drivers/ilo/ilo_screen.c | 2 ++<br>
src/gallium/drivers/llvmpipe/lp_screen.c | 5 +++++<br>
src/gallium/drivers/nouveau/nv30/nv30_screen.c | 2 ++<br>
src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++<br>
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 6 ++----<br>
src/gallium/drivers/r300/r300_screen.c | 3 +++<br>
src/gallium/drivers/r600/r600_pipe.c | 1 +<br>
src/gallium/drivers/radeonsi/radeonsi_pipe.c | 1 +<br>
src/gallium/drivers/softpipe/sp_screen.c | 5 +++--<br>
src/gallium/drivers/svga/svga_screen.c | 2 ++<br>
src/gallium/include/pipe/p_defines.h | 3 ++-<br>
15 files changed, 33 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_limits.h b/src/gallium/auxiliary/gallivm/lp_bld_limits.h<br>
index 5675e36..521b45b 100644<br>
--- a/src/gallium/auxiliary/gallivm/lp_bld_limits.h<br>
+++ b/src/gallium/auxiliary/gallivm/lp_bld_limits.h<br>
@@ -112,6 +112,8 @@ gallivm_get_shader_param(enum pipe_shader_cap param)<br>
return 1;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
return PIPE_MAX_SAMPLERS;<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
+ return PIPE_MAX_SHADER_SAMPLER_VIEWS;<br>
case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:<br>
return 1;<br>
default:<br>
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst<br>
index a01f548..035309d 100644<br>
--- a/src/gallium/docs/source/screen.rst<br>
+++ b/src/gallium/docs/source/screen.rst<br>
@@ -247,10 +247,12 @@ to be 0.<br>
BGNSUB, ENDSUB, CAL, and RET, including RET in the main block.<br>
* ``PIPE_SHADER_CAP_INTEGERS``: Whether integer opcodes are supported.<br>
If unsupported, only float opcodes are supported.<br>
-* ``PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS``: THe maximum number of texture<br>
+* ``PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS``: The maximum number of texture<br>
samplers.<br>
* ``PIPE_SHADER_CAP_PREFERRED_IR``: Preferred representation of the<br>
program. It should be one of the ``pipe_shader_ir`` enum values.<br>
+* ``PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS``: The maximum number of texture<br>
+ sampler views. Must not be lower than PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS.<br>
<br>
<br>
.. _pipe_compute_cap:<br>
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c<br>
index 20adf21..5dafa92 100644<br>
--- a/src/gallium/drivers/freedreno/freedreno_screen.c<br>
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c<br>
@@ -323,6 +323,7 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,<br>
*/<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 16;<br>
case PIPE_SHADER_CAP_PREFERRED_IR:<br>
return PIPE_SHADER_IR_TGSI;<br>
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c<br>
index 77607d0..5e1e18d 100644<br>
--- a/src/gallium/drivers/i915/i915_screen.c<br>
+++ b/src/gallium/drivers/i915/i915_screen.c<br>
@@ -106,6 +106,7 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha<br>
case PIPE_SHADER_VERTEX:<br>
switch (cap) {<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))<br>
return PIPE_MAX_SAMPLERS;<br>
else<br>
@@ -151,6 +152,7 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return I915_TEX_UNITS;<br>
default:<br>
debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);<br>
diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c<br>
index a345b70..d6e3f94 100644<br>
--- a/src/gallium/drivers/ilo/ilo_screen.c<br>
+++ b/src/gallium/drivers/ilo/ilo_screen.c<br>
@@ -141,6 +141,8 @@ ilo_get_shader_param(struct pipe_screen *screen, unsigned shader,<br>
return 1;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
return ILO_MAX_SAMPLERS;<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
+ return ILO_MAX_SAMPLER_VIEWS;<br>
case PIPE_SHADER_CAP_PREFERRED_IR:<br>
return PIPE_SHADER_IR_TGSI;<br>
case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:<br>
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c<br>
index f61df98..81ebc69 100644<br>
--- a/src/gallium/drivers/llvmpipe/lp_screen.c<br>
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c<br>
@@ -262,6 +262,11 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe<br>
return PIPE_MAX_SAMPLERS;<br>
else<br>
return 0;<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
+ if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))<br>
+ return PIPE_MAX_SHADER_SAMPLER_VIEWS;<br>
+ else<br>
+ return 0;<br>
default:<br>
return draw_get_shader_param(shader, param);<br>
}<br>
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c<br>
index 807100e..26ff681 100644<br>
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c<br>
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c<br>
@@ -190,6 +190,7 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,<br>
case PIPE_SHADER_CAP_MAX_TEMPS:<br>
return (eng3d->oclass >= NV40_3D_CLASS) ? 32 : 13;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_ADDRS:<br>
return 2;<br>
@@ -228,6 +229,7 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,<br>
case PIPE_SHADER_CAP_MAX_ADDRS:<br>
return (eng3d->oclass >= NV40_3D_CLASS) ? 1 : 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 16;<br>
case PIPE_SHADER_CAP_MAX_PREDS:<br>
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:<br>
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c<br>
index 0ce9e34..f7dfc98 100644<br>
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c<br>
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c<br>
@@ -250,6 +250,8 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
return 1;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ /* The chip could handle more sampler views than samplers */<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return MIN2(32, PIPE_MAX_SAMPLERS);<br>
default:<br>
NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);<br>
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c<br>
index b203089..cc5814e 100644<br>
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c<br>
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c<br>
@@ -253,10 +253,8 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,<br>
return 1;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
return 16; /* would be 32 in linked (OpenGL-style) mode */<br>
- /*<br>
- case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLER_VIEWS:<br>
- return 32;<br>
- */<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
+ return 16; /* XXX not sure if more are really safe */<br>
default:<br>
NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);<br>
return 0;<br>
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c<br>
index 476770a..c21ee68 100644<br>
--- a/src/gallium/drivers/r300/r300_screen.c<br>
+++ b/src/gallium/drivers/r300/r300_screen.c<br>
@@ -238,6 +238,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e<br>
case PIPE_SHADER_CAP_MAX_PREDS:<br>
return is_r500 ? 1 : 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return r300screen->caps.num_tex_units;<br>
case PIPE_SHADER_CAP_MAX_ADDRS:<br>
case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:<br>
@@ -257,6 +258,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e<br>
switch (param)<br>
{<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
case PIPE_SHADER_CAP_SUBROUTINES:<br>
return 0;<br>
default:;<br>
@@ -297,6 +299,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e<br>
case PIPE_SHADER_CAP_SUBROUTINES:<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 0;<br>
case PIPE_SHADER_CAP_PREFERRED_IR:<br>
return PIPE_SHADER_IR_TGSI;<br>
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c<br>
index 633c22a..5e1d262 100644<br>
--- a/src/gallium/drivers/r600/r600_pipe.c<br>
+++ b/src/gallium/drivers/r600/r600_pipe.c<br>
@@ -597,6 +597,7 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
return 1;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 16;<br>
case PIPE_SHADER_CAP_PREFERRED_IR:<br>
if (shader == PIPE_SHADER_COMPUTE) {<br>
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c<br>
index e662e78..1ff8c14 100644<br>
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c<br>
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c<br>
@@ -492,6 +492,7 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e<br>
case PIPE_SHADER_CAP_SUBROUTINES:<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 16;<br>
case PIPE_SHADER_CAP_PREFERRED_IR:<br>
return PIPE_SHADER_IR_TGSI;<br>
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c<br>
index 47ef20e..0ec0aad 100644<br>
--- a/src/gallium/drivers/softpipe/sp_screen.c<br>
+++ b/src/gallium/drivers/softpipe/sp_screen.c<br>
@@ -204,13 +204,14 @@ softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe<br>
case PIPE_SHADER_GEOMETRY:<br>
switch (param) {<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
if (sp_screen->use_llvm)<br>
/* Softpipe doesn't yet know how to tell draw/llvm about textures */<br>
return 0;<br>
- else<br>
+ else<br>
return PIPE_MAX_SAMPLERS;<br>
default:<br>
- if (sp_screen->use_llvm)<br>
+ if (sp_screen->use_llvm)<br>
return draw_get_shader_param(shader, param);<br>
else<br>
return draw_get_shader_param_no_llvm(shader, param);<br>
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c<br>
index c16be16..977dec5 100644<br>
--- a/src/gallium/drivers/svga/svga_screen.c<br>
+++ b/src/gallium/drivers/svga/svga_screen.c<br>
@@ -332,6 +332,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 16;<br>
default:<br>
debug_printf("Unexpected fragment shader query %u\n", param);<br>
@@ -382,6 +383,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en<br>
case PIPE_SHADER_CAP_INTEGERS:<br>
return 0;<br>
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:<br>
+ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:<br>
return 0;<br>
default:<br>
debug_printf("Unexpected vertex shader query %u\n", param);<br>
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h<br>
index db6db32..7e71e77 100644<br>
--- a/src/gallium/include/pipe/p_defines.h<br>
+++ b/src/gallium/include/pipe/p_defines.h<br>
@@ -571,7 +571,8 @@ enum pipe_shader_cap<br>
PIPE_SHADER_CAP_INTEGERS = 17,<br>
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS = 18,<br>
PIPE_SHADER_CAP_PREFERRED_IR = 19,<br>
- PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED = 20<br>
+ PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED = 20,<br>
+ PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS = 21<br>
};<br>
<br>
/**<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>