@@ -100,17 +100,16 @@ def test02_interp_1d(t, wrap_mode, texture_type):
100
100
101
101
StorageType = dr .array_t (tex .value ())
102
102
103
- for _ in range (0 , 4 ):
104
- values = StorageType (rng_1 .next_float32 ())
105
- tex .set_value (values )
106
- tex_no_accel .set_value (values )
103
+ values = StorageType (rng_1 .next_float32 ())
104
+ tex .set_value (values )
105
+ tex_no_accel .set_value (values )
107
106
108
- pos = Array1f (rng_2 .next_float32 ())
109
- result_no_accel = tex_no_accel .eval (pos )
110
- result_accel = tex .eval (pos )
111
- dr .eval (result_no_accel , result_accel )
107
+ pos = Array1f (rng_2 .next_float32 ())
108
+ result_no_accel = tex_no_accel .eval (pos )
109
+ result_accel = tex .eval (pos )
110
+ dr .eval (result_no_accel , result_accel )
112
111
113
- assert dr .allclose (result_no_accel , result_accel , 5e-3 , 5e-3 )
112
+ assert dr .allclose (result_no_accel , result_accel , 5e-3 , 5e-3 )
114
113
115
114
116
115
@pytest .mark .parametrize ("wrap_mode" , wrap_modes )
@@ -131,17 +130,16 @@ def test03_interp_2d(t, wrap_mode, texture_type):
131
130
tex = TexType ([N , M ], ch , True , dr .FilterMode .Linear , wrap_mode )
132
131
tex_no_accel = TexType ([N , M ], ch , False , dr .FilterMode .Linear , wrap_mode )
133
132
134
- for _ in range (0 , 4 ):
135
- values = rng_1 .next_float32 ()
136
- tex .set_value (values )
137
- tex_no_accel .set_value (values )
133
+ values = rng_1 .next_float32 ()
134
+ tex .set_value (values )
135
+ tex_no_accel .set_value (values )
138
136
139
- pos = Array2f (rng_2 .next_float32 (), rng_2 .next_float32 ())
140
- result_no_accel = tex_no_accel .eval (pos )
141
- result_accel = tex .eval (pos )
142
- dr .eval (result_no_accel , result_accel )
137
+ pos = Array2f (rng_2 .next_float32 (), rng_2 .next_float32 ())
138
+ result_no_accel = tex_no_accel .eval (pos )
139
+ result_accel = tex .eval (pos )
140
+ dr .eval (result_no_accel , result_accel )
143
141
144
- assert (dr .allclose (result_no_accel , result_accel , 5e-3 , 5e-3 ))
142
+ assert (dr .allclose (result_no_accel , result_accel , 5e-3 , 5e-3 ))
145
143
146
144
147
145
@pytest .mark .parametrize ("wrap_mode" , wrap_modes )
@@ -162,17 +160,16 @@ def test04_interp_3d(t, wrap_mode, texture_type):
162
160
tex = TexType ([N , M , L ], ch , True , dr .FilterMode .Linear , wrap_mode )
163
161
tex_no_accel = TexType ([N , M , L ], ch , False , dr .FilterMode .Linear , wrap_mode )
164
162
165
- for _ in range (0 , 4 ):
166
- values = rng_1 .next_float32 ()
167
- tex .set_value (values )
168
- tex_no_accel .set_value (values )
163
+ values = rng_1 .next_float32 ()
164
+ tex .set_value (values )
165
+ tex_no_accel .set_value (values )
169
166
170
- pos = Array3f (rng_2 .next_float32 (), rng_2 .next_float32 (), rng_2 .next_float32 ())
171
- result_no_accel = tex_no_accel .eval (pos )
172
- result_accel = tex .eval (pos )
173
- dr .eval (result_no_accel , result_accel )
167
+ pos = Array3f (rng_2 .next_float32 (), rng_2 .next_float32 (), rng_2 .next_float32 ())
168
+ result_no_accel = tex_no_accel .eval (pos )
169
+ result_accel = tex .eval (pos )
170
+ dr .eval (result_no_accel , result_accel )
174
171
175
- assert (dr .allclose (result_no_accel , result_accel , 6e-3 , 6e-3 ))
172
+ assert (dr .allclose (result_no_accel , result_accel , 6e-3 , 6e-3 ))
176
173
177
174
178
175
@pytest .mark .parametrize ("migrate" , [True , False ])
@@ -565,12 +562,15 @@ def test18_fetch_1d(t, texture_type):
565
562
tex_no_accel .set_value (tex_data )
566
563
567
564
pos = Array1f (0.5 )
568
- out_no_acel = tex_no_accel .eval_fetch (pos )
565
+ out_no_accel = tex_no_accel .eval_fetch (pos )
569
566
out_accel = tex .eval_fetch (pos )
567
+
568
+ dr .eval (tex_data , out_accel , out_no_accel )
569
+
570
570
for k in range (0 , ch ):
571
- assert dr .allclose (tex_data [k ], out_no_acel [0 ][k ])
571
+ assert dr .allclose (tex_data [k ], out_no_accel [0 ][k ])
572
572
assert dr .allclose (tex_data [k ], out_accel [0 ][k ])
573
- assert dr .allclose (tex_data [ch + k ], out_no_acel [1 ][k ])
573
+ assert dr .allclose (tex_data [ch + k ], out_no_accel [1 ][k ])
574
574
assert dr .allclose (tex_data [ch + k ], out_accel [1 ][k ])
575
575
576
576
@@ -597,6 +597,9 @@ def test19_fetch_2d(t, texture_type):
597
597
pos = Array2f (0.5 , 0.5 )
598
598
out_no_accel = tex_no_accel .eval_fetch (pos )
599
599
out_accel = tex .eval_fetch (pos )
600
+
601
+ dr .eval (tex_data , out_accel , out_no_accel )
602
+
600
603
for k in range (0 , ch ):
601
604
assert dr .allclose (tex_data [k ], out_no_accel [0 ][k ])
602
605
assert dr .allclose (tex_data [k ], out_accel [0 ][k ])
@@ -631,6 +634,9 @@ def test20_fetch_3d(t, texture_type):
631
634
pos = Array3f (0.3 , 0.3 , 0.3 )
632
635
out_no_accel = tex_no_accel .eval_fetch (pos )
633
636
out_accel = tex .eval_fetch (pos )
637
+
638
+ dr .eval (tex_data , out_accel , out_no_accel )
639
+
634
640
for k in range (0 , ch ):
635
641
assert dr .allclose (tex_data [k ], out_no_accel [0 ][k ])
636
642
assert dr .allclose (tex_data [k ], out_accel [0 ][k ])
0 commit comments