{
struct u_vbuf_caps caps;
bool uses_user_vertex_buffers = !(flags & CSO_NO_USER_VERTEX_BUFFERS);
+ bool needs64b = !(flags & CSO_NO_64B_VERTEX_BUFFERS);
- u_vbuf_get_caps(cso->pipe->screen, &caps);
+ u_vbuf_get_caps(cso->pipe->screen, &caps, needs64b);
/* Enable u_vbuf if needed. */
if (caps.fallback_always ||
struct u_vbuf;
#define CSO_NO_USER_VERTEX_BUFFERS (1 << 0)
+#define CSO_NO_64B_VERTEX_BUFFERS (1 << 1)
struct cso_context *cso_create_context(struct pipe_context *pipe,
unsigned flags);
{ PIPE_FORMAT_R8G8B8A8_SSCALED, PIPE_FORMAT_R32G32B32A32_FLOAT },
};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
+void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
+ bool needs64b)
{
unsigned i;
for (i = 0; i < ARRAY_SIZE(vbuf_format_fallbacks); i++) {
enum pipe_format format = vbuf_format_fallbacks[i].from;
+ unsigned comp_bits = util_format_get_component_bits(format, 0, 0);
+
+ if ((comp_bits > 32) && !needs64b)
+ continue;
if (!screen->is_format_supported(screen, format, PIPE_BUFFER, 0, 0,
PIPE_BIND_VERTEX_BUFFER)) {
};
-void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps);
+void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps,
+ bool needs64b);
struct u_vbuf *
u_vbuf_create(struct pipe_context *pipe, struct u_vbuf_caps *caps);
* profile, so that u_vbuf is bypassed completely if there is nothing else
* to do.
*/
- unsigned cso_flags =
- ctx->API == API_OPENGL_CORE ? CSO_NO_USER_VERTEX_BUFFERS : 0;
+ unsigned cso_flags;
+ switch (ctx->API) {
+ case API_OPENGL_CORE:
+ cso_flags = CSO_NO_USER_VERTEX_BUFFERS;
+ break;
+ case API_OPENGLES:
+ case API_OPENGLES2:
+ cso_flags = CSO_NO_64B_VERTEX_BUFFERS;
+ break;
+ default:
+ cso_flags = 0;
+ break;
+ }
+
st->cso_context = cso_create_context(pipe, cso_flags);
st_init_atoms(st);