Inconsistensies with the Compute Shader tutorial
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- cpp
- Domínio
- computer-graphics, documentation
Direção de pesquisa
Compare o tutorial de Compute Shader com as seções referenciadas de Drawing a Triangle, especialmente Logical device and queues e Loading compute shaders. Revise os exemplos de queue, shader-stage, dispatch, createBuffer, descriptor-binding e particle quanto à consistência e à ausência de definições. A tarefa estará concluída quando o tutorial de compute seguir o estilo atual da API e introduzir cada símbolo necessário antes de usá-lo.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I've been trying to follow along with the compute shader tutorial after doing everything up till this tutorial, and it seems like the compute shader section is based off an older version of the tutorial, as there are multiple inconsistencies with how the code is structured. These are a couple of the issues I've found:
In Drawing a Triangle / Setup / Logical device and queues, the graphics queue is created like so:
graphicsQueue = vk::raii::Queue(device, graphicsIndex, 0);
In the compute shader section, the compute queue is created like so:
computeQueue = std::make_unique<vk::raii::Queue>( *device, graphicsAndComputeIndex, 0 );
The "Loading compute shaders" section states to load in the shader with
vk::PipelineShaderStageCreateInfo computeShaderStageInfo({}, vk::ShaderStageFlagBits::eCompute, shaderModule, "compMain");
but this gives errors with constructor parameter mismatches. Seems like the fix is to create the computer shader stage in the same way the vertex/fragment shader stages are created in the other tutorial section:
vk::PipelineShaderStageCreateInfo computeShaderStageInfo {
.stage = vk::ShaderStageFlagBits::eCompute,
.module = shaderModule,
.pName = "compMain"
};
When dispatching work, the tutorial says
Now it’s time to actually tell the GPU to do some compute. This is done by calling computeCommandBuffers[frameIndex]→dispatch inside a command buffer. While not perfectly true, a dispatch is for compute as a draw call like commandBuffers[frameIndex]→draw is for graphics. This dispatches a given number of compute work items in at max. three dimensions.
yet commandBuffers[frameIndex]→draw isn't used before in the tutorial. There are a few others (e.g the createBuffer function having a different prototype than the one in earlier sections, the std::array layoutBindings also needing to be created with structs, instead of vk::DescriptorSetLayoutBinding, etc.)
The computer shader tutorial also assume a lot more than the previous sections. When creating the compute queue, it assigns to a computeQueue variable that hasn't appeared anywhere before up till this point. A few sections later, in the loop where the particle positions are initialized, it creates std::vector<Particle> particles(PARTICLE_COUNT);. This is the first time PARTICLE_COUNT is mentioned, and the first time the C++ Particle struct is mentioned. Neither are defined or mentioned anywhere after (though the Particle struct is added onto later).
- Linguagem predominante
- C++
- Estrelas
- 434
- Forks
- 135
- Merge médio
- 9d 16h
- PRs com merge (30d)
- 4
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de KhronosGroup/Vulkan-Tutorial
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
KhronosGroup/Vulkan-Tutorial#528 · 1 responsável ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
KhronosGroup/Vulkan-Tutorial#527 · 1 responsável ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
KhronosGroup/Vulkan-Tutorial#525 · 1 responsável ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
KhronosGroup/Vulkan-Tutorial#524 · 1 responsável ·
-
Multithreading chapter still talks about render passesTalvez livre de novo @SaschaWillems assumiu há 29 dias e não há nenhum pull request aberto. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
KhronosGroup/Vulkan-Tutorial#519 · 1 responsável ·
Todas as issues de KhronosGroup/Vulkan-Tutorial
Issues semelhantes
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
scp-fs2open/fs2open.github.com#7914 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 2 dias
-
bug low priority rt_lib wasm
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
eclipse-score/inc_someip_gateway#356 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
HarperFast/rocksdb-js#945 ·
Mantenedores costumam responder em até 1 dia