EEVEE Next: Ensure correct material settings are used #108283
|
@ -203,7 +203,7 @@ MaterialPass MaterialModule::material_pass_get(Object *ob,
|
||||||
matpass.sub_pass = nullptr;
|
matpass.sub_pass = nullptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ShaderKey shader_key(matpass.gpumat, geometry_type, pipeline_type);
|
ShaderKey shader_key(matpass.gpumat, geometry_type, pipeline_type, blender_mat->blend_flag);
|
||||||
|
|
||||||
PassMain::Sub *shader_sub = shader_map_.lookup_or_add_cb(shader_key, [&]() {
|
PassMain::Sub *shader_sub = shader_map_.lookup_or_add_cb(shader_key, [&]() {
|
||||||
/* First time encountering this shader. Create a sub that will contain materials using it. */
|
/* First time encountering this shader. Create a sub that will contain materials using it. */
|
||||||
|
|
|
@ -108,7 +108,7 @@ static inline eMaterialGeometry to_material_geometry(const Object *ob)
|
||||||
|
|
||||||
/** Unique key to identify each material in the hash-map. */
|
/** Unique key to identify each material in the hash-map. */
|
||||||
struct MaterialKey {
|
struct MaterialKey {
|
||||||
Material *mat;
|
::Material *mat;
|
||||||
uint64_t options;
|
uint64_t options;
|
||||||
|
|
||||||
MaterialKey(::Material *mat_, eMaterialGeometry geometry, eMaterialPipeline surface_pipeline)
|
MaterialKey(::Material *mat_, eMaterialGeometry geometry, eMaterialPipeline surface_pipeline)
|
||||||
|
@ -145,10 +145,14 @@ struct ShaderKey {
|
||||||
GPUShader *shader;
|
GPUShader *shader;
|
||||||
uint64_t options;
|
uint64_t options;
|
||||||
|
|
||||||
ShaderKey(GPUMaterial *gpumat, eMaterialGeometry geometry, eMaterialPipeline pipeline)
|
ShaderKey(GPUMaterial *gpumat,
|
||||||
|
eMaterialGeometry geometry,
|
||||||
|
eMaterialPipeline pipeline,
|
||||||
|
char blend_flags)
|
||||||
{
|
{
|
||||||
shader = GPU_material_get_shader(gpumat);
|
shader = GPU_material_get_shader(gpumat);
|
||||||
options = shader_uuid_from_material_type(pipeline, geometry);
|
options = blend_flags;
|
||||||
|
options = (options << 6u) | shader_uuid_from_material_type(pipeline, geometry);
|
||||||
options = (options << 16u) | shader_closure_bits_from_flag(gpumat);
|
options = (options << 16u) | shader_closure_bits_from_flag(gpumat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue