diff options
author | Jason Ekstrand <[email protected]> | 2015-07-22 15:26:53 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-07-22 15:26:56 -0700 |
commit | c9dc1f409817379c8ae9655cade54d0872aa86fe (patch) | |
tree | 0577a9a5c37074ebdf882325c2c0ea6831840f43 /src/vulkan/anv_pipeline.c | |
parent | 2c2233e328341700b7bc5c574f9de21ab4e4116a (diff) |
vk/pipeline: Be more sloppy about shader entrypoint names
The CTS passes in NULL names right now. It's not too hard to support that
as just "main". With this, and a patch to vulkancts, we now pass all 6
tests.
Diffstat (limited to 'src/vulkan/anv_pipeline.c')
-rw-r--r-- | src/vulkan/anv_pipeline.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index 817b644eefb..5aeacefddf6 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -79,9 +79,10 @@ VkResult anv_CreateShader( assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SHADER_CREATE_INFO); assert(pCreateInfo->flags == 0); - size_t name_len = strlen(pCreateInfo->pName); + const char *name = pCreateInfo->pName ? pCreateInfo->pName : "main"; + size_t name_len = strlen(name); - if (strcmp(pCreateInfo->pName, "main") != 0) { + if (strcmp(name, "main") != 0) { anv_finishme("Multiple shaders per module not really supported"); } @@ -91,7 +92,7 @@ VkResult anv_CreateShader( return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); shader->module = module; - memcpy(shader->entrypoint, pCreateInfo->pName, name_len + 1); + memcpy(shader->entrypoint, name, name_len + 1); *pShader = anv_shader_to_handle(shader); |