mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Initial compute support.
This commit is contained in:
@@ -49,6 +49,18 @@ namespace bgfx
|
||||
};
|
||||
};
|
||||
|
||||
struct Access
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
Read,
|
||||
Write,
|
||||
ReadWrite,
|
||||
|
||||
Count
|
||||
};
|
||||
};
|
||||
|
||||
struct Attrib
|
||||
{
|
||||
enum Enum // corresponds to vertex shader attribute:
|
||||
@@ -1082,7 +1094,16 @@ namespace bgfx
|
||||
///
|
||||
uint32_t submitMask(uint32_t _viewMask, int32_t _depth = 0);
|
||||
|
||||
/// Discard all previously set state for draw call.
|
||||
///
|
||||
void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access);
|
||||
|
||||
///
|
||||
void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access);
|
||||
|
||||
/// Dispatch compute.
|
||||
void dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX = 1, uint16_t _numY = 1, uint16_t _numZ = 1);
|
||||
|
||||
/// Discard all previously set state for draw or compute call.
|
||||
void discard();
|
||||
|
||||
/// Request screen shot.
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
#define BGFX_TEXTURE_COMPARE_ALWAYS UINT32_C(0x00080000)
|
||||
#define BGFX_TEXTURE_COMPARE_SHIFT 16
|
||||
#define BGFX_TEXTURE_COMPARE_MASK UINT32_C(0x000f0000)
|
||||
#define BGFX_TEXTURE_COMPUTE_WRITE UINT32_C(0x00100000)
|
||||
#define BGFX_TEXTURE_RESERVED_SHIFT 24
|
||||
#define BGFX_TEXTURE_RESERVED_MASK UINT32_C(0xff000000)
|
||||
|
||||
@@ -295,6 +296,7 @@
|
||||
#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000020000000)
|
||||
#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000040000000)
|
||||
#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000080000000)
|
||||
#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000100000000)
|
||||
|
||||
#define BGFX_CAPS_TEXTURE_DEPTH_MASK (0 \
|
||||
| BGFX_CAPS_TEXTURE_FORMAT_D16 \
|
||||
|
||||
Reference in New Issue
Block a user