fix compilation warnings

This commit is contained in:
Ivan 'provod' Avdeev 2021-05-24 11:12:44 -07:00
parent 35275e0916
commit 5de30a4ff0
5 changed files with 11 additions and 8 deletions

View File

@ -691,6 +691,7 @@ VkShaderModule loadShader(const char *filename) {
};
VkShaderModule shader;
byte* buf = gEngine.COM_LoadFile( filename, &size, false);
uint32_t *pcode;
if (!buf)
{
@ -703,7 +704,9 @@ VkShaderModule loadShader(const char *filename) {
smci.codeSize = size;
//smci.pCode = (const uint32_t*)buf;
memcpy(&smci.pCode, &buf, sizeof(void*));
//memcpy(&smci.pCode, &buf, sizeof(void*));
memcpy(&pcode, &buf, sizeof(pcode));
smci.pCode = pcode;
XVK_CHECK(vkCreateShaderModule(vk_core.device, &smci, NULL, &shader));
Mem_Free(buf);

View File

@ -112,7 +112,7 @@ void VK_DescriptorShutdown( void )
vkDestroyDescriptorSetLayout(vk_core.device, vk_desc.one_uniform_buffer_layout, NULL);
}
void VK_DescriptorsCreate(const vk_descriptors_t *desc)
void VK_DescriptorsCreate(vk_descriptors_t *desc)
{
{
VkDescriptorSetLayoutCreateInfo dslci = {
@ -174,7 +174,7 @@ void VK_DescriptorsCreate(const vk_descriptors_t *desc)
}
}
void VK_DescriptorsWrite(vk_descriptors_t *desc)
void VK_DescriptorsWrite(const vk_descriptors_t *desc)
{
VkWriteDescriptorSet wds[16];
ASSERT(ARRAYSIZE(wds) >= desc->num_bindings);
@ -217,7 +217,7 @@ void VK_DescriptorsWrite(vk_descriptors_t *desc)
vkUpdateDescriptorSets(vk_core.device, desc->num_bindings, wds, 0, NULL);
}
void VK_DescriptorsDestroy(vk_descriptors_t *desc)
void VK_DescriptorsDestroy(const vk_descriptors_t *desc)
{
vkDestroyDescriptorPool(vk_core.device, desc->desc_pool, NULL);
vkDestroyPipelineLayout(vk_core.device, desc->pipeline_layout, NULL);

View File

@ -51,8 +51,8 @@ typedef struct {
} vk_descriptors_t;
void VK_DescriptorsCreate(vk_descriptors_t *desc);
void VK_DescriptorsWrite(vk_descriptors_t *desc);
void VK_DescriptorsDestroy(vk_descriptors_t *desc);
void VK_DescriptorsWrite(const vk_descriptors_t *desc);
void VK_DescriptorsDestroy(const vk_descriptors_t *desc);
// typedef enum {
// VK_DescType_SingleTexture,

View File

@ -19,7 +19,7 @@ typedef struct {
static void loadRadData( const model_t *map, const char *filename ) {
fs_offset_t size;
const byte *data, *buffer = gEngine.COM_LoadFile( filename, &size, false);
byte *data, *buffer = gEngine.COM_LoadFile( filename, &size, false);
memset(g_emissive_texture_table, 0, sizeof(g_emissive_texture_table));

View File

@ -958,7 +958,7 @@ void VK_RenderModelDynamicCommit( void ) {
if (g_dynamic_model.model.num_geometries > 0) {
g_dynamic_model.model.dynamic = true;
VK_RenderModelInit( &g_dynamic_model.model );
VK_RenderModelDraw( &g_dynamic_model );
VK_RenderModelDraw( &g_dynamic_model.model );
}
g_dynamic_model.model.debug_name = NULL;