mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
ShaderGeneration: Get rid of static buffers
This commit is contained in:
@ -7,10 +7,8 @@
|
||||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/GeometryShaderGen.h"
|
||||
#include "VideoCommon/LightingShaderGen.h"
|
||||
#include "VideoCommon/VertexShaderGen.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
static char text[16384];
|
||||
|
||||
static const char* primitives_ogl[] =
|
||||
{
|
||||
@ -39,12 +37,6 @@ static inline T GenerateGeometryShader(u32 primitive_type, API_TYPE ApiType)
|
||||
if (uid_data == nullptr)
|
||||
uid_data = &dummy_data;
|
||||
|
||||
out.SetBuffer(text);
|
||||
const bool is_writing_shadercode = (out.GetBuffer() != nullptr);
|
||||
|
||||
if (is_writing_shadercode)
|
||||
text[sizeof(text) - 1] = 0x7C; // canary
|
||||
|
||||
uid_data->primitive_type = primitive_type;
|
||||
const unsigned int vertex_in = primitive_type + 1;
|
||||
unsigned int vertex_out = primitive_type == PRIMITIVE_TRIANGLES ? 3 : 4;
|
||||
@ -288,12 +280,6 @@ static inline T GenerateGeometryShader(u32 primitive_type, API_TYPE ApiType)
|
||||
|
||||
out.Write("}\n");
|
||||
|
||||
if (is_writing_shadercode)
|
||||
{
|
||||
if (text[sizeof(text) - 1] != 0x7C)
|
||||
PanicAlert("GeometryShader generator - buffer too small, canary has been eaten!");
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user