diff options
author | Marek Olšák <[email protected]> | 2016-10-09 19:26:43 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-10-24 21:41:35 +0200 |
commit | 72267a25db6d5abae80f785b8c3742a38d57767a (patch) | |
tree | 892119d51881cb9e817d159deb428f9b7de8dd29 /src/gallium/auxiliary/tgsi/tgsi_scan.c | |
parent | d89890d000da36c51484ee170b2d9727d2766a93 (diff) |
tgsi/scan: get information about shader buffer usage
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_scan.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index c27f0c6b89a..517b98387a1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -339,6 +339,18 @@ scan_instruction(struct tgsi_shader_info *info, info->images_writemask = info->images_declared; else info->images_writemask |= 1 << src->Register.Index; + } else if (src->Register.File == TGSI_FILE_BUFFER) { + if (src->Register.Indirect) + info->shader_buffers_atomic = info->shader_buffers_declared; + else + info->shader_buffers_atomic |= 1 << src->Register.Index; + } + } else { + if (src->Register.File == TGSI_FILE_BUFFER) { + if (src->Register.Indirect) + info->shader_buffers_load = info->shader_buffers_declared; + else + info->shader_buffers_load |= 1 << src->Register.Index; } } } @@ -366,6 +378,11 @@ scan_instruction(struct tgsi_shader_info *info, info->images_writemask = info->images_declared; else info->images_writemask |= 1 << dst->Register.Index; + } else if (dst->Register.File == TGSI_FILE_BUFFER) { + if (dst->Register.Indirect) + info->shader_buffers_store = info->shader_buffers_declared; + else + info->shader_buffers_store |= 1 << dst->Register.Index; } } } @@ -427,6 +444,8 @@ scan_declaration(struct tgsi_shader_info *info, info->const_buffers_declared |= 1u << buffer; } else if (file == TGSI_FILE_IMAGE) { info->images_declared |= 1u << reg; + } else if (file == TGSI_FILE_BUFFER) { + info->shader_buffers_declared |= 1u << reg; } else if (file == TGSI_FILE_INPUT) { info->input_semantic_name[reg] = (ubyte) semName; info->input_semantic_index[reg] = (ubyte) semIndex; |