[Mesa-dev] RFC: basevertex and vertexid handling in gallium

sroland at vmware.com sroland at vmware.com
Mon Oct 13 00:45:14 PDT 2014


From: Roland Scheidegger <sroland at vmware.com>

So, gallium doesn't yet expose basevertex shader semantic. Neither does
it really handle the different vertexID options (GL-style including
basevertex and d3d10-style not including it). draw currently implements
the latter (on purpose) whereas most drivers probably actually wanted
the former, though I can't tell if they are succesful in that or not.

Hence this is an attempt of fixing this, however I wasn't sure how
exactly this should be exposed. I thought just following core mesa and
expose two different vertexID semantics was easiest, but I guess other
options would be doable. Also, I'm not sure what cap bits are needed -
I'd guess one for being able to handle basevertex, but if there's both
vertexid and vertexid_zerobase semantics, do they each need their own
cap bit for drivers (the former right now doesn't actually have its own
cap bit, tied to something else apparently). glsl could do lowering of
vertexid to vertexid_zerobase for us for drivers requiring it.

I've attached what I've got so far but obviously this isn't complete.

Roland Scheidegger (1):
  gallium: add basevertex and vertexid_zerobase semantics

 src/gallium/auxiliary/draw/draw_llvm.c          |  8 +++++-
 src/gallium/auxiliary/gallivm/lp_bld_tgsi.h     |  1 +
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |  5 ++++
 src/gallium/auxiliary/tgsi/tgsi_strings.c       |  2 ++
 src/gallium/docs/source/tgsi.rst                | 36 +++++++++++++++++++++++++
 src/gallium/include/pipe/p_shader_tokens.h      |  4 ++-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp      |  8 ++++--
 7 files changed, 60 insertions(+), 4 deletions(-)

-- 
1.9.1



More information about the mesa-dev mailing list