From 6e48db69a37ab6a0306e378033ffe1bf57c6b647 Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Sun, 11 Dec 2022 15:37:35 +0300 Subject: Changed `RD::PipelineDynamicStateFlags` type to enum flags --- servers/rendering/rendering_device.cpp | 16 ++++++++-------- servers/rendering/rendering_device.h | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'servers/rendering') diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 23070fb7c0..ec19094537 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -286,7 +286,7 @@ static Vector _get_spec_constan return ret; } -RID RenderingDevice::_render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const Ref &p_rasterization_state, const Ref &p_multisample_state, const Ref &p_depth_stencil_state, const Ref &p_blend_state, int p_dynamic_state_flags, uint32_t p_for_render_pass, const TypedArray &p_specialization_constants) { +RID RenderingDevice::_render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const Ref &p_rasterization_state, const Ref &p_multisample_state, const Ref &p_depth_stencil_state, const Ref &p_blend_state, BitField p_dynamic_state_flags, uint32_t p_for_render_pass, const TypedArray &p_specialization_constants) { PipelineRasterizationState rasterization_state; if (p_rasterization_state.is_valid()) { rasterization_state = p_rasterization_state->base; @@ -906,13 +906,13 @@ void RenderingDevice::_bind_methods() { BIND_ENUM_CONSTANT(BLEND_OP_MAXIMUM); BIND_ENUM_CONSTANT(BLEND_OP_MAX); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_LINE_WIDTH); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_DEPTH_BIAS); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_BLEND_CONSTANTS); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_DEPTH_BOUNDS); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_STENCIL_COMPARE_MASK); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_STENCIL_WRITE_MASK); - BIND_ENUM_CONSTANT(DYNAMIC_STATE_STENCIL_REFERENCE); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_LINE_WIDTH); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_DEPTH_BIAS); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_BLEND_CONSTANTS); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_DEPTH_BOUNDS); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_STENCIL_COMPARE_MASK); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_STENCIL_WRITE_MASK); + BIND_BITFIELD_FLAG(DYNAMIC_STATE_STENCIL_REFERENCE); BIND_ENUM_CONSTANT(INITIAL_ACTION_CLEAR); //start rendering and clear the framebuffer (supply params) BIND_ENUM_CONSTANT(INITIAL_ACTION_CLEAR_REGION); //start rendering and clear the framebuffer (supply params) diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 0b43b73042..27c3f77c5b 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -1112,7 +1112,7 @@ public: }; virtual bool render_pipeline_is_valid(RID p_pipeline) = 0; - virtual RID render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const PipelineRasterizationState &p_rasterization_state, const PipelineMultisampleState &p_multisample_state, const PipelineDepthStencilState &p_depth_stencil_state, const PipelineColorBlendState &p_blend_state, int p_dynamic_state_flags = 0, uint32_t p_for_render_pass = 0, const Vector &p_specialization_constants = Vector()) = 0; + virtual RID render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const PipelineRasterizationState &p_rasterization_state, const PipelineMultisampleState &p_multisample_state, const PipelineDepthStencilState &p_depth_stencil_state, const PipelineColorBlendState &p_blend_state, BitField p_dynamic_state_flags = 0, uint32_t p_for_render_pass = 0, const Vector &p_specialization_constants = Vector()) = 0; /**************************/ /**** COMPUTE PIPELINE ****/ @@ -1322,7 +1322,7 @@ protected: Error _buffer_update(RID p_buffer, uint32_t p_offset, uint32_t p_size, const Vector &p_data, BitField p_post_barrier = BARRIER_MASK_ALL_BARRIERS); - RID _render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const Ref &p_rasterization_state, const Ref &p_multisample_state, const Ref &p_depth_stencil_state, const Ref &p_blend_state, int p_dynamic_state_flags, uint32_t p_for_render_pass, const TypedArray &p_specialization_constants); + RID _render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const Ref &p_rasterization_state, const Ref &p_multisample_state, const Ref &p_depth_stencil_state, const Ref &p_blend_state, BitField p_dynamic_state_flags, uint32_t p_for_render_pass, const TypedArray &p_specialization_constants); RID _compute_pipeline_create(RID p_shader, const TypedArray &p_specialization_constants); Vector _draw_list_begin_split(RID p_framebuffer, uint32_t p_splits, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector &p_clear_color_values = Vector(), float p_clear_depth = 1.0, uint32_t p_clear_stencil = 0, const Rect2 &p_region = Rect2(), const TypedArray &p_storage_textures = TypedArray()); @@ -1357,7 +1357,7 @@ VARIANT_ENUM_CAST(RenderingDevice::StencilOperation) VARIANT_ENUM_CAST(RenderingDevice::LogicOperation) VARIANT_ENUM_CAST(RenderingDevice::BlendFactor) VARIANT_ENUM_CAST(RenderingDevice::BlendOperation) -VARIANT_ENUM_CAST(RenderingDevice::PipelineDynamicStateFlags) +VARIANT_BITFIELD_CAST(RenderingDevice::PipelineDynamicStateFlags) VARIANT_ENUM_CAST(RenderingDevice::PipelineSpecializationConstantType) VARIANT_ENUM_CAST(RenderingDevice::InitialAction) VARIANT_ENUM_CAST(RenderingDevice::FinalAction) -- cgit v1.2.3