2019-11-03 03:36:54 +00:00
|
|
|
#pragma once
|
2019-11-03 05:18:51 +00:00
|
|
|
#include "gpu_hw.h"
|
2020-09-12 04:52:18 +00:00
|
|
|
#include "shadergen.h"
|
2019-11-03 03:36:54 +00:00
|
|
|
|
2020-09-12 04:52:18 +00:00
|
|
|
class GPU_HW_ShaderGen : public ShaderGen
|
2019-11-03 03:36:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-02-29 14:05:31 +00:00
|
|
|
GPU_HW_ShaderGen(HostDisplay::RenderAPI render_api, u32 resolution_scale, bool true_color, bool scaled_dithering,
|
2020-09-11 12:20:19 +00:00
|
|
|
GPUTextureFilter texture_filtering, bool uv_limits, bool supports_dual_source_blend);
|
2019-11-03 03:36:54 +00:00
|
|
|
~GPU_HW_ShaderGen();
|
|
|
|
|
2020-08-10 12:37:30 +00:00
|
|
|
std::string GenerateBatchVertexShader(bool textured);
|
2019-11-03 05:18:51 +00:00
|
|
|
std::string GenerateBatchFragmentShader(GPU_HW::BatchRenderMode transparency, GPU::TextureMode texture_mode,
|
2020-04-03 14:11:33 +00:00
|
|
|
bool dithering, bool interlacing);
|
2020-04-03 14:11:39 +00:00
|
|
|
std::string GenerateInterlacedFillFragmentShader();
|
2020-05-25 17:18:04 +00:00
|
|
|
std::string GenerateDisplayFragmentShader(bool depth_24bit, GPU_HW::InterlacedRenderMode interlace_mode);
|
2019-11-14 06:58:27 +00:00
|
|
|
std::string GenerateVRAMReadFragmentShader();
|
2020-06-23 15:39:53 +00:00
|
|
|
std::string GenerateVRAMWriteFragmentShader(bool use_ssbo);
|
2020-04-19 12:30:54 +00:00
|
|
|
std::string GenerateVRAMCopyFragmentShader();
|
2020-05-03 07:11:28 +00:00
|
|
|
std::string GenerateVRAMUpdateDepthFragmentShader();
|
2019-11-03 03:36:54 +00:00
|
|
|
|
|
|
|
private:
|
2019-11-03 05:18:51 +00:00
|
|
|
void WriteCommonFunctions(std::stringstream& ss);
|
|
|
|
void WriteBatchUniformBuffer(std::stringstream& ss);
|
2020-09-11 12:20:19 +00:00
|
|
|
void WriteBatchTextureFilter(std::stringstream& ss, GPUTextureFilter texture_filter);
|
2020-05-02 06:01:16 +00:00
|
|
|
|
|
|
|
u32 m_resolution_scale;
|
|
|
|
bool m_true_color;
|
|
|
|
bool m_scaled_dithering;
|
2020-09-11 12:20:19 +00:00
|
|
|
GPUTextureFilter m_texture_filter;
|
2020-08-10 12:37:30 +00:00
|
|
|
bool m_uv_limits;
|
2019-11-03 03:36:54 +00:00
|
|
|
};
|