| 14 | #include <libntc/shaders/Bindings.h> |
| 15 | |
| 16 | bool GraphicsBlockCompressionPass::Init() |
| 17 | { |
| 18 | // Create the binding layout |
| 19 | nvrhi::VulkanBindingOffsets vulkanBindingOffsets; |
| 20 | vulkanBindingOffsets |
| 21 | .setConstantBufferOffset(0) |
| 22 | .setSamplerOffset(0) |
| 23 | .setShaderResourceOffset(0) |
| 24 | .setUnorderedAccessViewOffset(0); |
| 25 | |
| 26 | auto bindingLayoutDesc = nvrhi::BindingLayoutDesc() |
| 27 | .setVisibility(nvrhi::ShaderType::Compute) |
| 28 | .setBindingOffsets(vulkanBindingOffsets) |
| 29 | .addItem(nvrhi::BindingLayoutItem::VolatileConstantBuffer(NTC_BINDING_BC_CONSTANT_BUFFER)) |
| 30 | .addItem(nvrhi::BindingLayoutItem::Texture_SRV(NTC_BINDING_BC_INPUT_TEXTURE)) |
| 31 | .addItem(nvrhi::BindingLayoutItem::Texture_UAV(NTC_BINDING_BC_OUTPUT_TEXTURE)); |
| 32 | |
| 33 | m_bindingLayout = m_device->createBindingLayout(bindingLayoutDesc); |
| 34 | if (!m_bindingLayout) |
| 35 | return false; |
| 36 | |
| 37 | bindingLayoutDesc.addItem(nvrhi::BindingLayoutItem::RawBuffer_SRV(NTC_BINDING_BC_MODE_BUFFER)); |
| 38 | m_bindingLayoutWithModeBuffer = m_device->createBindingLayout(bindingLayoutDesc); |
| 39 | if (!m_bindingLayoutWithModeBuffer) |
| 40 | return false; |
| 41 | |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | bool GraphicsBlockCompressionPass::ExecuteComputePass(nvrhi::ICommandList* commandList, ntc::ComputePassDesc& computePass, |
| 46 | nvrhi::ITexture* inputTexture, nvrhi::Format inputFormat, int inputMipLevel, |
nothing calls this directly
no outgoing calls
no test coverage detected