/* Size of the derefs buffer in bytes. */
unsigned derefs_size = 0;
- nir_foreach_function(function, shader) {
- if (function->impl) {
- nir_foreach_block(block, function->impl) {
+ nir_foreach_function_impl(impl, shader) {
+ {
+ nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_intrinsic) {
nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
static void
tcs_add_output_reads(nir_shader *shader, BITSET_WORD **read)
{
- nir_foreach_function(function, shader) {
- if (!function->impl)
- continue;
-
- nir_foreach_block(block, function->impl) {
+ nir_foreach_function_impl(impl, shader) {
+ nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
if (instr->type != nir_instr_type_intrinsic)
continue;
consts->ShaderCompilerOptions[i].NirOptions->force_indirect_unrolling_sampler;
bool uses_indirect_sampler_array_indexing = false;
- nir_foreach_function(function, prog->_LinkedShaders[i]->Program->nir) {
- nir_foreach_block(block, function->impl) {
+ nir_foreach_function_impl(impl, prog->_LinkedShaders[i]->Program->nir) {
+ nir_foreach_block(block, impl) {
nir_foreach_instr(instr, block) {
/* Check if a sampler array is accessed indirectly */
if (instr->type == nir_instr_type_tex) {
* a nir_address_format_32bit_index_offset pointer. From there forward,
* we leave the derefs in place and let nir_lower_explicit_io handle them.
*/
- nir_foreach_function(function, shader) {
- if (function->impl &&
- lower_buffer_interface_derefs_impl(function->impl, shader_program))
+ nir_foreach_function_impl(impl, shader) {
+ if (lower_buffer_interface_derefs_impl(impl, shader_program))
progress = true;
}
if (!nir)
return NULL;
- nir_foreach_function(func, nir)
+ nir_foreach_function_impl(impl, nir)
{
- nir_foreach_block(block, func->impl)
+ nir_foreach_block(block, impl)
{
nir_foreach_instr(instr, block)
{