diff options
author | Jordan Justen <[email protected]> | 2015-12-18 01:42:46 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-12-18 01:45:11 -0800 |
commit | 5e82a91324d13c9194416347521120a93beef133 (patch) | |
tree | 9d2d8012b6dd421f548d06d11d3d172f22a2c203 /src/vulkan/anv_pipeline.c | |
parent | d7f66f9f6fb47ddf30c782961eb2fc1dcc593975 (diff) |
anv/gen8: Add support for gl_NumWorkGroups
Co-authored-by: Kristian Høgsberg <[email protected]>
Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/vulkan/anv_pipeline.c')
-rw-r--r-- | src/vulkan/anv_pipeline.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index bf983ed8f2a..1906205c4d0 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -348,7 +348,18 @@ anv_pipeline_compile(struct anv_pipeline *pipeline, /* All binding table offsets provided by apply_pipeline_layout() are * relative to the start of the bindint table (plus MAX_RTS for VS). */ - unsigned bias = stage == MESA_SHADER_FRAGMENT ? MAX_RTS : 0; + unsigned bias; + switch (stage) { + case MESA_SHADER_FRAGMENT: + bias = MAX_RTS; + break; + case MESA_SHADER_COMPUTE: + bias = 1; + break; + default: + bias = 0; + break; + } prog_data->binding_table.size_bytes = 0; prog_data->binding_table.texture_start = bias; prog_data->binding_table.ubo_start = bias; @@ -619,6 +630,8 @@ anv_pipeline_compile_cs(struct anv_pipeline *pipeline, memset(prog_data, 0, sizeof(*prog_data)); + prog_data->binding_table.work_groups_start = 0; + nir_shader *nir = anv_pipeline_compile(pipeline, module, entrypoint, MESA_SHADER_COMPUTE, &prog_data->base); |