supports switching the format between sRGB and linear for a surface that is
used as destination in draw and blit calls.
* ``PIPE_CAP_NIR_COMPACT_ARRAYS``: True if the compiler backend supports NIR's compact array feature, for all shader stages.
+* ``PIPE_CAP_MAX_VARYINGS``: The maximum number of fragment shader
+ varyings. This will generally correspond to
+ ``PIPE_SHADER_CAP_MAX_INPUTS`` for the fragment shader, but in some
+ cases may be a smaller number.
.. _pipe_capf:
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return 0;
+ case PIPE_CAP_MAX_VARYINGS:
+ return screen->specs.max_varyings;
+
case PIPE_CAP_PCI_GROUP:
case PIPE_CAP_PCI_BUS:
case PIPE_CAP_PCI_DEVICE:
case PIPE_CAP_MAX_VIEWPORTS:
return 1;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 16;
+
case PIPE_CAP_SHAREABLE_SHADERS:
case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
/* manage the variants for these ourself, to avoid breaking precompile: */
return 0;
case PIPE_CAP_ENDIANNESS:
return PIPE_ENDIAN_LITTLE;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 10;
case PIPE_CAP_VENDOR_ID:
return 0x8086;
return 1;
case PIPE_CAP_CLEAR_TEXTURE:
return 1;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 32;
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
return 2048;
case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
return 8 * 1024 * 1024;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 8;
+
/* supported capabilities */
case PIPE_CAP_ANISOTROPIC_FILTER:
case PIPE_CAP_POINT_SPRITE:
return NV50_MAX_WINDOW_RECTANGLES;
case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
return 16 * 1024 * 1024;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 15;
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
return class_3d >= GM200_3D_CLASS ? 8 : 0;
case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
return 64 * 1024 * 1024;
+ case PIPE_CAP_MAX_VARYINGS:
+ /* NOTE: These only count our slots for GENERIC varyings.
+ * The address space may be larger, but the actual hard limit seems to be
+ * less than what the address space layout permits, so don't add TEXCOORD,
+ * COLOR, etc. here.
+ */
+ return 0x1f0 / 16;
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
return 16;
case PIPE_SHADER_CAP_MAX_INPUTS:
- if (shader == PIPE_SHADER_VERTEX)
- return 32;
- /* NOTE: These only count our slots for GENERIC varyings.
- * The address space may be larger, but the actual hard limit seems to be
- * less than what the address space layout permits, so don't add TEXCOORD,
- * COLOR, etc. here.
- */
- if (shader == PIPE_SHADER_FRAGMENT)
- return 0x1f0 / 16;
- /* Actually this counts CLIPVERTEX, which occupies the last generic slot,
- * and excludes 0x60 per-patch inputs.
- */
return 0x200 / 16;
case PIPE_SHADER_CAP_MAX_OUTPUTS:
return 32;
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
return 4;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 16;
+
default:
return u_pipe_screen_get_param_defaults(screen, param);
}
case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
return 2048;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 10;
+
case PIPE_CAP_VENDOR_ID:
return 0x1002;
case PIPE_CAP_DEVICE_ID:
case PIPE_CAP_MAX_TEXEL_OFFSET:
return 7;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 32;
+
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600;
case PIPE_CAP_ENDIANNESS:
case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
return 30;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 32;
+
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
return sscreen->info.chip_class <= VI ?
PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600 : 0;
return 1;
case PIPE_CAP_CLEAR_TEXTURE:
return 1;
+ case PIPE_CAP_MAX_VARYINGS:
+ return TGSI_EXEC_MAX_INPUT_ATTRIBS;
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
return sws->have_sm4_1 ? 1 : 0; /* only single-channel textures */
+ case PIPE_CAP_MAX_VARYINGS:
+ return sws->have_vgpu10 ? VGPU10_MAX_FS_INPUTS : 10;
/* Unsupported features */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
return 4;
+ case PIPE_CAP_MAX_VARYINGS:
+ return V3D_MAX_FS_INPUTS / 4;
+
/* Texturing. */
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
/* Note: Not supported in hardware, just faking it. */
return 5;
+ case PIPE_CAP_MAX_VARYINGS:
+ return 8;
+
case PIPE_CAP_VENDOR_ID:
return 0x14E4;
case PIPE_CAP_ACCELERATED:
return 1; /* TODO: need to introduce a hw-cap for this */
case PIPE_CAP_QUERY_BUFFER_OBJECT:
return vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_QBO;
+ case PIPE_CAP_MAX_VARYINGS:
+ if (vscreen->caps.caps.v1.glsl_level < 150)
+ return vscreen->caps.caps.v2.max_vertex_attribs;
+ return 32;
case PIPE_CAP_TEXTURE_GATHER_SM5:
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
case PIPE_CAP_FAKE_SW_MSAA:
PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND,
PIPE_CAP_DEST_SURFACE_SRGB_CONTROL,
PIPE_CAP_NIR_COMPACT_ARRAYS,
+ PIPE_CAP_MAX_VARYINGS,
};
/**
c->Program[MESA_SHADER_VERTEX].MaxAttribs =
MIN2(c->Program[MESA_SHADER_VERTEX].MaxAttribs, 16);
- /* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number
- * of inputs. It's always 2 colors + N generic inputs. */
- c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
- PIPE_SHADER_CAP_MAX_INPUTS);
+ c->MaxVarying = screen->get_param(screen, PIPE_CAP_MAX_VARYINGS);
c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
c->MaxGeometryOutputVertices =
screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES);