Example 14 ComputeScan fix for new NBL API and use HLSL#113
Open
kpentaris wants to merge 38 commits intoDevsh-Graphics-Programming:masterfrom
Open
Example 14 ComputeScan fix for new NBL API and use HLSL#113kpentaris wants to merge 38 commits intoDevsh-Graphics-Programming:masterfrom
kpentaris wants to merge 38 commits intoDevsh-Graphics-Programming:masterfrom
Conversation
Comment on lines
+45
to
+50
| auto minSSBOAlign = m_physicalDevice->getLimits().minSSBOAlignment; | ||
| constexpr auto begin = in_count / 4 + 118; | ||
| assert(((begin * sizeof(uint32_t)) & (minSSBOAlign - 1u)) == 0u); | ||
| constexpr auto end = in_count * 3 / 4 - 78; | ||
| assert(((end * sizeof(uint32_t)) & (minSSBOAlign - 1u)) == 0u); | ||
| constexpr auto elementCount = end - begin; |
There was a problem hiding this comment.
what's the point of all this?
| { | ||
| IGPUBuffer::SCreationParams inputDataBufferCreationParams = {}; | ||
| inputDataBufferCreationParams.size = sizeof(uint32_t) * in_count; // TODO Declare the element data type in the shader? | ||
| inputDataBufferCreationParams.usage = IGPUBuffer::EUF_STORAGE_BUFFER_BIT | IGPUBuffer::EUF_TRANSFER_SRC_BIT | IGPUBuffer::EUF_TRANSFER_DST_BIT; |
There was a problem hiding this comment.
address usage, if you want to use BDA
Comment on lines
+87
to
+88
| CArithmeticOps::DispatchInfo reduce_dispatch_info; | ||
| reducer->buildParameters(elementCount, reduce_push_constants, reduce_dispatch_info); |
There was a problem hiding this comment.
I think I've left a comment in the "mother PR" that this should be a constructor of parameters or something
Kinda silly to have to use a factory to do some basic arithmetic
14_ComputeReduce/main.cpp
Outdated
Comment on lines
165
to
169
| // (REVIEW): Check if this new download_buffer is needed or if we can directly read from the gpu_input buffer | ||
| auto downloaded_buffer = m_device->createBuffer(std::move(params)); | ||
| auto memReqs = downloaded_buffer->getMemoryReqs(); | ||
| memReqs.memoryTypeBits &= m_physicalDevice->getDownStreamingMemoryTypeBits(); | ||
| auto queriesMem = m_device->allocate(memReqs, downloaded_buffer.get()); |
There was a problem hiding this comment.
use the downstreaming buffer and make a consumption callback.
Otherwise you'll have a problem making a 128MB HOST_VISIBLE and DEVICE_LOCAL buffer, not everyone has ReBAR configured correctly.
There was a problem hiding this comment.
See example 05 (whichever does the streaming consumer callback), how to download a buffer and consume it "piecewise"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still doesn't work. There are shader issues with shared memory reading. The basic outline is correct however.