[Mesa-dev] [PATCH 0/9] cs: Add gl_NumWorkGroups

Kristian Høgsberg krh at bitplanet.net
Fri Sep 25 17:49:09 PDT 2015


Jordan Justen <jordan.l.justen at intel.com> writes:

> git://people.freedesktop.org/~jljusten/mesa cs-num-work-groups-v1
> http://patchwork.freedesktop.org/bundle/jljusten/cs-num-work-groups-v1
>
> I recently sent a piglit patch for the ARB_compute_shader
> indirect-compute test: "arb_compute_shader: Use gl_NumWorkGroups in
> global ID tests"
>
> These patches allow the arb_compute_shader-indirect-compute test (with
> the patch added to piglit) to pass.
>
> To test, I use i965 and set MESA_GL_VERSION_OVERRIDE=4.3,
> MESA_GLSL_VERSION_OVERRIDE=430 and
> MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader.
>
> Jordan Justen (9):
>   mesa/cs: Add MESA_VERBOSE=api support in DispatchCompute*

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   i965/cs: Re-emit push constants and cs_state on new batches
>   i965/cs: Re-emit cs_state when surfaces have changed

I was confused about why these were split out from the patches further
down that introduce the dependencies.  Then I realized they're fixes for
the current code: 2/9 reemits the push constants when we start a new
batch as they're stored in the batch. For 3/9, when we bind new buffers
or textures we need to reemit cs state to flush the new binding table
out.

I would mention that in the commit messages.

Both,
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   i965/cs: Store compute invocation information in brw context

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   i965/cs: Add a binding table entry for gl_NumWorkGroups

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   i965/cs: Setup surface binding for gl_NumWorkGroups

Maybe we should mention that we have to do this as an atom because it
has to happen after uses_num_work_groups is set in brw_upload_cs_prog()
but before brw_upload_cs_state().

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   glsl/cs: Add gl_NumWorkGroups as a system value

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   nir: Convert SYSTEM_VALUE_NUM_WORK_GROUPS to a nir intrinsic

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

>   i965/cs: Generate code to load gl_NumWorkGroups

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

Kristian

>
>  src/glsl/builtin_variables.cpp                   |  2 +-
>  src/glsl/nir/nir.c                               |  4 ++
>  src/glsl/nir/nir_intrinsics.h                    |  1 +
>  src/glsl/shader_enums.h                          |  1 +
>  src/mesa/drivers/dri/i965/brw_compute.c          | 52 +++++++++++++-----------
>  src/mesa/drivers/dri/i965/brw_context.h          | 27 +++++++++++-
>  src/mesa/drivers/dri/i965/brw_fs.cpp             | 20 +++++++--
>  src/mesa/drivers/dri/i965/brw_fs.h               |  3 +-
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp         | 28 +++++++++++++
>  src/mesa/drivers/dri/i965/brw_state.h            |  1 +
>  src/mesa/drivers/dri/i965/brw_state_upload.c     |  3 ++
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 43 ++++++++++++++++++++
>  src/mesa/drivers/dri/i965/gen7_cs_state.c        |  9 ++--
>  src/mesa/main/compute.c                          |  7 ++++
>  14 files changed, 167 insertions(+), 34 deletions(-)


More information about the mesa-dev mailing list