Merge branch 'release/1.10.x'

This commit is contained in:
rdb 2023-02-03 14:52:39 +01:00
commit b09a8a84ec
15 changed files with 203 additions and 96 deletions

View File

@ -968,23 +968,22 @@ update() {
SoundsPlaying sounds_finished; SoundsPlaying sounds_finished;
double rtc = TrueClock::get_global_ptr()->get_short_time(); double rtc = TrueClock::get_global_ptr()->get_short_time();
SoundsPlaying::iterator i=_sounds_playing.begin(); SoundsPlaying::iterator it = _sounds_playing.begin();
for (; i!=_sounds_playing.end(); ++i) { while (it != _sounds_playing.end()) {
OpenALAudioSound *sound = (*i); PT(OpenALAudioSound) sound = *(it++);
sound->pull_used_buffers(); sound->pull_used_buffers();
sound->push_fresh_buffers(); sound->push_fresh_buffers();
sound->restart_stalled_audio(); sound->restart_stalled_audio();
sound->cache_time(rtc); sound->cache_time(rtc);
if ((sound->_source == 0)|| if (sound->_source == 0 ||
((sound->_stream_queued.size() == 0)&& (sound->_stream_queued.empty() &&
(sound->_loops_completed >= sound->_playing_loops))) { (sound->_loops_completed >= sound->_playing_loops))) {
sounds_finished.insert(*i); sounds_finished.insert(std::move(sound));
} }
} }
i=sounds_finished.begin(); for (OpenALAudioSound *sound : sounds_finished) {
for (; i!=sounds_finished.end(); ++i) { sound->finished();
(**i).finished();
} }
} }

View File

@ -23,7 +23,6 @@
using std::endl; using std::endl;
using std::istream; using std::istream;
using std::istringstream; using std::istringstream;
using std::move;
using std::ostream; using std::ostream;
using std::string; using std::string;
@ -728,7 +727,7 @@ read(StreamReader &sr, bool want_server_info) {
} }
// Parse the header // Parse the header
int num_multifiles = parse_header(Datagram(move(header))); int num_multifiles = parse_header(Datagram(std::move(header)));
if (num_multifiles < 0) { if (num_multifiles < 0) {
downloader_cat.error() << "invalid db header" << endl; downloader_cat.error() << "invalid db header" << endl;
return false; return false;
@ -748,7 +747,7 @@ read(StreamReader &sr, bool want_server_info) {
} }
// Parse the header // Parse the header
int mfr_length = parse_record_header(Datagram(move(mfr_header))); int mfr_length = parse_record_header(Datagram(std::move(mfr_header)));
// Ok, now that we know the size of the mfr, read it in Make a buffer to // Ok, now that we know the size of the mfr, read it in Make a buffer to
// read the multifile record into do not count the header length twice // read the multifile record into do not count the header length twice
@ -760,7 +759,7 @@ read(StreamReader &sr, bool want_server_info) {
} }
// Parse the mfr // Parse the mfr
PT(DownloadDb::MultifileRecord) mfr = parse_mfr(Datagram(move(mfr_record))); PT(DownloadDb::MultifileRecord) mfr = parse_mfr(Datagram(std::move(mfr_record)));
// Only read in the individual file info if you are the server // Only read in the individual file info if you are the server
if (want_server_info) { if (want_server_info) {
@ -779,7 +778,7 @@ read(StreamReader &sr, bool want_server_info) {
} }
// Parse the header // Parse the header
int fr_length = parse_record_header(Datagram(move(fr_header))); int fr_length = parse_record_header(Datagram(std::move(fr_header)));
// Ok, now that we know the size of the mfr, read it in do not count // Ok, now that we know the size of the mfr, read it in do not count
// the header length twice // the header length twice
@ -792,7 +791,7 @@ read(StreamReader &sr, bool want_server_info) {
} }
// Parse the file record // Parse the file record
PT(DownloadDb::FileRecord) fr = parse_fr(Datagram(move(fr_record))); PT(DownloadDb::FileRecord) fr = parse_fr(Datagram(std::move(fr_record)));
// Add this file record to the current multifilerecord // Add this file record to the current multifilerecord
mfr->add_file_record(fr); mfr->add_file_record(fr);

View File

