HLSL: use LOD form of ImageQuerySize when needed.
The non-LOD form of image size query is prohibited in certain cases: see the OpImageQuerySize and OpImageQuerySizeLod sections of the SPIR-V spec for details. Sometimes we were generating the non-LOD form when we should have been using the LOD form. Sometimes the LOD form is required even if the underlying HLSL query did not supply a MIP level itself, in which case level 0 is now queried.
This commit is contained in:
@@ -364,6 +364,8 @@ gl_FragCoord origin is upper left
|
||||
0:70 'sizeQueryTemp' (temp uint)
|
||||
0:70 textureSize (temp uint)
|
||||
0:70 'g_tTex1df4' (uniform texture1D)
|
||||
0:70 Constant:
|
||||
0:70 0 (const int)
|
||||
0:70 move second child to first child (temp int)
|
||||
0:70 'WidthI' (temp int)
|
||||
0:70 Convert uint to int (temp int)
|
||||
@@ -808,6 +810,8 @@ gl_FragCoord origin is upper left
|
||||
0:70 'sizeQueryTemp' (temp uint)
|
||||
0:70 textureSize (temp uint)
|
||||
0:70 'g_tTex1df4' (uniform texture1D)
|
||||
0:70 Constant:
|
||||
0:70 0 (const int)
|
||||
0:70 move second child to first child (temp int)
|
||||
0:70 'WidthI' (temp int)
|
||||
0:70 Convert uint to int (temp int)
|
||||
@@ -1284,7 +1288,7 @@ gl_FragCoord origin is upper left
|
||||
276: 6(float) CompositeExtract 275 0
|
||||
Store 268(r51) 276
|
||||
281: 278 Load 280(g_tTex1df4)
|
||||
282: 14(int) ImageQuerySize 281
|
||||
282: 14(int) ImageQuerySizeLod 281 53
|
||||
Store 277(sizeQueryTemp) 282
|
||||
284: 15(int) Load 277(sizeQueryTemp)
|
||||
285: 14(int) Bitcast 284
|
||||
|
||||
Reference in New Issue
Block a user