diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-02-14 12:45:52 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-02-14 12:45:52 +0100 |
| commit | f582eb80d73a1d0b735503c8894636782406228c (patch) | |
| tree | c4eb2da956a5b8977c8796b5fe25725ff518a23f /src/compute-renderpass.cpp | |
| parent | bbb45f80298dc4a41d31805416bad19363c8eff8 (diff) | |
High level buffer class
Diffstat (limited to 'src/compute-renderpass.cpp')
| -rw-r--r-- | src/compute-renderpass.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compute-renderpass.cpp b/src/compute-renderpass.cpp index 8fd4895..d801b11 100644 --- a/src/compute-renderpass.cpp +++ b/src/compute-renderpass.cpp @@ -4,6 +4,10 @@ #include "vk-renderer.hpp" +void ComputeRenderpass::set_pipeline(std::string& shader_name) { + this->pipeline = api.create_compute_pipeline(shader_name.c_str()); +} + void ComputeRenderpass::set_ouput_texture(Texture* output_texture) { this->output_texture = output_texture; @@ -27,6 +31,11 @@ void ComputeRenderpass::set_constant(off_t offset, Texture* texture) { 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); +} + void ComputeRenderpass::execute(VkCommandBuffer command_buffer) { vkCmdPushConstants(command_buffer, api.bindless_descriptor.pipeline_layout, VK_SHADER_STAGE_COMPUTE_BIT, 0, 64, (void*)&constants); |
