mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
PostProcessingShaderGen: Use ints instead of bools for options
This commit is contained in:
parent
a02feeb8e8
commit
3bd9f85af8
|
@ -146,6 +146,7 @@ void ShaderGen::WriteHeader(std::stringstream& ss)
|
|||
ss << "#define lerp mix\n";
|
||||
|
||||
ss << "#define CONSTANT const\n";
|
||||
ss << "#define GLOBAL\n";
|
||||
ss << "#define VECTOR_EQ(a, b) ((a) == (b))\n";
|
||||
ss << "#define VECTOR_NEQ(a, b) ((a) != (b))\n";
|
||||
ss << "#define VECTOR_COMP_EQ(a, b) equal((a), (b))\n";
|
||||
|
@ -181,6 +182,7 @@ void ShaderGen::WriteHeader(std::stringstream& ss)
|
|||
ss << "#define mat3 float3x3\n";
|
||||
ss << "#define mat4 float4x4\n";
|
||||
ss << "#define CONSTANT static const\n";
|
||||
ss << "#define GLOBAL static\n";
|
||||
ss << "#define VECTOR_EQ(a, b) (all((a) == (b)))\n";
|
||||
ss << "#define VECTOR_NEQ(a, b) (any((a) != (b)))\n";
|
||||
ss << "#define VECTOR_COMP_EQ(a, b) ((a) == (b))\n";
|
||||
|
|
|
@ -161,9 +161,9 @@ void PostProcessingShaderGen::WriteUniformBuffer(std::stringstream& ss, const Po
|
|||
switch (option.type)
|
||||
{
|
||||
case PostProcessingShader::Option::Type::Bool:
|
||||
ss << " bool " << option.name << ";\n";
|
||||
ss << " int " << option.name << ";\n";
|
||||
for (u32 i = option.vector_size; i < PostProcessingShader::Option::MAX_VECTOR_COMPONENTS; i++)
|
||||
ss << " bool ubo_pad" << (pad_counter++) << ";\n";
|
||||
ss << " int ubo_pad" << (pad_counter++) << ";\n";
|
||||
break;
|
||||
|
||||
case PostProcessingShader::Option::Type::Int:
|
||||
|
|
|
@ -925,7 +925,7 @@ void VulkanHostDisplay::ApplyPostProcessingChain(s32 final_left, s32 final_top,
|
|||
if (use_push_constants)
|
||||
{
|
||||
u8 buffer[PostProcessingShader::PUSH_CONSTANT_SIZE_THRESHOLD];
|
||||
Assert(pps.uniforms_size < sizeof(buffer));
|
||||
Assert(pps.uniforms_size <= sizeof(buffer));
|
||||
m_post_processing_chain.GetShaderStage(i).FillUniformBuffer(
|
||||
buffer, texture_width, texture_height, texture_view_x, texture_view_y, texture_view_width, texture_view_height,
|
||||
texture_width, texture_width, 0.0f);
|
||||
|
|
Loading…
Reference in a new issue