Skip to content

Commit

Permalink
changes for GLSL & HLSL shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirulogeswaren committed Aug 22, 2024
1 parent c5f5b1b commit bb8de94
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Core/Graphics/RHI/Metal/METALPipelineHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace CGL::Graphics {

m_rpState = gpu_device->newRenderPipelineState(m_rpDescriptor, &ns_error);

if(!m_rpState) {
if(!m_rpState)
{
CGL_LOG(METALPipelineHandler, Error, ns_error->localizedDescription()->utf8String());
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Graphics/RHI/Metal/METALPipelineHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace CGL::Graphics
public:
METALPipelineHandler();

inline auto GetRenderPipelineDescriptor() const { return m_rpDescriptor; }
inline auto GetRenderPipelineState() const { return m_rpState; }
inline MTL::RenderPipelineDescriptor* GetRenderPipelineDescriptor() const { return m_rpDescriptor; }
inline MTL::RenderPipelineState* GetRenderPipelineState() const { return m_rpState; }

void CreateRenderPipelineState(MTL::Device* gpu_device);

Expand Down
4 changes: 1 addition & 3 deletions Core/Graphics/RHI/Metal/METALRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ namespace CGL::Graphics
void Renderer::SetRenderPipeline_METAL()
{
GetImpl()->GetRenderPipelineHandler()->CreateRenderPipelineState(GetImpl()->GetDevice());
GetImpl()->GetRenderCommandEncoder()->setRenderPipelineState(
GetImpl()->GetRenderPipelineHandler()->GetRenderPipelineState()
);
GetImpl()->GetRenderCommandEncoder()->setRenderPipelineState(GetImpl()->GetRenderPipelineHandler()->GetRenderPipelineState());
}

void Renderer::SetPrimitiveTopology_METAL(PrimitiveType topology)
Expand Down
2 changes: 1 addition & 1 deletion Samples/HelloTriangle/Assets/DirectX/HelloTriangleVS.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct VS_INPUT
{
float3 Position : POSITION;
float4 Position : POSITION;
float3 Color : COLOR0;
};

Expand Down
2 changes: 1 addition & 1 deletion Samples/HelloTriangle/Assets/OpenGL/HelloTriangleVS.vert
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#version 460 core
layout (location = 0) in vec3 Position;
layout (location = 0) in vec4 Position;
layout (location = 1) in vec3 aColor;
out vec3 Color;

Expand Down

0 comments on commit bb8de94

Please sign in to comment.