Cleanup: EEVEE: Use correct array size and use equals_v2v2_int

This commit is contained in:
Clément Foucault
2020-09-03 21:12:40 +02:00
parent a92d77acf7
commit 22a84a673a

View File

@@ -202,7 +202,7 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
* Compute Mipmap texel alignment.
*/
for (int i = 0; i < 10; i++) {
int mip_size[2];
int mip_size[3];
GPU_texture_get_mipmap_size(txl->color, i, mip_size);
common_data->mip_ratio[i][0] = viewport_size[0] / (mip_size[0] * powf(2.0f, i));
common_data->mip_ratio[i][1] = viewport_size[1] / (mip_size[1] * powf(2.0f, i));
@@ -432,7 +432,7 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l
int minmax_size[3], depth_size[3];
GPU_texture_get_mipmap_size(depth_src, 0, depth_size);
GPU_texture_get_mipmap_size(txl->maxzbuffer, 0, minmax_size);
bool is_full_res_minmaxz = (minmax_size[0] == depth_size[0] && minmax_size[1] == depth_size[1]);
bool is_full_res_minmaxz = equals_v2v2_int(minmax_size, depth_size);
DRW_stats_group_start("Max buffer");
/* Copy depth buffer to max texture top level */