return 1;
case PIPE_SHADER_CAP_INTEGERS:
return 1;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return PIPE_MAX_SAMPLERS;
default:
return 0;
}
cell_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return CELL_MAX_SAMPLERS;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return CELL_MAX_SAMPLERS;
case PIPE_CAP_NPOT_TEXTURES:
switch(shader)
{
case PIPE_SHADER_FRAGMENT:
- return tgsi_exec_get_shader_param(param);
+ switch (param) {
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return CELL_MAX_SAMPLERS;
+ default:
+ return tgsi_exec_get_shader_param(param);
+ }
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
return draw_get_shader_param(shader, param);
return is->debug.lie ? 1 : 0;
/* Texturing. */
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 8;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 0;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return I915_MAX_TEXTURE_2D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
{
switch(shader) {
case PIPE_SHADER_VERTEX:
- return draw_get_shader_param(shader, cap);
+ switch (cap) {
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 0;
+ default:
+ return draw_get_shader_param(shader, cap);
+ }
case PIPE_SHADER_FRAGMENT:
break;
default:
return 0;
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 8;
default:
debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
return 0;
brw_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return 8;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 8;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 16; /* XXX correct? */
case PIPE_CAP_NPOT_TEXTURES:
return 1;
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 8;
default:
assert(0);
return 0;
llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return PIPE_MAX_SAMPLERS;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- /* At this time, the draw module and llvmpipe driver only
- * support vertex shader texture lookups when LLVM is enabled in
- * the draw module.
- */
- if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
- return PIPE_MAX_VERTEX_SAMPLERS;
- else
- return 0;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
case PIPE_CAP_NPOT_TEXTURES:
return tgsi_exec_get_shader_param(param);
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
- return draw_get_shader_param(shader, param);
+ switch (param) {
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ /* At this time, the draw module and llvmpipe driver only
+ * support vertex shader texture lookups when LLVM is enabled in
+ * the draw module.
+ */
+ if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
+ return PIPE_MAX_VERTEX_SAMPLERS;
+ else
+ return 0;
+ default:
+ return draw_get_shader_param(shader, param);
+ }
default:
return 0;
}
nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 32;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 64;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return 0; /* please inline, or provide function declarations */
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 32;
default:
NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);
return 0;
nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 32;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 64;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return 1; /* but inlining everything, we need function declarations */
case PIPE_SHADER_CAP_INTEGERS:
return 1;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 32;
default:
NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);
return 0;
struct nvfx_screen *screen = nvfx_screen(pscreen);
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return 16;
case PIPE_CAP_NPOT_TEXTURES:
return screen->advertise_npot;
case PIPE_CAP_TWO_SIDED_STENCIL:
return 13;
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
return !!screen->use_nv4x;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- return 0; /* We have 4 on nv40 - but unsupported currently */
case PIPE_CAP_BLEND_EQUATION_SEPARATE:
return screen->advertise_blend_equation_separate;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 0;
case PIPE_SHADER_CAP_SUBROUTINES:
return screen->use_nv4x ? 1 : 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 16;
default:
break;
}
return 1;
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 0; /* We have 4 on nv40 - but unsupported currently */
default:
break;
}
case PIPE_CAP_TGSI_INSTANCEID:
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
case PIPE_CAP_SEAMLESS_CUBE_MAP:
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
case PIPE_CAP_SCALED_RESOLVE:
return !r300screen->caps.has_tcl;
/* Texturing. */
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return r300screen->caps.num_tex_units;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
case PIPE_SHADER_CAP_SUBROUTINES:
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return r300screen->caps.num_tex_units;
}
break;
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR:
case PIPE_SHADER_CAP_SUBROUTINES:
case PIPE_SHADER_CAP_INTEGERS:
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
return 0;
}
break;
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
return rscreen->info.drm_minor >= 9 ?
(family >= CHIP_CEDAR ? 16384 : 8192) : 0;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return 16;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 32;
return 0;
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 16;
default:
return 0;
}
softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
switch (param) {
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return PIPE_MAX_SAMPLERS;
- case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
-#ifdef HAVE_LLVM
- /* Softpipe doesn't yet know how to tell draw/llvm about textures */
- return 0;
-#else
- return PIPE_MAX_VERTEX_SAMPLERS;
-#endif
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
case PIPE_CAP_NPOT_TEXTURES:
return tgsi_exec_get_shader_param(param);
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
- return draw_get_shader_param(shader, param);
+ switch (param) {
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+#ifdef HAVE_LLVM
+ /* Softpipe doesn't yet know how to tell draw/llvm about textures */
+ return 0;
+#else
+ return PIPE_MAX_VERTEX_SAMPLERS;
+#endif
+ default:
+ return draw_get_shader_param(shader, param);
+ }
default:
return 0;
}
case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
return 16.0;
- case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
- return 16;
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
return 16;
case PIPE_CAP_NPOT_TEXTURES:
return 0;
case PIPE_SHADER_CAP_INTEGERS:
return 0;
+ case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
+ return 16;
}
break;
case PIPE_SHADER_VERTEX:
* pipe_screen::get_param() and pipe_screen::get_paramf().
*/
enum pipe_cap {
- PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS = 0,
PIPE_CAP_NPOT_TEXTURES = 1,
PIPE_CAP_TWO_SIDED_STENCIL = 2,
PIPE_CAP_GLSL = 3, /* XXX need something better */
PIPE_CAP_GUARD_BAND_RIGHT = 23, /*< float */
PIPE_CAP_GUARD_BAND_BOTTOM = 24, /*< float */
PIPE_CAP_TEXTURE_MIRROR_CLAMP = 25,
- PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS = 27,
PIPE_CAP_BLEND_EQUATION_SEPARATE = 28,
PIPE_CAP_SM3 = 29, /*< Shader Model, supported */
PIPE_CAP_STREAM_OUTPUT = 30,
PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR = 14,
PIPE_SHADER_CAP_INDIRECT_CONST_ADDR = 15,
PIPE_SHADER_CAP_SUBROUTINES = 16, /* BGNSUB, ENDSUB, CAL, RET */
- PIPE_SHADER_CAP_INTEGERS = 17
+ PIPE_SHADER_CAP_INTEGERS = 17,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS = 18
};
}
screen_caps.stages_with_sampling = (1 << screen_caps.stages) - 1;
- if(!screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS))
+ if(!screen->get_shader_param(screen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS))
screen_caps.stages_with_sampling &=~ (1 << PIPE_SHADER_VERTEX);
memset(format_support, 0xff, sizeof(format_support));
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
c->MaxTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
+ = _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_TEXTURE_IMAGE_UNITS);
c->MaxVertexTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS),
+ = _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_VERTEX_TEXTURE_IMAGE_UNITS);
c->MaxCombinedTextureImageUnits