mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-03-17 18:54:51 +01:00
* gl: Enable vertex textures * rsx: use textureLod instead of generic texture sample * rsx: handle uploading of W32_X32_Y32_Z32 * gl: Re-enable proper shader logging remove old logging method that overwrites single file * gl: Declare texture_coord_scale for vertex samplers * gl: texture remap fixes; enable remap for vertex textures * gl: offset texture indices to base layer 16 * rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout * vk: Enable vertex textures * rsx: define special calls for vertex texture fetch * gl: improved vertex texture fetch setup * vk: Fix texture formats and component mapping * vk: Implement vertex texture fetch functions properly * vk/gl: proper fix for primitive restart index revert inadvertent decompiler update * gl: Disable filtering for vertex textures
55 lines
1.7 KiB
C++
55 lines
1.7 KiB
C++
#pragma once
|
|
#include "GLVertexProgram.h"
|
|
#include "GLFragmentProgram.h"
|
|
#include "../Common/ProgramStateCache.h"
|
|
|
|
struct GLTraits
|
|
{
|
|
using vertex_program_type = GLVertexProgram;
|
|
using fragment_program_type = GLFragmentProgram;
|
|
using pipeline_storage_type = gl::glsl::program;
|
|
using pipeline_properties = void*;
|
|
|
|
static
|
|
void recompile_fragment_program(const RSXFragmentProgram &RSXFP, fragment_program_type& fragmentProgramData, size_t ID)
|
|
{
|
|
fragmentProgramData.Decompile(RSXFP);
|
|
fragmentProgramData.Compile();
|
|
}
|
|
|
|
static
|
|
void recompile_vertex_program(const RSXVertexProgram &RSXVP, vertex_program_type& vertexProgramData, size_t ID)
|
|
{
|
|
vertexProgramData.Decompile(RSXVP);
|
|
vertexProgramData.Compile();
|
|
}
|
|
|
|
static
|
|
pipeline_storage_type build_pipeline(const vertex_program_type &vertexProgramData, const fragment_program_type &fragmentProgramData, const pipeline_properties &pipelineProperties)
|
|
{
|
|
pipeline_storage_type result;
|
|
__glcheck result.create()
|
|
.attach(gl::glsl::shader_view(vertexProgramData.id))
|
|
.attach(gl::glsl::shader_view(fragmentProgramData.id))
|
|
.bind_fragment_data_location("ocol0", 0)
|
|
.bind_fragment_data_location("ocol1", 1)
|
|
.bind_fragment_data_location("ocol2", 2)
|
|
.bind_fragment_data_location("ocol3", 3)
|
|
.make();
|
|
__glcheck result.use();
|
|
|
|
LOG_NOTICE(RSX, "*** prog id = %d", result.id());
|
|
LOG_NOTICE(RSX, "*** vp id = %d", vertexProgramData.id);
|
|
LOG_NOTICE(RSX, "*** fp id = %d", fragmentProgramData.id);
|
|
|
|
LOG_NOTICE(RSX, "*** vp shader = \n%s", vertexProgramData.shader.c_str());
|
|
LOG_NOTICE(RSX, "*** fp shader = \n%s", fragmentProgramData.shader.c_str());
|
|
|
|
return result;
|
|
}
|
|
};
|
|
|
|
class GLProgramBuffer : public program_state_cache<GLTraits>
|
|
{
|
|
};
|