Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 14 ComputeScan fix for new NBL API and use HLSL #113

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

kpentaris
Copy link
Contributor

Still doesn't work. There are shader issues with shared memory reading. The basic outline is correct however.

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See example 05 (whichever does the streaming consumer callback), how to download a buffer and consume it "piecewise"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants