1/*
2 * Copyright © 2018 Broadcom
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#include "pipe/p_screen.h"
25#include "util/u_screen.h"
26
27/**
28 * Helper to use from a pipe_screen->get_param() implementation to return
29 * default values for unsupported PIPE_CAPs.
30 *
31 * Call this function from your pipe_screen->get_param() implementation's
32 * default case, so that implementors of new pipe caps don't need to
33 */
34int
35u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
36                                 enum pipe_cap param)
37{
38   assert(param < PIPE_CAP_LAST);
39
40   /* Let's keep these sorted by position in p_defines.h. */
41   switch (param) {
42   case PIPE_CAP_NPOT_TEXTURES:
43   case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
44   case PIPE_CAP_ANISOTROPIC_FILTER:
45   case PIPE_CAP_POINT_SPRITE:
46      return 0;
47
48   case PIPE_CAP_GRAPHICS:
49   case PIPE_CAP_GL_CLAMP:
50   case PIPE_CAP_MAX_RENDER_TARGETS:
51      return 1;
52
53   case PIPE_CAP_OCCLUSION_QUERY:
54   case PIPE_CAP_QUERY_TIME_ELAPSED:
55   case PIPE_CAP_TEXTURE_SWIZZLE:
56      return 0;
57
58   case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
59   case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
60   case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
61      unreachable("driver must implement these.");
62
63   case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
64   case PIPE_CAP_BLEND_EQUATION_SEPARATE:
65   case PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD:
66   case PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES:
67   case PIPE_CAP_VERTEX_SHADER_SATURATE:
68   case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS: /* enables EXT_transform_feedback */
69   case PIPE_CAP_PRIMITIVE_RESTART:
70   case PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX:
71   case PIPE_CAP_INDEP_BLEND_ENABLE:
72   case PIPE_CAP_INDEP_BLEND_FUNC:
73   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: /* Enables GL_EXT_texture_array */
74   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
75   case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
76   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
77   case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
78   case PIPE_CAP_DEPTH_CLIP_DISABLE:
79   case PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE:
80   case PIPE_CAP_DEPTH_CLAMP_ENABLE:
81   case PIPE_CAP_SHADER_STENCIL_EXPORT:
82   case PIPE_CAP_TGSI_INSTANCEID:
83   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
84   case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
85   case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
86   case PIPE_CAP_SEAMLESS_CUBE_MAP:
87   case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
88   case PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND:
89      return 0;
90
91   case PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART:
92   case PIPE_CAP_SUPPORTED_PRIM_MODES:
93      return BITFIELD_MASK(PIPE_PRIM_MAX);
94
95   case PIPE_CAP_MIN_TEXEL_OFFSET:
96      /* GL 3.x minimum value. */
97      return -8;
98   case PIPE_CAP_MAX_TEXEL_OFFSET:
99      return 7;
100
101   case PIPE_CAP_CONDITIONAL_RENDER:
102   case PIPE_CAP_TEXTURE_BARRIER:
103      return 0;
104
105   case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
106      /* GL_EXT_transform_feedback minimum value. */
107      return 4;
108   case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
109      return 64;
110
111   case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
112   case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
113   case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
114   case PIPE_CAP_VERTEX_COLOR_CLAMPED:
115      return 0;
116
117   case PIPE_CAP_GLSL_FEATURE_LEVEL:
118   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
119      /* Minimum GLSL level implemented by gallium drivers. */
120      return 120;
121
122   case PIPE_CAP_ESSL_FEATURE_LEVEL:
123      /* Tell gallium frontend to fallback to PIPE_CAP_GLSL_FEATURE_LEVEL */
124      return 0;
125
126   case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
127   case PIPE_CAP_USER_VERTEX_BUFFERS:
128   case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
129   case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
130   case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
131   case PIPE_CAP_COMPUTE:
132      return 0;
133
134   case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
135      /* GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT default value. */
136      return 1;
137
138   case PIPE_CAP_START_INSTANCE:
139   case PIPE_CAP_QUERY_TIMESTAMP:
140   case PIPE_CAP_TEXTURE_MULTISAMPLE:
141      return 0;
142
143   case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
144      /* GL_ARB_map_buffer_alignment minimum value. All drivers expose the
145       * extension.
146       */
147      return 64;
148
149   case PIPE_CAP_CUBE_MAP_ARRAY:
150   case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
151      return 0;
152
153   case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
154      /* GL_EXT_texture_buffer minimum value. */
155      return 256;
156
157   case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
158   case PIPE_CAP_TGSI_TEXCOORD:
159   case PIPE_CAP_TEXTURE_BUFFER_SAMPLER:
160      return 0;
161
162   case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
163      return 1;
164
165   case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
166   case PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE:
167   case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
168      return 0;
169
170   case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
171      /* GL_EXT_texture_buffer minimum value. */
172      return 65536;
173
174   case PIPE_CAP_MAX_VIEWPORTS:
175      return 1;
176
177   case PIPE_CAP_ENDIANNESS:
178      return PIPE_ENDIAN_LITTLE;
179
180   case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
181   case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
182   case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
183   case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
184   case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS: /* Enables ARB_texture_gather */
185   case PIPE_CAP_TEXTURE_GATHER_SM5:
186   case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
187   case PIPE_CAP_FAKE_SW_MSAA:
188   case PIPE_CAP_TEXTURE_QUERY_LOD:
189      return 0;
190
191   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
192      return -8;
193   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
194      return 7;
195
196   case PIPE_CAP_SAMPLE_SHADING:
197   case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
198   case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
199   case PIPE_CAP_MAX_VERTEX_STREAMS:
200   case PIPE_CAP_DRAW_INDIRECT:
201   case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
202      return 0;
203
204   case PIPE_CAP_VENDOR_ID:
205   case PIPE_CAP_DEVICE_ID:
206      return 0xffffffff;
207
208   case PIPE_CAP_ACCELERATED:
209   case PIPE_CAP_VIDEO_MEMORY:
210   case PIPE_CAP_UMA:
211      unreachable("driver must implement these.");
212
213   case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
214      return 0;
215
216   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
217      /* GL minimum value */
218      return 2048;
219
220   case PIPE_CAP_SAMPLER_VIEW_TARGET:
221   case PIPE_CAP_CLIP_HALFZ:
222   case PIPE_CAP_VERTEXID_NOBASE:
223   case PIPE_CAP_POLYGON_OFFSET_CLAMP:
224   case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
225   case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
226   case PIPE_CAP_RESOURCE_FROM_USER_MEMORY_COMPUTE_ONLY:
227   case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
228   case PIPE_CAP_DEVICE_PROTECTED_CONTENT:
229   case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
230   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
231   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
232   case PIPE_CAP_DEPTH_BOUNDS_TEST:
233   case PIPE_CAP_TGSI_TXQS:
234   case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
235      return 0;
236
237   /* All drivers should expose this cap, as it is required for applications to
238    * be able to efficiently compile GL shaders from multiple threads during
239    * load.
240    */
241   case PIPE_CAP_SHAREABLE_SHADERS:
242      return 1;
243
244   case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
245   case PIPE_CAP_CLEAR_TEXTURE:
246   case PIPE_CAP_CLEAR_SCISSORED:
247   case PIPE_CAP_DRAW_PARAMETERS:
248   case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
249   case PIPE_CAP_MULTI_DRAW_INDIRECT:
250   case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS:
251   case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
252   case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
253   case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
254      return 0;
255
256   case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
257      /* Enables GL_ARB_shader_storage_buffer_object */
258      return 0;
259
260   case PIPE_CAP_INVALIDATE_BUFFER:
261   case PIPE_CAP_GENERATE_MIPMAP:
262   case PIPE_CAP_STRING_MARKER:
263   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
264   case PIPE_CAP_QUERY_BUFFER_OBJECT:
265   case PIPE_CAP_QUERY_MEMORY_INFO: /* Enables GL_ATI_meminfo */
266      return 0;
267
268   case PIPE_CAP_PCI_GROUP:
269   case PIPE_CAP_PCI_BUS:
270   case PIPE_CAP_PCI_DEVICE:
271   case PIPE_CAP_PCI_FUNCTION:
272      unreachable("driver must implement these.");
273
274   case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
275   case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
276   case PIPE_CAP_CULL_DISTANCE:
277   case PIPE_CAP_TGSI_VOTE:
278   case PIPE_CAP_MAX_WINDOW_RECTANGLES: /* Enables EXT_window_rectangles */
279   case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
280   case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
281   case PIPE_CAP_VIEWPORT_SWIZZLE:
282   case PIPE_CAP_VIEWPORT_MASK:
283   case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
284   case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
285   case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
286   case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
287   case PIPE_CAP_NATIVE_FENCE_FD:
288      return 0;
289
290   case PIPE_CAP_RASTERIZER_SUBPIXEL_BITS:
291      return 4; /* GLES 2.0 minimum value */
292
293   case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
294   case PIPE_CAP_PREFER_BACK_BUFFER_REUSE:
295      return 1;
296
297   case PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS:
298      return 0;
299
300   case PIPE_CAP_FBFETCH:
301   case PIPE_CAP_FBFETCH_COHERENT:
302   case PIPE_CAP_BLEND_EQUATION_ADVANCED:
303   case PIPE_CAP_TGSI_MUL_ZERO_WINS:
304   case PIPE_CAP_DOUBLES:
305   case PIPE_CAP_INT64:
306   case PIPE_CAP_INT64_DIVMOD:
307   case PIPE_CAP_TGSI_TEX_TXF_LZ:
308   case PIPE_CAP_TGSI_CLOCK:
309   case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
310   case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
311   case PIPE_CAP_TGSI_BALLOT:
312   case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
313   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
314   case PIPE_CAP_TGSI_DIV:
315   case PIPE_CAP_NIR_ATOMICS_AS_DEREF:
316      return 0;
317
318   case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
319      /* Drivers generally support this, and it reduces GL overhead just to
320       * throw an error when buffers are mapped.
321       */
322      return 1;
323
324   case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
325      /* Don't unset this unless your driver can do better */
326      return 1;
327
328   case PIPE_CAP_POST_DEPTH_COVERAGE:
329   case PIPE_CAP_BINDLESS_TEXTURE:
330   case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
331   case PIPE_CAP_NIR_COMPACT_ARRAYS:
332   case PIPE_CAP_QUERY_SO_OVERFLOW:
333   case PIPE_CAP_MEMOBJ:
334   case PIPE_CAP_LOAD_CONSTBUF:
335   case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
336   case PIPE_CAP_TILE_RASTER_ORDER:
337      return 0;
338
339   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
340      /* nonzero overrides defaults */
341      return 0;
342
343   case PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS:
344   case PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET:
345   case PIPE_CAP_CONTEXT_PRIORITY_MASK:
346   case PIPE_CAP_FENCE_SIGNAL:
347   case PIPE_CAP_CONSTBUF0_FLAGS:
348   case PIPE_CAP_PACKED_UNIFORMS:
349   case PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_TRIANGLES:
350   case PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_POINTS_LINES:
351   case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
352   case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_POINTS_LINES:
353   case PIPE_CAP_MAX_CONSERVATIVE_RASTER_SUBPIXEL_PRECISION_BIAS:
354   case PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE:
355   case PIPE_CAP_CONSERVATIVE_RASTER_INNER_COVERAGE:
356   case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
357   case PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS:
358   case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS:
359   case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS:
360   case PIPE_CAP_TGSI_ATOMFADD:
361   case PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS:
362   case PIPE_CAP_IMAGE_LOAD_FORMATTED:
363   case PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA:
364   case PIPE_CAP_FRAGMENT_SHADER_INTERLOCK:
365   case PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED:
366   case PIPE_CAP_ATOMIC_FLOAT_MINMAX:
367   case PIPE_CAP_SHADER_SAMPLES_IDENTICAL:
368   case PIPE_CAP_TGSI_ATOMINC_WRAP:
369   case PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE:
370   case PIPE_CAP_GLSL_ZERO_INIT:
371      return 0;
372
373   case PIPE_CAP_MAX_GS_INVOCATIONS:
374      return 32;
375
376   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
377      return 1 << 27;
378
379   case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
380   case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
381      return 0;
382
383   case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET:
384      return 2047;
385
386   case PIPE_CAP_SURFACE_SAMPLE_COUNT:
387      return 0;
388   case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL:
389      return 1;
390
391   case PIPE_CAP_MAX_VARYINGS:
392      return 8;
393
394   case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
395      return 0;
396
397   case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
398      return 0;
399
400   case PIPE_CAP_THROTTLE:
401      return 1;
402
403   case PIPE_CAP_TEXTURE_SHADOW_LOD:
404      return 0;
405
406   case PIPE_CAP_GL_SPIRV:
407   case PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS:
408      return 0;
409
410   case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
411      return 0;
412
413   case PIPE_CAP_DMABUF:
414#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
415      return 1;
416#else
417      return 0;
418#endif
419
420   case PIPE_CAP_TEXTURE_SHADOW_MAP: /* Enables ARB_shadow */
421      return 1;
422
423   case PIPE_CAP_FLATSHADE:
424   case PIPE_CAP_ALPHA_TEST:
425   case PIPE_CAP_POINT_SIZE_FIXED:
426   case PIPE_CAP_TWO_SIDED_COLOR:
427   case PIPE_CAP_CLIP_PLANES:
428      return 1;
429
430   case PIPE_CAP_MAX_VERTEX_BUFFERS:
431      return 16;
432
433   case PIPE_CAP_OPENCL_INTEGER_FUNCTIONS:
434   case PIPE_CAP_INTEGER_MULTIPLY_32X16:
435      return 0;
436   case PIPE_CAP_NIR_IMAGES_AS_DEREF:
437      return 1;
438
439   case PIPE_CAP_FRONTEND_NOOP:
440      /* Enables INTEL_blackhole_render */
441      return 0;
442
443   case PIPE_CAP_PACKED_STREAM_OUTPUT:
444      return 1;
445
446   case PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED:
447   case PIPE_CAP_PSIZ_CLAMPED:
448   case PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE:
449      return 0;
450
451   case PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE:
452      return 512 * 1024;
453
454   case PIPE_CAP_SYSTEM_SVM:
455   case PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL:
456   case PIPE_CAP_NO_CLIP_ON_COPY_TEX:
457   case PIPE_CAP_MAX_TEXTURE_MB:
458   case PIPE_CAP_PREFER_REAL_BUFFER_IN_CONSTBUF0:
459      return 0;
460
461   case PIPE_CAP_TEXRECT:
462      return 1;
463
464   case PIPE_CAP_SHADER_ATOMIC_INT64:
465      return 0;
466
467   case PIPE_CAP_SAMPLER_REDUCTION_MINMAX:
468   case PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB:
469      return 0;
470
471   case PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH:
472      return 1;
473
474   case PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART:
475   case PIPE_CAP_DRAW_VERTEX_STATE:
476      return 0;
477
478   default:
479      unreachable("bad PIPE_CAP_*");
480   }
481}
482