@ -171,6 +171,7 @@ typedef char GLchar;
#define GL_RG32I 0x823B #define GL_RG32I 0x823B
#define GL_RG32UI 0x823C #define GL_RG32UI 0x823C
#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
#define GL_PROGRAM_BINARY_LENGTH 0x8741 #define GL_PROGRAM_BINARY_LENGTH 0x8741
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
#define GL_PROGRAM_BINARY_FORMATS 0x87FF #define GL_PROGRAM_BINARY_FORMATS 0x87FF

View File

@ -220,6 +220,7 @@ munge_format_impl(const GeomVertexFormat *orig,
// Combine the primary data columns into a single array. // Combine the primary data columns into a single array.
new_format = new GeomVertexFormat(*format); new_format = new GeomVertexFormat(*format);
PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat; PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat;
size_t insert_at = 0;
const GeomVertexColumn *column = format->get_vertex_column(); const GeomVertexColumn *column = format->get_vertex_column();
if (column != nullptr) { if (column != nullptr) {
@ -263,22 +264,34 @@ munge_format_impl(const GeomVertexFormat *orig,
// This is the first time we've encountered this texcoord name. // This is the first time we've encountered this texcoord name.
const GeomVertexColumn *texcoord_type = format->get_column(name); const GeomVertexColumn *texcoord_type = format->get_column(name);
// Note that we have to add something as a placeholder, even if the
// texture coordinates aren't defined.
int num_values = 2;
int column_alignment = 0;
int start = new_array_format->get_total_bytes();
start = (start + sizeof(PN_stdfloat) - 1) & ~(sizeof(PN_stdfloat) - 1);
if (texcoord_type != nullptr) { if (texcoord_type != nullptr) {
new_array_format->add_column column_alignment = texcoord_type->get_column_alignment();
(name, texcoord_type->get_num_values(), NT_stdfloat, C_texcoord, num_values = texcoord_type->get_num_values();
-1, texcoord_type->get_column_alignment());
} else {
// We have to add something as a placeholder, even if the
// texture coordinates aren't defined.
new_array_format->add_column(name, 2, NT_stdfloat, C_texcoord);
} }
if (start + num_values * sizeof(PN_stdfloat) > glgsg->get_max_vertex_attrib_stride()) {
// We are exceeding the limit for stride reported by the driver.
// Start a new array.
new_format->insert_array(insert_at++, new_array_format);
new_array_format = new GeomVertexArrayFormat;
start = 0;
}
new_array_format->add_column(name, num_values, NT_stdfloat,
C_texcoord, start, column_alignment);
new_format->remove_column(name); new_format->remove_column(name);
} }
} }
} }
} }
new_format->insert_array(0, new_array_format); if (new_array_format->get_num_columns() > 0) {
new_format->insert_array(insert_at, new_array_format);
}
format = GeomVertexFormat::register_format(new_format); format = GeomVertexFormat::register_format(new_format);
} }
@ -377,6 +390,7 @@ premunge_format_impl(const GeomVertexFormat *orig) {
// of doing this step at load time than you might be at run time. // of doing this step at load time than you might be at run time.
new_format = new GeomVertexFormat(*format); new_format = new GeomVertexFormat(*format);
PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat; PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat;
size_t insert_at = 0;
const GeomVertexColumn *column = format->get_vertex_column(); const GeomVertexColumn *column = format->get_vertex_column();
if (column != nullptr) { if (column != nullptr) {
@ -421,15 +435,25 @@ premunge_format_impl(const GeomVertexFormat *orig) {
// This is the first time we've encountered this texcoord name. // This is the first time we've encountered this texcoord name.
const GeomVertexColumn *texcoord_type = format->get_column(name); const GeomVertexColumn *texcoord_type = format->get_column(name);
// Note that we have to add something as a placeholder, even if the
// texture coordinates aren't defined.
int num_values = 2;
int column_alignment = 0;
int start = new_array_format->get_total_bytes();
start = (start + sizeof(PN_stdfloat) - 1) & ~(sizeof(PN_stdfloat) - 1);
if (texcoord_type != nullptr) { if (texcoord_type != nullptr) {
new_array_format->add_column column_alignment = texcoord_type->get_column_alignment();
(name, texcoord_type->get_num_values(), NT_stdfloat, C_texcoord, num_values = texcoord_type->get_num_values();
-1, texcoord_type->get_column_alignment());
} else {
// We have to add something as a placeholder, even if the
// texture coordinates aren't defined.
new_array_format->add_column(name, 2, NT_stdfloat, C_texcoord);
} }
if (start + num_values * sizeof(PN_stdfloat) > 2048) {
// We are exceeding the limit for stride (and the one that is
// guaranteed to be supported). Start a new array.
new_format->insert_array(insert_at++, new_array_format);
new_array_format = new GeomVertexArrayFormat;
start = 0;
}
new_array_format->add_column(name, num_values, NT_stdfloat,
C_texcoord, start, column_alignment);
new_format->remove_column(name); new_format->remove_column(name);
} }
} }
@ -453,7 +477,9 @@ premunge_format_impl(const GeomVertexFormat *orig) {
} }
// Finally, insert the interleaved array first in the format. // Finally, insert the interleaved array first in the format.
new_format->insert_array(0, new_array_format); if (new_array_format->get_num_columns() > 0) {
new_format->insert_array(insert_at, new_array_format);
}
format = GeomVertexFormat::register_format(new_format); format = GeomVertexFormat::register_format(new_format);
} }

