Commit Graph

11 Commits

Author SHA1 Message Date
Alan Coopersmith 23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Adam Jackson 66e8eaa456 glamor: Drop the non-VAO rendering path
GLES spells this extension as GL_OES_vertex_array_object, but it is
functionally equivalent to the GL_ARB version. Mesa has supported both
since 9.0, let's go ahead and require it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-11-15 09:53:50 -05:00
Emil Velikov e12e02b2e6 glamor: use the lowercase xnf.*alloc API
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-06 08:57:06 +10:00
Keith Packard 49aa5e3ea4 glamor: Use vertex array objects
Core contexts require the use of vertex array objects, so switch both glamor
and ephyr/glamor over.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-01-21 06:49:40 +10:00
Eric Anholt 74be466d40 glamor: Avoid GL errors from mapping with size == 0.
GL 4.5 / GLES 3.0 require throwing GL errors at map time, and Mesa
before that might throw errors accidentally if a malloc(0) call was
made to return the mapping.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2015-11-10 13:50:09 -08:00
Eric Anholt c5e6fffbdd glamor: Drop CloseScreen-time GL resource cleanup code.
These will all be freed when the context is freed.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:35 -07:00
Eric Anholt 0d9ad78180 glamor: Fix GLES2 non-VBO temporary memory allocation.
We'd get a request for like 16 bytes, claim to have allocated
GLAMOR_VBO_SIZE, and then not reallocate when something a request
bigger than 16 came along.  The intent was to always allocate at least
GLAMOR_VBO_SIZE.

Fixes segfaults with Xephyr -glamor_gles2 and running gnome-terminal.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-06-23 14:51:56 -07:00
Eric Anholt fab0a4a4c9 glamor: Replace glamor_get/put_context() with just glamor_make_current().
Now that we have the DIX global state for the current context, we
don't need to track nesting to try to reduce MakeCurrent overhead.

v2: Fix a mistaken replacement of a put_context with make_current in
    glamor_fill_spans_gl() (caught by keithp).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
2014-04-23 10:32:23 -07:00
Markus Wick 82168b1e6e glamor: Select VBO path by ARB_mbr extension.
The mbr path was hard coded enabled for desktop gl and disabled for
gles.  But there are both desktop without mbr and GLES with mbr.

v2: Don't forget to update the fini path, too (change by anholt)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-26 12:58:40 -07:00
Eric Anholt 2843a2f9b5 glamor: Use buffer_storage
v2:
  - Make the default buffer size a #define. (by Markus Wick)
  - Fix the return offset for mapping with buffer_storage.  (oops!)
v3:
  - Avoid GL error at first rendering from unmapping no buffer.
  - Rebase on the glBindBuffer(GL_ARRAY_BUFFER, 0) change.
v4: Rebase on Markus's vbo init changes.
v5: Fix missing put_context() in the buffer_storage fallback path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
2014-03-10 13:57:21 -07:00
Eric Anholt d310d566b1 glamor: Extract the streamed vertex data code used by Render.
We should be uploading any vertex data using this kind of upload
style, since it saves a bunch of extra copies of our vertex data.

v2:
  - Add a simple comment about what the function does.
  - Use get_vbo_space()'s return in trapezoids, instead of dereffing
    glamor_priv->vb (by Markus Wick).
  - Fix the double-unmapping by moving put_vbo_space() outside of
    flush_composite_rects().
  - Remove the rest of the composite_vbo_offset usage, and just always
    use get_vbo_space()'s return value.
v3:
  - Fix failure to put_vbo_space in traps when no prims were
    generated.
  - Unbind the VBO from put_vbo_space().  Keeps callers from
    forgetting to do so.
v4:
  - Split out some changes into the previous 3 commits while trying to
    track down a regression.
  - Fix regression due to rebase fail where glamor_priv->vbo_offset
    wasn't incremented.
v5:
  - Fix GLES2 VBO sizing.
  - Add a comment about resize behavior.
  - Move glamor_vbo.c init code to glamor_vbo.c from
    glamor_render.c. (Derived from Markus's changes, but the GLES2 fix
    dropped almost all of the code in the functions).
v6:
  - Drop the initial BufferData on GLES2 (it happens at put() time).
  - Don't forget to set vbo_offset to the size on GLES2.
  - Use char * instead of void * in the cast to return the vbo_offset.
  - Resize the default FBO to 512kb, to be similar to previous
    behavior.  +1.66124% +/- 0.284223% (n=679) on aa10text.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
2014-03-10 13:57:21 -07:00