Commit def624bc by Geoff Lang

Move maxSamples from Extensions to Caps because it is an ES3 limit.

BUG=angleproject:886 Change-Id: Ibcfc2f06e8308e2e6eb1a6c38206b803f689d7af Reviewed-on: https://chromium-review.googlesource.com/265470Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent a836e883
......@@ -448,7 +448,7 @@ Caps::Caps()
maxTextureImageUnits(0),
minProgramTexelOffset(0),
maxProgramTexelOffset(0),
// Table 6.33
maxUniformBufferBindings(0),
maxUniformBlockSize(0),
uniformBufferOffsetAlignment(0),
......@@ -458,10 +458,12 @@ Caps::Caps()
maxVaryingComponents(0),
maxVaryingVectors(0),
maxCombinedTextureImageUnits(0),
// Table 6.34
maxTransformFeedbackInterleavedComponents(0),
maxTransformFeedbackSeparateAttributes(0),
maxTransformFeedbackSeparateComponents(0)
maxTransformFeedbackSeparateComponents(0),
// Table 6.35
maxSamples(0)
{
}
......
......@@ -177,7 +177,6 @@ struct Extensions
// GL_ANGLE_framebuffer_multisample
bool framebufferMultisample;
GLuint maxSamples;
// GL_ANGLE_instanced_arrays
bool instancedArrays;
......@@ -305,6 +304,9 @@ struct Caps
GLuint maxTransformFeedbackInterleavedComponents;
GLuint maxTransformFeedbackSeparateAttributes;
GLuint maxTransformFeedbackSeparateComponents;
// Table 6.35, Framebuffer Dependent Values
GLuint maxSamples;
};
}
......
......@@ -819,7 +819,7 @@ void Context::getIntegerv(GLenum pname, GLint *params)
case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: *params = mCaps.maxTransformFeedbackSeparateAttributes; break;
case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: *params = mCaps.maxTransformFeedbackSeparateComponents; break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = mCaps.compressedTextureFormats.size(); break;
case GL_MAX_SAMPLES_ANGLE: *params = mExtensions.maxSamples; break;
case GL_MAX_SAMPLES_ANGLE: *params = mCaps.maxSamples; break;
case GL_MAX_VIEWPORT_DIMS:
{
params[0] = mCaps.maxViewportWidth;
......@@ -1576,7 +1576,7 @@ void Context::initCaps(GLuint clientVersion)
mTextureCaps.insert(format, formatCaps);
}
mExtensions.maxSamples = maxSamples;
mCaps.maxSamples = maxSamples;
}
Data Context::getData() const
......
......@@ -1072,6 +1072,9 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, gl::
caps->maxTransformFeedbackSeparateAttributes = GetMaximumStreamOutputBuffers(featureLevel);
caps->maxTransformFeedbackSeparateComponents = GetMaximumStreamOutputSeparateComponents(featureLevel);
// Multisample limits
caps->maxSamples = maxSamples;
// GL extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = true;
......@@ -1094,7 +1097,6 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, gl::
extensions->blendMinMax = true;
extensions->framebufferBlit = GetFramebufferBlitSupport(featureLevel);
extensions->framebufferMultisample = GetFramebufferMultisampleSupport(featureLevel);
extensions->maxSamples = maxSamples;
extensions->instancedArrays = GetInstancingSupport(featureLevel);
extensions->packReverseRowOrder = true;
extensions->standardDerivatives = GetDerivativeInstructionSupport(featureLevel);
......
......@@ -472,6 +472,9 @@ void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceT
caps->maxTransformFeedbackSeparateAttributes = 0;
caps->maxTransformFeedbackSeparateComponents = 0;
// Multisample limits
caps->maxSamples = maxSamples;
// GL extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = deviceCaps.MaxVertexIndex >= (1 << 16);
......@@ -528,7 +531,6 @@ void GenerateCaps(IDirect3D9 *d3d9, IDirect3DDevice9 *device, D3DDEVTYPE deviceT
extensions->blendMinMax = true;
extensions->framebufferBlit = true;
extensions->framebufferMultisample = true;
extensions->maxSamples = maxSamples;
extensions->instancedArrays = deviceCaps.PixelShaderVersion >= D3DPS_VERSION(3, 0);
extensions->packReverseRowOrder = true;
extensions->standardDerivatives = (deviceCaps.PS20Caps.Caps & D3DPS20CAPS_GRADIENTINSTRUCTIONS) != 0;
......
......@@ -183,6 +183,9 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
caps->maxTransformFeedbackSeparateAttributes = 4;
caps->maxTransformFeedbackSeparateComponents = 4;
// Table 6.35, Framebuffer Dependent Values
caps->maxSamples = 4;
// Extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->textureNPOT = true;
......
......@@ -351,9 +351,9 @@ bool ValidateRenderbufferStorageParametersANGLE(gl::Context *context, GLenum tar
ASSERT(samples == 0 || context->getExtensions().framebufferMultisample);
// ANGLE_framebuffer_multisample states that the value of samples must be less than or equal
// to MAX_SAMPLES_ANGLE (Context::getExtensions().maxSamples) otherwise GL_INVALID_VALUE is
// to MAX_SAMPLES_ANGLE (Context::getCaps().maxSamples) otherwise GL_INVALID_VALUE is
// generated.
if (static_cast<GLuint>(samples) > context->getExtensions().maxSamples)
if (static_cast<GLuint>(samples) > context->getCaps().maxSamples)
{
context->recordError(Error(GL_INVALID_VALUE));
return false;
......
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