r600/sfn: read number of images from shader info

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
This commit is contained in:
Gert Wollny 2021-05-02 20:23:11 +02:00
parent efdb888b29
commit 6a15c7d9ad
3 changed files with 15 additions and 4 deletions

View File

@ -303,6 +303,7 @@ bool ShaderFromNir::emit_instruction(nir_instr *instr)
bool ShaderFromNir::process_declaration()
{
impl->set_shader_info(sh);
if (!impl->scan_inputs_read(sh))
return false;

View File

@ -285,13 +285,20 @@ bool ShaderFromNirProcessor::process_uniforms(nir_variable *uniform)
sh_info().indirect_files |= 1 << TGSI_FILE_IMAGE;
}
if (uniform->type->is_image()) {
++m_image_count;
}
return true;
}
void ShaderFromNirProcessor::set_shader_info(const nir_shader *sh)
{
m_image_count = sh->info.num_images;
do_set_shader_info(sh);
}
void ShaderFromNirProcessor::do_set_shader_info(const nir_shader *sh)
{
(void)sh;
}
bool ShaderFromNirProcessor::scan_inputs_read(const nir_shader *sh)
{
return true;

View File

@ -93,6 +93,7 @@ public:
void get_array_info(r600_shader& shader) const;
virtual bool scan_inputs_read(const nir_shader *sh);
void set_shader_info(const nir_shader *sh);
protected:
@ -123,6 +124,8 @@ protected:
void inc_atomic_file_count();
virtual void do_set_shader_info(const nir_shader *sh);
enum ESlots {
es_face,
es_instanceid,