Added PointSprites Support for renderers that do not support Geometry Shaders
Change-Id: Iae9ac5f8fbba68dba5e49ccda7bb7eebb05c8e9a
Reviewed-on: https://chromium-review.googlesource.com/240450
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index de1d4af..cb2c9f7 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -140,8 +140,8 @@
}
else
{
- // Reserve registers for dx_DepthRange and dx_ViewAdjust
- mUniformHLSL->reserveUniformRegisters(2);
+ // Reserve registers for dx_DepthRange, dx_ViewAdjust and dx_ViewCoords
+ mUniformHLSL->reserveUniformRegisters(3);
}
}
@@ -510,10 +510,11 @@
out << " float3 dx_DepthRange : packoffset(c0);\n";
}
- // dx_ViewAdjust will only be used in Feature Level 9 shaders.
+ // dx_ViewAdjust and dx_ViewCoords will only be used in Feature Level 9 shaders.
// However, we declare it for all shaders (including Feature Level 10+).
// The bytecode is the same whether we declare it or not, since D3DCompiler removes it if it's unused.
out << " float4 dx_ViewAdjust : packoffset(c1);\n";
+ out << " float2 dx_ViewCoords : packoffset(c2);\n";
out << "};\n"
"\n";
@@ -525,7 +526,8 @@
out << "uniform float3 dx_DepthRange : register(c0);\n";
}
- out << "uniform float4 dx_ViewAdjust : register(c1);\n"
+ out << "uniform float4 dx_ViewAdjust : register(c1);\n";
+ out << "uniform float2 dx_ViewCoords : register(c2);\n"
"\n";
}