gallium: New cap PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET.
authorMathias Fröhlich <mathias.froehlich@web.de>
Thu, 6 Sep 2018 14:13:42 +0000 (16:13 +0200)
committerMathias Fröhlich <mathias.froehlich@web.de>
Mon, 10 Sep 2018 05:59:31 +0000 (07:59 +0200)
Introduce a new capability for the maximum value of
pipe_vertex_element::src_offset. Initially just every driver
backend returns the value previously set from _mesa_init_constants.
So this shall end up in no functional change.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 07c63aa3700ea37cf14e9248066c91e4a122b802..73dbbee94a90054840eacc20ba9b775900955e35 100644 (file)
@@ -323,6 +323,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
       return 0;
 
+   case PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET:
+      return 2047;
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
index b5ad8f970d2f6c0a57bb3c1b3976bebef7610572..0abd164494ce1f576c7054dbc87694eff85b7f7e 100644 (file)
@@ -475,6 +475,8 @@ subpixel precision bias in bits during conservative rasterization.
 * ``PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET: Maximum recommend memory size
   for all active texture uploads combined. This is a performance hint.
   0 means no limit.
+* ``PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET``: The maximum supported value for
+  of pipe_vertex_element::src_offset.
 
 .. _pipe_capf:
 
index 6f11527d5ca2d1d3b3f149c94a8a898528e96a61..c58f165962548800ff4ece78bf4f30a5e29dd0fa 100644 (file)
@@ -824,6 +824,7 @@ enum pipe_cap
    PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTERS,
    PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS,
    PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET,
+   PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET,
 };
 
 /**
index 661b2e499fe06b9f14a8d674198a082a437db2e5..798ee60875a854f2a9b1518c82df5ef576284d58 100644 (file)
@@ -404,6 +404,12 @@ void st_init_limits(struct pipe_screen *screen,
    c->MaxVertexAttribStride
       = screen->get_param(screen, PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE);
 
+   /* The value cannot be larger than that since pipe_vertex_buffer::src_offset
+    * is only 16 bits.
+    */
+   temp = screen->get_param(screen, PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET);
+   c->MaxVertexAttribRelativeOffset = MIN2(0xffff, temp);
+
    c->StripTextureBorder = GL_TRUE;
 
    c->GLSLSkipStrictMaxUniformLimitCheck =