diff options
| author | Quentin LADEVIE <qladevie@wanadev.fr> | 2022-02-16 11:47:54 +0100 |
|---|---|---|
| committer | Quentin LADEVIE <qladevie@wanadev.fr> | 2022-02-16 11:47:54 +0100 |
| commit | 0baf9dab1c07c52a956ec4a0969854b7fc46e104 (patch) | |
| tree | 3bbdcd7c125c31d0fbee4e2e5cd88da6681e896f /src/compute-renderpass.cpp | |
| parent | f582eb80d73a1d0b735503c8894636782406228c (diff) | |
Fixes artifacts when moving in the scene
Diffstat (limited to 'src/compute-renderpass.cpp')
| -rw-r--r-- | src/compute-renderpass.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compute-renderpass.cpp b/src/compute-renderpass.cpp index d801b11..87a2810 100644 --- a/src/compute-renderpass.cpp +++ b/src/compute-renderpass.cpp @@ -12,7 +12,7 @@ void ComputeRenderpass::set_ouput_texture(Texture* output_texture) { this->output_texture = output_texture; // TODO: Remove hardcoded offset - memcpy(constants.data() + 56, &output_texture->device_image.bindless_storage_index, 4); + memcpy(constants.data() + 56, &output_texture->device_image.bindless_storage_index, sizeof(bindless_index)); } void ComputeRenderpass::set_dispatch_size(size_t count_x, size_t count_y, size_t count_z) { @@ -26,14 +26,14 @@ void ComputeRenderpass::set_constant(off_t offset, uint64_t* constant) { } void ComputeRenderpass::set_constant(off_t offset, Texture* texture) { - memcpy(constants.data() + offset, (void*)&texture->device_image.bindless_storage_index, 4); + memcpy(constants.data() + offset, (void*)&texture->device_image.bindless_storage_index, sizeof(bindless_index)); input_textures.push_back(texture); } void ComputeRenderpass::set_constant(off_t offset, Buffer* buffer) { auto address = buffer->device_address(); - memcpy(constants.data() + offset, (void*)&address, 8); + memcpy(constants.data() + offset, (void*)&address, sizeof(VkDeviceAddress)); } void ComputeRenderpass::execute(VkCommandBuffer command_buffer) { |
