Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
GraphicsStateGuardian Class Reference

Encapsulates all the communication with a particular instance of a given rendering backend. More...

#include "graphicsStateGuardian.h"

Inheritance diagram for GraphicsStateGuardian:
GraphicsStateGuardianBase TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase DXGraphicsStateGuardian9 TinyGraphicsStateGuardian

Public Types

enum  ShaderModel {
  SM_00, SM_11, SM_20, SM_2X,
  SM_30, SM_40, SM_50
}
 
typedef bool TextureCallback(TextureContext *tc, void *callback_arg)
 

Public Member Functions

 GraphicsStateGuardian (CoordinateSystem internal_coordinate_system, GraphicsEngine *engine, GraphicsPipe *pipe)
 
virtual bool begin_draw_primitives (const GeomPipelineReader *geom_reader, const GeomMunger *munger, const GeomVertexDataPipelineReader *data_reader, bool force)
 Called before a sequence of draw_primitive() functions are called, this should prepare the vertex data for rendering. More...
 
virtual bool begin_frame (Thread *current_thread)
 Called before each frame is rendered, to allow the GSG a chance to do any internal cleanup before beginning the frame. More...
 
virtual void begin_occlusion_query ()
 Begins a new occlusion query. More...
 
virtual bool begin_scene ()
 Called between begin_frame() and end_frame() to mark the beginning of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame. More...
 
