shader interface

pull/8/head
cosmonaut 2020-12-16 14:59:14 -08:00
parent 5850d0851f
commit fddba3a94d
1 changed files with 26 additions and 0 deletions

View File

@ -24,6 +24,8 @@
*
*/
#include <stddef.h>
#ifndef REFRESH_H
#define REFRESH_H
@ -468,6 +470,12 @@ typedef struct REFRESH_RenderPassCreateInfo
const REFRESH_DepthTargetDescription *depthTargetDescription; /* can be NULL */
} REFRESH_RenderPassCreateInfo;
typedef struct REFRESH_ShaderModuleCreateInfo
{
size_t codeSize;
const uint32_t *byteCode;
} REFRESH_ShaderModuleCreateInfo;
/* Pipeline state structures */
typedef struct REFRESH_ShaderStageState
@ -682,6 +690,12 @@ REFRESHAPI REFRESH_Framebuffer* REFRESH_CreateFramebuffer(
REFRESH_FramebufferCreateInfo *framebufferCreateInfo
);
/* Returns an allocated ShaderModule* object. */
REFRESHAPI REFRESH_ShaderModule* REFRESH_CreateShaderModule(
REFRESH_Device *device,
REFRESH_ShaderModuleCreateInfo *shaderModuleCreateInfo
);
/* Creates a 2D texture.
*
* format: The pixel format of the texture data.
@ -1090,6 +1104,18 @@ REFRESHAPI void REFRESH_AddDisposeIndexBuffer(
REFRESH_Buffer *buffer
);
/* Sends an shader module to be destroyed by the renderer. Note that we call it
* "AddDispose" because it may not be immediately destroyed by the renderer if
* this is not called from the main thread (for example, if a garbage collector
* deletes the resource instead of the programmer).
*
* shaderModule: The REFRESH_ShaderModule to be destroyed.
*/
REFRESHAPI void REFRESH_AddDisposeShaderModule(
REFRESH_Device *device,
REFRESH_ShaderModule *shaderModule
);
/* Graphics State */
/* Begins a render pass.