View File

@ -181,6 +181,19 @@ has_fixed_function_pipeline() const {
#endif #endif
} }
/**
*
*/
INLINE int CLP(GraphicsStateGuardian)::
get_max_vertex_attrib_stride() const {
#ifdef OPENGLES_1
// Best guess.
return 2048;
#else
return _max_vertex_attrib_stride;
#endif
}
/** /**
* Calls glFinish() if the config variable gl-finish is set True. * Calls glFinish() if the config variable gl-finish is set True.
*/ */

View File

@ -1861,9 +1861,9 @@ reset() {
_shader_caps._active_gprofile = (int)CG_PROFILE_GLSLG; _shader_caps._active_gprofile = (int)CG_PROFILE_GLSLG;
} }
} }
_shader_caps._ultimate_vprofile = (int)CG_PROFILE_GLSLV; _shader_caps._ultimate_vprofile = (int)CG_PROFILE_GP5VP;
_shader_caps._ultimate_fprofile = (int)CG_PROFILE_GLSLF; _shader_caps._ultimate_fprofile = (int)CG_PROFILE_GP5FP;
_shader_caps._ultimate_gprofile = (int)CG_PROFILE_GLSLG; _shader_caps._ultimate_gprofile = (int)CG_PROFILE_GP5GP;
// Bug workaround for radeons. // Bug workaround for radeons.
if (_shader_caps._active_fprofile == CG_PROFILE_ARBFP1) { if (_shader_caps._active_fprofile == CG_PROFILE_ARBFP1) {
@ -3522,6 +3522,31 @@ reset() {
} }
#endif #endif
#ifndef OPENGLES_1
#ifdef OPENGLES
if (is_at_least_gles_version(3, 1))
#else
if (is_at_least_gl_version(4, 4))
#endif
{
_max_vertex_attrib_stride = -1;
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, &_max_vertex_attrib_stride);
if (_max_vertex_attrib_stride < 0) {
GLCAT.warning()
<< "Failed to query GL_MAX_VERTEX_ATTRIB_STRIDE.\n";
_max_vertex_attrib_stride = INT_MAX;
}
else if (GLCAT.is_debug()) {
GLCAT.debug()
<< "max vertex attrib stride = " << _max_vertex_attrib_stride << "\n";
}
}
else {
_max_vertex_attrib_stride = INT_MAX;
}
#endif // !OPENGLES_1
_current_vbuffer_index = 0; _current_vbuffer_index = 0;
_current_ibuffer_index = 0; _current_ibuffer_index = 0;
_current_vao_index = 0; _current_vao_index = 0;
@ -6920,6 +6945,16 @@ setup_array_data(const unsigned char *&client_pointer,
return (client_pointer != nullptr); return (client_pointer != nullptr);
} }
#ifndef OPENGLES_1
int stride = array_reader->get_array_format()->get_stride();
if (stride > _max_vertex_attrib_stride) {
GLCAT.error()
<< "Vertex array stride " << stride << " exceeds supported maximum "
<< _max_vertex_attrib_stride << "!\n";
return false;
}
#endif
// Prepare the buffer object and bind it. // Prepare the buffer object and bind it.
CLP(VertexBufferContext) *gvbc = DCAST(CLP(VertexBufferContext), CLP(VertexBufferContext) *gvbc = DCAST(CLP(VertexBufferContext),
array_reader->prepare_now(get_prepared_objects(), this)); array_reader->prepare_now(get_prepared_objects(), this));

