render: only upload to texture if data was passed
This commit is contained in:
@@ -42,7 +42,6 @@ TexturePtr Renderer::CreateTexture(const VideoParams ¶ms, const void *data,
|
|||||||
&& it->depth == params.effective_depth()
|
&& it->depth == params.effective_depth()
|
||||||
&& it->format == params.format()
|
&& it->format == params.format()
|
||||||
&& it->channel_count == params.channel_count()) {
|
&& it->channel_count == params.channel_count()) {
|
||||||
this->Flush();
|
|
||||||
v = it->handle;
|
v = it->handle;
|
||||||
texture_cache_.erase(it);
|
texture_cache_.erase(it);
|
||||||
break;
|
break;
|
||||||
@@ -53,8 +52,10 @@ TexturePtr Renderer::CreateTexture(const VideoParams ¶ms, const void *data,
|
|||||||
if (v.isNull()) {
|
if (v.isNull()) {
|
||||||
v = CreateNativeTexture(params.effective_width(), params.effective_height(), params.effective_depth(),
|
v = CreateNativeTexture(params.effective_width(), params.effective_height(), params.effective_depth(),
|
||||||
params.format(), params.channel_count(), data, linesize);
|
params.format(), params.channel_count(), data, linesize);
|
||||||
} else {
|
} else if (data) {
|
||||||
UploadToTexture(v, params, data, linesize);
|
UploadToTexture(v, params, data, linesize);
|
||||||
|
} else {
|
||||||
|
this->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return CreateTextureFromNativeHandle(v, params);
|
return CreateTextureFromNativeHandle(v, params);
|
||||||
|
|||||||
Reference in New Issue
Block a user