"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/compiler/nir/nir_lower_var_copies.c" between
mesa-19.1.3.tar.xz and mesa-19.1.4.tar.xz

About: Mesa is an open-source implementation of the OpenGL specification - a system for rendering interactive 3D graphics (main library code). Latest release.

nir_lower_var_copies.c  (mesa-19.1.3.tar.xz):nir_lower_var_copies.c  (mesa-19.1.4.tar.xz)
skipping to change at line 59 skipping to change at line 59
assert(**deref_arr == NULL); assert(**deref_arr == NULL);
*deref_arr = NULL; *deref_arr = NULL;
return parent; return parent;
} }
static void static void
emit_deref_copy_load_store(nir_builder *b, emit_deref_copy_load_store(nir_builder *b,
nir_deref_instr *dst_deref, nir_deref_instr *dst_deref,
nir_deref_instr **dst_deref_arr, nir_deref_instr **dst_deref_arr,
nir_deref_instr *src_deref, nir_deref_instr *src_deref,
nir_deref_instr **src_deref_arr) nir_deref_instr **src_deref_arr,
enum gl_access_qualifier dst_access,
enum gl_access_qualifier src_access)
{ {
if (dst_deref_arr || src_deref_arr) { if (dst_deref_arr || src_deref_arr) {
assert(dst_deref_arr && src_deref_arr); assert(dst_deref_arr && src_deref_arr);
dst_deref = build_deref_to_next_wildcard(b, dst_deref, &dst_deref_arr); dst_deref = build_deref_to_next_wildcard(b, dst_deref, &dst_deref_arr);
src_deref = build_deref_to_next_wildcard(b, src_deref, &src_deref_arr); src_deref = build_deref_to_next_wildcard(b, src_deref, &src_deref_arr);
} }
if (dst_deref_arr || src_deref_arr) { if (dst_deref_arr || src_deref_arr) {
assert(dst_deref_arr && src_deref_arr); assert(dst_deref_arr && src_deref_arr);
assert((*dst_deref_arr)->deref_type == nir_deref_type_array_wildcard); assert((*dst_deref_arr)->deref_type == nir_deref_type_array_wildcard);
skipping to change at line 82 skipping to change at line 84
unsigned length = glsl_get_length(src_deref->type); unsigned length = glsl_get_length(src_deref->type);
/* The wildcards should represent the same number of elements */ /* The wildcards should represent the same number of elements */
assert(length == glsl_get_length(dst_deref->type)); assert(length == glsl_get_length(dst_deref->type));
assert(length > 0); assert(length > 0);
for (unsigned i = 0; i < length; i++) { for (unsigned i = 0; i < length; i++) {
emit_deref_copy_load_store(b, emit_deref_copy_load_store(b,
nir_build_deref_array_imm(b, dst_deref, i), nir_build_deref_array_imm(b, dst_deref, i),
dst_deref_arr + 1, dst_deref_arr + 1,
nir_build_deref_array_imm(b, src_deref, i), nir_build_deref_array_imm(b, src_deref, i),
src_deref_arr + 1); src_deref_arr + 1, dst_access, src_access);
} }
} else { } else {
assert(glsl_get_bare_type(dst_deref->type) == assert(glsl_get_bare_type(dst_deref->type) ==
glsl_get_bare_type(src_deref->type)); glsl_get_bare_type(src_deref->type));
assert(glsl_type_is_vector_or_scalar(dst_deref->type)); assert(glsl_type_is_vector_or_scalar(dst_deref->type));
nir_store_deref(b, dst_deref, nir_load_deref(b, src_deref), ~0); nir_store_deref_with_access(b, dst_deref,
nir_load_deref_with_access(b, src_deref, src_a
ccess),
~0, src_access);
} }
} }
void void
nir_lower_deref_copy_instr(nir_builder *b, nir_intrinsic_instr *copy) nir_lower_deref_copy_instr(nir_builder *b, nir_intrinsic_instr *copy)
{ {
/* Unfortunately, there's just no good way to handle wildcards except to /* Unfortunately, there's just no good way to handle wildcards except to
* flip the chain around and walk the list from variable to final pointer. * flip the chain around and walk the list from variable to final pointer.
*/ */
assert(copy->src[0].is_ssa && copy->src[1].is_ssa); assert(copy->src[0].is_ssa && copy->src[1].is_ssa);
nir_deref_instr *dst = nir_instr_as_deref(copy->src[0].ssa->parent_instr); nir_deref_instr *dst = nir_instr_as_deref(copy->src[0].ssa->parent_instr);
nir_deref_instr *src = nir_instr_as_deref(copy->src[1].ssa->parent_instr); nir_deref_instr *src = nir_instr_as_deref(copy->src[1].ssa->parent_instr);
nir_deref_path dst_path, src_path; nir_deref_path dst_path, src_path;
nir_deref_path_init(&dst_path, dst, NULL); nir_deref_path_init(&dst_path, dst, NULL);
nir_deref_path_init(&src_path, src, NULL); nir_deref_path_init(&src_path, src, NULL);
b->cursor = nir_before_instr(&copy->instr); b->cursor = nir_before_instr(&copy->instr);
emit_deref_copy_load_store(b, dst_path.path[0], &dst_path.path[1], emit_deref_copy_load_store(b, dst_path.path[0], &dst_path.path[1],
src_path.path[0], &src_path.path[1]); src_path.path[0], &src_path.path[1],
nir_intrinsic_dst_access(copy),
nir_intrinsic_src_access(copy));
nir_deref_path_finish(&dst_path); nir_deref_path_finish(&dst_path);
nir_deref_path_finish(&src_path); nir_deref_path_finish(&src_path);
} }
static bool static bool
lower_var_copies_impl(nir_function_impl *impl) lower_var_copies_impl(nir_function_impl *impl)
{ {
bool progress = false; bool progress = false;
 End of changes. 4 change blocks. 
4 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)