View File

@ -451,6 +451,8 @@ public:
INLINE int get_gl_version_minor() const; INLINE int get_gl_version_minor() const;
INLINE bool has_fixed_function_pipeline() const; INLINE bool has_fixed_function_pipeline() const;
INLINE int get_max_vertex_attrib_stride() const;
virtual void set_state_and_transform(const RenderState *state, virtual void set_state_and_transform(const RenderState *state,
const TransformState *transform); const TransformState *transform);
@ -751,6 +753,7 @@ protected:
bool _use_vertex_attrib_binding; bool _use_vertex_attrib_binding;
CPT(GeomVertexFormat) _current_vertex_format; CPT(GeomVertexFormat) _current_vertex_format;
const GeomVertexColumn *_vertex_attrib_columns[32]; const GeomVertexColumn *_vertex_attrib_columns[32];
int _max_vertex_attrib_stride = INT_MAX;
GLuint _current_sbuffer_index; GLuint _current_sbuffer_index;
pvector<GLuint> _current_sbuffer_base; pvector<GLuint> _current_sbuffer_base;

View File

@ -48,6 +48,9 @@ get_stride() const {
* Changes the total number of bytes reserved in the array for each vertex. * Changes the total number of bytes reserved in the array for each vertex.
* You may not reduce this below get_total_bytes(), but you may increase it * You may not reduce this below get_total_bytes(), but you may increase it
* arbitrarily. * arbitrarily.
*
* You should avoid arrays with stride higher than 2048, which is the typical
* limit supported by graphics hardware.
*/ */
INLINE void GeomVertexArrayFormat:: INLINE void GeomVertexArrayFormat::
set_stride(int stride) { set_stride(int stride) {

View File

@ -23,7 +23,6 @@
using std::max; using std::max;
using std::min; using std::min;
using std::move;
GeomVertexArrayFormat::Registry *GeomVertexArrayFormat::_registry = nullptr; GeomVertexArrayFormat::Registry *GeomVertexArrayFormat::_registry = nullptr;
TypeHandle GeomVertexArrayFormat::_type_handle; TypeHandle GeomVertexArrayFormat::_type_handle;
@ -56,7 +55,7 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0,
_divisor(0), _divisor(0),
_columns_unsorted(false) _columns_unsorted(false)
{ {
add_column(move(name0), num_components0, numeric_type0, contents0); add_column(std::move(name0), num_components0, numeric_type0, contents0);
} }
/** /**
@ -76,8 +75,8 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0,
_divisor(0), _divisor(0),
_columns_unsorted(false) _columns_unsorted(false)
{ {
add_column(move(name0), num_components0, numeric_type0, contents0); add_column(std::move(name0), num_components0, numeric_type0, contents0);
add_column(move(name1), num_components1, numeric_type1, contents1); add_column(std::move(name1), num_components1, numeric_type1, contents1);
} }
/** /**
@ -100,9 +99,9 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0,
_divisor(0), _divisor(0),
_columns_unsorted(false) _columns_unsorted(false)
{ {
add_column(move(name0), num_components0, numeric_type0, contents0); add_column(std::move(name0), num_components0, numeric_type0, contents0);
add_column(move(name1), num_components1, numeric_type1, contents1); add_column(std::move(name1), num_components1, numeric_type1, contents1);
add_column(move(name2), num_components2, numeric_type2, contents2); add_column(std::move(name2), num_components2, numeric_type2, contents2);
} }
/** /**
@ -128,10 +127,10 @@ GeomVertexArrayFormat(CPT_InternalName name0, int num_components0,
_divisor(0), _divisor(0),
_columns_unsorted(false) _columns_unsorted(false)
{ {
add_column(move(name0), num_components0, numeric_type0, contents0); add_column(std::move(name0), num_components0, numeric_type0, contents0);
add_column(move(name1), num_components1, numeric_type1, contents1); add_column(std::move(name1), num_components1, numeric_type1, contents1);
add_column(move(name2), num_components2, numeric_type2, contents2); add_column(std::move(name2), num_components2, numeric_type2, contents2);
add_column(move(name3), num_components3, numeric_type3, contents3); add_column(std::move(name3), num_components3, numeric_type3, contents3);
} }
/** /**
@ -223,7 +222,7 @@ add_column(CPT_InternalName name, int num_components,
start = _total_bytes; start = _total_bytes;
} }
return add_column(GeomVertexColumn(move(name), num_components, numeric_type, contents, return add_column(GeomVertexColumn(std::move(name), num_components, numeric_type, contents,
start, column_alignment)); start, column_alignment));
} }

View File

@ -28,7 +28,6 @@
#endif #endif
using std::istream; using std::istream;
using std::move;
using std::ostream; using std::ostream;
using std::ostringstream; using std::ostringstream;
using std::string; using std::string;
@ -92,10 +91,11 @@ cp_report_error(ShaderArgInfo &p, const string &msg) {
case SAT_sampler1d: tstr = "sampler1D "; break; case SAT_sampler1d: tstr = "sampler1D "; break;
case SAT_sampler2d: tstr = "sampler2D "; break; case SAT_sampler2d: tstr = "sampler2D "; break;
case SAT_sampler3d: tstr = "sampler3D "; break; case SAT_sampler3d: tstr = "sampler3D "; break;
case SAT_sampler2d_array: tstr = "sampler2DArray "; break; case SAT_sampler2d_array: tstr = "sampler2DARRAY "; break;
case SAT_sampler_cube: tstr = "samplerCUBE "; break; case SAT_sampler_cube: tstr = "samplerCUBE "; break;
case SAT_sampler_buffer: tstr = "samplerBUF "; break; case SAT_sampler_buffer: tstr = "samplerBUF "; break;
case SAT_sampler_cube_array:tstr = "samplerCUBEARRAY "; break; case SAT_sampler_cube_array:tstr = "samplerCUBEARRAY "; break;
case SAT_sampler1d_array: tstr = "sampler1DARRAY "; break;
default: tstr = "unknown "; break; default: tstr = "unknown "; break;
} }
@ -228,15 +228,15 @@ cp_errchk_parameter_ptr(ShaderArgInfo &p) {
* message and return false. * message and return false.
*/ */
bool Shader:: bool Shader::
cp_errchk_parameter_sampler(ShaderArgInfo &p) cp_errchk_parameter_sampler(ShaderArgInfo &p) {
{ if (p._type != SAT_sampler1d &&
if ((p._type!=SAT_sampler1d)&& p._type != SAT_sampler2d &&
(p._type!=SAT_sampler2d)&& p._type != SAT_sampler3d &&
(p._type!=SAT_sampler3d)&& p._type != SAT_sampler2d_array &&
(p._type!=SAT_sampler2d_array)&& p._type != SAT_sampler_cube &&
(p._type!=SAT_sampler_cube)&& p._type != SAT_sampler_buffer &&
(p._type!=SAT_sampler_buffer)&& p._type != SAT_sampler_cube_array &&
(p._type!=SAT_sampler_cube_array)) { p._type != SAT_sampler1d_array) {
cp_report_error(p, "parameter should have a 'sampler' type"); cp_report_error(p, "parameter should have a 'sampler' type");
return false; return false;
} }
@ -1429,6 +1429,7 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) {
case SAT_sampler_cube: bind._desired_type = Texture::TT_cube_map; break; case SAT_sampler_cube: bind._desired_type = Texture::TT_cube_map; break;
case SAT_sampler_buffer: bind._desired_type = Texture::TT_buffer_texture; break; case SAT_sampler_buffer: bind._desired_type = Texture::TT_buffer_texture; break;
case SAT_sampler_cube_array:bind._desired_type = Texture::TT_cube_map_array; break; case SAT_sampler_cube_array:bind._desired_type = Texture::TT_cube_map_array; break;
case SAT_sampler1d_array:bind._desired_type = Texture::TT_1d_texture_array; break;
default: default:
cp_report_error(p, "Invalid type for a tex-parameter"); cp_report_error(p, "Invalid type for a tex-parameter");
return false; return false;
@ -1630,6 +1631,15 @@ compile_parameter(ShaderArgInfo &p, int *arg_dim) {
_tex_spec.push_back(bind); _tex_spec.push_back(bind);
return true; return true;
} }
case SAT_sampler1d_array: {
ShaderTexSpec bind;
bind._id = p._id;
bind._name = kinputname;
bind._part = STO_named_input;
bind._desired_type = Texture::TT_1d_texture_array;
_tex_spec.push_back(bind);
return true;
}
default: default:
cp_report_error(p, "invalid type for non-prefix parameter"); cp_report_error(p, "invalid type for non-prefix parameter");
return false; return false;
@ -1751,6 +1761,7 @@ cg_parameter_type(CGparameter p) {
case CG_SAMPLERCUBE: return Shader::SAT_sampler_cube; case CG_SAMPLERCUBE: return Shader::SAT_sampler_cube;
case CG_SAMPLERBUF: return Shader::SAT_sampler_buffer; case CG_SAMPLERBUF: return Shader::SAT_sampler_buffer;
case CG_SAMPLERCUBEARRAY:return Shader::SAT_sampler_cube_array; case CG_SAMPLERCUBEARRAY:return Shader::SAT_sampler_cube_array;
case CG_SAMPLER1DARRAY: return Shader::SAT_sampler1d_array;
// CG_SAMPLER1DSHADOW and CG_SAMPLER2DSHADOW // CG_SAMPLER1DSHADOW and CG_SAMPLER2DSHADOW
case 1313: return Shader::SAT_sampler1d; case 1313: return Shader::SAT_sampler1d;
case 1314: return Shader::SAT_sampler2d; case 1314: return Shader::SAT_sampler2d;
@ -3540,7 +3551,7 @@ make(string body, ShaderLanguage lang) {
} }
#endif #endif
ShaderFile sbody(move(body)); ShaderFile sbody(std::move(body));
if (cache_generated_shaders) { if (cache_generated_shaders) {
ShaderTable::const_iterator i = _make_table.find(sbody); ShaderTable::const_iterator i = _make_table.find(sbody);
@ -3600,8 +3611,8 @@ make(ShaderLanguage lang, string vertex, string fragment, string geometry,
return nullptr; return nullptr;
} }
ShaderFile sbody(move(vertex), move(fragment), move(geometry), ShaderFile sbody(std::move(vertex), std::move(fragment), std::move(geometry),
move(tess_control), move(tess_evaluation)); std::move(tess_control), std::move(tess_evaluation));
if (cache_generated_shaders) { if (cache_generated_shaders) {
ShaderTable::const_iterator i = _make_table.find(sbody); ShaderTable::const_iterator i = _make_table.find(sbody);
@ -3645,7 +3656,7 @@ make_compute(ShaderLanguage lang, string body) {
ShaderFile sbody; ShaderFile sbody;
sbody._separate = true; sbody._separate = true;
sbody._compute = move(body); sbody._compute = std::move(body);
if (cache_generated_shaders) { if (cache_generated_shaders) {
ShaderTable::const_iterator i = _make_table.find(sbody); ShaderTable::const_iterator i = _make_table.find(sbody);

View File

@ -282,6 +282,7 @@ public:
SAT_sampler_cube, SAT_sampler_cube,
SAT_sampler_buffer, SAT_sampler_buffer,
SAT_sampler_cube_array, SAT_sampler_cube_array,
SAT_sampler1d_array,
SAT_unknown SAT_unknown
}; };

View File

@ -75,7 +75,6 @@
#include "weakNodePath.h" #include "weakNodePath.h"
using std::max; using std::max;
using std::move;
using std::ostream; using std::ostream;
using std::ostringstream; using std::ostringstream;
using std::string; using std::string;
@ -3384,11 +3383,11 @@ set_shader_input(ShaderInput &&inp) {
pnode->get_attrib(ShaderAttrib::get_class_slot()); pnode->get_attrib(ShaderAttrib::get_class_slot());
if (attrib != nullptr) { if (attrib != nullptr) {
const ShaderAttrib *sa = (const ShaderAttrib *)attrib; const ShaderAttrib *sa = (const ShaderAttrib *)attrib;
pnode->set_attrib(sa->set_shader_input(move(inp))); pnode->set_attrib(sa->set_shader_input(std::move(inp)));
} else { } else {
// Create a new ShaderAttrib for this node. // Create a new ShaderAttrib for this node.
CPT(ShaderAttrib) sa = DCAST(ShaderAttrib, ShaderAttrib::make()); CPT(ShaderAttrib) sa = DCAST(ShaderAttrib, ShaderAttrib::make());
pnode->set_attrib(sa->set_shader_input(move(inp))); pnode->set_attrib(sa->set_shader_input(std::move(inp)));
} }
} }
@ -5563,7 +5562,7 @@ calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
bool found_any = false; bool found_any = false;
node()->calc_tight_bounds(min_point, max_point, found_any, node()->calc_tight_bounds(min_point, max_point, found_any,
move(transform), current_thread); std::move(transform), current_thread);
return found_any; return found_any;
} }
@ -5863,7 +5862,7 @@ NodePath NodePath::
decode_from_bam_stream(vector_uchar data, BamReader *reader) { decode_from_bam_stream(vector_uchar data, BamReader *reader) {
NodePath result; NodePath result;
DatagramBuffer buffer(move(data)); DatagramBuffer buffer(std::move(data));
BamReader local_reader; BamReader local_reader;
if (reader == nullptr) { if (reader == nullptr) {

View File

@ -16,8 +16,6 @@
#include "shaderInput_ext.h" #include "shaderInput_ext.h"
#include "shaderAttrib.h" #include "shaderAttrib.h"
using std::move;
#ifdef HAVE_PYTHON #ifdef HAVE_PYTHON
#ifndef CPPPARSER #ifndef CPPPARSER
@ -215,7 +213,7 @@ find_net_python_tag(PyObject *key) const {
*/ */
NodePath NodePath
py_decode_NodePath_from_bam_stream(vector_uchar data) { py_decode_NodePath_from_bam_stream(vector_uchar data) {
return py_decode_NodePath_from_bam_stream_persist(nullptr, move(data)); return py_decode_NodePath_from_bam_stream_persist(nullptr, std::move(data));
} }
/** /**
@ -235,7 +233,7 @@ py_decode_NodePath_from_bam_stream_persist(PyObject *unpickler, vector_uchar dat
} }
} }
return NodePath::decode_from_bam_stream(move(data), reader); return NodePath::decode_from_bam_stream(std::move(data), reader);
} }
/** /**
@ -253,7 +251,7 @@ set_shader_input(CPT_InternalName name, PyObject *value, int priority) {
} }
ShaderInput &input = attrib->_inputs[name]; ShaderInput &input = attrib->_inputs[name];
invoke_extension(&input).__init__(move(name), value, priority); invoke_extension(&input).__init__(std::move(name), value, priority);
if (!_PyErr_OCCURRED()) { if (!_PyErr_OCCURRED()) {
node->set_attrib(ShaderAttrib::return_new(attrib)); node->set_attrib(ShaderAttrib::return_new(attrib));
@ -294,7 +292,7 @@ set_shader_inputs(PyObject *args, PyObject *kwargs) {
CPT_InternalName name(std::string(buffer, length)); CPT_InternalName name(std::string(buffer, length));
ShaderInput &input = attrib->_inputs[name]; ShaderInput &input = attrib->_inputs[name];
invoke_extension(&input).__init__(move(name), value); invoke_extension(&input).__init__(std::move(name), value);
} }
if (!_PyErr_OCCURRED()) { if (!_PyErr_OCCURRED()) {

View File

@ -1293,15 +1293,20 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
text << "\t float4 tex" << i << " = tex" << texture_type_as_string(tex._type); text << "\t float4 tex" << i << " = tex" << texture_type_as_string(tex._type);
text << "(tex_" << i << ", texcoord" << i << "."; text << "(tex_" << i << ", texcoord" << i << ".";
switch (tex._type) { switch (tex._type) {
case Texture::TT_cube_map_array:
text << "xyzw";
break;
case Texture::TT_cube_map: case Texture::TT_cube_map:
case Texture::TT_3d_texture: case Texture::TT_3d_texture:
case Texture::TT_2d_texture_array: case Texture::TT_2d_texture_array:
text << "xyz"; text << "xyz";
break; break;
case Texture::TT_2d_texture: case Texture::TT_2d_texture:
case Texture::TT_1d_texture_array:
text << "xy"; text << "xy";
break; break;
case Texture::TT_1d_texture: case Texture::TT_1d_texture:
case Texture::TT_buffer_texture:
text << "x"; text << "x";
break; break;
default: default:
@ -1345,6 +1350,9 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
} }
text << "(tex_" << i << ", texcoord" << i << "."; text << "(tex_" << i << ", texcoord" << i << ".";
switch (tex._type) { switch (tex._type) {
case Texture::TT_cube_map_array:
text << "xyzw";
break;
case Texture::TT_cube_map: case Texture::TT_cube_map:
case Texture::TT_3d_texture: case Texture::TT_3d_texture:
case Texture::TT_2d_texture_array: case Texture::TT_2d_texture_array:
@ -1353,7 +1361,11 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
case Texture::TT_2d_texture: case Texture::TT_2d_texture:
text << "xyw"; text << "xyw";
break; break;
case Texture::TT_1d_texture_array:
text << "xy";
break;
case Texture::TT_1d_texture: case Texture::TT_1d_texture:
case Texture::TT_buffer_texture:
text << "x"; text << "x";
break; break;
default: default:
@ -1977,24 +1989,33 @@ combine_source_as_string(const ShaderKey::TextureInfo &info, short num, bool alp
const char *ShaderGenerator:: const char *ShaderGenerator::
texture_type_as_string(Texture::TextureType ttype) { texture_type_as_string(Texture::TextureType ttype) {
switch (ttype) { switch (ttype) {
case Texture::TT_1d_texture: case Texture::TT_1d_texture:
return "1D"; return "1D";
break;
case Texture::TT_2d_texture: case Texture::TT_2d_texture:
return "2D"; return "2D";
break;
case Texture::TT_3d_texture: case Texture::TT_3d_texture:
return "3D"; return "3D";
break;
case Texture::TT_cube_map: case Texture::TT_2d_texture_array:
return "CUBE"; return "2DARRAY";
break;
case Texture::TT_2d_texture_array: case Texture::TT_cube_map:
return "2DARRAY"; return "CUBE";
break;
default: case Texture::TT_buffer_texture:
pgraphnodes_cat.error() << "Unsupported texture type!\n"; return "BUF";
return "2D";
case Texture::TT_cube_map_array:
return "CUBEARRAY";
case Texture::TT_1d_texture_array:
return "1DARRAY";
default:
pgraphnodes_cat.error() << "Unsupported texture type!\n";
return "2D";
} }
} }

View File

@ -42,7 +42,6 @@
using std::max; using std::max;
using std::min; using std::min;
using std::move;
using std::wstring; using std::wstring;
// This is the factor by which CT_small scales the character down. // This is the factor by which CT_small scales the character down.
@ -1197,7 +1196,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) {
tex_ptr[1] = quad._uvs[1]; tex_ptr[1] = quad._uvs[1];
tex_ptr += stride; tex_ptr += stride;
glyphs.push_back(move(quad._glyph)); glyphs.push_back(std::move(quad._glyph));
} }
} else { } else {
// 64-bit vertex case. // 64-bit vertex case.
@ -1245,7 +1244,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) {
tex_ptr[1] = quad._uvs[1]; tex_ptr[1] = quad._uvs[1];
tex_ptr += stride; tex_ptr += stride;
glyphs.push_back(move(quad._glyph)); glyphs.push_back(std::move(quad._glyph));
} }
} }
} }
@ -1751,7 +1750,7 @@ shape_buffer(hb_buffer_t *buf, PlacedGlyphs &placed_glyphs, PN_stdfloat &xpos,
// it may involve multiple Geoms if we need to add cheesy accents or // it may involve multiple Geoms if we need to add cheesy accents or
// ligatures. // ligatures.
GlyphPlacement placement; GlyphPlacement placement;
placement._glyph = move(glyph); placement._glyph = std::move(glyph);
placement._scale = glyph_scale; placement._scale = glyph_scale;
placement._xpos = xpos + x_offset; placement._xpos = xpos + x_offset;
placement._ypos = properties.get_glyph_shift() + y_offset; placement._ypos = properties.get_glyph_shift() + y_offset;
@ -1801,7 +1800,7 @@ draw_underscore(TextAssembler::PlacedGlyphs &placed_glyphs,
// LVecBase4(0), RenderState::make_empty()); // LVecBase4(0), RenderState::make_empty());
GlyphPlacement placement; GlyphPlacement placement;
placement._glyph = move(glyph); placement._glyph = std::move(glyph);
placement._xpos = 0; placement._xpos = 0;
placement._ypos = 0; placement._ypos = 0;
placement._scale = 1; placement._scale = 1;
@ -2458,7 +2457,7 @@ assign_quad_to(QuadMap &quad_map, const RenderState *state,
quad._dimensions += LVecBase4(offset[0], -offset[1], offset[0], -offset[1]); quad._dimensions += LVecBase4(offset[0], -offset[1], offset[0], -offset[1]);
quad._glyph = _glyph; quad._glyph = _glyph;
quad_map[state->compose(_glyph->get_state())].push_back(move(quad)); quad_map[state->compose(_glyph->get_state())].push_back(std::move(quad));
} }
} }