Increase the varying register count to what the feature level supports.

TRAC #22243 Signed-off-by: Jamie Madill Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1775 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4e48204a
...@@ -2128,7 +2128,7 @@ float Context::getMaximumPointSize() const ...@@ -2128,7 +2128,7 @@ float Context::getMaximumPointSize() const
int Context::getMaximumVaryingVectors() const int Context::getMaximumVaryingVectors() const
{ {
return mMajorShaderModel >= 3 ? MAX_VARYING_VECTORS_SM3 : MAX_VARYING_VECTORS_SM2; return mRenderer->getMaxVaryingVectors();
} }
unsigned int Context::getMaximumCombinedTextureImageUnits() const unsigned int Context::getMaximumCombinedTextureImageUnits() const
......
...@@ -58,17 +58,16 @@ class Query; ...@@ -58,17 +58,16 @@ class Query;
enum enum
{ {
MAX_DRAW_BUFFERS = 1,
MAX_VERTEX_ATTRIBS = 16, MAX_VERTEX_ATTRIBS = 16,
MAX_VARYING_VECTORS_SM2 = 8,
MAX_VARYING_VECTORS_SM3 = 10,
MAX_TEXTURE_IMAGE_UNITS = 16, MAX_TEXTURE_IMAGE_UNITS = 16,
// Implementation upper limit, for devices supporting vertex texture fetch. // Implementation upper limits, real maximums depend on the hardware
// Real limit depends on the shader model
IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16, IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16,
IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS, IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS,
MAX_DRAW_BUFFERS = 1 IMPLEMENTATION_MAX_VARYING_VECTORS = 32
}; };
enum QueryType enum QueryType
......
...@@ -1174,7 +1174,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std:: ...@@ -1174,7 +1174,7 @@ bool ProgramBinary::linkVaryings(InfoLog &infoLog, std::string& pixelHLSL, std::
} }
// Map the varyings to the register file // Map the varyings to the register file
const Varying *packing[MAX_VARYING_VECTORS_SM3][4] = {NULL}; const Varying *packing[IMPLEMENTATION_MAX_VARYING_VECTORS][4] = {NULL};
int registers = packVaryings(infoLog, packing, fragmentShader); int registers = packVaryings(infoLog, packing, fragmentShader);
if (registers < 0) if (registers < 0)
......
...@@ -147,6 +147,7 @@ class Renderer ...@@ -147,6 +147,7 @@ class Renderer
virtual unsigned int getMaxVertexTextureImageUnits() const = 0; virtual unsigned int getMaxVertexTextureImageUnits() const = 0;
virtual int getMaxVertexUniformVectors() const = 0; virtual int getMaxVertexUniformVectors() const = 0;
virtual int getMaxFragmentUniformVectors() const = 0; virtual int getMaxFragmentUniformVectors() const = 0;
virtual int getMaxVaryingVectors() const = 0;
virtual bool getNonPower2TextureSupport() const = 0; virtual bool getNonPower2TextureSupport() const = 0;
virtual bool getDepthTextureSupport() const = 0; virtual bool getDepthTextureSupport() const = 0;
virtual bool getOcclusionQuerySupport() const = 0; virtual bool getOcclusionQuerySupport() const = 0;
......
...@@ -1884,6 +1884,21 @@ int Renderer11::getMaxFragmentUniformVectors() const ...@@ -1884,6 +1884,21 @@ int Renderer11::getMaxFragmentUniformVectors() const
return MAX_FRAGMENT_UNIFORM_VECTORS_D3D11; return MAX_FRAGMENT_UNIFORM_VECTORS_D3D11;
} }
int Renderer11::getMaxVaryingVectors() const
{
META_ASSERT(gl::IMPLEMENTATION_MAX_VARYING_VECTORS == D3D11_VS_OUTPUT_REGISTER_COUNT);
switch (mFeatureLevel)
{
case D3D_FEATURE_LEVEL_11_0:
return D3D11_VS_OUTPUT_REGISTER_COUNT;
case D3D_FEATURE_LEVEL_10_1:
case D3D_FEATURE_LEVEL_10_0:
return D3D10_VS_OUTPUT_REGISTER_COUNT;
default: UNREACHABLE();
return 0;
}
}
bool Renderer11::getNonPower2TextureSupport() const bool Renderer11::getNonPower2TextureSupport() const
{ {
// TODO // TODO
......
...@@ -107,6 +107,7 @@ class Renderer11 : public Renderer ...@@ -107,6 +107,7 @@ class Renderer11 : public Renderer
virtual unsigned int getMaxVertexTextureImageUnits() const; virtual unsigned int getMaxVertexTextureImageUnits() const;
virtual int getMaxVertexUniformVectors() const; virtual int getMaxVertexUniformVectors() const;
virtual int getMaxFragmentUniformVectors() const; virtual int getMaxFragmentUniformVectors() const;
virtual int getMaxVaryingVectors() const;
virtual bool getNonPower2TextureSupport() const; virtual bool getNonPower2TextureSupport() const;
virtual bool getDepthTextureSupport() const; virtual bool getDepthTextureSupport() const;
virtual bool getOcclusionQuerySupport() const; virtual bool getOcclusionQuerySupport() const;
......
...@@ -2250,6 +2250,11 @@ int Renderer9::getMaxFragmentUniformVectors() const ...@@ -2250,6 +2250,11 @@ int Renderer9::getMaxFragmentUniformVectors() const
return getMajorShaderModel() >= 3 ? MAX_FRAGMENT_UNIFORM_VECTORS_SM3 : MAX_FRAGMENT_UNIFORM_VECTORS_SM2; return getMajorShaderModel() >= 3 ? MAX_FRAGMENT_UNIFORM_VECTORS_SM3 : MAX_FRAGMENT_UNIFORM_VECTORS_SM2;
} }
int Renderer9::getMaxVaryingVectors() const
{
return getMajorShaderModel() >= 3 ? MAX_VARYING_VECTORS_SM3 : MAX_VARYING_VECTORS_SM2;
}
bool Renderer9::getNonPower2TextureSupport() const bool Renderer9::getNonPower2TextureSupport() const
{ {
return mSupportsNonPower2Textures; return mSupportsNonPower2Textures;
......
...@@ -41,6 +41,8 @@ enum ...@@ -41,6 +41,8 @@ enum
MAX_VERTEX_UNIFORM_VECTORS = D3D9_MAX_FLOAT_CONSTANTS - 2, // Reserve space for dx_HalfPixelSize and dx_DepthRange. MAX_VERTEX_UNIFORM_VECTORS = D3D9_MAX_FLOAT_CONSTANTS - 2, // Reserve space for dx_HalfPixelSize and dx_DepthRange.
MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3, // Reserve space for dx_Coord, dx_DepthFront and dx_DepthRange. MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3, // Reserve space for dx_Coord, dx_DepthFront and dx_DepthRange.
MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3, MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3,
MAX_VARYING_VECTORS_SM2 = 8,
MAX_VARYING_VECTORS_SM3 = 10
}; };
class Renderer9 : public Renderer class Renderer9 : public Renderer
...@@ -134,6 +136,7 @@ class Renderer9 : public Renderer ...@@ -134,6 +136,7 @@ class Renderer9 : public Renderer
virtual unsigned int getMaxVertexTextureImageUnits() const; virtual unsigned int getMaxVertexTextureImageUnits() const;
virtual int getMaxVertexUniformVectors() const; virtual int getMaxVertexUniformVectors() const;
virtual int getMaxFragmentUniformVectors() const; virtual int getMaxFragmentUniformVectors() const;
virtual int getMaxVaryingVectors() const;
virtual bool getNonPower2TextureSupport() const; virtual bool getNonPower2TextureSupport() const;
virtual bool getDepthTextureSupport() const; virtual bool getDepthTextureSupport() const;
virtual bool getOcclusionQuerySupport() const; virtual bool getOcclusionQuerySupport() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment