Added working compute example

This commit is contained in:
Alejandro Saucedo 2020-07-30 07:49:39 +01:00
parent ae12be78db
commit a012551d00
7 changed files with 267 additions and 13 deletions

View file

@ -327,13 +327,14 @@ public:
// TODO: There is no command line arguments parsing (nor Android settings) for this
// example, so we have no way of picking between GLSL or HLSL shaders.
// Hard-code to glsl for now.
const std::string shadersPath = getAssetPath() + "shaders/glsl/computeheadless/";
const std::string shadersPath = getAssetPath() + "shaders/glsl/";
std::cout << "Shader path: " << shadersPath << std::endl;
VkPipelineShaderStageCreateInfo shaderStage = {};
shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
shaderStage.stage = VK_SHADER_STAGE_COMPUTE_BIT;
shaderStage.module = vks::tools::loadShader((shadersPath + "headless.comp.spv").c_str(), device);
shaderStage.module = vks::tools::loadShader((shadersPath + "computeheadless.comp.spv").c_str(), device);
shaderStage.pName = "main";
shaderStage.pSpecializationInfo = &specializationInfo;