Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move experimental vulkan functions to mainline graphics_vulkan library #8675

Merged
merged 6 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
69 changes: 69 additions & 0 deletions engine/graphics/src/dmsdk/graphics/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ namespace dmGraphics
*/
typedef uintptr_t HIndexBuffer;

/*#
* Storage buffer handle
* @typedef
* @name HStorageBuffer
*/
typedef uintptr_t HStorageBuffer;

/*#
* Uniform location handle
* @typedef
Expand Down Expand Up @@ -113,6 +120,13 @@ namespace dmGraphics
*/
const uint32_t INVALID_STREAM_OFFSET = 0xFFFFFFFF;

/*#
* Max buffer color attachments
* @constant
* @name MAX_BUFFER_COLOR_ATTACHMENTS
*/
const uint8_t MAX_BUFFER_COLOR_ATTACHMENTS = 4;

/*#
* @enum
* @name HandleResult
Expand Down Expand Up @@ -143,6 +157,22 @@ namespace dmGraphics
MAX_ATTACHMENT_COUNT = 3
};

/*#
* @enum
* @name AttachmentOp
* @member ATTACHMENT_OP_DONT_CARE
* @member ATTACHMENT_OP_LOAD
* @member ATTACHMENT_OP_STORE
* @member ATTACHMENT_OP_CLEAR
*/
enum AttachmentOp
{
ATTACHMENT_OP_DONT_CARE,
ATTACHMENT_OP_LOAD,
ATTACHMENT_OP_STORE,
ATTACHMENT_OP_CLEAR,
};

/*#
* @enum
* @name TextureFormat
Expand Down Expand Up @@ -221,6 +251,45 @@ namespace dmGraphics
TEXTURE_FORMAT_COUNT
};

struct PipelineState
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this doesn't need to live in the dmsdk? we could potentially do:
typedef struct PipelineState* HPipelineState

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense I think, as I think this struct may be a bit volatile.

{
uint64_t m_WriteColorMask : 4;
uint64_t m_WriteDepth : 1;
uint64_t m_PrimtiveType : 3;
// Depth Test
uint64_t m_DepthTestEnabled : 1;
uint64_t m_DepthTestFunc : 3;
// Stencil Test
uint64_t m_StencilEnabled : 1;

// Front
uint64_t m_StencilFrontOpFail : 3;
uint64_t m_StencilFrontOpPass : 3;
uint64_t m_StencilFrontOpDepthFail : 3;
uint64_t m_StencilFrontTestFunc : 3;

// Back
uint64_t m_StencilBackOpFail : 3;
uint64_t m_StencilBackOpPass : 3;
uint64_t m_StencilBackOpDepthFail : 3;
uint64_t m_StencilBackTestFunc : 3;

uint64_t m_StencilWriteMask : 8;
uint64_t m_StencilCompareMask : 8;
uint64_t m_StencilReference : 8;
// Blending
uint64_t m_BlendEnabled : 1;
uint64_t m_BlendSrcFactor : 4;
uint64_t m_BlendDstFactor : 4;
// Culling
uint64_t m_CullFaceEnabled : 1;
uint64_t m_CullFaceType : 2;
// Face winding
uint64_t m_FaceWinding : 1;
// Polygon offset
uint64_t m_PolygonOffsetFillEnabled : 1;
};

/*#
* Get the attachment texture from a render target. Returns zero if no such attachment texture exists.
* @name GetRenderTargetAttachment
Expand Down