mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	gl_rasterizer: move shader uniform sync from SetShader() to ctor
This commit is contained in:
		
							parent
							
								
									384849232b
								
							
						
					
					
						commit
						c2719feda2
					
				
					 1 changed files with 24 additions and 24 deletions
				
			
		|  | @ -176,7 +176,6 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) { | ||||||
| 
 | 
 | ||||||
|     // Sync fixed function OpenGL state
 |     // Sync fixed function OpenGL state
 | ||||||
|     SyncClipEnabled(); |     SyncClipEnabled(); | ||||||
|     SyncClipCoef(); |  | ||||||
|     SyncCullMode(); |     SyncCullMode(); | ||||||
|     SyncBlendEnabled(); |     SyncBlendEnabled(); | ||||||
|     SyncBlendFuncs(); |     SyncBlendFuncs(); | ||||||
|  | @ -187,6 +186,30 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) { | ||||||
|     SyncColorWriteMask(); |     SyncColorWriteMask(); | ||||||
|     SyncStencilWriteMask(); |     SyncStencilWriteMask(); | ||||||
|     SyncDepthWriteMask(); |     SyncDepthWriteMask(); | ||||||
|  | 
 | ||||||
|  |     // Sync uniforms
 | ||||||
|  |     SyncClipCoef(); | ||||||
|  |     SyncDepthScale(); | ||||||
|  |     SyncDepthOffset(); | ||||||
|  |     SyncAlphaTest(); | ||||||
|  |     SyncCombinerColor(); | ||||||
|  |     auto& tev_stages = Pica::g_state.regs.texturing.GetTevStages(); | ||||||
|  |     for (std::size_t index = 0; index < tev_stages.size(); ++index) | ||||||
|  |         SyncTevConstColor(index, tev_stages[index]); | ||||||
|  | 
 | ||||||
|  |     SyncGlobalAmbient(); | ||||||
|  |     for (unsigned light_index = 0; light_index < 8; light_index++) { | ||||||
|  |         SyncLightSpecular0(light_index); | ||||||
|  |         SyncLightSpecular1(light_index); | ||||||
|  |         SyncLightDiffuse(light_index); | ||||||
|  |         SyncLightAmbient(light_index); | ||||||
|  |         SyncLightPosition(light_index); | ||||||
|  |         SyncLightDistanceAttenuationBias(light_index); | ||||||
|  |         SyncLightDistanceAttenuationScale(light_index); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     SyncFogColor(); | ||||||
|  |     SyncProcTexNoise(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| RasterizerOpenGL::~RasterizerOpenGL() {} | RasterizerOpenGL::~RasterizerOpenGL() {} | ||||||
|  | @ -1284,29 +1307,6 @@ void RasterizerOpenGL::SetShader() { | ||||||
|                        "Uniform block size did not match! Got %d, expected %zu", |                        "Uniform block size did not match! Got %d, expected %zu", | ||||||
|                        static_cast<int>(block_size), sizeof(UniformData)); |                        static_cast<int>(block_size), sizeof(UniformData)); | ||||||
|             glUniformBlockBinding(current_shader->shader.handle, block_index, 0); |             glUniformBlockBinding(current_shader->shader.handle, block_index, 0); | ||||||
| 
 |  | ||||||
|             // Update uniforms
 |  | ||||||
|             SyncDepthScale(); |  | ||||||
|             SyncDepthOffset(); |  | ||||||
|             SyncAlphaTest(); |  | ||||||
|             SyncCombinerColor(); |  | ||||||
|             auto& tev_stages = Pica::g_state.regs.texturing.GetTevStages(); |  | ||||||
|             for (int index = 0; index < tev_stages.size(); ++index) |  | ||||||
|                 SyncTevConstColor(index, tev_stages[index]); |  | ||||||
| 
 |  | ||||||
|             SyncGlobalAmbient(); |  | ||||||
|             for (int light_index = 0; light_index < 8; light_index++) { |  | ||||||
|                 SyncLightSpecular0(light_index); |  | ||||||
|                 SyncLightSpecular1(light_index); |  | ||||||
|                 SyncLightDiffuse(light_index); |  | ||||||
|                 SyncLightAmbient(light_index); |  | ||||||
|                 SyncLightPosition(light_index); |  | ||||||
|                 SyncLightDistanceAttenuationBias(light_index); |  | ||||||
|                 SyncLightDistanceAttenuationScale(light_index); |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|             SyncFogColor(); |  | ||||||
|             SyncProcTexNoise(); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue