Commit f2d0e48d authored by Connor Abbott's avatar Connor Abbott

glsl/nir: Add optimization pass for access flags

Right now, this just deduces when we can arbitrarily reorder SSBO and
image loads, matching the existing logic in radeonsi's TGSI->LLVM pass.
This approach can't handle some things that nir_opt_copy_prop_vars can,
but it can handle images, and with GCM it lets us hoist reads outside of
loops. We can also pass this information to LLVM which lets it do its
own optimizations on it.

This is GLSL only as I haven't tested it on Vulkan yet, and it would
probably need a few changes to work there.
Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
parent c813c577
......@@ -36,6 +36,7 @@ LIBGLSL_FILES = \
glsl/gl_nir_link_xfb.c \
glsl/gl_nir_linker.c \
glsl/gl_nir_linker.h \
glsl/gl_nir_opt_access.c \
glsl/gl_nir.h \
glsl/glsl_parser_extras.cpp \
glsl/glsl_parser_extras.h \
......
......@@ -44,6 +44,8 @@ bool gl_nir_lower_samplers_as_deref(nir_shader *shader,
bool gl_nir_lower_buffers(nir_shader *shader,
const struct gl_shader_program *shader_program);
bool gl_nir_opt_access(nir_shader *shader);
#ifdef __cplusplus
}
#endif
......
This diff is collapsed.
......@@ -84,6 +84,7 @@ files_libglsl = files(
'gl_nir_link_xfb.c',
'gl_nir_linker.c',
'gl_nir_linker.h',
'gl_nir_opt_access.c',
'gl_nir.h',
'glsl_parser_extras.cpp',
'glsl_parser_extras.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment