Commit 097d3c0c by Jamie Madill Committed by Commit Bot

Make SamplerState a contained class.

This will more easily allow us to use a cached completeness comparison value. The cached value only gets updated on certain setters. Bug: angleproject:2763 Change-Id: Ib80db8517560617087ae8360f7af69d6c2392b76 Reviewed-on: https://chromium-review.googlesource.com/1171507Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarFrank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent f0d258c3
...@@ -42,112 +42,112 @@ const std::string &Sampler::getLabel() const ...@@ -42,112 +42,112 @@ const std::string &Sampler::getLabel() const
void Sampler::setMinFilter(GLenum minFilter) void Sampler::setMinFilter(GLenum minFilter)
{ {
mState.minFilter = minFilter; mState.setMinFilter(minFilter);
} }
GLenum Sampler::getMinFilter() const GLenum Sampler::getMinFilter() const
{ {
return mState.minFilter; return mState.getMinFilter();
} }
void Sampler::setMagFilter(GLenum magFilter) void Sampler::setMagFilter(GLenum magFilter)
{ {
mState.magFilter = magFilter; mState.setMagFilter(magFilter);
} }
GLenum Sampler::getMagFilter() const GLenum Sampler::getMagFilter() const
{ {
return mState.magFilter; return mState.getMagFilter();
} }
void Sampler::setWrapS(GLenum wrapS) void Sampler::setWrapS(GLenum wrapS)
{ {
mState.wrapS = wrapS; mState.setWrapS(wrapS);
} }
GLenum Sampler::getWrapS() const GLenum Sampler::getWrapS() const
{ {
return mState.wrapS; return mState.getWrapS();
} }
void Sampler::setWrapT(GLenum wrapT) void Sampler::setWrapT(GLenum wrapT)
{ {
mState.wrapT = wrapT; mState.setWrapT(wrapT);
} }
GLenum Sampler::getWrapT() const GLenum Sampler::getWrapT() const
{ {
return mState.wrapT; return mState.getWrapT();
} }
void Sampler::setWrapR(GLenum wrapR) void Sampler::setWrapR(GLenum wrapR)
{ {
mState.wrapR = wrapR; mState.setWrapR(wrapR);
} }
GLenum Sampler::getWrapR() const GLenum Sampler::getWrapR() const
{ {
return mState.wrapR; return mState.getWrapR();
} }
void Sampler::setMaxAnisotropy(float maxAnisotropy) void Sampler::setMaxAnisotropy(float maxAnisotropy)
{ {
mState.maxAnisotropy = maxAnisotropy; mState.setMaxAnisotropy(maxAnisotropy);
} }
float Sampler::getMaxAnisotropy() const float Sampler::getMaxAnisotropy() const
{ {
return mState.maxAnisotropy; return mState.getMaxAnisotropy();
} }
void Sampler::setMinLod(GLfloat minLod) void Sampler::setMinLod(GLfloat minLod)
{ {
mState.minLod = minLod; mState.setMinLod(minLod);
} }
GLfloat Sampler::getMinLod() const GLfloat Sampler::getMinLod() const
{ {
return mState.minLod; return mState.getMinLod();
} }
void Sampler::setMaxLod(GLfloat maxLod) void Sampler::setMaxLod(GLfloat maxLod)
{ {
mState.maxLod = maxLod; mState.setMaxLod(maxLod);
} }
GLfloat Sampler::getMaxLod() const GLfloat Sampler::getMaxLod() const
{ {
return mState.maxLod; return mState.getMaxLod();
} }
void Sampler::setCompareMode(GLenum compareMode) void Sampler::setCompareMode(GLenum compareMode)
{ {
mState.compareMode = compareMode; mState.setCompareMode(compareMode);
} }
GLenum Sampler::getCompareMode() const GLenum Sampler::getCompareMode() const
{ {
return mState.compareMode; return mState.getCompareMode();
} }
void Sampler::setCompareFunc(GLenum compareFunc) void Sampler::setCompareFunc(GLenum compareFunc)
{ {
mState.compareFunc = compareFunc; mState.setCompareFunc(compareFunc);
} }
GLenum Sampler::getCompareFunc() const GLenum Sampler::getCompareFunc() const
{ {
return mState.compareFunc; return mState.getCompareFunc();
} }
void Sampler::setSRGBDecode(GLenum sRGBDecode) void Sampler::setSRGBDecode(GLenum sRGBDecode)
{ {
mState.sRGBDecode = sRGBDecode; mState.setSRGBDecode(sRGBDecode);
} }
GLenum Sampler::getSRGBDecode() const GLenum Sampler::getSRGBDecode() const
{ {
return mState.sRGBDecode; return mState.getSRGBDecode();
} }
const SamplerState &Sampler::getSamplerState() const const SamplerState &Sampler::getSamplerState() const
......
...@@ -26,9 +26,9 @@ namespace ...@@ -26,9 +26,9 @@ namespace
{ {
bool IsPointSampled(const SamplerState &samplerState) bool IsPointSampled(const SamplerState &samplerState)
{ {
return (samplerState.magFilter == GL_NEAREST && return (samplerState.getMagFilter() == GL_NEAREST &&
(samplerState.minFilter == GL_NEAREST || (samplerState.getMinFilter() == GL_NEAREST ||
samplerState.minFilter == GL_NEAREST_MIPMAP_NEAREST)); samplerState.getMinFilter() == GL_NEAREST_MIPMAP_NEAREST));
} }
size_t GetImageDescIndex(TextureTarget target, size_t level) size_t GetImageDescIndex(TextureTarget target, size_t level)
...@@ -53,7 +53,7 @@ InitState DetermineInitState(const Context *context, const uint8_t *pixels) ...@@ -53,7 +53,7 @@ InitState DetermineInitState(const Context *context, const uint8_t *pixels)
bool IsMipmapFiltered(const SamplerState &samplerState) bool IsMipmapFiltered(const SamplerState &samplerState)
{ {
switch (samplerState.minFilter) switch (samplerState.getMinFilter())
{ {
case GL_NEAREST: case GL_NEAREST:
case GL_LINEAR: case GL_LINEAR:
...@@ -280,8 +280,8 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState, ...@@ -280,8 +280,8 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
bool npotSupport = data.getExtensions().textureNPOT || data.getClientMajorVersion() >= 3; bool npotSupport = data.getExtensions().textureNPOT || data.getClientMajorVersion() >= 3;
if (!npotSupport) if (!npotSupport)
{ {
if ((samplerState.wrapS != GL_CLAMP_TO_EDGE && !isPow2(baseImageDesc.size.width)) || if ((samplerState.getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(baseImageDesc.size.width)) ||
(samplerState.wrapT != GL_CLAMP_TO_EDGE && !isPow2(baseImageDesc.size.height))) (samplerState.getWrapT() != GL_CLAMP_TO_EDGE && !isPow2(baseImageDesc.size.height)))
{ {
return false; return false;
} }
...@@ -320,12 +320,13 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState, ...@@ -320,12 +320,13 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
// texture unit, such as TEXTURE_WRAP_R for an external texture, does not affect completeness. // texture unit, such as TEXTURE_WRAP_R for an external texture, does not affect completeness.
if (mType == TextureType::External) if (mType == TextureType::External)
{ {
if (samplerState.wrapS != GL_CLAMP_TO_EDGE || samplerState.wrapT != GL_CLAMP_TO_EDGE) if (samplerState.getWrapS() != GL_CLAMP_TO_EDGE ||
samplerState.getWrapT() != GL_CLAMP_TO_EDGE)
{ {
return false; return false;
} }
if (samplerState.minFilter != GL_LINEAR && samplerState.minFilter != GL_NEAREST) if (samplerState.getMinFilter() != GL_LINEAR && samplerState.getMinFilter() != GL_NEAREST)
{ {
return false; return false;
} }
...@@ -343,11 +344,11 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState, ...@@ -343,11 +344,11 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
// extension, due to some underspecification problems, we must allow linear filtering // extension, due to some underspecification problems, we must allow linear filtering
// for legacy compatibility with WebGL 1. // for legacy compatibility with WebGL 1.
// See http://crbug.com/649200 // See http://crbug.com/649200
if (samplerState.compareMode == GL_NONE && baseImageDesc.format.info->sized) if (samplerState.getCompareMode() == GL_NONE && baseImageDesc.format.info->sized)
{ {
if ((samplerState.minFilter != GL_NEAREST && if ((samplerState.getMinFilter() != GL_NEAREST &&
samplerState.minFilter != GL_NEAREST_MIPMAP_NEAREST) || samplerState.getMinFilter() != GL_NEAREST_MIPMAP_NEAREST) ||
samplerState.magFilter != GL_NEAREST) samplerState.getMagFilter() != GL_NEAREST)
{ {
return false; return false;
} }
...@@ -366,9 +367,9 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState, ...@@ -366,9 +367,9 @@ bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
if (!IsMultisampled(mType) && baseImageDesc.format.info->depthBits > 0 && if (!IsMultisampled(mType) && baseImageDesc.format.info->depthBits > 0 &&
mDepthStencilTextureMode == GL_STENCIL_INDEX) mDepthStencilTextureMode == GL_STENCIL_INDEX)
{ {
if ((samplerState.minFilter != GL_NEAREST && if ((samplerState.getMinFilter() != GL_NEAREST &&
samplerState.minFilter != GL_NEAREST_MIPMAP_NEAREST) || samplerState.getMinFilter() != GL_NEAREST_MIPMAP_NEAREST) ||
samplerState.magFilter != GL_NEAREST) samplerState.getMagFilter() != GL_NEAREST)
{ {
return false; return false;
} }
...@@ -678,123 +679,123 @@ GLenum Texture::getSwizzleAlpha() const ...@@ -678,123 +679,123 @@ GLenum Texture::getSwizzleAlpha() const
void Texture::setMinFilter(GLenum minFilter) void Texture::setMinFilter(GLenum minFilter)
{ {
mState.mSamplerState.minFilter = minFilter; mState.mSamplerState.setMinFilter(minFilter);
mDirtyBits.set(DIRTY_BIT_MIN_FILTER); mDirtyBits.set(DIRTY_BIT_MIN_FILTER);
} }
GLenum Texture::getMinFilter() const GLenum Texture::getMinFilter() const
{ {
return mState.mSamplerState.minFilter; return mState.mSamplerState.getMinFilter();
} }
void Texture::setMagFilter(GLenum magFilter) void Texture::setMagFilter(GLenum magFilter)
{ {
mState.mSamplerState.magFilter = magFilter; mState.mSamplerState.setMagFilter(magFilter);
mDirtyBits.set(DIRTY_BIT_MAG_FILTER); mDirtyBits.set(DIRTY_BIT_MAG_FILTER);
} }
GLenum Texture::getMagFilter() const GLenum Texture::getMagFilter() const
{ {
return mState.mSamplerState.magFilter; return mState.mSamplerState.getMagFilter();
} }
void Texture::setWrapS(GLenum wrapS) void Texture::setWrapS(GLenum wrapS)
{ {
mState.mSamplerState.wrapS = wrapS; mState.mSamplerState.setWrapS(wrapS);
mDirtyBits.set(DIRTY_BIT_WRAP_S); mDirtyBits.set(DIRTY_BIT_WRAP_S);
} }
GLenum Texture::getWrapS() const GLenum Texture::getWrapS() const
{ {
return mState.mSamplerState.wrapS; return mState.mSamplerState.getWrapS();
} }
void Texture::setWrapT(GLenum wrapT) void Texture::setWrapT(GLenum wrapT)
{ {
mState.mSamplerState.wrapT = wrapT; mState.mSamplerState.setWrapT(wrapT);
mDirtyBits.set(DIRTY_BIT_WRAP_T); mDirtyBits.set(DIRTY_BIT_WRAP_T);
} }
GLenum Texture::getWrapT() const GLenum Texture::getWrapT() const
{ {
return mState.mSamplerState.wrapT; return mState.mSamplerState.getWrapT();
} }
void Texture::setWrapR(GLenum wrapR) void Texture::setWrapR(GLenum wrapR)
{ {
mState.mSamplerState.wrapR = wrapR; mState.mSamplerState.setWrapR(wrapR);
mDirtyBits.set(DIRTY_BIT_WRAP_R); mDirtyBits.set(DIRTY_BIT_WRAP_R);
} }
GLenum Texture::getWrapR() const GLenum Texture::getWrapR() const
{ {
return mState.mSamplerState.wrapR; return mState.mSamplerState.getWrapR();
} }
void Texture::setMaxAnisotropy(float maxAnisotropy) void Texture::setMaxAnisotropy(float maxAnisotropy)
{ {
mState.mSamplerState.maxAnisotropy = maxAnisotropy; mState.mSamplerState.setMaxAnisotropy(maxAnisotropy);
mDirtyBits.set(DIRTY_BIT_MAX_ANISOTROPY); mDirtyBits.set(DIRTY_BIT_MAX_ANISOTROPY);
} }
float Texture::getMaxAnisotropy() const float Texture::getMaxAnisotropy() const
{ {
return mState.mSamplerState.maxAnisotropy; return mState.mSamplerState.getMaxAnisotropy();
} }
void Texture::setMinLod(GLfloat minLod) void Texture::setMinLod(GLfloat minLod)
{ {
mState.mSamplerState.minLod = minLod; mState.mSamplerState.setMinLod(minLod);
mDirtyBits.set(DIRTY_BIT_MIN_LOD); mDirtyBits.set(DIRTY_BIT_MIN_LOD);
} }
GLfloat Texture::getMinLod() const GLfloat Texture::getMinLod() const
{ {
return mState.mSamplerState.minLod; return mState.mSamplerState.getMinLod();
} }
void Texture::setMaxLod(GLfloat maxLod) void Texture::setMaxLod(GLfloat maxLod)
{ {
mState.mSamplerState.maxLod = maxLod; mState.mSamplerState.setMaxLod(maxLod);
mDirtyBits.set(DIRTY_BIT_MAX_LOD); mDirtyBits.set(DIRTY_BIT_MAX_LOD);
} }
GLfloat Texture::getMaxLod() const GLfloat Texture::getMaxLod() const
{ {
return mState.mSamplerState.maxLod; return mState.mSamplerState.getMaxLod();
} }
void Texture::setCompareMode(GLenum compareMode) void Texture::setCompareMode(GLenum compareMode)
{ {
mState.mSamplerState.compareMode = compareMode; mState.mSamplerState.setCompareMode(compareMode);
mDirtyBits.set(DIRTY_BIT_COMPARE_MODE); mDirtyBits.set(DIRTY_BIT_COMPARE_MODE);
} }
GLenum Texture::getCompareMode() const GLenum Texture::getCompareMode() const
{ {
return mState.mSamplerState.compareMode; return mState.mSamplerState.getCompareMode();
} }
void Texture::setCompareFunc(GLenum compareFunc) void Texture::setCompareFunc(GLenum compareFunc)
{ {
mState.mSamplerState.compareFunc = compareFunc; mState.mSamplerState.setCompareFunc(compareFunc);
mDirtyBits.set(DIRTY_BIT_COMPARE_FUNC); mDirtyBits.set(DIRTY_BIT_COMPARE_FUNC);
} }
GLenum Texture::getCompareFunc() const GLenum Texture::getCompareFunc() const
{ {
return mState.mSamplerState.compareFunc; return mState.mSamplerState.getCompareFunc();
} }
void Texture::setSRGBDecode(GLenum sRGBDecode) void Texture::setSRGBDecode(GLenum sRGBDecode)
{ {
mState.mSamplerState.sRGBDecode = sRGBDecode; mState.mSamplerState.setSRGBDecode(sRGBDecode);
mDirtyBits.set(DIRTY_BIT_SRGB_DECODE); mDirtyBits.set(DIRTY_BIT_SRGB_DECODE);
} }
GLenum Texture::getSRGBDecode() const GLenum Texture::getSRGBDecode() const
{ {
return mState.mSamplerState.sRGBDecode; return mState.mSamplerState.getSRGBDecode();
} }
const SamplerState &Texture::getSamplerState() const const SamplerState &Texture::getSamplerState() const
......
...@@ -110,17 +110,17 @@ SamplerState::SamplerState() ...@@ -110,17 +110,17 @@ SamplerState::SamplerState()
{ {
memset(this, 0, sizeof(SamplerState)); memset(this, 0, sizeof(SamplerState));
minFilter = GL_NEAREST_MIPMAP_LINEAR; mMinFilter = GL_NEAREST_MIPMAP_LINEAR;
magFilter = GL_LINEAR; mMagFilter = GL_LINEAR;
wrapS = GL_REPEAT; mWrapS = GL_REPEAT;
wrapT = GL_REPEAT; mWrapT = GL_REPEAT;
wrapR = GL_REPEAT; mWrapR = GL_REPEAT;
maxAnisotropy = 1.0f; mMaxAnisotropy = 1.0f;
minLod = -1000.0f; mMinLod = -1000.0f;
maxLod = 1000.0f; mMaxLod = 1000.0f;
compareMode = GL_NONE; mCompareMode = GL_NONE;
compareFunc = GL_LEQUAL; mCompareFunc = GL_LEQUAL;
sRGBDecode = GL_DECODE_EXT; mSRGBDecode = GL_DECODE_EXT;
} }
SamplerState::SamplerState(const SamplerState &other) = default; SamplerState::SamplerState(const SamplerState &other) = default;
...@@ -134,14 +134,69 @@ SamplerState SamplerState::CreateDefaultForTarget(TextureType type) ...@@ -134,14 +134,69 @@ SamplerState SamplerState::CreateDefaultForTarget(TextureType type)
// default min filter is GL_LINEAR and the default s and t wrap modes are GL_CLAMP_TO_EDGE. // default min filter is GL_LINEAR and the default s and t wrap modes are GL_CLAMP_TO_EDGE.
if (type == TextureType::External || type == TextureType::Rectangle) if (type == TextureType::External || type == TextureType::Rectangle)
{ {
state.minFilter = GL_LINEAR; state.mMinFilter = GL_LINEAR;
state.wrapS = GL_CLAMP_TO_EDGE; state.mWrapS = GL_CLAMP_TO_EDGE;
state.wrapT = GL_CLAMP_TO_EDGE; state.mWrapT = GL_CLAMP_TO_EDGE;
} }
return state; return state;
} }
void SamplerState::setMinFilter(GLenum minFilter)
{
mMinFilter = minFilter;
}
void SamplerState::setMagFilter(GLenum magFilter)
{
mMagFilter = magFilter;
}
void SamplerState::setWrapS(GLenum wrapS)
{
mWrapS = wrapS;
}
void SamplerState::setWrapT(GLenum wrapT)
{
mWrapT = wrapT;
}
void SamplerState::setWrapR(GLenum wrapR)
{
mWrapR = wrapR;
}
void SamplerState::setMaxAnisotropy(float maxAnisotropy)
{
mMaxAnisotropy = maxAnisotropy;
}
void SamplerState::setMinLod(GLfloat minLod)
{
mMinLod = minLod;
}
void SamplerState::setMaxLod(GLfloat maxLod)
{
mMaxLod = maxLod;
}
void SamplerState::setCompareMode(GLenum compareMode)
{
mCompareMode = compareMode;
}
void SamplerState::setCompareFunc(GLenum compareFunc)
{
mCompareFunc = compareFunc;
}
void SamplerState::setSRGBDecode(GLenum sRGBDecode)
{
mSRGBDecode = sRGBDecode;
}
ImageUnit::ImageUnit() ImageUnit::ImageUnit()
: texture(), level(0), layered(false), layer(0), access(GL_READ_ONLY), format(GL_R32UI) : texture(), level(0), layered(false), layer(0), access(GL_READ_ONLY), format(GL_R32UI)
{ {
......
...@@ -196,31 +196,77 @@ bool operator==(const DepthStencilState &a, const DepthStencilState &b); ...@@ -196,31 +196,77 @@ bool operator==(const DepthStencilState &a, const DepthStencilState &b);
bool operator!=(const DepthStencilState &a, const DepthStencilState &b); bool operator!=(const DepthStencilState &a, const DepthStencilState &b);
// State from Table 6.10 (state per sampler object) // State from Table 6.10 (state per sampler object)
struct SamplerState final class SamplerState final
{ {
public:
// This will zero-initialize the struct, including padding. // This will zero-initialize the struct, including padding.
SamplerState(); SamplerState();
SamplerState(const SamplerState &other); SamplerState(const SamplerState &other);
static SamplerState CreateDefaultForTarget(TextureType type); static SamplerState CreateDefaultForTarget(TextureType type);
GLenum minFilter; GLenum getMinFilter() const { return mMinFilter; }
GLenum magFilter;
void setMinFilter(GLenum minFilter);
GLenum getMagFilter() const { return mMagFilter; }
void setMagFilter(GLenum magFilter);
GLenum getWrapS() const { return mWrapS; }
void setWrapS(GLenum wrapS);
GLenum getWrapT() const { return mWrapT; }
void setWrapT(GLenum wrapT);
GLenum getWrapR() const { return mWrapR; }
void setWrapR(GLenum wrapR);
float getMaxAnisotropy() const { return mMaxAnisotropy; }
void setMaxAnisotropy(float maxAnisotropy);
GLfloat getMinLod() const { return mMinLod; }
void setMinLod(GLfloat minLod);
GLfloat getMaxLod() const { return mMaxLod; }
void setMaxLod(GLfloat maxLod);
GLenum getCompareMode() const { return mCompareMode; }
void setCompareMode(GLenum compareMode);
GLenum getCompareFunc() const { return mCompareFunc; }
void setCompareFunc(GLenum compareFunc);
GLenum getSRGBDecode() const { return mSRGBDecode; }
void setSRGBDecode(GLenum sRGBDecode);
private:
GLenum mMinFilter;
GLenum mMagFilter;
GLenum wrapS; GLenum mWrapS;
GLenum wrapT; GLenum mWrapT;
GLenum wrapR; GLenum mWrapR;
// From EXT_texture_filter_anisotropic // From EXT_texture_filter_anisotropic
float maxAnisotropy; float mMaxAnisotropy;
GLfloat minLod; GLfloat mMinLod;
GLfloat maxLod; GLfloat mMaxLod;
GLenum compareMode; GLenum mCompareMode;
GLenum compareFunc; GLenum mCompareFunc;
GLenum sRGBDecode; GLenum mSRGBDecode;
}; };
bool operator==(const SamplerState &a, const SamplerState &b); bool operator==(const SamplerState &a, const SamplerState &b);
......
...@@ -170,10 +170,10 @@ void QueryTexParameterBase(const Texture *texture, GLenum pname, ParamType *para ...@@ -170,10 +170,10 @@ void QueryTexParameterBase(const Texture *texture, GLenum pname, ParamType *para
*params = CastFromGLintStateValue<ParamType>(pname, texture->getMaxLevel()); *params = CastFromGLintStateValue<ParamType>(pname, texture->getMaxLevel());
break; break;
case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MIN_LOD:
*params = CastFromStateValue<ParamType>(pname, texture->getSamplerState().minLod); *params = CastFromStateValue<ParamType>(pname, texture->getMinLod());
break; break;
case GL_TEXTURE_MAX_LOD: case GL_TEXTURE_MAX_LOD:
*params = CastFromStateValue<ParamType>(pname, texture->getSamplerState().maxLod); *params = CastFromStateValue<ParamType>(pname, texture->getMaxLod());
break; break;
case GL_TEXTURE_COMPARE_MODE: case GL_TEXTURE_COMPARE_MODE:
*params = CastFromGLintStateValue<ParamType>(pname, texture->getCompareMode()); *params = CastFromGLintStateValue<ParamType>(pname, texture->getCompareMode());
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace gl namespace gl
{ {
class Context; class Context;
struct SamplerState; class SamplerState;
} // namespace gl } // namespace gl
namespace rx namespace rx
......
...@@ -241,28 +241,28 @@ angle::Result RenderStateCache::getSamplerState(const gl::Context *context, ...@@ -241,28 +241,28 @@ angle::Result RenderStateCache::getSamplerState(const gl::Context *context,
D3D11_SAMPLER_DESC samplerDesc; D3D11_SAMPLER_DESC samplerDesc;
samplerDesc.Filter = samplerDesc.Filter =
gl_d3d11::ConvertFilter(samplerState.minFilter, samplerState.magFilter, gl_d3d11::ConvertFilter(samplerState.getMinFilter(), samplerState.getMagFilter(),
samplerState.maxAnisotropy, samplerState.compareMode); samplerState.getMaxAnisotropy(), samplerState.getCompareMode());
samplerDesc.AddressU = gl_d3d11::ConvertTextureWrap(samplerState.wrapS); samplerDesc.AddressU = gl_d3d11::ConvertTextureWrap(samplerState.getWrapS());
samplerDesc.AddressV = gl_d3d11::ConvertTextureWrap(samplerState.wrapT); samplerDesc.AddressV = gl_d3d11::ConvertTextureWrap(samplerState.getWrapT());
samplerDesc.AddressW = gl_d3d11::ConvertTextureWrap(samplerState.wrapR); samplerDesc.AddressW = gl_d3d11::ConvertTextureWrap(samplerState.getWrapR());
samplerDesc.MipLODBias = 0; samplerDesc.MipLODBias = 0;
samplerDesc.MaxAnisotropy = samplerDesc.MaxAnisotropy =
gl_d3d11::ConvertMaxAnisotropy(samplerState.maxAnisotropy, featureLevel); gl_d3d11::ConvertMaxAnisotropy(samplerState.getMaxAnisotropy(), featureLevel);
samplerDesc.ComparisonFunc = gl_d3d11::ConvertComparison(samplerState.compareFunc); samplerDesc.ComparisonFunc = gl_d3d11::ConvertComparison(samplerState.getCompareFunc());
samplerDesc.BorderColor[0] = 0.0f; samplerDesc.BorderColor[0] = 0.0f;
samplerDesc.BorderColor[1] = 0.0f; samplerDesc.BorderColor[1] = 0.0f;
samplerDesc.BorderColor[2] = 0.0f; samplerDesc.BorderColor[2] = 0.0f;
samplerDesc.BorderColor[3] = 0.0f; samplerDesc.BorderColor[3] = 0.0f;
samplerDesc.MinLOD = samplerState.minLod; samplerDesc.MinLOD = samplerState.getMinLod();
samplerDesc.MaxLOD = samplerState.maxLod; samplerDesc.MaxLOD = samplerState.getMaxLod();
if (featureLevel <= D3D_FEATURE_LEVEL_9_3) if (featureLevel <= D3D_FEATURE_LEVEL_9_3)
{ {
// Check that maxLOD is nearly FLT_MAX (1000.0f is the default), since 9_3 doesn't support // Check that maxLOD is nearly FLT_MAX (1000.0f is the default), since 9_3 doesn't support
// anything other than FLT_MAX. Note that Feature Level 9_* only supports GL ES 2.0, so the // anything other than FLT_MAX. Note that Feature Level 9_* only supports GL ES 2.0, so the
// consumer of ANGLE can't modify the Max LOD themselves. // consumer of ANGLE can't modify the Max LOD themselves.
ASSERT(samplerState.maxLod >= 999.9f); ASSERT(samplerState.getMaxLod() >= 999.9f);
// Now just set MaxLOD to FLT_MAX. Other parts of the renderer (e.g. the non-zero max LOD // Now just set MaxLOD to FLT_MAX. Other parts of the renderer (e.g. the non-zero max LOD
// workaround) should take account of this. // workaround) should take account of this.
......
...@@ -942,26 +942,26 @@ angle::Result Renderer9::setSamplerState(const gl::Context *context, ...@@ -942,26 +942,26 @@ angle::Result Renderer9::setSamplerState(const gl::Context *context,
int d3dSampler = index + d3dSamplerOffset; int d3dSampler = index + d3dSamplerOffset;
mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU, mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU,
gl_d3d9::ConvertTextureWrap(samplerState.wrapS)); gl_d3d9::ConvertTextureWrap(samplerState.getWrapS()));
mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV, mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV,
gl_d3d9::ConvertTextureWrap(samplerState.wrapT)); gl_d3d9::ConvertTextureWrap(samplerState.getWrapT()));
mDevice->SetSamplerState( mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAGFILTER,
d3dSampler, D3DSAMP_MAGFILTER, gl_d3d9::ConvertMagFilter(samplerState.getMagFilter(),
gl_d3d9::ConvertMagFilter(samplerState.magFilter, samplerState.maxAnisotropy)); samplerState.getMaxAnisotropy()));
D3DTEXTUREFILTERTYPE d3dMinFilter, d3dMipFilter; D3DTEXTUREFILTERTYPE d3dMinFilter, d3dMipFilter;
float lodBias; float lodBias;
gl_d3d9::ConvertMinFilter(samplerState.minFilter, &d3dMinFilter, &d3dMipFilter, &lodBias, gl_d3d9::ConvertMinFilter(samplerState.getMinFilter(), &d3dMinFilter, &d3dMipFilter,
samplerState.maxAnisotropy, baseLevel); &lodBias, samplerState.getMaxAnisotropy(), baseLevel);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXMIPLEVEL, baseLevel); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXMIPLEVEL, baseLevel);
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPMAPLODBIAS, static_cast<DWORD>(lodBias)); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPMAPLODBIAS, static_cast<DWORD>(lodBias));
if (getNativeExtensions().textureFilterAnisotropic) if (getNativeExtensions().textureFilterAnisotropic)
{ {
DWORD maxAnisotropy = DWORD maxAnisotropy = std::min(mDeviceCaps.MaxAnisotropy,
std::min(mDeviceCaps.MaxAnisotropy, static_cast<DWORD>(samplerState.maxAnisotropy)); static_cast<DWORD>(samplerState.getMaxAnisotropy()));
mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXANISOTROPY, maxAnisotropy); mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAXANISOTROPY, maxAnisotropy);
} }
} }
......
...@@ -14,18 +14,19 @@ ...@@ -14,18 +14,19 @@
namespace namespace
{ {
template <typename T> template <typename Getter, typename Setter>
static inline void SyncSamplerStateMember(const rx::FunctionsGL *functions, static inline void SyncSamplerStateMember(const rx::FunctionsGL *functions,
GLuint sampler, GLuint sampler,
const gl::SamplerState &newState, const gl::SamplerState &newState,
gl::SamplerState &curState, gl::SamplerState &curState,
GLenum name, GLenum name,
T(gl::SamplerState::*samplerMember)) Getter getter,
Setter setter)
{ {
if (curState.*samplerMember != newState.*samplerMember) if ((curState.*getter)() != (newState.*getter)())
{ {
curState.*samplerMember = newState.*samplerMember; (curState.*setter)((newState.*getter)());
functions->samplerParameterf(sampler, name, static_cast<GLfloat>(curState.*samplerMember)); functions->samplerParameterf(sampler, name, static_cast<GLfloat>((curState.*getter)()));
} }
} }
} }
...@@ -54,17 +55,17 @@ SamplerGL::~SamplerGL() ...@@ -54,17 +55,17 @@ SamplerGL::~SamplerGL()
void SamplerGL::syncState(const gl::Context *context) void SamplerGL::syncState(const gl::Context *context)
{ {
// clang-format off // clang-format off
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MIN_FILTER, &gl::SamplerState::minFilter); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MIN_FILTER, &gl::SamplerState::getMinFilter, &gl::SamplerState::setMinFilter);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAG_FILTER, &gl::SamplerState::magFilter); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAG_FILTER, &gl::SamplerState::getMagFilter, &gl::SamplerState::setMagFilter);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_S, &gl::SamplerState::wrapS); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_S, &gl::SamplerState::getWrapS, &gl::SamplerState::setWrapS);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_T, &gl::SamplerState::wrapT); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_T, &gl::SamplerState::getWrapT, &gl::SamplerState::setWrapT);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_R, &gl::SamplerState::wrapR); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_WRAP_R, &gl::SamplerState::getWrapR, &gl::SamplerState::setWrapR);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAX_ANISOTROPY_EXT, &gl::SamplerState::maxAnisotropy); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAX_ANISOTROPY_EXT, &gl::SamplerState::getMaxAnisotropy, &gl::SamplerState::setMaxAnisotropy);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MIN_LOD, &gl::SamplerState::minLod); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MIN_LOD, &gl::SamplerState::getMinLod, &gl::SamplerState::setMinLod);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAX_LOD, &gl::SamplerState::maxLod); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_MAX_LOD, &gl::SamplerState::getMaxLod, &gl::SamplerState::setMaxLod);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_COMPARE_MODE, &gl::SamplerState::compareMode); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_COMPARE_MODE, &gl::SamplerState::getCompareMode, &gl::SamplerState::setCompareMode);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_COMPARE_FUNC, &gl::SamplerState::compareFunc); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_COMPARE_FUNC, &gl::SamplerState::getCompareFunc, &gl::SamplerState::setCompareFunc);
SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_SRGB_DECODE_EXT, &gl::SamplerState::sRGBDecode); SyncSamplerStateMember(mFunctions, mSamplerID, mState, mAppliedSamplerState, GL_TEXTURE_SRGB_DECODE_EXT, &gl::SamplerState::getSRGBDecode, &gl::SamplerState::setSRGBDecode);
// clang-format on // clang-format on
} }
......
...@@ -1150,59 +1150,59 @@ gl::Error TextureGL::syncState(const gl::Context *context, const gl::Texture::Di ...@@ -1150,59 +1150,59 @@ gl::Error TextureGL::syncState(const gl::Context *context, const gl::Texture::Di
switch (dirtyBit) switch (dirtyBit)
{ {
case gl::Texture::DIRTY_BIT_MIN_FILTER: case gl::Texture::DIRTY_BIT_MIN_FILTER:
mAppliedSampler.minFilter = mState.getSamplerState().minFilter; mAppliedSampler.setMinFilter(mState.getSamplerState().getMinFilter());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_MIN_FILTER, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_MIN_FILTER,
mAppliedSampler.minFilter); mAppliedSampler.getMinFilter());
break; break;
case gl::Texture::DIRTY_BIT_MAG_FILTER: case gl::Texture::DIRTY_BIT_MAG_FILTER:
mAppliedSampler.magFilter = mState.getSamplerState().magFilter; mAppliedSampler.setMagFilter(mState.getSamplerState().getMagFilter());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_MAG_FILTER, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_MAG_FILTER,
mAppliedSampler.magFilter); mAppliedSampler.getMagFilter());
break; break;
case gl::Texture::DIRTY_BIT_WRAP_S: case gl::Texture::DIRTY_BIT_WRAP_S:
mAppliedSampler.wrapS = mState.getSamplerState().wrapS; mAppliedSampler.setWrapS(mState.getSamplerState().getWrapS());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_S, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_S,
mAppliedSampler.wrapS); mAppliedSampler.getWrapS());
break; break;
case gl::Texture::DIRTY_BIT_WRAP_T: case gl::Texture::DIRTY_BIT_WRAP_T:
mAppliedSampler.wrapT = mState.getSamplerState().wrapT; mAppliedSampler.setWrapT(mState.getSamplerState().getWrapT());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_T, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_T,
mAppliedSampler.wrapT); mAppliedSampler.getWrapT());
break; break;
case gl::Texture::DIRTY_BIT_WRAP_R: case gl::Texture::DIRTY_BIT_WRAP_R:
mAppliedSampler.wrapR = mState.getSamplerState().wrapR; mAppliedSampler.setWrapR(mState.getSamplerState().getWrapR());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_R, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_WRAP_R,
mAppliedSampler.wrapR); mAppliedSampler.getWrapR());
break; break;
case gl::Texture::DIRTY_BIT_MAX_ANISOTROPY: case gl::Texture::DIRTY_BIT_MAX_ANISOTROPY:
mAppliedSampler.maxAnisotropy = mState.getSamplerState().maxAnisotropy; mAppliedSampler.setMaxAnisotropy(mState.getSamplerState().getMaxAnisotropy());
functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MAX_ANISOTROPY_EXT, functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MAX_ANISOTROPY_EXT,
mAppliedSampler.maxAnisotropy); mAppliedSampler.getMaxAnisotropy());
break; break;
case gl::Texture::DIRTY_BIT_MIN_LOD: case gl::Texture::DIRTY_BIT_MIN_LOD:
mAppliedSampler.minLod = mState.getSamplerState().minLod; mAppliedSampler.setMinLod(mState.getSamplerState().getMinLod());
functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MIN_LOD, functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MIN_LOD,
mAppliedSampler.minLod); mAppliedSampler.getMinLod());
break; break;
case gl::Texture::DIRTY_BIT_MAX_LOD: case gl::Texture::DIRTY_BIT_MAX_LOD:
mAppliedSampler.maxLod = mState.getSamplerState().maxLod; mAppliedSampler.setMaxLod(mState.getSamplerState().getMaxLod());
functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MAX_LOD, functions->texParameterf(ToGLenum(getType()), GL_TEXTURE_MAX_LOD,
mAppliedSampler.maxLod); mAppliedSampler.getMaxLod());
break; break;
case gl::Texture::DIRTY_BIT_COMPARE_MODE: case gl::Texture::DIRTY_BIT_COMPARE_MODE:
mAppliedSampler.compareMode = mState.getSamplerState().compareMode; mAppliedSampler.setCompareMode(mState.getSamplerState().getCompareMode());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_COMPARE_MODE, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_COMPARE_MODE,
mAppliedSampler.compareMode); mAppliedSampler.getCompareMode());
break; break;
case gl::Texture::DIRTY_BIT_COMPARE_FUNC: case gl::Texture::DIRTY_BIT_COMPARE_FUNC:
mAppliedSampler.compareFunc = mState.getSamplerState().compareFunc; mAppliedSampler.setCompareFunc(mState.getSamplerState().getCompareFunc());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_COMPARE_FUNC, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_COMPARE_FUNC,
mAppliedSampler.compareFunc); mAppliedSampler.getCompareFunc());
break; break;
case gl::Texture::DIRTY_BIT_SRGB_DECODE: case gl::Texture::DIRTY_BIT_SRGB_DECODE:
mAppliedSampler.sRGBDecode = mState.getSamplerState().sRGBDecode; mAppliedSampler.setSRGBDecode(mState.getSamplerState().getSRGBDecode());
functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_SRGB_DECODE_EXT, functions->texParameteri(ToGLenum(getType()), GL_TEXTURE_SRGB_DECODE_EXT,
mAppliedSampler.sRGBDecode); mAppliedSampler.getSRGBDecode());
break; break;
// Texture state // Texture state
...@@ -1280,12 +1280,12 @@ gl::Error TextureGL::setBaseLevel(const gl::Context *context, GLuint baseLevel) ...@@ -1280,12 +1280,12 @@ gl::Error TextureGL::setBaseLevel(const gl::Context *context, GLuint baseLevel)
void TextureGL::setMinFilter(const gl::Context *context, GLenum filter) void TextureGL::setMinFilter(const gl::Context *context, GLenum filter)
{ {
if (filter != mAppliedSampler.minFilter) if (filter != mAppliedSampler.getMinFilter())
{ {
const FunctionsGL *functions = GetFunctionsGL(context); const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context); StateManagerGL *stateManager = GetStateManagerGL(context);
mAppliedSampler.minFilter = filter; mAppliedSampler.setMinFilter(filter);
mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_MIN_FILTER); mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_MIN_FILTER);
stateManager->bindTexture(getType(), mTextureID); stateManager->bindTexture(getType(), mTextureID);
...@@ -1294,12 +1294,12 @@ void TextureGL::setMinFilter(const gl::Context *context, GLenum filter) ...@@ -1294,12 +1294,12 @@ void TextureGL::setMinFilter(const gl::Context *context, GLenum filter)
} }
void TextureGL::setMagFilter(const gl::Context *context, GLenum filter) void TextureGL::setMagFilter(const gl::Context *context, GLenum filter)
{ {
if (filter != mAppliedSampler.magFilter) if (filter != mAppliedSampler.getMagFilter())
{ {
const FunctionsGL *functions = GetFunctionsGL(context); const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context); StateManagerGL *stateManager = GetStateManagerGL(context);
mAppliedSampler.magFilter = filter; mAppliedSampler.setMagFilter(filter);
mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_MAG_FILTER); mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_MAG_FILTER);
stateManager->bindTexture(getType(), mTextureID); stateManager->bindTexture(getType(), mTextureID);
......
...@@ -1112,19 +1112,19 @@ gl::Error TextureVk::syncState(const gl::Context *context, const gl::Texture::Di ...@@ -1112,19 +1112,19 @@ gl::Error TextureVk::syncState(const gl::Context *context, const gl::Texture::Di
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.pNext = nullptr; samplerInfo.pNext = nullptr;
samplerInfo.flags = 0; samplerInfo.flags = 0;
samplerInfo.magFilter = gl_vk::GetFilter(samplerState.magFilter); samplerInfo.magFilter = gl_vk::GetFilter(samplerState.getMagFilter());
samplerInfo.minFilter = gl_vk::GetFilter(samplerState.minFilter); samplerInfo.minFilter = gl_vk::GetFilter(samplerState.getMinFilter());
samplerInfo.mipmapMode = gl_vk::GetSamplerMipmapMode(samplerState.minFilter); samplerInfo.mipmapMode = gl_vk::GetSamplerMipmapMode(samplerState.getMinFilter());
samplerInfo.addressModeU = gl_vk::GetSamplerAddressMode(samplerState.wrapS); samplerInfo.addressModeU = gl_vk::GetSamplerAddressMode(samplerState.getWrapS());
samplerInfo.addressModeV = gl_vk::GetSamplerAddressMode(samplerState.wrapT); samplerInfo.addressModeV = gl_vk::GetSamplerAddressMode(samplerState.getWrapT());
samplerInfo.addressModeW = gl_vk::GetSamplerAddressMode(samplerState.wrapR); samplerInfo.addressModeW = gl_vk::GetSamplerAddressMode(samplerState.getWrapR());
samplerInfo.mipLodBias = 0.0f; samplerInfo.mipLodBias = 0.0f;
samplerInfo.anisotropyEnable = VK_FALSE; samplerInfo.anisotropyEnable = VK_FALSE;
samplerInfo.maxAnisotropy = 1.0f; samplerInfo.maxAnisotropy = 1.0f;
samplerInfo.compareEnable = VK_FALSE; samplerInfo.compareEnable = VK_FALSE;
samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS; samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
samplerInfo.minLod = samplerState.minLod; samplerInfo.minLod = samplerState.getMinLod();
samplerInfo.maxLod = samplerState.maxLod; samplerInfo.maxLod = samplerState.getMaxLod();
samplerInfo.borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK; samplerInfo.borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK;
samplerInfo.unnormalizedCoordinates = VK_FALSE; samplerInfo.unnormalizedCoordinates = VK_FALSE;
...@@ -1159,7 +1159,7 @@ const vk::ImageView &TextureVk::getImageView() const ...@@ -1159,7 +1159,7 @@ const vk::ImageView &TextureVk::getImageView() const
{ {
ASSERT(mImage.valid()); ASSERT(mImage.valid());
const GLenum minFilter = mState.getSamplerState().minFilter; const GLenum minFilter = mState.getSamplerState().getMinFilter();
if (minFilter == GL_LINEAR || minFilter == GL_NEAREST) if (minFilter == GL_LINEAR || minFilter == GL_NEAREST)
{ {
return mBaseLevelImageView; return mBaseLevelImageView;
......
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