case PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE:
case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
case PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS:
+ case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS:
+ case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS:
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
* ``PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS``: Maximum total number of shader
buffers. A value of 0 means the sum of all per-shader stage maximums (see
``PIPE_SHADER_CAP_MAX_SHADER_BUFFERS``).
+* ``PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS``: Maximum total number of atomic
+ counters. A value of 0 means the default value (MAX_ATOMIC_COUNTERS = 4096).
+* ``PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS``: Maximum total number of
+ atomic counter buffers. A value of 0 means the sum of all per-shader stage
+ maximums (see ``PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS``).
.. _pipe_capf:
return rscreen->b.info.pci_dev;
case PIPE_CAP_PCI_FUNCTION:
return rscreen->b.info.pci_func;
+
+ case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS:
+ if (rscreen->b.family >= CHIP_CEDAR && rscreen->has_atomics)
+ return 8;
+ return 0;
+ case PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS:
+ if (rscreen->b.family >= CHIP_CEDAR && rscreen->has_atomics)
+ return EG_MAX_ATOMIC_BUFFERS;
+ return 0;
+
default:
return u_pipe_screen_get_param_defaults(pscreen, param);
}
PIPE_CAP_MAX_SHADER_BUFFER_SIZE,
PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE,
PIPE_CAP_MAX_COMBINED_SHADER_BUFFERS,
+ PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS,
+ PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS,
};
/**
unsigned sh;
bool can_ubo = true;
int temp;
- bool ssbo_atomic = true;
c->MaxTextureLevels
= _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
* for separate atomic counters get the actual hw limits
* per stage on atomic counters and buffers
*/
- ssbo_atomic = false;
pc->MaxAtomicCounters = temp;
pc->MaxAtomicBuffers = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS);
} else {
c->MaxAtomicBufferSize =
c->Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters * ATOMIC_COUNTER_SIZE;
- if (!ssbo_atomic) {
- /* on all HW with separate atomic (evergreen) the following
- lines are true. not sure it's worth adding CAPs for this at this
- stage. */
- c->MaxCombinedAtomicCounters = c->Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters;
- c->MaxCombinedAtomicBuffers = c->Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers;
- } else {
+ c->MaxCombinedAtomicBuffers =
+ MIN2(screen->get_param(screen,
+ PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS),
+ MAX_COMBINED_ATOMIC_BUFFERS);
+ if (!c->MaxCombinedAtomicBuffers) {
c->MaxCombinedAtomicBuffers =
c->Program[MESA_SHADER_VERTEX].MaxAtomicBuffers +
c->Program[MESA_SHADER_TESS_CTRL].MaxAtomicBuffers +
assert(c->MaxCombinedAtomicBuffers <= MAX_COMBINED_ATOMIC_BUFFERS);
}
+ c->MaxCombinedAtomicCounters =
+ screen->get_param(screen, PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS);
+ if (!c->MaxCombinedAtomicCounters)
+ c->MaxCombinedAtomicCounters = MAX_ATOMIC_COUNTERS;
+
if (c->MaxCombinedAtomicBuffers > 0) {
extensions->ARB_shader_atomic_counters = GL_TRUE;
extensions->ARB_shader_atomic_counter_ops = GL_TRUE;