[Mesa-dev] [PATCH] nir: acknowledge the existence of nir_builder.h

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 30 03:01:11 PDT 2015


On 30/03/15 02:05, Eric Anholt wrote:
> Emil Velikov <emil.l.velikov at gmail.com> writes:
> 
>> The header was added with commit 2a135c470e3(nir: Add an ALU op builder
>> kind of like ir_builder.h) but did not made it into to the sources list,
>> and its dependency of nir_builder_opcodes.h was missing.
>>
>> Fortunately it remained unused until resent commit faf6106c6f6(nir:
> 
> "recent"
> 
Thanks :-)

>> Implement a Mesa IR -> NIR translator.)
>>
>> Cc: Kenneth Graunke <kenneth at whitecape.org>
>> Cc: Eric Anholt <eric at anholt.net>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>
>> Not sure how the out-of-tree build was able to finish without this, 
To asnwer this one myself. As we walk through the subdirs recursively,
the BUILT_SOURCES are generated. Even with parallel build,
the separate jobs run within the same unit (Makefile). So by the time
we're in mesa/Makefile all the glsl sources are generated.

>> although the commit looks like a must have if we want the file in the 
>> tarball.
>>
>> Based on top of the earlier Android series.
>>
>> -Emil
>>
>> ---
>>  src/glsl/Android.gen.mk   | 2 ++
>>  src/glsl/Makefile.am      | 2 ++
>>  src/glsl/Makefile.sources | 1 +
>>  3 files changed, 5 insertions(+)
>>
>> diff --git a/src/glsl/Android.gen.mk b/src/glsl/Android.gen.mk
>> index 82f2bf1..2f54da4 100644
>> --- a/src/glsl/Android.gen.mk
>> +++ b/src/glsl/Android.gen.mk
>> @@ -97,6 +97,8 @@ $(intermediates)/nir/nir_builder_opcodes.h: $(nir_builder_opcodes_deps)
>>  	@mkdir -p $(dir $@)
>>  	@$(MESA_PYTHON2) $(nir_builder_opcodes_gen) $< > $@
>>  
>> +$(LOCAL_PATH)/nir/nir_builder.h: $(intermediates)/nir/nir_builder_opcodes.h
>> +
>>  nir_constant_expressions_gen := $(LOCAL_PATH)/nir/nir_constant_expressions.py
>>  nir_constant_expressions_deps := \
>>  	$(LOCAL_PATH)/nir/nir_opcodes.py \
>> diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
>> index ed90366..58af166 100644
>> --- a/src/glsl/Makefile.am
>> +++ b/src/glsl/Makefile.am
>> @@ -244,6 +244,8 @@ nir/nir_builder_opcodes.h: nir/nir_opcodes.py nir/nir_builder_opcodes_h.py
>>  	$(MKDIR_P) nir;							\
>>  	$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/nir/nir_builder_opcodes_h.py > $@
>>  
>> +nir/nir_builder.h: nir/nir_builder_opcodes.h
>> +
>>  nir/nir_constant_expressions.c: nir/nir_opcodes.py nir/nir_constant_expressions.py nir/nir_constant_expressions.h
>>  	$(MKDIR_P) nir;							\
>>  	$(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/nir/nir_constant_expressions.py > $@
> 
> This is weird -- nir_builder.h isn't a build target that needs to be
> regenerated.  What's it for?
> 
True, nir_builder.h does not need to be generated, but it depends on a
file that is - nir_builder_opcodes.h.  Thus we should note that
dependency. Plus it makes sense given a similar rule a few lines below.

nir/nir.h: nir/nir_opcodes.h


>> diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
>> index 8d29c55..c3b63d1 100644
>> --- a/src/glsl/Makefile.sources
>> +++ b/src/glsl/Makefile.sources
>> @@ -22,6 +22,7 @@ NIR_FILES = \
>>  	nir/glsl_to_nir.h \
>>  	nir/nir.c \
>>  	nir/nir.h \
>> +	nir/nir_builder.h \
>>  	nir/nir_constant_expressions.h \
>>  	nir/nir_dominance.c \
>>  	nir/nir_from_ssa.c \
>> -- 
>> 2.3.1
> 
> This hunk is certainly needed.
> 



More information about the mesa-dev mailing list