more expressive API
This commit is contained in:
parent
8052074c42
commit
477a284cfa
@ -327,23 +327,23 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateSampledImage( RenderState& state, int binding,
|
void updateSampledImage( RenderState& state, int binding,
|
||||||
QSGTexture** texture, QSGMaterial* newMaterial, QSGMaterial*) override final
|
QSGTexture* textures[], QSGMaterial* newMaterial, QSGMaterial*) override final
|
||||||
{
|
{
|
||||||
if ( binding != 1 )
|
if ( binding != 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto material = static_cast< const GradientMaterial* >( newMaterial );
|
auto material = static_cast< const GradientMaterial* >( newMaterial );
|
||||||
|
|
||||||
auto txt = TextureCache::instance()->texture(
|
auto texture = TextureCache::instance()->texture(
|
||||||
state.rhi(), material->stops(), material->spread() );
|
state.rhi(), material->stops(), material->spread() );
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
txt->updateRhiTexture( state.rhi(), state.resourceUpdateBatch() );
|
texture->updateRhiTexture( state.rhi(), state.resourceUpdateBatch() );
|
||||||
#else
|
#else
|
||||||
txt->commitTextureOperations( state.rhi(), state.resourceUpdateBatch() );
|
texture->commitTextureOperations( state.rhi(), state.resourceUpdateBatch() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*texture = txt;
|
textures[0] = texture;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user