diff options
author | Jordan Justen <[email protected]> | 2016-03-28 14:49:56 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2016-03-28 17:01:35 -0700 |
commit | 8dbfa265a439904628c2d875885e80bc45a90a05 (patch) | |
tree | 20cc993d0acf1edefad612355425a1a03606c145 /src/intel/vulkan/genX_cmd_buffer.c | |
parent | 1a3adae84aa16247cba0e3619d54e6d8d543fcf1 (diff) |
anv/gen7: DispatchIndirect requires cmd parser 5
Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 1b53f85419b..35c46008a84 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -638,6 +638,24 @@ void genX(CmdDrawIndexedIndirect)( .PrimitiveTopologyType = pipeline->topology); } +#if GEN_GEN == 7 + +static bool +verify_cmd_parser(const struct anv_device *device, + int required_version, + const char *function) +{ + if (device->instance->physicalDevice.cmd_parser_version < required_version) { + vk_errorf(VK_ERROR_FEATURE_NOT_PRESENT, + "cmd parser version %d is required for %s", + required_version, function); + return false; + } else { + return true; + } +} + +#endif void genX(CmdDispatch)( VkCommandBuffer commandBuffer, @@ -699,6 +717,14 @@ void genX(CmdDispatchIndirect)( uint32_t bo_offset = buffer->offset + offset; struct anv_batch *batch = &cmd_buffer->batch; +#if GEN_GEN == 7 + /* Linux 4.4 added command parser version 5 which allows the GPGPU + * indirect dispatch registers to be written. + */ + if (verify_cmd_parser(cmd_buffer->device, 5, "vkCmdDispatchIndirect")) + return; +#endif + if (prog_data->uses_num_work_groups) { cmd_buffer->state.num_workgroups_offset = bo_offset; cmd_buffer->state.num_workgroups_bo = bo; |