From 9e5ed2bb73ed9b56923e3323ffcb7443a61b0cf7 Mon Sep 17 00:00:00 2001 From: Greavesy1899 Date: Fri, 29 Nov 2024 13:09:17 +0000 Subject: [PATCH] Bump to SM5 --- .../Rendering/Graphics/ShaderManager.cs | 30 +++++++++---------- .../Rendering/Graphics/Shaders/BaseShader.cs | 6 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Mafia2Libs/Rendering/Graphics/ShaderManager.cs b/Mafia2Libs/Rendering/Graphics/ShaderManager.cs index dfa54aed..6dea6d1c 100644 --- a/Mafia2Libs/Rendering/Graphics/ShaderManager.cs +++ b/Mafia2Libs/Rendering/Graphics/ShaderManager.cs @@ -13,45 +13,45 @@ public bool Init(ID3D11Device device) // construct default shader ShaderInitParams DefaultInitParams = new ShaderInitParams(); DefaultInitParams.Elements = VertexLayouts.NormalLayout.GetLayout(); - DefaultInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "LightPixelShader", "ps_4_0"); - DefaultInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_4_0"); - DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_4_0"); + DefaultInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "LightPixelShader", "ps_5_0"); + DefaultInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_5_0"); + DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_5_0"); DefaultShader OurDefaultShader = new DefaultShader(device, DefaultInitParams); // construct debug shader ShaderInitParams DebugInitParams = new ShaderInitParams(); DebugInitParams.Elements = VertexLayouts.BasicLayout.GetLayout(); - DebugInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("DebugPS.hlsl", "DebugPixelShader", "ps_4_0"); - DebugInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("DebugVS.hlsl", "DebugVertexShader", "vs_4_0"); - DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_4_0"); + DebugInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("DebugPS.hlsl", "DebugPixelShader", "ps_5_0"); + DebugInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("DebugVS.hlsl", "DebugVertexShader", "vs_5_0"); + DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_5_0"); DebugShader OurDebugShader = new DebugShader(device, DebugInitParams); // construct collision shader ShaderInitParams CollisionInitParams = new ShaderInitParams(); CollisionInitParams.Elements = VertexLayouts.CollisionLayout.GetLayout(); - CollisionInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("CollisionPS.hlsl", "CollisionShader", "ps_4_0"); - CollisionInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("CollisionVS.hlsl", "CollisionShader", "vs_4_0"); - DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_4_0"); + CollisionInitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("CollisionPS.hlsl", "CollisionShader", "ps_5_0"); + CollisionInitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("CollisionVS.hlsl", "CollisionShader", "vs_5_0"); + DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_5_0"); CollisionShader OurCollisionShader = new CollisionShader(device, CollisionInitParams); // construct shader_601151254 shader ShaderInitParams Shader601151254_InitParams = new ShaderInitParams(); Shader601151254_InitParams.Elements = VertexLayouts.NormalLayout.GetLayout(); - Shader601151254_InitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "PS_601151254", "ps_4_0"); - Shader601151254_InitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_4_0"); - DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_4_0"); + Shader601151254_InitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "PS_601151254", "ps_5_0"); + Shader601151254_InitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_5_0"); + DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_5_0"); Shader_601151254 OurShader601151254 = new Shader_601151254(device, Shader601151254_InitParams); // construct shader_50760736 shader ShaderInitParams Shader_50760736_InitParams = new ShaderInitParams(); Shader_50760736_InitParams.Elements = VertexLayouts.NormalLayout.GetLayout(); - Shader_50760736_InitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "PS_50760736", "ps_4_0"); - Shader_50760736_InitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_4_0"); - DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_4_0"); + Shader_50760736_InitParams.PixelShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightPS.hlsl", "PS_50760736", "ps_5_0"); + Shader_50760736_InitParams.VertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightVertexShader", "vs_5_0"); + DefaultInitParams.InstancedVertexShaderFile = new ShaderInitParams.ShaderFileEntryPoint("LightVS.hlsl", "LightInstanceVertexShader", "vs_5_0"); Shader_50760736 OurShader50760736 = new Shader_50760736(device, Shader_50760736_InitParams); diff --git a/Mafia2Libs/Rendering/Graphics/Shaders/BaseShader.cs b/Mafia2Libs/Rendering/Graphics/Shaders/BaseShader.cs index 2348bdbb..bc07ccca 100644 --- a/Mafia2Libs/Rendering/Graphics/Shaders/BaseShader.cs +++ b/Mafia2Libs/Rendering/Graphics/Shaders/BaseShader.cs @@ -1,10 +1,9 @@ -using System; -using Rendering.Core; +using Rendering.Core; using ResourceTypes.Materials; -using System.Drawing; using System.Numerics; using System.Runtime.InteropServices; using System.Windows; +using Utils.Logging; using Vortice.D3DCompiler; using Vortice.Direct3D; using Vortice.Direct3D11; @@ -378,6 +377,7 @@ public Blob ConstructBytecode(ShaderInitParams.ShaderFileEntryPoint ShaderFileDa if(OurErrorcode != null) { Error = OurErrorcode.ConvertToString(); + Log.WriteLine(string.Format("DX11 Compiler Error: {0}", Error), LoggingTypes.ERROR, LogCategoryTypes.APPLICATION); } return OurBytecode;