Skip to content

Commit

Permalink
Add PropertiesID field to Metadata structs
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Jan 27, 2025
1 parent 59d98c5 commit a1bc850
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/SDL3_shadercross/SDL_shadercross.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ typedef struct SDL_ShaderCross_GraphicsShaderMetadata
Uint32 num_storage_textures; /**< The number of storage textures defined in the shader. */
Uint32 num_storage_buffers; /**< The number of storage buffers defined in the shader. */
Uint32 num_uniform_buffers; /**< The number of uniform buffers defined in the shader. */

SDL_PropertiesID props; /**< A properties ID for extensions. This is allocated and freed by the caller, and should be 0 if no extensions are needed. */
} SDL_ShaderCross_GraphicsShaderMetadata;

typedef struct SDL_ShaderCross_ComputePipelineMetadata
Expand All @@ -64,6 +66,8 @@ typedef struct SDL_ShaderCross_ComputePipelineMetadata
Uint32 threadcount_x; /**< The number of threads in the X dimension. */
Uint32 threadcount_y; /**< The number of threads in the Y dimension. */
Uint32 threadcount_z; /**< The number of threads in the Z dimension. */

SDL_PropertiesID props; /**< A properties ID for extensions. This is allocated and freed by the caller, and should be 0 if no extensions are needed. */
} SDL_ShaderCross_ComputePipelineMetadata;

typedef struct SDL_ShaderCross_SPIRV_Info
Expand Down
4 changes: 4 additions & 0 deletions src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ int main(int argc, char *argv[])
case SHADERFORMAT_JSON: {
if (shaderStage == SDL_SHADERCROSS_SHADERSTAGE_COMPUTE) {
SDL_ShaderCross_ComputePipelineMetadata info;
info.props = 0;
if (SDL_ShaderCross_ReflectComputeSPIRV(
fileData,
fileSize,
Expand All @@ -411,6 +412,7 @@ int main(int argc, char *argv[])
}
} else {
SDL_ShaderCross_GraphicsShaderMetadata info;
info.props = 0;
if (SDL_ShaderCross_ReflectGraphicsSPIRV(
fileData,
fileSize,
Expand Down Expand Up @@ -561,6 +563,7 @@ int main(int argc, char *argv[])

if (shaderStage == SDL_SHADERCROSS_SHADERSTAGE_COMPUTE) {
SDL_ShaderCross_ComputePipelineMetadata info;
info.props = 0;
bool result = SDL_ShaderCross_ReflectComputeSPIRV(
spirv,
bytecodeSize,
Expand All @@ -575,6 +578,7 @@ int main(int argc, char *argv[])
}
} else {
SDL_ShaderCross_GraphicsShaderMetadata info;
info.props = 0;
bool result = SDL_ShaderCross_ReflectGraphicsSPIRV(
spirv,
bytecodeSize,
Expand Down

0 comments on commit a1bc850

Please sign in to comment.