mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-27 01:22:37 -06:00
video_core: Resolve C4267 warning on MSVC
This commit is contained in:
parent
3a43475149
commit
de1374c1b9
2 changed files with 7 additions and 5 deletions
|
@ -798,7 +798,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glBindTexture(GL_TEXTURE_2D, state.texture_units[0].texture_2d);
|
||||
|
||||
for (std::size_t level{0}; level <= color_surface->max_level; ++level) {
|
||||
for (u32 level{0}; level <= color_surface->max_level; ++level) {
|
||||
glCopyImageSubData(color_surface->texture.handle, GL_TEXTURE_2D, level, 0, 0, 0,
|
||||
temp_tex.handle, GL_TEXTURE_2D, level, 0, 0, 0,
|
||||
color_surface->GetScaledWidth() >> level,
|
||||
|
|
|
@ -50,16 +50,18 @@ void TextureDownloaderES::Test() {
|
|||
state.Apply();
|
||||
|
||||
original_data.resize(tex_size * tex_size);
|
||||
for (std::size_t idx = 0; idx < original_data.size(); ++idx)
|
||||
for (std::size_t idx = 0; idx < original_data.size(); ++idx) {
|
||||
original_data[idx] = data_generator(idx);
|
||||
glTexStorage2D(GL_TEXTURE_2D, 1, tuple.internal_format, tex_size, tex_size);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, tex_size, tex_size, tuple.format, tuple.type,
|
||||
}
|
||||
GLsizei tex_sizei = static_cast<GLsizei>(tex_size);
|
||||
glTexStorage2D(GL_TEXTURE_2D, 1, tuple.internal_format, tex_sizei, tex_sizei);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, tex_sizei, tex_sizei, tuple.format, tuple.type,
|
||||
original_data.data());
|
||||
|
||||
decltype(original_data) new_data(original_data.size());
|
||||
glFinish();
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
GetTexImage(GL_TEXTURE_2D, 0, tuple.format, tuple.type, tex_size, tex_size,
|
||||
GetTexImage(GL_TEXTURE_2D, 0, tuple.format, tuple.type, tex_sizei, tex_sizei,
|
||||
new_data.data());
|
||||
glFinish();
|
||||
auto time = std::chrono::high_resolution_clock::now() - start;
|
||||
|
|
Loading…
Reference in a new issue