diff options
author | Brian Paul <brianp@vmware.com> | 2010-04-15 12:48:12 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-04-15 12:48:12 -0600 |
commit | 0f16b07a041148ce9d050ec58f42a4302a9cb2cf (patch) | |
tree | 5661a0431da6ed5e2a68dae1bae3fe83e47e208a /src/gallium/drivers/nouveau/nouveau_statebuf.h | |
parent | 563a7e3cc552fdcfcaf9ac0d4b1683c3ba2ae732 (diff) | |
parent | eee220d65d3d37030f33971b02823c614e3eb618 (diff) |
Merge branch 'master' into lp-surface-tilinglp-surface-tiling
This brings in the gallium-resources branch changes. Things seem to be
working but there's probabaly bugs to be found.
Conflicts:
src/gallium/drivers/llvmpipe/lp_rast.c
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/llvmpipe/lp_texture.h
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_statebuf.h')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_statebuf.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_statebuf.h b/src/gallium/drivers/nouveau/nouveau_statebuf.h new file mode 100644 index 0000000000..dcffdd9115 --- /dev/null +++ b/src/gallium/drivers/nouveau/nouveau_statebuf.h @@ -0,0 +1,27 @@ +#ifndef __NOUVEAU_STATEBUF_H__ +#define __NOUVEAU_STATEBUF_H__ + +/* state buffers: lightweight state objects interface */ +/* relocations are not supported, but Gallium CSOs don't require them */ + +struct nouveau_statebuf_builder +{ + uint32_t* p; +#ifdef DEBUG + uint32_t* pend; +#endif +}; + +#ifdef DEBUG +#define sb_init(var) {var, var + sizeof(var) / sizeof((var)[0])} +#define sb_data(sb, v) do {assert((sb).p != (sb).pend); *(sb).p++ = (v);} while(0) +#else +#define sb_init(var) {var} +#define sb_data(sb, v) *(sb).p++ = (v) +#endif + +#define sb_method(sb, v, n) sb_data(sb, RING_3D(v, n)); + +#define sb_len(sb, var) ((sb).p - (var)) +#define sb_emit(chan, sb_buf, sb_len) do {WAIT_RING((chan), (sb_len)); OUT_RINGp((chan), (sb_buf), (sb_len)); } while(0) +#endif |