On Mon Sep 18 11:25:09 2023 +0000, Henri Verbeet wrote:
A couple of minor comments:
+typedef enum D3D12_SHADING_RATE_COMBINER +{ + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, + D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, + D3D12_SHADING_RATE_COMBINER_MIN = 2, + D3D12_SHADING_RATE_COMBINER_MAX = 3, + D3D12_SHADING_RATE_COMBINER_SUM = 4, +} D3D12_SHADING_RATE_COMBINER;
It doesn't matter much here, but it seems some decimals slipped through.
+cpp_quote("#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2") +cpp_quote("#define D3D12_SHADING_RATE_VALID_MASK 3")
Should that just use the following?
const UINT D3D12_SHADING_RATE_X_AXIS_SHIFT = 2; const UINT D3D12_SHADING_RATE_VALID_MASK = 3;
+cpp_quote("#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) <<
D3D12_SHADING_RATE_X_AXIS_SHIFT | (y))")
"D3D12_MAKE_COARSE_SHADING_RATE(x, y)"
+cpp_quote("#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK)")
The choice of "y" for the macro parameter is a bit odd, I think. The macro extracts the y-axis value; the input would be a combined x and y shading rate value like those produced by D3D12_MAKE_COARSE_SHADING_RATE.
Thanks for the review.
I made that one enum use hexadecimal constants too, changed the `#define`s for plain constants into regular IDL-level constants, and changed the macro parameters `x` and `y` into `val` for the macros that extract the x or y value out of a combined value.