restructure texture subresources
continuous-integration/drone/push Build is passing Details

pull/51/head
cosmonaut 2024-02-29 17:17:49 -08:00
parent 8e04b0d1c9
commit 721854921d
4 changed files with 608 additions and 756 deletions

View File

@ -385,8 +385,7 @@ typedef struct Refresh_TextureSlice
{ {
Refresh_Texture *texture; Refresh_Texture *texture;
uint32_t mipLevel; uint32_t mipLevel;
uint32_t baseLayer; uint32_t layer;
uint32_t layerCount;
uint32_t x; uint32_t x;
uint32_t y; uint32_t y;
uint32_t z; uint32_t z;
@ -495,6 +494,7 @@ typedef struct Refresh_TextureCreateInfo
uint32_t height; uint32_t height;
uint32_t depth; uint32_t depth;
uint8_t isCube; uint8_t isCube;
uint32_t layerCount;
uint32_t levelCount; uint32_t levelCount;
Refresh_SampleCount sampleCount; Refresh_SampleCount sampleCount;
Refresh_TextureFormat format; Refresh_TextureFormat format;
@ -580,8 +580,7 @@ typedef struct Refresh_GraphicsPipelineCreateInfo
typedef struct Refresh_ColorAttachmentInfo typedef struct Refresh_ColorAttachmentInfo
{ {
Refresh_Texture *texture; /* We can't use TextureSlice because render passes take a single rectangle. */ Refresh_Texture *texture;
uint32_t depth;
uint32_t layer; uint32_t layer;
uint32_t level; uint32_t level;
Refresh_Vec4 clearColor; /* Can be ignored by RenderPass */ Refresh_Vec4 clearColor; /* Can be ignored by RenderPass */
@ -592,8 +591,7 @@ typedef struct Refresh_ColorAttachmentInfo
typedef struct Refresh_DepthStencilAttachmentInfo typedef struct Refresh_DepthStencilAttachmentInfo
{ {
Refresh_Texture *texture; /* We can't use TextureSlice because render passes take a single rectangle. */ Refresh_Texture *texture;
uint32_t depth;
uint32_t layer; uint32_t layer;
uint32_t level; uint32_t level;
Refresh_DepthStencilValue depthStencilClearValue; /* Can be ignored by RenderPass */ Refresh_DepthStencilValue depthStencilClearValue; /* Can be ignored by RenderPass */
@ -1004,20 +1002,14 @@ REFRESHAPI void Refresh_BindComputeBuffers(
/* Binds textures for use with the currently bound compute pipeline. /* Binds textures for use with the currently bound compute pipeline.
* *
* pTextures: An array of textures to bind. * pTextureSlices: An array of texture slices to bind.
* Length must be equal to the number of buffers
* specified by the compute pipeline.
*
* pLevels: An array of levels to bind,
* corresponding to the indices in pTextures.
* Length must be equal to the number of buffers * Length must be equal to the number of buffers
* specified by the compute pipeline. * specified by the compute pipeline.
*/ */
REFRESHAPI void Refresh_BindComputeTextures( REFRESHAPI void Refresh_BindComputeTextures(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures, Refresh_TextureSlice **pTextureSlices
uint32_t **pLevels
); );
/* Pushes compute shader params to the device. /* Pushes compute shader params to the device.

View File

@ -675,15 +675,13 @@ void Refresh_BindComputeBuffers(
void Refresh_BindComputeTextures( void Refresh_BindComputeTextures(
Refresh_Device *device, Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures, Refresh_TextureSlice **pTextureSlices
uint32_t **pLevels
) { ) {
NULL_RETURN(device); NULL_RETURN(device);
device->BindComputeTextures( device->BindComputeTextures(
device->driverData, device->driverData,
commandBuffer, commandBuffer,
pTextures, pTextureSlices
pLevels
); );
} }

View File

@ -389,8 +389,7 @@ struct Refresh_Device
void (*BindComputeTextures)( void (*BindComputeTextures)(
Refresh_Renderer *driverData, Refresh_Renderer *driverData,
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_Texture **pTextures, Refresh_TextureSlice **pTextureSlices
uint32_t **pLevels
); );
void (*PushComputeShaderUniforms)( void (*PushComputeShaderUniforms)(

File diff suppressed because it is too large Load Diff