[D3D12] Fix point size calculation + point code cleanup
6fcf9d21fe made per-vertex diameter vs. constant radius consistent, and with that commit the shader works with direct pixel to NDC conversion, however, the NDC conversion factor was outdated in that commit (still included the 0.5 factor for diameter to radius conversion, resulting in all points being 50% narrower along each axis than needed). Now, the diameter to radius conversion factor is used there properly, and also the multiplication of the per-vertex diameter by 0.5 has been removed from the shader since the constant already includes it now (the constant diameter is passed via the system constants instead of the radius also).
This commit is contained in:
@@ -242,9 +242,10 @@ class DxbcShaderTranslator : public ShaderTranslator {
|
||||
float ndc_offset[3];
|
||||
float point_vertex_diameter_max;
|
||||
|
||||
float point_constant_radius[2];
|
||||
// Screen point size * 2 (but not supersampled) -> size in NDC.
|
||||
float point_screen_to_ndc[2];
|
||||
float point_constant_diameter[2];
|
||||
// Diameter in guest screen coordinates > radius (0.5 * diameter) in the NDC
|
||||
// for the host viewport.
|
||||
float point_screen_diameter_to_ndc_radius[2];
|
||||
|
||||
uint32_t interpolator_sampling_pattern;
|
||||
uint32_t ps_param_gen;
|
||||
@@ -356,8 +357,8 @@ class DxbcShaderTranslator : public ShaderTranslator {
|
||||
kNDCOffset,
|
||||
kPointVertexDiameterMax,
|
||||
|
||||
kPointConstantRadius,
|
||||
kPointScreenToNDC,
|
||||
kPointConstantDiameter,
|
||||
kPointScreenDiameterToNDCRadius,
|
||||
|
||||
kInterpolatorSamplingPattern,
|
||||
kPSParamGen,
|
||||
|
||||
Reference in New Issue
Block a user