From 623d7de1c35dd3bd998cbdbbfd317e3457c86e7d Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 30 Dec 2015 10:51:01 +1300 Subject: nulldrv: Add more proper support for ShaderModule objects Again not OK to claim success but return junk rather than a proper handle. Fixes various layers exploding when running against nulldrv. Signed-off-by: Chris Forbes --- icd/nulldrv/nulldrv.c | 12 +++++++++++- icd/nulldrv/nulldrv.h | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c index 0403da8c..2c5e3a28 100644 --- a/icd/nulldrv/nulldrv.c +++ b/icd/nulldrv/nulldrv.c @@ -1892,8 +1892,18 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule( const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) { - // TODO: Fill in with real data NULLDRV_LOG_FUNC; + + struct nulldrv_dev *dev = nulldrv_dev(device); + struct nulldrv_shader_module *shader_module; + + shader_module = (struct nulldrv_shader_module *) nulldrv_base_create(dev, + sizeof(*shader_module), VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT); + if (!shader_module) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + *pShaderModule = (VkShaderModule) shader_module; + return VK_SUCCESS; } diff --git a/icd/nulldrv/nulldrv.h b/icd/nulldrv/nulldrv.h index 38652587..f933a77a 100644 --- a/icd/nulldrv/nulldrv.h +++ b/icd/nulldrv/nulldrv.h @@ -113,6 +113,10 @@ struct nulldrv_sampler { struct nulldrv_obj obj; }; +struct nulldrv_shader_module { + struct nulldrv_obj obj; +}; + struct nulldrv_pipeline_cache { struct nulldrv_obj obj; }; -- cgit v1.2.3