diff --git a/panda/src/express/virtualFileMountRamdisk.cxx b/panda/src/express/virtualFileMountRamdisk.cxx index 9f10931985..244f5c79df 100644 --- a/panda/src/express/virtualFileMountRamdisk.cxx +++ b/panda/src/express/virtualFileMountRamdisk.cxx @@ -235,7 +235,13 @@ open_write_file(const Filename &file, bool truncate) { if (truncate) { // Reset to an empty string. f->_data.str(string()); - f->_timestamp = time(NULL); + + // Instead of setting the time, we ensure that we always store a newer time. + // This is a workarround for the case that a file is written twice per + // second, since the timer only has a one second precision. The proper + // solution to fix this would be to switch to a higher precision + // timer everywhere. + f->_timestamp = max(f->_timestamp + 1, time(NULL)); } return new OSubStream(&f->_wrapper, 0, 0); @@ -275,7 +281,9 @@ open_read_write_file(const Filename &file, bool truncate) { if (truncate) { // Reset to an empty string. f->_data.str(string()); - f->_timestamp = time(NULL); + + // See open_write_file + f->_timestamp = max(f->_timestamp + 1, time(NULL)); } return new SubStream(&f->_wrapper, 0, 0); diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 94cef280d7..708347a119 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -1462,24 +1462,27 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { return; } #ifndef OPENGLES - case GL_IMAGE_1D_EXT: - case GL_IMAGE_2D_EXT: - case GL_IMAGE_3D_EXT: - case GL_IMAGE_CUBE_EXT: - case GL_IMAGE_2D_ARRAY_EXT: - case GL_IMAGE_BUFFER_EXT: - case GL_INT_IMAGE_1D_EXT: - case GL_INT_IMAGE_2D_EXT: - case GL_INT_IMAGE_3D_EXT: - case GL_INT_IMAGE_CUBE_EXT: - case GL_INT_IMAGE_2D_ARRAY_EXT: - case GL_INT_IMAGE_BUFFER_EXT: - case GL_UNSIGNED_INT_IMAGE_1D_EXT: - case GL_UNSIGNED_INT_IMAGE_2D_EXT: - case GL_UNSIGNED_INT_IMAGE_3D_EXT: - case GL_UNSIGNED_INT_IMAGE_CUBE_EXT: - case GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT: - case GL_UNSIGNED_INT_IMAGE_BUFFER_EXT: + case GL_IMAGE_1D: + case GL_IMAGE_2D: + case GL_IMAGE_3D: + case GL_IMAGE_CUBE: + case GL_IMAGE_2D_ARRAY: + case GL_IMAGE_CUBE_MAP_ARRAY: + case GL_IMAGE_BUFFER: + case GL_INT_IMAGE_1D: + case GL_INT_IMAGE_2D: + case GL_INT_IMAGE_3D: + case GL_INT_IMAGE_CUBE: + case GL_INT_IMAGE_2D_ARRAY: + case GL_INT_IMAGE_CUBE_MAP_ARRAY: + case GL_INT_IMAGE_BUFFER: + case GL_UNSIGNED_INT_IMAGE_1D: + case GL_UNSIGNED_INT_IMAGE_2D: + case GL_UNSIGNED_INT_IMAGE_3D: + case GL_UNSIGNED_INT_IMAGE_CUBE: + case GL_UNSIGNED_INT_IMAGE_2D_ARRAY: + case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY: + case GL_UNSIGNED_INT_IMAGE_BUFFER: // This won't really change at runtime, so we might as well bind once // and then forget about it. _glgsg->_glUniform1i(p, _glsl_img_inputs.size()); diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 1d46c1d900..4b3ac328e9 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -6232,7 +6232,10 @@ do_set_simple_ram_image(CData *cdata, CPTA_uchar image, int x_size, int y_size) */ int Texture:: do_get_expected_num_mipmap_levels(const CData *cdata) const { - int size = max(cdata->_x_size, max(cdata->_y_size, cdata->_z_size)); + int size = max(cdata->_x_size, cdata->_y_size); + if (cdata->_texture_type == Texture::TT_3d_texture) { + size = max(size, cdata->_z_size); + } int count = 1; while (size > 1) { size >>= 1;