virtual void bind_light (PointLight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties. More...
 
virtual void bind_light (DirectionalLight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties. More...
 
virtual void bind_light (Spotlight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties. More...
 
virtual void clear (DrawableRegion *clearable)
 Clears the framebuffer within the current DisplayRegion, according to the flags indicated by the given DrawableRegion object. More...
 
virtual void clear_before_callback ()
 Resets any non-standard graphics state that might give a callback apoplexy. More...
 
void clear_flash_texture ()
 Resets the "flash texture", so that no textures will flash. More...
 
virtual void clear_state_and_transform ()
 Forgets the current graphics state and current transform, so that the next call to set_state_and_transform() will have to reload everything. More...
 
virtual PN_stdfloat compute_distance_to (const LPoint3 &point) const
 This function will compute the distance to the indicated point, assumed to be in eye coordinates, from the camera plane. More...
 
virtual CPT (TransformState) calc_projection_mat(const Lens *lens)
 
virtual CPT (RenderState) begin_decal_base_first()
 
virtual CPT (RenderState) begin_decal_nested()
 
virtual CPT (RenderState) begin_decal_base_second()
 
 CPT (TransformState) get_external_transform() const
 
 CPT (TransformState) get_internal_transform() const
 
virtual CPT (TransformState) get_cs_transform_for(CoordinateSystem cs) const
 
virtual CPT (TransformState) get_cs_transform() const
 
 CPT (TransformState) get_inv_cs_transform() const
 
virtual bool depth_offset_decals ()
 Returns true if this GSG can implement decals using a DepthOffsetAttrib, or false if that is unreliable and the three-step rendering process should be used instead. More...
 
virtual void dispatch_compute (int size_x, int size_y, int size_z)
 Dispatches a currently bound compute shader using the given work group counts. More...
 
void do_issue_clip_plane ()
 
void do_issue_color ()
 This method is defined in the base class because it is likely that this functionality will be used for all (or at least most) kinds of GraphicsStateGuardians–it's not specific to any one rendering backend. More...
 
void do_issue_color_scale ()
 
virtual void do_issue_light ()
 This implementation of do_issue_light() assumes we have a limited number of hardware lights available. More...
 
virtual bool draw_lines (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected line segments. More...
 
virtual bool draw_linestrips (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of line strips. More...
 
virtual bool draw_patches (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of "patches", which can only be processed by a tessellation shader. More...
 
virtual bool draw_points (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected points. More...
 
virtual bool draw_triangles (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected triangles. More...
 
virtual bool draw_trifans (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of triangle fans. More...
 
virtual bool draw_tristrips (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of triangle strips. More...
 
virtual void end_draw_primitives ()
 Called after a sequence of draw_primitive() functions are called, this should do whatever cleanup is appropriate. More...
 
virtual void end_frame (Thread *current_thread)
 Called after each frame is rendered, to allow the GSG a chance to do any internal cleanup after rendering the frame, and before the window flips. More...
 
virtual void end_scene ()
 Called between begin_frame() and end_frame() to mark the end of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame. More...
 
virtual bool extract_texture_data (Texture *tex)
 This method should only be called by the GraphicsEngine. More...
 
const Shader::ShaderPtrDatafetch_ptr_parameter (const Shader::ShaderPtrSpec &spec)
 Return a pointer to struct ShaderPtrData. More...
 
const LMatrix4fetch_specified_part (Shader::ShaderMatInput input, InternalName *name, LMatrix4 &t, int index)
 See fetch_specified_value. More...
 
const LMatrix4fetch_specified_value (Shader::ShaderMatSpec &spec, int altered)
 The gsg contains a large number of useful matrices: More...
 
virtual void finish_decal ()
 Called during draw to clean up after decals are finished. More...
 
void flush_timer_queries ()
 Called by the graphics engine on the draw thread to check the status of the running timer queries and submit their results to the PStats server. More...
 
virtual TypeHandle force_init_type ()
 
virtual bool framebuffer_copy_to_ram (Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb)
 Copy the pixels within the indicated display region from the framebuffer into system memory, not texture memory. More...
 
virtual bool framebuffer_copy_to_texture (Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb)
 Copy the pixels within the indicated display region from the framebuffer into texture memory. More...
 
bool get_alpha_scale_via_texture () const
 Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha. More...
 
bool get_alpha_scale_via_texture (const TextureAttrib *tex_attrib) const
 This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect. More...
 
bool get_color_scale_via_lighting () const
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color. More...
 
CoordinateSystem get_coordinate_system () const
 Returns the coordinate system in effect on this particular gsg. More...
 
bool get_copy_texture_inverted () const
 Returns true if this particular GSG has the property that any framebuffer-to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down. More...
 
const DisplayRegionget_current_display_region () const
 
const Lensget_current_lens () const
 
Lens::StereoChannel get_current_stereo_channel () const
 
int get_current_tex_view_offset () const
 
virtual string get_driver_renderer ()
 Returns GL_Renderer. More...
 
virtual int get_driver_shader_version_major ()
 Returns the major version of the shader model. More...
 
virtual int get_driver_shader_version_minor ()
 Returns the minor version of the shader model. More...
 
virtual string get_driver_vendor ()
 Returns the vendor of the video card driver. More...
 
virtual string get_driver_version ()
 Returns driver version This has an implementation-defined meaning, and may be "" if the particular graphics implementation does not provide a way to query this information. More...
 
virtual int get_driver_version_major ()
 Returns major version of the video driver. More...
 
virtual int get_driver_version_minor ()
 Returns the minor version of the video driver. More...
 
virtual bool get_effective_incomplete_render () const
 Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags. More...
 
GraphicsEngineget_engine () const
 Returns the graphics engine that created this GSG. More...
 
Textureget_flash_texture () const
 Returns the current "flash texture", if any, or NULL if none. More...
 
PN_stdfloat get_gamma (PN_stdfloat gamma)
 Get the current gamma setting. More...
 
virtual bool get_incomplete_render () const
 Returns the incomplete_render flag. More...
 
virtual CoordinateSystem get_internal_coordinate_system () const
 Returns the coordinate system used internally by the GSG. More...
 
Loaderget_loader () const
 Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true. More...
 
int get_max_2d_texture_array_layers () const
 Returns the largest possible number of pages, or -1 if there is no particular limit. More...
 
int get_max_3d_texture_dimension () const
 Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit. More...
 
int get_max_clip_planes () const
 Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit. More...
 
int get_max_color_targets () const
 Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG. More...
 
int get_max_cube_map_dimension () const
 Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit. More...
 
int get_max_lights () const
 Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit. More...
 
virtual int get_max_texture_dimension () const
 Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit. More...
 
int get_max_texture_stages () const
 Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG. More...
 
int get_max_vertex_transform_indices () const
 Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware. More...
 
int get_max_vertex_transforms () const
 Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware. More...
 
virtual int get_max_vertices_per_array () const
 Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG. More...
 
virtual int get_max_vertices_per_primitive () const
 Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG. More...
 
int get_maximum_simultaneous_render_targets () const
 Deprecated. More...
 
GraphicsPipeget_pipe () const
 Returns the graphics pipe on which this GSG was created. More...
 
virtual PreparedGraphicsObjectsget_prepared_objects ()
 Returns the set of texture and geom objects that have been prepared with this GSG (and possibly other GSG's that share objects). More...
 
RenderBuffer get_render_buffer (int buffer_type, const FrameBufferProperties &prop)
 Returns a RenderBuffer object suitable for operating on the requested set of buffers. More...
 
bool get_runtime_color_scale () const
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting. More...
 
virtual SceneSetupget_scene () const
 Returns the current SceneSetup object. More...
 
ShaderGeneratorget_shader_generator () const
 Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary. More...
 
int get_shader_model () const
 Returns the ShaderModel. More...
 
virtual int get_supported_geom_rendering () const
 Returns the union of Geom::GeomRendering values that this particular GSG can support directly. More...
 
bool get_supports_2d_texture_array () const
 Returns true if this GSG can render 2-d textures array. More...
 
bool get_supports_3d_texture () const
 Returns true if this GSG can render 3-d (volumetric) textures. More...
 
bool get_supports_basic_shaders () const
 Returns true if this particular GSG supports arbfp1+arbvp1 or above. More...
 
virtual bool get_supports_cg_profile (const string &name) const
 Returns true if this particular GSG supports the specified Cg Shader Profile. More...
 
bool get_supports_compressed_texture () const
 Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing. More...
 
virtual bool get_supports_compressed_texture_format (int compression_mode) const
 Returns true if this GSG can accept textures pre-compressed in the indicated format. More...
 
bool get_supports_compute_shaders () const
 Returns true if this particular GSG supports compute shaders. More...
 
bool get_supports_cube_map () const
 Returns true if this GSG can render cube map textures. More...
 
bool get_supports_depth_stencil () const
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool get_supports_depth_texture () const
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool get_supports_generate_mipmap () const
 Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software. More...
 
bool get_supports_geometry_instancing () const
 Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model. More...
 
bool get_supports_geometry_shaders () const
 Returns true if this particular GSG supports geometry shaders. More...
 
bool get_supports_glsl () const
 Returns true if this particular GSG supports GLSL shaders. More...
 
virtual bool get_supports_multisample () const
 Returns true if this particular GSG supports using the multisample bits to provide antialiasing, and also supports M_multisample and M_multisample_mask transparency modes. More...
 
bool get_supports_occlusion_query () const
 Returns true if this GSG supports an occlusion query. More...
 
bool get_supports_sampler_objects () const
 Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects. More...
 
bool get_supports_shadow_filter () const
 Returns true if this particular GSG supports the filter mode FT_shadow for depth textures. More...
 
bool get_supports_stencil () const
 Returns true if this particular GSG supports stencil buffers at all. More...
 
bool get_supports_tessellation_shaders () const
 Returns true if this particular GSG supports tesselation shaders. More...
 
bool get_supports_tex_non_pow2 () const
 Returns true if this GSG can handle non power of two sized textures. More...
 
bool get_supports_texture_combine () const
 Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha(). More...
 
bool get_supports_texture_dot3 () const
 Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes. More...
 
bool get_supports_texture_saved_result () const
 Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs. More...
 
bool get_supports_texture_srgb () const
 Returns true if this GSG can handle sRGB textures. More...
 
bool get_supports_timer_query () const
 Returns true if this GSG supports a timer query. More...
 
bool get_supports_two_sided_stencil () const
 Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon. More...
 
Texture::QualityLevel get_texture_quality_override () const
 Returns the global quality_level override specified by set_texture_quality_override. More...
 
const GraphicsThreadingModelget_threading_model () const
 Returns the threading model that was used to create this GSG. More...
 
bool get_timer_queries_active () const
 Returns true if timer queries are currently enabled on this GSG. More...
 
virtual TypeHandle get_type () const
 
virtual bool has_extension (const string &extension) const
 Returns true if the GSG implements the extension identified by the given string. More...
 
bool is_active () const
 Returns the active flag associated with the GraphicsStateGuardian. More...
 
bool is_hardware () const
 Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only. More...
 
bool is_valid () const
 Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet. More...
 
void mark_new ()
 Marks the GSG as "new", so that the next call to reset_if_new() will be effective. More...
 
bool needs_reset () const
 Returns true if the gsg is marked as needing a reset. More...
 
virtual bool prefers_triangle_strips () const
 Returns true if this GSG strongly prefers triangle strips to individual triangles (such as SGI), or false if it prefers to minimize the number of primitive batches, even at the expense of triangle strips (such as most PC hardware). More...
 
virtual void prepare_display_region (DisplayRegionPipelineReader *dr)
 Makes the specified DisplayRegion current. More...
 
virtual GeomContextprepare_geom (Geom *geom)
 Prepares the indicated Geom for retained-mode rendering, by creating whatever structures are necessary in the GSG (for instance, vertex buffers). More...
 
virtual IndexBufferContextprepare_index_buffer (GeomPrimitive *data)
 Prepares the indicated buffer for retained-mode rendering. More...
 
virtual bool prepare_lens ()
 Makes the current lens (whichever lens was most recently specified with set_scene()) active, so that it will transform future rendered geometry. More...
 
virtual SamplerContextprepare_sampler (const SamplerState &sampler)
 Creates whatever structures the GSG requires to represent the sampler internally, and returns a newly-allocated SamplerContext object with this data. More...
 
virtual ShaderContextprepare_shader (Shader *shader)
 Compile a vertex/fragment shader body. More...
 
virtual TextureContextprepare_texture (Texture *tex)
 Creates whatever structures the GSG requires to represent the texture internally, and returns a newly-allocated TextureContext object with this data. More...
 
virtual VertexBufferContextprepare_vertex_buffer (GeomVertexArrayData *data)
 Prepares the indicated buffer for retained-mode rendering. More...
 
virtual PT (OcclusionQueryContext) end_occlusion_query()
 
virtual PT (TimerQueryContext) issue_timer_query(int pstats_index)
 
virtual PT (GeomMunger) get_geom_munger(const RenderState *state
 
virtual PT (GeomMunger) make_geom_munger(const RenderState *state
 
virtual PT (Texture) make_shadow_buffer(const NodePath &light_np
 
void release_all ()
 Releases all prepared objects. More...
 
int release_all_geoms ()
 Frees the resources for all geoms associated with this GSG. More...
 
int release_all_index_buffers ()
 Frees the resources for all index buffers associated with this GSG. More...
 
int release_all_samplers ()
 Frees the resources for all samplers associated with this GSG. More...
 
int release_all_textures ()
 Frees the resources for all textures associated with this GSG. More...
 
int release_all_vertex_buffers ()
 Frees the resources for all vertex buffers associated with this GSG. More...
 
virtual void release_geom (GeomContext *gc)
 Frees the resources previously allocated via a call to prepare_geom(), including deleting the GeomContext itself, if it is non-NULL. More...
 
virtual void release_index_buffer (IndexBufferContext *ibc)
 Frees the resources previously allocated via a call to prepare_data(), including deleting the IndexBufferContext itself, if necessary. More...
 
virtual void release_sampler (SamplerContext *sc)
 Frees the resources previously allocated via a call to prepare_sampler(), including deleting the SamplerContext itself, if it is non-NULL. More...
 
virtual void release_shader (ShaderContext *sc)
 Releases the resources allocated by prepare_shader. More...
 
virtual void release_texture (TextureContext *tc)
 Frees the resources previously allocated via a call to prepare_texture(), including deleting the TextureContext itself, if it is non-NULL. More...
 
virtual void release_vertex_buffer (VertexBufferContext *vbc)
 Frees the resources previously allocated via a call to prepare_data(), including deleting the VertexBufferContext itself, if necessary. More...
 
virtual void remove_window (GraphicsOutputBase *window)
 This is simply a transparent call to GraphicsEngine::remove_window(). More...
 
virtual void reset ()
 Resets all internal state as if the gsg were newly created. More...
 
bool reset_if_new ()
 Calls reset() to initialize the GSG, but only if it hasn't been called yet. More...
 
virtual void restore_gamma ()
 Restore original gamma setting. More...
 
void set_active (bool active)
 Sets the active flag associated with the GraphicsStateGuardian. More...
 
void set_coordinate_system (CoordinateSystem cs)
 Changes the coordinate system in effect on this particular gsg. More...
 
void set_current_properties (const FrameBufferProperties *properties)
 
void set_flash_texture (Texture *tex)
 Sets the "flash texture". More...
 
virtual bool set_gamma (PN_stdfloat gamma)
 Set gamma. More...
 
void set_incomplete_render (bool incomplete_render)
 Sets the incomplete_render flag. More...
 
void set_loader (Loader *loader)
 Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true. More...
 
bool set_scene (SceneSetup *scene_setup)
 Sets the SceneSetup object that indicates the initial camera position, etc. More...
 
void set_shader_generator (ShaderGenerator *shader_generator)
 Sets the ShaderGenerator object that will be used by this GSG to generate shaders when necessary. More...
 
void set_shader_model (int shader_model)
 Sets the ShaderModel. More...
 
virtual void set_state_and_transform (const RenderState *state, const TransformState *transform)
 Simultaneously resets the render state and the transform state. More...
 
void set_texture_quality_override (Texture::QualityLevel quality_level)
 Specifies the global quality_level to be imposed for all Textures rendered by this GSG. More...
 
void traverse_prepared_textures (TextureCallback *func, void *callback_arg)
 Calls the indicated function on all currently-prepared textures, or until the callback function returns false. More...
 
virtual bool update_texture (TextureContext *tc, bool force)
 Ensures that the current Texture data is refreshed onto the GSG. More...
 
- Public Member Functions inherited from GraphicsStateGuardianBase
 MAKE_SEQ (get_gsgs, get_num_gsgs, get_gsg)
 
virtual TextureContextprepare_texture (Texture *tex, int view)=0
 
- Public Member Functions inherited from TypedWritableReferenceCount
 TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
void operator= (const TypedWritableReferenceCount &copy)
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More...
 
string encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. More...
 
bool encode_to_bam_stream (string &data, BamWriter *writer=NULL) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
virtual void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More...
 
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More...
 
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More...
 
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static void create_gamma_table (PN_stdfloat gamma, unsigned short *red_table, unsigned short *green_table, unsigned short *blue_table)
 Create a gamma table. More...
 
static TextureStageget_alpha_scale_texture_stage ()
 Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from GraphicsStateGuardianBase
static void add_gsg (GraphicsStateGuardianBase *gsg)
 Called by a GSG after it has been initialized, to add a new GSG to the available list. More...
 
static TypeHandle get_class_type ()
 
static GraphicsStateGuardianBaseget_default_gsg ()
 Returns a pointer to the "default" GSG. More...
 
static GraphicsStateGuardianBaseget_gsg (int n)
 Returns the nth GSG in the universe. More...
 
static int get_num_gsgs ()
 Returns the total number of GSG's in the universe. More...
 
static void init_type ()
 
static void remove_gsg (GraphicsStateGuardianBase *gsg)
 Called by a GSG destructor to remove a GSG from the available list. More...
 
static void set_default_gsg (GraphicsStateGuardianBase *default_gsg)
 Specifies a particular GSG to use as the "default" GSG. More...
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
static PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data
 
- Static Public Member Functions inherited from TypedWritable
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

virtual Threadcurrent_thread
 
virtual GraphicsOutputBasehost
 
- Public Attributes inherited from GraphicsStateGuardianBase
virtual Threadcurrent_thread =0
 
virtual GraphicsOutputBasehost =0
 
- Public Attributes inherited from TypedWritableReferenceCount
static BamReaderreader = NULL)
 

Static Public Attributes

static PStatCollector _clear_pcollector
 
static PStatCollector _command_latency_pcollector
 
static PStatCollector _compute_dispatch_pcollector
 
static PStatCollector _create_index_buffer_pcollector
 
static PStatCollector _create_vertex_buffer_pcollector
 
static PStatCollector _data_transferred_pcollector
 
static PStatCollector _draw_primitive_pcollector
 
static PStatCollector _draw_set_state_alpha_test_pcollector
 
static PStatCollector _draw_set_state_antialias_pcollector
 
static PStatCollector _draw_set_state_blending_pcollector
 
static PStatCollector _draw_set_state_clip_plane_pcollector
 
static PStatCollector _draw_set_state_color_pcollector
 
static PStatCollector _draw_set_state_cull_face_pcollector
 
static PStatCollector _draw_set_state_depth_offset_pcollector
 
static PStatCollector _draw_set_state_depth_test_pcollector
 
static PStatCollector _draw_set_state_depth_write_pcollector
 
static PStatCollector _draw_set_state_fog_pcollector
 
static PStatCollector _draw_set_state_light_pcollector
 
static PStatCollector _draw_set_state_material_pcollector
 
static PStatCollector _draw_set_state_pcollector
 
static PStatCollector _draw_set_state_render_mode_pcollector
 
static PStatCollector _draw_set_state_rescale_normal_pcollector
 
static PStatCollector _draw_set_state_scissor_pcollector
 
static PStatCollector _draw_set_state_shade_model_pcollector
 
static PStatCollector _draw_set_state_shader_parameters_pcollector
 
static PStatCollector _draw_set_state_shader_pcollector
 
static PStatCollector _draw_set_state_stencil_pcollector
 
static PStatCollector _draw_set_state_tex_gen_pcollector
 
static PStatCollector _draw_set_state_tex_matrix_pcollector
 
static PStatCollector _draw_set_state_texture_pcollector
 
static PStatCollector _draw_set_state_transform_pcollector
 
static PStatCollector _flush_pcollector
 
static PStatCollector _index_buffer_switch_pcollector
 
static PStatCollector _load_index_buffer_pcollector
 
static PStatCollector _load_texture_pcollector
 
static PStatCollector _load_vertex_buffer_pcollector
 
static PStatCollector _prepare_geom_pcollector
 
static PStatCollector _prepare_index_buffer_pcollector
 
static PStatCollector _prepare_pcollector
 
static PStatCollector _prepare_sampler_pcollector
 
static PStatCollector _prepare_shader_pcollector
 
static PStatCollector _prepare_texture_pcollector
 
static PStatCollector _prepare_vertex_buffer_pcollector
 
static PStatCollector _primitive_batches_other_pcollector
 
static PStatCollector _primitive_batches_patch_pcollector
 
static PStatCollector _primitive_batches_pcollector
 
static PStatCollector _primitive_batches_tri_pcollector
 
static PStatCollector _primitive_batches_trifan_pcollector
 
static PStatCollector _primitive_batches_tristrip_pcollector
 
static PStatCollector _state_pcollector
 
static PStatCollector _texmgrmem_resident_pcollector
 
static PStatCollector _texmgrmem_total_pcollector
 
static PStatCollector _texture_state_pcollector
 
static PStatCollector _timer_queries_pcollector
 
static PStatCollector _transform_state_pcollector
 
static PStatCollector _vertex_buffer_switch_pcollector
 
static PStatCollector _vertices_indexed_tristrip_pcollector
 
static PStatCollector _vertices_other_pcollector
 
static PStatCollector _vertices_patch_pcollector
 
static PStatCollector _vertices_tri_pcollector
 
static PStatCollector _vertices_trifan_pcollector
 
static PStatCollector _vertices_tristrip_pcollector
 
static PStatCollector _wait_occlusion_pcollector
 
static PStatCollector _wait_timer_pcollector
 
- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = (TypedWritable*)0L
 

Friends

class GraphicsEngine
 
class GraphicsPipe
 
class GraphicsWindow
 

Detailed Description

Encapsulates all the communication with a particular instance of a given rendering backend.

Tries to guarantee that redundant state-change requests are not issued (hence "state guardian").

There will be one of these objects for each different graphics context active in the system.

Definition at line 67 of file graphicsStateGuardian.h.

Member Function Documentation

◆ begin_draw_primitives()

bool GraphicsStateGuardian::begin_draw_primitives ( const GeomPipelineReader geom_reader,
const GeomMunger munger,
const GeomVertexDataPipelineReader data_reader,
bool  force 
)
virtual

Called before a sequence of draw_primitive() functions are called, this should prepare the vertex data for rendering.

It returns true if the vertices are ok, false to abort this group of primitives.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2158 of file graphicsStateGuardian.cxx.

References draw_triangles().

Referenced by TinyGraphicsStateGuardian::begin_draw_primitives(), DXGraphicsStateGuardian9::begin_draw_primitives(), and finish_decal().

◆ begin_frame()

bool GraphicsStateGuardian::begin_frame ( Thread current_thread)
virtual

Called before each frame is rendered, to allow the GSG a chance to do any internal cleanup before beginning the frame.

The return value is true if successful (in which case the frame will be drawn and end_frame() will be called later), or false if unsuccessful (in which case nothing will be drawn and end_frame() will not be called).

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 1783 of file graphicsStateGuardian.cxx.

References begin_scene(), ClockObject::get_frame_count(), and ClockObject::get_global_clock().

Referenced by TinyGraphicsStateGuardian::begin_frame(), DXGraphicsStateGuardian9::begin_frame(), and prepare_lens().

◆ begin_occlusion_query()

void GraphicsStateGuardian::begin_occlusion_query ( )
virtual

Begins a new occlusion query.

After this call, you may call begin_draw_primitives() and draw_triangles()/draw_whatever() repeatedly. Eventually, you should call end_occlusion_query() before the end of the frame; that will return a new OcclusionQueryContext object that will tell you how many pixels represented by the bracketed geometry passed the depth test.

It is not valid to call begin_occlusion_query() between another begin_occlusion_query() .. end_occlusion_query() sequence.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 768 of file graphicsStateGuardian.cxx.

References dispatch_compute().

Referenced by PipeOcclusionCullTraverser::get_texture(), and release_index_buffer().

◆ begin_scene()

bool GraphicsStateGuardian::begin_scene ( )
virtual

Called between begin_frame() and end_frame() to mark the beginning of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.

All 3-D drawing commands, except the clear operation, must be enclosed within begin_scene() .. end_scene(). This must be called in the draw thread.

The return value is true if successful (in which case the scene will be drawn and end_scene() will be called later), or false if unsuccessful (in which case nothing will be drawn and end_scene() will not be called).

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 1838 of file graphicsStateGuardian.cxx.

References end_scene().

Referenced by begin_frame(), TinyGraphicsStateGuardian::begin_scene(), DXGraphicsStateGuardian9::begin_scene(), GraphicsEngine::do_cull(), PipeOcclusionCullTraverser::set_scene(), and DisplayRegionDrawCallbackData::upcall().

◆ bind_light() [1/3]

void GraphicsStateGuardian::bind_light ( PointLight light_obj,
const NodePath light,
int  light_id 
)
virtual

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2690 of file graphicsStateGuardian.cxx.

Referenced by bind_light(), and framebuffer_copy_to_ram().

◆ bind_light() [2/3]

void GraphicsStateGuardian::bind_light ( DirectionalLight light_obj,
const NodePath light,
int  light_id 
)
virtual

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2702 of file graphicsStateGuardian.cxx.

References bind_light().

◆ bind_light() [3/3]

void GraphicsStateGuardian::bind_light ( Spotlight light_obj,
const NodePath light,
int  light_id 
)
virtual

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2714 of file graphicsStateGuardian.cxx.

References create_gamma_table(), and PStatClient::is_connected().

◆ clear()

void GraphicsStateGuardian::clear ( DrawableRegion clearable)
virtual

Clears the framebuffer within the current DisplayRegion, according to the flags indicated by the given DrawableRegion object.

This does not set the DisplayRegion first. You should call prepare_display_region() to specify the region you wish the clear operation to apply to.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2330 of file graphicsStateGuardian.cxx.

References get_render_buffer().

Referenced by GraphicsEngine::do_cull(), TinyGraphicsBuffer::end_frame(), and set_state_and_transform().

◆ clear_before_callback()

void GraphicsStateGuardian::clear_before_callback ( )
virtual

Resets any non-standard graphics state that might give a callback apoplexy.

Some drivers require that the graphics state be restored to neutral before performing certain operations. In OpenGL, for instance, this closes any open vertex buffers.

Implements GraphicsStateGuardianBase.

Definition at line 1692 of file graphicsStateGuardian.cxx.

References clear_state_and_transform().

Referenced by GraphicsEngine::do_cull(), and prepare_display_region().

◆ clear_flash_texture()

void GraphicsStateGuardian::clear_flash_texture ( )

Resets the "flash texture", so that no textures will flash.

See set_flash_texture().

Definition at line 509 of file graphicsStateGuardian.cxx.

References get_flash_texture().

Referenced by set_flash_texture().

◆ clear_state_and_transform()

void GraphicsStateGuardian::clear_state_and_transform ( )
virtual

Forgets the current graphics state and current transform, so that the next call to set_state_and_transform() will have to reload everything.

This is a good thing to call when you are no longer sure what the graphics state is. This should only be called from the draw thread.

Implements GraphicsStateGuardianBase.

Definition at line 1706 of file graphicsStateGuardian.cxx.

References remove_window().

Referenced by clear_before_callback(), GraphicsEngine::do_cull(), and DisplayRegionDrawCallbackData::upcall().

◆ compute_distance_to()

PN_stdfloat GraphicsStateGuardian::compute_distance_to ( const LPoint3 point) const
virtual

This function will compute the distance to the indicated point, assumed to be in eye coordinates, from the camera plane.

The point is assumed to be in the GSG's internal coordinate system.

Implements GraphicsStateGuardianBase.

Definition at line 884 of file graphicsStateGuardian.cxx.

References fetch_specified_value().

Referenced by dispatch_compute().

◆ create_gamma_table()

void GraphicsStateGuardian::create_gamma_table ( PN_stdfloat  gamma,
unsigned short *  red_table,
unsigned short *  green_table,
unsigned short *  blue_table 
)
static

◆ depth_offset_decals()

bool GraphicsStateGuardian::depth_offset_decals ( )
virtual

Returns true if this GSG can implement decals using a DepthOffsetAttrib, or false if that is unreliable and the three-step rendering process should be used instead.

Implements GraphicsStateGuardianBase.

Reimplemented in TinyGraphicsStateGuardian.

Definition at line 2055 of file graphicsStateGuardian.cxx.

References finish_decal().

Referenced by flush_timer_queries().

◆ dispatch_compute()

void GraphicsStateGuardian::dispatch_compute ( int  size_x,
int  size_y,
int  size_z 
)
virtual

Dispatches a currently bound compute shader using the given work group counts.

Implements GraphicsStateGuardianBase.

Definition at line 807 of file graphicsStateGuardian.cxx.

References compute_distance_to().

Referenced by begin_occlusion_query(), and GraphicsEngine::dispatch_compute().

◆ do_issue_color()

void GraphicsStateGuardian::do_issue_color ( )

This method is defined in the base class because it is likely that this functionality will be used for all (or at least most) kinds of GraphicsStateGuardians–it's not specific to any one rendering backend.

The ColorAttribute just changes the interpretation of the color on the vertices, and fiddles with _vertex_colors_enabled, etc.

Definition at line 2458 of file graphicsStateGuardian.cxx.

References do_issue_light(), ColorAttrib::get_color(), ColorAttrib::get_color_type(), ColorScaleAttrib::get_scale(), ColorScaleAttrib::has_alpha_scale(), and ColorScaleAttrib::has_scale().

Referenced by get_render_buffer().

◆ do_issue_light()

void GraphicsStateGuardian::do_issue_light ( )
virtual

This implementation of do_issue_light() assumes we have a limited number of hardware lights available.

This function assigns each light to a different hardware light id, trying to keep each light associated with the same id where possible, but reusing id's when necessary. When it is no longer possible to reuse existing id's (e.g. all id's are in use), the next sequential id is assigned (if available).

It will call apply_light() each time a light is assigned to a particular id for the first time in a given frame, and it will subsequently call enable_light() to enable or disable each light as the frame is rendered, as well as enable_lighting() to enable or disable overall lighting.

Reimplemented in TinyGraphicsStateGuardian.

Definition at line 2561 of file graphicsStateGuardian.cxx.

References PandaNode::as_light(), framebuffer_copy_to_texture(), NodePath::is_empty(), and NodePath::node().

Referenced by do_issue_color().

◆ draw_lines()

bool GraphicsStateGuardian::draw_lines ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of disconnected line segments.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2214 of file graphicsStateGuardian.cxx.

References draw_linestrips().

Referenced by draw_patches().

◆ draw_linestrips()

bool GraphicsStateGuardian::draw_linestrips ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of line strips.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 2224 of file graphicsStateGuardian.cxx.

References draw_points().

Referenced by draw_lines().

◆ draw_patches()

bool GraphicsStateGuardian::draw_patches ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of "patches", which can only be processed by a tessellation shader.

Implements GraphicsStateGuardianBase.

Definition at line 2204 of file graphicsStateGuardian.cxx.

References draw_lines().

Referenced by draw_trifans().

◆ draw_points()

bool GraphicsStateGuardian::draw_points ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of disconnected points.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2234 of file graphicsStateGuardian.cxx.

References end_draw_primitives().

Referenced by draw_linestrips().

◆ draw_triangles()

bool GraphicsStateGuardian::draw_triangles ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of disconnected triangles.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2173 of file graphicsStateGuardian.cxx.

References draw_tristrips().

Referenced by begin_draw_primitives().

◆ draw_trifans()

bool GraphicsStateGuardian::draw_trifans ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of triangle fans.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 2193 of file graphicsStateGuardian.cxx.

References draw_patches().

Referenced by draw_tristrips().

◆ draw_tristrips()

bool GraphicsStateGuardian::draw_tristrips ( const GeomPrimitivePipelineReader reader,
bool  force 
)
virtual

Draws a series of triangle strips.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2183 of file graphicsStateGuardian.cxx.

References draw_trifans().

Referenced by draw_triangles().

◆ end_draw_primitives()

void GraphicsStateGuardian::end_draw_primitives ( )
virtual

Called after a sequence of draw_primitive() functions are called, this should do whatever cleanup is appropriate.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2246 of file graphicsStateGuardian.cxx.

References reset().

Referenced by draw_points(), TinyGraphicsStateGuardian::end_draw_primitives(), and DXGraphicsStateGuardian9::end_draw_primitives().

◆ end_frame()

void GraphicsStateGuardian::end_frame ( Thread current_thread)
virtual

Called after each frame is rendered, to allow the GSG a chance to do any internal cleanup after rendering the frame, and before the window flips.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 1887 of file graphicsStateGuardian.cxx.

References flush_timer_queries().

Referenced by TinyGraphicsStateGuardian::end_frame(), DXGraphicsStateGuardian9::end_frame(), and end_scene().

◆ end_scene()

void GraphicsStateGuardian::end_scene ( )
virtual

Called between begin_frame() and end_frame() to mark the end of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.

All 3-D drawing commands, except the clear operation, must be enclosed within begin_scene() .. end_scene().

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 1852 of file graphicsStateGuardian.cxx.

References end_frame().

Referenced by begin_scene(), GraphicsEngine::do_cull(), TinyGraphicsStateGuardian::end_scene(), DXGraphicsStateGuardian9::end_scene(), PipeOcclusionCullTraverser::end_traverse(), and DisplayRegionDrawCallbackData::upcall().

◆ extract_texture_data()

bool GraphicsStateGuardian::extract_texture_data ( Texture tex)
virtual

This method should only be called by the GraphicsEngine.

Do not call it directly; call GraphicsEngine::extract_texture_data() instead.

This method will be called in the draw thread to download the texture memory's image into its ram_image value. It returns true on success, false otherwise.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 627 of file graphicsStateGuardian.cxx.

References prepare_sampler().

Referenced by GraphicsEngine::extract_texture_data(), and release_texture().

◆ fetch_ptr_parameter()

const Shader::ShaderPtrData * GraphicsStateGuardian::fetch_ptr_parameter ( const Shader::ShaderPtrSpec spec)

Return a pointer to struct ShaderPtrData.

Definition at line 1624 of file graphicsStateGuardian.cxx.

References prepare_display_region().

Referenced by fetch_specified_part(), and DXShaderContext9::issue_parameters().

◆ fetch_specified_part()

const LMatrix4 * GraphicsStateGuardian::fetch_specified_part ( Shader::ShaderMatInput  input,
InternalName *  name,
LMatrix4 t,
int  index 
)

◆ fetch_specified_value()

const LMatrix4 * GraphicsStateGuardian::fetch_specified_value ( Shader::ShaderMatSpec spec,
int  altered 
)

The gsg contains a large number of useful matrices:

the world transform, the modelview matrix, the cs_transform, etc, etc.

A shader can request any of these values, and furthermore, it can request that various compositions, inverses, and transposes be performed. The ShaderMatSpec is a data structure indicating what datum is desired and what conversions to perform. This routine, fetch_specified_value, is responsible for doing the actual retrieval and conversions.

Some values, like the following, aren't matrices:

window size texture coordinates of card center

This routine can fetch these values as well, by shoehorning them into a matrix. In this way, we avoid the need for a separate routine to fetch these values.

The "altered" bits indicate what parts of the state_and_transform have changed since the last time this particular ShaderMatSpec was evaluated. This may allow data to be cached and not reevaluated.

Definition at line 940 of file graphicsStateGuardian.cxx.

References fetch_specified_part(), LMatrix4f::get_row3(), LMatrix4f::ident_mat(), LVecBase3f::normalize(), LMatrix4f::set_row(), LMatrix4f::xform_point(), and LMatrix4f::xform_vec().

Referenced by compute_distance_to(), and DXShaderContext9::issue_parameters().

◆ finish_decal()

void GraphicsStateGuardian::finish_decal ( )
virtual

Called during draw to clean up after decals are finished.

Implements GraphicsStateGuardianBase.

Definition at line 2145 of file graphicsStateGuardian.cxx.

References begin_draw_primitives().

Referenced by depth_offset_decals().

◆ flush_timer_queries()

void GraphicsStateGuardian::flush_timer_queries ( )

Called by the graphics engine on the draw thread to check the status of the running timer queries and submit their results to the PStats server.

Definition at line 1922 of file graphicsStateGuardian.cxx.

References PStatThread::add_frame(), depth_offset_decals(), ClockObject::get_frame_count(), and ClockObject::get_global_clock().

Referenced by end_frame().

◆ framebuffer_copy_to_ram()

bool GraphicsStateGuardian::framebuffer_copy_to_ram ( Texture tex,
int  view,
int  z,
const DisplayRegion dr,
const RenderBuffer rb 
)
virtual

Copy the pixels within the indicated display region from the framebuffer into system memory, not texture memory.

Returns true on success, false on failure.

This completely redefines the ram image of the indicated texture.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2676 of file graphicsStateGuardian.cxx.

References bind_light().

Referenced by framebuffer_copy_to_texture(), and DisplayRegion::get_screenshot().

◆ framebuffer_copy_to_texture()

bool GraphicsStateGuardian::framebuffer_copy_to_texture ( Texture tex,
int  view,
int  z,
const DisplayRegion dr,
const RenderBuffer rb 
)
virtual

Copy the pixels within the indicated display region from the framebuffer into texture memory.

If z > -1, it is the cube map index into which to copy.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2659 of file graphicsStateGuardian.cxx.

References framebuffer_copy_to_ram().

Referenced by do_issue_light().

◆ get_alpha_scale_texture_stage()

TextureStage * GraphicsStateGuardian::get_alpha_scale_texture_stage ( )
inlinestatic

Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true.

Definition at line 923 of file graphicsStateGuardian.I.

References get_runtime_color_scale().

Referenced by get_alpha_scale_via_texture().

◆ get_alpha_scale_via_texture() [1/2]

bool GraphicsStateGuardian::get_alpha_scale_via_texture ( ) const
inline

Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha.

Definition at line 894 of file graphicsStateGuardian.I.

Referenced by get_color_scale_via_lighting(), and StandardMunger::StandardMunger().

◆ get_alpha_scale_via_texture() [2/2]

bool GraphicsStateGuardian::get_alpha_scale_via_texture ( const TextureAttrib tex_attrib) const
inline

This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect.

This considers whether there is at least one additional texture slot available on the GSG.

Definition at line 909 of file graphicsStateGuardian.I.

References get_alpha_scale_texture_stage(), and get_max_texture_stages().

◆ get_color_scale_via_lighting()

bool GraphicsStateGuardian::get_color_scale_via_lighting ( ) const
inline

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color.

Definition at line 881 of file graphicsStateGuardian.I.

References get_alpha_scale_via_texture().

Referenced by set_shader_model(), and StandardMunger::StandardMunger().

◆ get_coordinate_system()

CoordinateSystem GraphicsStateGuardian::get_coordinate_system ( ) const
inline

Returns the coordinate system in effect on this particular gsg.

Normally, this will be the default coordinate system, but it might be set differently at runtime.

Definition at line 953 of file graphicsStateGuardian.I.

References set_texture_quality_override().

Referenced by get_runtime_color_scale().

◆ get_copy_texture_inverted()

bool GraphicsStateGuardian::get_copy_texture_inverted ( ) const
inline

Returns true if this particular GSG has the property that any framebuffer-to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down.

If this is true, then on offscreen GraphicsBuffer created for the purposes of rendering into a texture should be created with the invert flag set true, to compensate. Panda will do this automatically if you create an offscreen buffer using GraphicsOutput::make_texture_buffer().

Definition at line 606 of file graphicsStateGuardian.I.

References get_supports_generate_mipmap(), and ConfigVariableBase::has_value().

Referenced by get_max_vertex_transform_indices(), and ParasiteBuffer::ParasiteBuffer().

◆ get_driver_renderer()

string GraphicsStateGuardian::get_driver_renderer ( )
virtual

Returns GL_Renderer.

Definition at line 3286 of file graphicsStateGuardian.cxx.

References get_driver_version().

◆ get_driver_shader_version_major()

int GraphicsStateGuardian::get_driver_shader_version_major ( )
virtual

Returns the major version of the shader model.

Definition at line 3335 of file graphicsStateGuardian.cxx.

References get_driver_shader_version_minor().

Referenced by get_driver_version_minor().

◆ get_driver_shader_version_minor()

int GraphicsStateGuardian::get_driver_shader_version_minor ( )
virtual

Returns the minor version of the shader model.

Definition at line 3345 of file graphicsStateGuardian.cxx.

Referenced by get_driver_shader_version_major().

◆ get_driver_vendor()

string GraphicsStateGuardian::get_driver_vendor ( )
virtual

Returns the vendor of the video card driver.

Definition at line 3277 of file graphicsStateGuardian.cxx.

Referenced by has_extension().

◆ get_driver_version()

string GraphicsStateGuardian::get_driver_version ( )
virtual

Returns driver version This has an implementation-defined meaning, and may be "" if the particular graphics implementation does not provide a way to query this information.

Definition at line 3299 of file graphicsStateGuardian.cxx.

References get_driver_version_major().

Referenced by get_driver_renderer().

◆ get_driver_version_major()

int GraphicsStateGuardian::get_driver_version_major ( )
virtual

Returns major version of the video driver.

This has an implementation-defined meaning, and may be -1 if the particular graphics implementation does not provide a way to query this information.

Definition at line 3312 of file graphicsStateGuardian.cxx.

References get_driver_version_minor().

Referenced by get_driver_version().

◆ get_driver_version_minor()

int GraphicsStateGuardian::get_driver_version_minor ( )
virtual

Returns the minor version of the video driver.

This has an implementation-defined meaning, and may be -1 if the particular graphics implementation does not provide a way to query this information.

Definition at line 3325 of file graphicsStateGuardian.cxx.

References get_driver_shader_version_major().

Referenced by get_driver_version_major().

◆ get_effective_incomplete_render()

bool GraphicsStateGuardian::get_effective_incomplete_render ( ) const
inlinevirtual

Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags.

It only makes sense to call this during the draw traversal; at other times this return value will be meaningless.

See CullTraverser::get_effective_incomplete_render() for this same information during the cull traversal.

Implements GraphicsStateGuardianBase.

Definition at line 189 of file graphicsStateGuardian.I.

References set_loader().

Referenced by get_incomplete_render().

◆ get_engine()

GraphicsEngine * GraphicsStateGuardian::get_engine ( ) const

Returns the graphics engine that created this GSG.

Since there is normally only one GraphicsEngine object in an application, this is usually the same as the global GraphicsEngine.

Definition at line 296 of file graphicsStateGuardian.cxx.

References get_supports_multisample().

Referenced by NonlinearImager::add_viewer(), DXTextureContext9::create_texture(), GraphicsEngine::do_cull(), and GraphicsEngine::make_output().

◆ get_flash_texture()

Texture * GraphicsStateGuardian::get_flash_texture ( ) const

Returns the current "flash texture", if any, or NULL if none.

See set_flash_texture().

Definition at line 522 of file graphicsStateGuardian.cxx.

References set_scene().

Referenced by clear_flash_texture().

◆ get_gamma()

PN_stdfloat GraphicsStateGuardian::get_gamma ( PN_stdfloat  gamma)

Get the current gamma setting.

Definition at line 436 of file graphicsStateGuardian.cxx.

References restore_gamma().

Referenced by set_gamma().

◆ get_incomplete_render()

bool GraphicsStateGuardian::get_incomplete_render ( ) const
inlinevirtual

Returns the incomplete_render flag.

See set_incomplete_render().

Implements GraphicsStateGuardianBase.

Definition at line 171 of file graphicsStateGuardian.I.

References get_effective_incomplete_render().

Referenced by set_incomplete_render().

◆ get_internal_coordinate_system()

CoordinateSystem GraphicsStateGuardian::get_internal_coordinate_system ( ) const
virtual

Returns the coordinate system used internally by the GSG.

This may be the same as the external coordinate system reported by get_coordinate_system(), or it may be something different.

In any case, vertices that have been transformed before being handed to the GSG (that is, vertices with a contents value of C_clip_point) will be expected to be in this coordinate system.

Implements GraphicsStateGuardianBase.

Definition at line 402 of file graphicsStateGuardian.cxx.

References get_prepared_objects().

Referenced by SpeedTreeNode::cull_callback(), and set_coordinate_system().

◆ get_loader()

Loader * GraphicsStateGuardian::get_loader ( ) const
inline

Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

Definition at line 213 of file graphicsStateGuardian.I.

References set_shader_generator().

Referenced by set_loader().

◆ get_max_2d_texture_array_layers()

int GraphicsStateGuardian::get_max_2d_texture_array_layers ( ) const
inline

Returns the largest possible number of pages, or -1 if there is no particular limit.

Returns 0 if 2-d texture arrays not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 379 of file graphicsStateGuardian.I.

References get_max_cube_map_dimension().

Referenced by get_max_3d_texture_dimension().

◆ get_max_3d_texture_dimension()

int GraphicsStateGuardian::get_max_3d_texture_dimension ( ) const
inline

Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit.

Returns 0 if 3-d textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 363 of file graphicsStateGuardian.I.

References get_max_2d_texture_array_layers().

Referenced by get_max_texture_dimension().

◆ get_max_clip_planes()

int GraphicsStateGuardian::get_max_clip_planes ( ) const
inline

Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 546 of file graphicsStateGuardian.I.

References get_max_vertex_transforms().

Referenced by get_max_lights().

◆ get_max_color_targets()

int GraphicsStateGuardian::get_max_color_targets ( ) const
inline

Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG.

If you exceed this number, the lowest-priority render targets will not be applied. Use RenderTarget::set_priority() to adjust the relative importance of the different render targets.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 830 of file graphicsStateGuardian.I.

References get_maximum_simultaneous_render_targets().

Referenced by get_maximum_simultaneous_render_targets(), and get_timer_queries_active().

◆ get_max_cube_map_dimension()

int GraphicsStateGuardian::get_max_cube_map_dimension ( ) const
inline

Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit.

Returns 0 if cube map textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 396 of file graphicsStateGuardian.I.

References get_supports_texture_combine().

Referenced by get_max_2d_texture_array_layers(), and GraphicsOutput::make_cube_map().

◆ get_max_lights()

int GraphicsStateGuardian::get_max_lights ( ) const
inline

Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 530 of file graphicsStateGuardian.I.

References get_max_clip_planes().

Referenced by get_supports_compressed_texture_format().

◆ get_max_texture_dimension()

int GraphicsStateGuardian::get_max_texture_dimension ( ) const
inlinevirtual

Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Implements GraphicsStateGuardianBase.

Definition at line 346 of file graphicsStateGuardian.I.

References get_max_3d_texture_dimension().

Referenced by get_max_texture_stages().

◆ get_max_texture_stages()

int GraphicsStateGuardian::get_max_texture_stages ( ) const
inline

Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG.

If you exceed this number, the lowest-priority texture stages will not be applied. Use TextureStage::set_priority() to adjust the relative importance of the different texture stages.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 327 of file graphicsStateGuardian.I.

References get_max_texture_dimension().

Referenced by get_alpha_scale_via_texture(), and get_max_vertices_per_primitive().

◆ get_max_vertex_transform_indices()

int GraphicsStateGuardian::get_max_vertex_transform_indices ( ) const
inline

Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware.

If this number is 0 (but get_max_transforms() is nonzero), then the graphics hardware (or API) doesn't support indexed transforms, but can support direct transform references.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 584 of file graphicsStateGuardian.I.

References get_copy_texture_inverted().

Referenced by get_max_vertex_transforms(), and StandardMunger::StandardMunger().

◆ get_max_vertex_transforms()

int GraphicsStateGuardian::get_max_vertex_transforms ( ) const
inline

Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware.

If this number is 0, then the hardware (or the graphics backend) doesn't support soft-skinned vertices (in which case Panda will animate the vertices in software).

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 565 of file graphicsStateGuardian.I.

References get_max_vertex_transform_indices().

Referenced by get_max_clip_planes(), and StandardMunger::StandardMunger().

◆ get_max_vertices_per_array()

int GraphicsStateGuardian::get_max_vertices_per_array ( ) const
inlinevirtual

Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG.

Implements GraphicsStateGuardianBase.

Definition at line 295 of file graphicsStateGuardian.I.

References get_max_vertices_per_primitive().

Referenced by prefers_triangle_strips().

◆ get_max_vertices_per_primitive()

int GraphicsStateGuardian::get_max_vertices_per_primitive ( ) const
inlinevirtual

Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG.

Implements GraphicsStateGuardianBase.

Definition at line 307 of file graphicsStateGuardian.I.

References get_max_texture_stages().

Referenced by get_max_vertices_per_array().

◆ get_maximum_simultaneous_render_targets()

int GraphicsStateGuardian::get_maximum_simultaneous_render_targets ( ) const
inline

Deprecated.

Use get_max_color_targets() instead, which returns the exact same value.

Definition at line 844 of file graphicsStateGuardian.I.

References get_max_color_targets(), and get_shader_model().

Referenced by get_max_color_targets().

◆ get_pipe()

GraphicsPipe * GraphicsStateGuardian::get_pipe ( ) const
inline

Returns the graphics pipe on which this GSG was created.

Definition at line 246 of file graphicsStateGuardian.I.

References get_threading_model().

Referenced by GraphicsEngine::do_cull(), get_shader_generator(), GraphicsEngine::make_buffer(), GraphicsEngine::make_output(), and SpeedTreeNode::write_error().

◆ get_prepared_objects()

PreparedGraphicsObjects * GraphicsStateGuardian::get_prepared_objects ( )
virtual

Returns the set of texture and geom objects that have been prepared with this GSG (and possibly other GSG's that share objects).

Implements GraphicsStateGuardianBase.

Definition at line 414 of file graphicsStateGuardian.cxx.

References set_gamma().

Referenced by get_internal_coordinate_system(), GraphicsOutput::get_num_display_regions(), and GraphicsEngine::remove_window().

◆ get_render_buffer()

RenderBuffer GraphicsStateGuardian::get_render_buffer ( int  buffer_type,
const FrameBufferProperties prop 
)

Returns a RenderBuffer object suitable for operating on the requested set of buffers.

buffer_type is the union of all the desired RenderBuffer::Type values.

Definition at line 2341 of file graphicsStateGuardian.cxx.

References LMatrix4f::convert_mat(), do_issue_color(), FrameBufferProperties::get_buffer_mask(), ClipPlaneAttrib::get_num_on_planes(), NodePath::is_empty(), and NodePath::node().

Referenced by clear(), and DisplayRegion::get_screenshot().

◆ get_runtime_color_scale()

bool GraphicsStateGuardian::get_runtime_color_scale ( ) const
inline

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting.

Definition at line 940 of file graphicsStateGuardian.I.

References get_coordinate_system().

Referenced by get_alpha_scale_texture_stage(), and StandardMunger::StandardMunger().

◆ get_scene()

SceneSetup * GraphicsStateGuardian::get_scene ( ) const
virtual

Returns the current SceneSetup object.

Implements GraphicsStateGuardianBase.

Definition at line 560 of file graphicsStateGuardian.cxx.

References prepare_texture().

Referenced by set_scene().

◆ get_shader_generator()

ShaderGenerator * GraphicsStateGuardian::get_shader_generator ( ) const
inline

Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.

Definition at line 235 of file graphicsStateGuardian.I.

References get_pipe().

Referenced by GraphicsEngine::do_cull(), set_shader_generator(), and StandardMunger::StandardMunger().

◆ get_shader_model()

int GraphicsStateGuardian::get_shader_model ( ) const
inline

Returns the ShaderModel.

Definition at line 854 of file graphicsStateGuardian.I.

References set_shader_model().

Referenced by get_maximum_simultaneous_render_targets().

◆ get_supported_geom_rendering()

int GraphicsStateGuardian::get_supported_geom_rendering ( ) const
virtual

Returns the union of Geom::GeomRendering values that this particular GSG can support directly.

If a Geom needs to be rendered that requires some additional properties, the StandardMunger and/or the CullableObject will convert it as needed.

This method is declared virtual solely so that it can be queried from cullableObject.cxx.

Implements GraphicsStateGuardianBase.

Definition at line 332 of file graphicsStateGuardian.cxx.

References get_supports_cg_profile().

Referenced by get_supports_multisample(), and StandardMunger::StandardMunger().

◆ get_supports_2d_texture_array()

bool GraphicsStateGuardian::get_supports_2d_texture_array ( ) const
inline

Returns true if this GSG can render 2-d textures array.

Definition at line 458 of file graphicsStateGuardian.I.

References get_supports_cube_map().

Referenced by get_supports_3d_texture().

◆ get_supports_3d_texture()

bool GraphicsStateGuardian::get_supports_3d_texture ( ) const
inline

Returns true if this GSG can render 3-d (volumetric) textures.

Definition at line 447 of file graphicsStateGuardian.I.

References get_supports_2d_texture_array().

Referenced by get_supports_texture_dot3().

◆ get_supports_basic_shaders()

bool GraphicsStateGuardian::get_supports_basic_shaders ( ) const
inline

Returns true if this particular GSG supports arbfp1+arbvp1 or above.

Definition at line 691 of file graphicsStateGuardian.I.

References get_supports_geometry_shaders().

Referenced by GraphicsEngine::do_cull(), and get_supports_sampler_objects().

◆ get_supports_cg_profile()

bool GraphicsStateGuardian::get_supports_cg_profile ( const string &  name) const
virtual

Returns true if this particular GSG supports the specified Cg Shader Profile.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 343 of file graphicsStateGuardian.cxx.

References set_coordinate_system().

Referenced by get_supported_geom_rendering().

◆ get_supports_compressed_texture()

bool GraphicsStateGuardian::get_supports_compressed_texture ( ) const
inline

Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing.

Definition at line 501 of file graphicsStateGuardian.I.

References get_supports_compressed_texture_format().

Referenced by DXTextureContext9::d3d_surface_to_texture(), and get_supports_texture_srgb().

◆ get_supports_compressed_texture_format()

bool GraphicsStateGuardian::get_supports_compressed_texture_format ( int  compression_mode) const
inlinevirtual

Returns true if this GSG can accept textures pre-compressed in the indicated format.

compression_mode may be any of the Texture::CompressionMode enums.

Implements GraphicsStateGuardianBase.

Definition at line 514 of file graphicsStateGuardian.I.

References BitMask< WType, nbits >::get_bit(), and get_max_lights().

Referenced by DXTextureContext9::d3d_surface_to_texture(), and get_supports_compressed_texture().

◆ get_supports_compute_shaders()

bool GraphicsStateGuardian::get_supports_compute_shaders ( ) const
inline

Returns true if this particular GSG supports compute shaders.

Definition at line 724 of file graphicsStateGuardian.I.

References get_supports_glsl().

Referenced by get_supports_tessellation_shaders().

◆ get_supports_cube_map()

bool GraphicsStateGuardian::get_supports_cube_map ( ) const
inline

Returns true if this GSG can render cube map textures.

Definition at line 468 of file graphicsStateGuardian.I.

References get_supports_tex_non_pow2().

Referenced by get_supports_2d_texture_array(), and GraphicsOutput::make_cube_map().

◆ get_supports_depth_stencil()

bool GraphicsStateGuardian::get_supports_depth_stencil ( ) const
inline

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This only returns true if the GSG supports the full packed depth-stencil functionality.

Definition at line 653 of file graphicsStateGuardian.I.

References get_supports_shadow_filter().

Referenced by get_supports_depth_texture().

◆ get_supports_depth_texture()

bool GraphicsStateGuardian::get_supports_depth_texture ( ) const
inline

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This returns true if the GSG supports GL_DEPTH_COMPONENT textures, which are considered a limited but still valid case of F_depth_stencil.

Definition at line 640 of file graphicsStateGuardian.I.

References get_supports_depth_stencil().

Referenced by get_supports_generate_mipmap().

◆ get_supports_generate_mipmap()

bool GraphicsStateGuardian::get_supports_generate_mipmap ( ) const
inline

Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software.

If this is true, then mipmaps can safely be enabled for rendered textures (e.g. using the MultitexReducer).

Definition at line 626 of file graphicsStateGuardian.I.

References get_supports_depth_texture().

Referenced by get_copy_texture_inverted().

◆ get_supports_geometry_instancing()

bool GraphicsStateGuardian::get_supports_geometry_instancing ( ) const
inline

Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model.

In OpenGL, this is done using the EXT_draw_instanced extension.

Definition at line 771 of file graphicsStateGuardian.I.

References get_supports_occlusion_query().

Referenced by get_supports_two_sided_stencil().

◆ get_supports_geometry_shaders()

bool GraphicsStateGuardian::get_supports_geometry_shaders ( ) const
inline

Returns true if this particular GSG supports geometry shaders.

Definition at line 702 of file graphicsStateGuardian.I.

References get_supports_tessellation_shaders().

Referenced by get_supports_basic_shaders().

◆ get_supports_glsl()

bool GraphicsStateGuardian::get_supports_glsl ( ) const
inline

Returns true if this particular GSG supports GLSL shaders.

Definition at line 735 of file graphicsStateGuardian.I.

References get_supports_stencil().

Referenced by get_supports_compute_shaders().

◆ get_supports_multisample()

bool GraphicsStateGuardian::get_supports_multisample ( ) const
virtual

Returns true if this particular GSG supports using the multisample bits to provide antialiasing, and also supports M_multisample and M_multisample_mask transparency modes.

If this is not true for a particular GSG, Panda will map the M_multisample modes to M_binary.

This method is declared virtual solely so that it can be queried from cullResult.cxx.

Implements GraphicsStateGuardianBase.

Definition at line 315 of file graphicsStateGuardian.cxx.

References get_supported_geom_rendering().

Referenced by get_engine().

◆ get_supports_occlusion_query()

bool GraphicsStateGuardian::get_supports_occlusion_query ( ) const
inline

Returns true if this GSG supports an occlusion query.

If this is true, then begin_occlusion_query() and end_occlusion_query() may be called to bracket a sequence of draw_triangles() (or whatever) calls to measure pixels that pass the depth test.

Definition at line 785 of file graphicsStateGuardian.I.

References get_supports_timer_query().

Referenced by get_supports_geometry_instancing().

◆ get_supports_sampler_objects()

bool GraphicsStateGuardian::get_supports_sampler_objects ( ) const
inline

Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects.

This doesn't really affect functionality, but if this is false, it may mean that using the same texture with different SamplerState objects will result in reduced performance.

Definition at line 680 of file graphicsStateGuardian.I.

References get_supports_basic_shaders().

Referenced by get_supports_shadow_filter().

◆ get_supports_shadow_filter()

bool GraphicsStateGuardian::get_supports_shadow_filter ( ) const
inlinevirtual

Returns true if this particular GSG supports the filter mode FT_shadow for depth textures.

Implements GraphicsStateGuardianBase.

Definition at line 664 of file graphicsStateGuardian.I.

References get_supports_sampler_objects().

Referenced by get_supports_depth_stencil().

◆ get_supports_stencil()

bool GraphicsStateGuardian::get_supports_stencil ( ) const
inline

Returns true if this particular GSG supports stencil buffers at all.

Definition at line 746 of file graphicsStateGuardian.I.

References get_supports_two_sided_stencil().

Referenced by get_supports_glsl().

◆ get_supports_tessellation_shaders()

bool GraphicsStateGuardian::get_supports_tessellation_shaders ( ) const
inline

Returns true if this particular GSG supports tesselation shaders.

Definition at line 713 of file graphicsStateGuardian.I.

References get_supports_compute_shaders().

Referenced by get_supports_geometry_shaders().

◆ get_supports_tex_non_pow2()

bool GraphicsStateGuardian::get_supports_tex_non_pow2 ( ) const
inline

Returns true if this GSG can handle non power of two sized textures.

Definition at line 479 of file graphicsStateGuardian.I.

References get_supports_texture_srgb().

Referenced by GraphicsEngine::do_cull(), and get_supports_cube_map().

◆ get_supports_texture_combine()

bool GraphicsStateGuardian::get_supports_texture_combine ( ) const
inline

Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha().

If this is false, you must limit yourself to using the simpler blend modes.

Definition at line 411 of file graphicsStateGuardian.I.

References get_supports_texture_saved_result().

Referenced by get_max_cube_map_dimension().

◆ get_supports_texture_dot3()

bool GraphicsStateGuardian::get_supports_texture_dot3 ( ) const
inline

Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.

Definition at line 436 of file graphicsStateGuardian.I.

References get_supports_3d_texture().

Referenced by get_supports_texture_saved_result().

◆ get_supports_texture_saved_result()

bool GraphicsStateGuardian::get_supports_texture_saved_result ( ) const
inline

Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs.

Definition at line 424 of file graphicsStateGuardian.I.

References get_supports_texture_dot3().

Referenced by get_supports_texture_combine().

◆ get_supports_texture_srgb()

bool GraphicsStateGuardian::get_supports_texture_srgb ( ) const
inlinevirtual

Returns true if this GSG can handle sRGB textures.

Implements GraphicsStateGuardianBase.

Definition at line 489 of file graphicsStateGuardian.I.

References get_supports_compressed_texture().

Referenced by get_supports_tex_non_pow2().

◆ get_supports_timer_query()

bool GraphicsStateGuardian::get_supports_timer_query ( ) const
inline

Returns true if this GSG supports a timer query.

Definition at line 795 of file graphicsStateGuardian.I.

References get_timer_queries_active().

Referenced by get_supports_occlusion_query().

◆ get_supports_two_sided_stencil()

bool GraphicsStateGuardian::get_supports_two_sided_stencil ( ) const
inline

Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon.

Definition at line 758 of file graphicsStateGuardian.I.

References get_supports_geometry_instancing().

Referenced by get_supports_stencil().

◆ get_texture_quality_override()

Texture::QualityLevel GraphicsStateGuardian::get_texture_quality_override ( ) const
inline

Returns the global quality_level override specified by set_texture_quality_override.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

Definition at line 985 of file graphicsStateGuardian.I.

References reset_if_new().

Referenced by set_texture_quality_override().

◆ get_threading_model()

const GraphicsThreadingModel & GraphicsStateGuardian::get_threading_model ( ) const
inline

Returns the threading model that was used to create this GSG.

Definition at line 257 of file graphicsStateGuardian.I.

References is_hardware().

Referenced by GraphicsEngine::dispatch_compute(), GraphicsEngine::extract_texture_data(), get_pipe(), and GraphicsEngine::make_output().

◆ get_timer_queries_active()

bool GraphicsStateGuardian::get_timer_queries_active ( ) const
inline

Returns true if timer queries are currently enabled on this GSG.

Definition at line 806 of file graphicsStateGuardian.I.

References get_max_color_targets().

Referenced by GraphicsEngine::do_cull(), and get_supports_timer_query().

◆ has_extension()

bool GraphicsStateGuardian::has_extension ( const string &  extension) const
virtual

Returns true if the GSG implements the extension identified by the given string.

This currently is only implemented by the OpenGL back-end.

Definition at line 3267 of file graphicsStateGuardian.cxx.

References get_driver_vendor().

Referenced by create_gamma_table().

◆ is_active()

bool GraphicsStateGuardian::is_active ( ) const
inline

Returns the active flag associated with the GraphicsStateGuardian.

Definition at line 104 of file graphicsStateGuardian.I.

References is_valid().

Referenced by GraphicsEngine::do_cull(), and set_active().

◆ is_hardware()

bool GraphicsStateGuardian::is_hardware ( ) const
inline

Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only.

Definition at line 269 of file graphicsStateGuardian.I.

References prefers_triangle_strips().

Referenced by get_threading_model().

◆ is_valid()

bool GraphicsStateGuardian::is_valid ( ) const
inline

Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet.

Definition at line 117 of file graphicsStateGuardian.I.

References needs_reset().

Referenced by TinyGraphicsBuffer::end_frame(), wdxGraphicsPipe9::get_interface_name(), is_active(), and GraphicsEngine::make_output().

◆ mark_new()

void GraphicsStateGuardian::mark_new ( )
inline

Marks the GSG as "new", so that the next call to reset_if_new() will be effective.

Definition at line 1012 of file graphicsStateGuardian.I.

Referenced by reset_if_new().

◆ needs_reset()

bool GraphicsStateGuardian::needs_reset ( ) const
inline

Returns true if the gsg is marked as needing a reset.

Definition at line 128 of file graphicsStateGuardian.I.

References set_incomplete_render().

Referenced by wdxGraphicsPipe9::get_interface_name(), is_valid(), and GraphicsEngine::make_output().

◆ prefers_triangle_strips()

bool GraphicsStateGuardian::prefers_triangle_strips ( ) const
inlinevirtual

Returns true if this GSG strongly prefers triangle strips to individual triangles (such as SGI), or false if it prefers to minimize the number of primitive batches, even at the expense of triangle strips (such as most PC hardware).

Implements GraphicsStateGuardianBase.

Definition at line 283 of file graphicsStateGuardian.I.

References get_max_vertices_per_array().

Referenced by is_hardware().

◆ prepare_display_region()

void GraphicsStateGuardian::prepare_display_region ( DisplayRegionPipelineReader dr)
virtual

◆ prepare_geom()

GeomContext * GraphicsStateGuardian::prepare_geom ( Geom geom)
virtual

Prepares the indicated Geom for retained-mode rendering, by creating whatever structures are necessary in the GSG (for instance, vertex buffers).

Returns the newly-allocated GeomContext that can be used to render the geom.

Implements GraphicsStateGuardianBase.

Definition at line 670 of file graphicsStateGuardian.cxx.

References release_geom().

Referenced by release_sampler().

◆ prepare_index_buffer()

IndexBufferContext * GraphicsStateGuardian::prepare_index_buffer ( GeomPrimitive data)
virtual

Prepares the indicated buffer for retained-mode rendering.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 736 of file graphicsStateGuardian.cxx.

References release_index_buffer().

Referenced by release_vertex_buffer().

◆ prepare_lens()

bool GraphicsStateGuardian::prepare_lens ( )
virtual

Makes the current lens (whichever lens was most recently specified with set_scene()) active, so that it will transform future rendered geometry.

Normally this is only called from the draw process, and usually it is called by set_scene().

The return value is true if the lens is acceptable, false if it is not.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 1745 of file graphicsStateGuardian.cxx.

References begin_frame(), and Lens::is_linear().

Referenced by remove_window().

◆ prepare_sampler()

SamplerContext * GraphicsStateGuardian::prepare_sampler ( const SamplerState sampler)
virtual

Creates whatever structures the GSG requires to represent the sampler internally, and returns a newly-allocated SamplerContext object with this data.

It is the responsibility of the calling function to later call release_sampler() with this same pointer (which will also delete the pointer).

This function should not be called directly to prepare a sampler. Instead, call Texture::prepare().

Implements GraphicsStateGuardianBase.

Definition at line 645 of file graphicsStateGuardian.cxx.

References release_sampler().

Referenced by extract_texture_data().

◆ prepare_shader()

ShaderContext * GraphicsStateGuardian::prepare_shader ( Shader shader)
virtual

Compile a vertex/fragment shader body.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 694 of file graphicsStateGuardian.cxx.

References release_shader().

Referenced by release_geom().

◆ prepare_texture()

TextureContext * GraphicsStateGuardian::prepare_texture ( Texture tex)
virtual

Creates whatever structures the GSG requires to represent the texture internally, and returns a newly-allocated TextureContext object with this data.

It is the responsibility of the calling function to later call release_texture() with this same pointer (which will also delete the pointer).

This function should not be called directly to prepare a texture. Instead, call Texture::prepare().

Definition at line 578 of file graphicsStateGuardian.cxx.

References update_texture().

Referenced by get_scene().

◆ prepare_vertex_buffer()

VertexBufferContext * GraphicsStateGuardian::prepare_vertex_buffer ( GeomVertexArrayData data)
virtual

Prepares the indicated buffer for retained-mode rendering.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 714 of file graphicsStateGuardian.cxx.

References release_vertex_buffer().

Referenced by release_shader().

◆ release_all()

void GraphicsStateGuardian::release_all ( )
inline

Releases all prepared objects.

Definition at line 24 of file graphicsStateGuardian.I.

References release_all_textures().

Referenced by GraphicsEngine::remove_all_windows().

◆ release_all_geoms()

int GraphicsStateGuardian::release_all_geoms ( )
inline

Frees the resources for all geoms associated with this GSG.

Definition at line 57 of file graphicsStateGuardian.I.

References release_all_vertex_buffers().

Referenced by release_all_samplers().

◆ release_all_index_buffers()

int GraphicsStateGuardian::release_all_index_buffers ( )
inline

Frees the resources for all index buffers associated with this GSG.

Definition at line 79 of file graphicsStateGuardian.I.

References set_active().

Referenced by release_all_vertex_buffers().

◆ release_all_samplers()

int GraphicsStateGuardian::release_all_samplers ( )
inline

Frees the resources for all samplers associated with this GSG.

Definition at line 46 of file graphicsStateGuardian.I.

References release_all_geoms().

Referenced by release_all_textures().

◆ release_all_textures()

int GraphicsStateGuardian::release_all_textures ( )
inline

Frees the resources for all textures associated with this GSG.

Definition at line 35 of file graphicsStateGuardian.I.

References release_all_samplers().

Referenced by release_all().

◆ release_all_vertex_buffers()

int GraphicsStateGuardian::release_all_vertex_buffers ( )
inline

Frees the resources for all vertex buffers associated with this GSG.

Definition at line 68 of file graphicsStateGuardian.I.

References release_all_index_buffers().

Referenced by release_all_geoms().

◆ release_geom()

void GraphicsStateGuardian::release_geom ( GeomContext gc)
virtual

Frees the resources previously allocated via a call to prepare_geom(), including deleting the GeomContext itself, if it is non-NULL.

This function should not be called directly to prepare a Geom. Instead, call Geom::prepare().

Implements GraphicsStateGuardianBase.

Definition at line 685 of file graphicsStateGuardian.cxx.

References prepare_shader().

Referenced by prepare_geom().

◆ release_index_buffer()

void GraphicsStateGuardian::release_index_buffer ( IndexBufferContext ibc)
virtual

Frees the resources previously allocated via a call to prepare_data(), including deleting the IndexBufferContext itself, if necessary.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 748 of file graphicsStateGuardian.cxx.

References begin_occlusion_query().

Referenced by prepare_index_buffer().

◆ release_sampler()

void GraphicsStateGuardian::release_sampler ( SamplerContext sc)
virtual

Frees the resources previously allocated via a call to prepare_sampler(), including deleting the SamplerContext itself, if it is non-NULL.

Implements GraphicsStateGuardianBase.

Definition at line 657 of file graphicsStateGuardian.cxx.

References prepare_geom().

Referenced by prepare_sampler().

◆ release_shader()

void GraphicsStateGuardian::release_shader ( ShaderContext sc)
virtual

Releases the resources allocated by prepare_shader.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 704 of file graphicsStateGuardian.cxx.

References prepare_vertex_buffer().

Referenced by prepare_shader().

◆ release_texture()

void GraphicsStateGuardian::release_texture ( TextureContext tc)
virtual

Frees the resources previously allocated via a call to prepare_texture(), including deleting the TextureContext itself, if it is non-NULL.

Implements GraphicsStateGuardianBase.

Reimplemented in TinyGraphicsStateGuardian, and DXGraphicsStateGuardian9.

Definition at line 611 of file graphicsStateGuardian.cxx.

References extract_texture_data().

Referenced by update_texture().

◆ release_vertex_buffer()

void GraphicsStateGuardian::release_vertex_buffer ( VertexBufferContext vbc)
virtual

Frees the resources previously allocated via a call to prepare_data(), including deleting the VertexBufferContext itself, if necessary.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 726 of file graphicsStateGuardian.cxx.

References prepare_index_buffer().

Referenced by prepare_vertex_buffer().

◆ remove_window()

void GraphicsStateGuardian::remove_window ( GraphicsOutputBase window)
virtual

This is simply a transparent call to GraphicsEngine::remove_window().

It exists primary to support removing a window from that compiles before the display module, and therefore has no knowledge of a GraphicsEngine object.

Implements GraphicsStateGuardianBase.

Definition at line 1725 of file graphicsStateGuardian.cxx.

References prepare_lens().

Referenced by clear_state_and_transform().

◆ reset()

void GraphicsStateGuardian::reset ( )
virtual

Resets all internal state as if the gsg were newly created.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2258 of file graphicsStateGuardian.cxx.

References set_state_and_transform().

Referenced by end_draw_primitives(), TinyGraphicsStateGuardian::reset(), DXGraphicsStateGuardian9::reset(), and reset_if_new().

◆ reset_if_new()

bool GraphicsStateGuardian::reset_if_new ( )
inline

Calls reset() to initialize the GSG, but only if it hasn't been called yet.

Returns true if the GSG was new, false otherwise.

Definition at line 997 of file graphicsStateGuardian.I.

References mark_new(), and reset().

Referenced by TinyGraphicsBuffer::begin_frame(), TinyGraphicsBuffer::end_frame(), and get_texture_quality_override().

◆ restore_gamma()

void GraphicsStateGuardian::restore_gamma ( )
virtual

Restore original gamma setting.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 446 of file graphicsStateGuardian.cxx.

References traverse_prepared_textures().

Referenced by get_gamma().

◆ set_active()

void GraphicsStateGuardian::set_active ( bool  active)
inline

Sets the active flag associated with the GraphicsStateGuardian.

If the GraphicsStateGuardian is marked inactive, nothing is rendered. This is not normally turned off unless there is a problem with the rendering detected at a low level.

Definition at line 93 of file graphicsStateGuardian.I.

References is_active().

Referenced by release_all_index_buffers().

◆ set_coordinate_system()

void GraphicsStateGuardian::set_coordinate_system ( CoordinateSystem  cs)

Changes the coordinate system in effect on this particular gsg.

This is also called the "external" coordinate system, since it is the coordinate system used by the scene graph, external to to GSG.

Normally, this will be the default coordinate system, but it might be set differently at runtime. It will automatically be copied from the current lens's coordinate system as each DisplayRegion is rendered.

Definition at line 361 of file graphicsStateGuardian.cxx.

References LMatrix4f::convert_mat(), and get_internal_coordinate_system().

Referenced by get_supports_cg_profile().

◆ set_flash_texture()

void GraphicsStateGuardian::set_flash_texture ( Texture tex)

Sets the "flash texture".

This is a debug feature; when enabled, the specified texture will begin flashing in the scene, helping you to find it visually.

The texture also flashes with a color code: blue for mipmap level 0, yellow for mipmap level 1, and red for mipmap level 2 or higher (even for textures that don't have mipmaps). This gives you an idea of the choice of the texture size. If it is blue, the texture is being drawn the proper size or magnified; if it is yellow, it is being minified a little bit; and if it red, it is being minified considerably. If you see a red texture when you are right in front of it, you should consider reducing the size of the texture to avoid wasting texture memory.

Not all rendering backends support the flash_texture feature. Presently, it is only supported by OpenGL.

Definition at line 496 of file graphicsStateGuardian.cxx.

References clear_flash_texture().

Referenced by traverse_prepared_textures().

◆ set_gamma()

bool GraphicsStateGuardian::set_gamma ( PN_stdfloat  gamma)
virtual

Set gamma.

Returns true on success.

Reimplemented in DXGraphicsStateGuardian9.

Definition at line 424 of file graphicsStateGuardian.cxx.

References get_gamma().

Referenced by get_prepared_objects().

◆ set_incomplete_render()

void GraphicsStateGuardian::set_incomplete_render ( bool  incomplete_render)
inline

Sets the incomplete_render flag.

When this is true, the frame will be rendered even if some of the geometry or textures in the scene are not available (e.g. they have been temporarily paged out). When this is false, the frame will be held up while this data is reloaded.

Setting this true allows for a smoother frame rate, but occasionally parts of the frame will be invisible or missing (they will generally come in within a second or two). Setting this false guarantees that every frame will be complete, but may cause more chugs as things are loaded up at runtime.

You may want to set this false during loading screens, to guarantee that all of your assets are available by the time you take the loading screen down.

This flag may also be set individually on each DisplayRegion. It will be considered true for a given DisplayRegion only if it is true on both the GSG and on the DisplayRegion.

Definition at line 160 of file graphicsStateGuardian.I.

References get_incomplete_render().

Referenced by needs_reset().

◆ set_loader()

void GraphicsStateGuardian::set_loader ( Loader loader)
inline

Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

Definition at line 201 of file graphicsStateGuardian.I.

References get_loader().

Referenced by GraphicsEngine::do_cull(), and get_effective_incomplete_render().

◆ set_scene()

bool GraphicsStateGuardian::set_scene ( SceneSetup scene_setup)

Sets the SceneSetup object that indicates the initial camera position, etc.

This must be called before traversal begins. Returns true if the scene is acceptable, false if something's wrong. This should be called in the draw thread only.

Definition at line 537 of file graphicsStateGuardian.cxx.

References SceneSetup::get_lens(), and get_scene().

Referenced by GraphicsEngine::do_cull(), get_flash_texture(), PipeOcclusionCullTraverser::set_scene(), and DisplayRegionDrawCallbackData::upcall().

◆ set_shader_generator()

void GraphicsStateGuardian::set_shader_generator ( ShaderGenerator shader_generator)
inline

Sets the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.

Definition at line 224 of file graphicsStateGuardian.I.

References get_shader_generator().

Referenced by GraphicsEngine::do_cull(), and get_loader().

◆ set_shader_model()

void GraphicsStateGuardian::set_shader_model ( int  shader_model)
inline

Sets the ShaderModel.

This will override the auto- detected shader model during GSG reset. Useful for testing lower-end shaders.

Definition at line 866 of file graphicsStateGuardian.I.

References get_color_scale_via_lighting().

Referenced by get_shader_model().

◆ set_state_and_transform()

void GraphicsStateGuardian::set_state_and_transform ( const RenderState state,
const TransformState *  trans 
)
virtual

Simultaneously resets the render state and the transform state.

This transform specified is the "internal" net transform, already converted into the GSG's internal coordinate space by composing it to get_cs_transform(). (Previously, this used to be the "external" net transform, with the assumption that that GSG would convert it internally, but that is no longer the case.)

Special case: if (state==NULL), then the target state is already stored in _target.

Implements GraphicsStateGuardianBase.

Reimplemented in DXGraphicsStateGuardian9, and TinyGraphicsStateGuardian.

Definition at line 2314 of file graphicsStateGuardian.cxx.

References clear().

Referenced by GraphicsEngine::dispatch_compute(), GraphicsEngine::do_cull(), and reset().

◆ set_texture_quality_override()

void GraphicsStateGuardian::set_texture_quality_override ( Texture::QualityLevel  quality_level)
inline

Specifies the global quality_level to be imposed for all Textures rendered by this GSG.

This overrides the value set on individual textures via Texture::set_quality_level(). Set this to Texture::QL_default in order to allow the individual texture quality levels to be respected.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

Definition at line 971 of file graphicsStateGuardian.I.

References get_texture_quality_override().

Referenced by get_coordinate_system().

◆ traverse_prepared_textures()

void GraphicsStateGuardian::traverse_prepared_textures ( GraphicsStateGuardian::TextureCallback *  func,
void *  callback_arg 
)

Calls the indicated function on all currently-prepared textures, or until the callback function returns false.

Definition at line 457 of file graphicsStateGuardian.cxx.

References set_flash_texture().

Referenced by restore_gamma().

◆ update_texture()

bool GraphicsStateGuardian::update_texture ( TextureContext tc,
bool  force 
)
virtual

Ensures that the current Texture data is refreshed onto the GSG.

This means updating the texture properties and/or re-uploading the texture image, if necessary. This should only be called within the draw thread.

If force is true, this function will not return until the texture has been fully uploaded. If force is false, the function may choose to upload a simple version of the texture instead, if the texture is not fully resident (and if get_incomplete_render() is true).

Implements GraphicsStateGuardianBase.

Reimplemented in TinyGraphicsStateGuardian, and DXGraphicsStateGuardian9.

Definition at line 599 of file graphicsStateGuardian.cxx.

References release_texture().

Referenced by prepare_texture().


The documentation for this class was generated from the following files: