1#ifndef EFT_CAFE_WRAPPER_H_
2#define EFT_CAFE_WRAPPER_H_
4#include <nw/eft/eft_Data.h>
5#include <nw/eft/eft_Heap.h>
11namespace nw {
namespace eft {
27 GX2Draw(
static_cast<GX2PrimitiveType>(primType), vertexNum);
32 GX2DrawIndexedEx(
static_cast<GX2PrimitiveType>(primType), vertexNum, GX2_INDEX_FORMAT_U32, indexPtr, 0, primCount);
37 GX2DrawEx(
static_cast<GX2PrimitiveType>(primType), vertexNum, startNum, 1);
42 GX2DrawEx(
static_cast<GX2PrimitiveType>(primType), vertexNum, 0, primCount);
57 return &mTextureSampler;
63static_assert(
sizeof(
TextureSampler) == 0xC,
"nw::eft::TextureSampler size mismatch");
89static_assert(
sizeof(
Rendercontext) == 0x20,
"nw::eft::Rendercontext size mismatch");
99 void BindBuffer(u32 index, u32 size, u32 stride);
101 static void BindExtBuffer(u32 index, u32 size, u32 element, u32 stride,
void* buffer);
110 return mVertexBufferSize;
119static_assert(
sizeof(
VertexBuffer) == 0x10,
"nw::eft::VertexBuffer size mismatch");
154 return mpVertexShader;
159 return mpPixelShader;
164 return mpGeometryShader;
178static_assert(
sizeof(
Shader) == 0x278,
"nw::eft::Shader size mismatch");
198 mUniformBlockMode = EFT_UNIFORM_BLOCK_MODE_MAX;
222static_assert(
sizeof(
UniformBlock) == 0x10,
"nw::eft::UniformBlock size mismatch");
Definition eft_CafeWrapper.h:14
static void DrawPrimitive(PrimitiveType primType, u32 vertexNum)
Definition eft_CafeWrapper.h:25
@ PRIM_TYPE_TRIANGLES
Definition eft_CafeWrapper.h:20
@ PRIM_TYPE_TRIANGLE_STRIP
Definition eft_CafeWrapper.h:21
@ PRIM_TYPE_QUADS
Definition eft_CafeWrapper.h:22
u32 PrimitiveType
Definition eft_CafeWrapper.h:16
static void DrawInstancePrimitive(PrimitiveType primType, u32 vertexNum, u32 primCount)
Definition eft_CafeWrapper.h:40
static void DrawInstanceIndexedPrimitive(PrimitiveType primType, u32 vertexNum, void *indexPtr, u32 primCount)
Definition eft_CafeWrapper.h:30
static void DrawPrimitive(PrimitiveType primType, u32 startNum, u32 vertexNum)
Definition eft_CafeWrapper.h:35
Definition eft_CafeWrapper.h:69
Rendercontext()
Definition eft_CafeWrapper.cpp:167
void SetupTexture(const Texture texture, TextureSlot slot, FragmentTextureLocation location)
Definition eft_CafeWrapper.cpp:296
ZBufATestType mZBufATestType
Definition eft_CafeWrapper.h:87
void SetupDisplaySideType(DisplaySideType displaySideType) const
Definition eft_CafeWrapper.cpp:265
BlendType mBlendType
Definition eft_CafeWrapper.h:86
void SetupZBufATest(ZBufATestType zBufATestType)
Definition eft_CafeWrapper.cpp:241
void SetupBlendType(BlendType blendType)
Definition eft_CafeWrapper.cpp:182
const TextureSampler * GetDefautSampler() const
Definition eft_CafeWrapper.h:80
void SetupTexture(const TextureRes *texture, TextureSlot slot, FragmentTextureLocation location)
Definition eft_CafeWrapper.cpp:281
void SetupCommonState()
Definition eft_CafeWrapper.cpp:173
TextureSampler mTextureSampler
Definition eft_CafeWrapper.h:83
TextureSampler mDefaultTextureSampler
Definition eft_CafeWrapper.h:84
Definition eft_CafeWrapper.h:122
u32 mAttribsIndex[cAttributeMax]
Definition eft_CafeWrapper.h:175
bool IsInitialized() const
Definition eft_CafeWrapper.h:139
const GX2GeometryShader * GetGeometryShader()
Definition eft_CafeWrapper.h:162
GX2VertexShader * mpVertexShader
Definition eft_CafeWrapper.h:168
u32 GetFragmentSamplerLocation(const char *name)
Definition eft_CafeWrapper.cpp:394
const GX2PixelShader * GetPixelShader()
Definition eft_CafeWrapper.h:157
@ cAttributeMax
Definition eft_CafeWrapper.h:126
Shader()
Definition eft_CafeWrapper.cpp:340
void BindShader()
Definition eft_CafeWrapper.cpp:377
bool CreateShader(Heap *heap, const void *gshBuffer, u32 gshBufferSize)
Definition eft_CafeWrapper.cpp:385
void SetupShader(Heap *heap)
Definition eft_CafeWrapper.cpp:423
u32 mAttribsNum
Definition eft_CafeWrapper.h:173
GX2FetchShader mFetchShader
Definition eft_CafeWrapper.h:171
u32 GetAttribute(const char *name, u32 index, VertexFormat fmt, u32 offset=0, bool instancingAttr=false)
Definition eft_CafeWrapper.cpp:404
const GX2VertexShader * GetVertexShader()
Definition eft_CafeWrapper.h:152
void * mpFetchShaderBuf
Definition eft_CafeWrapper.h:172
GX2AttribStream mAttribs[cAttributeMax]
Definition eft_CafeWrapper.h:174
GX2GeometryShader * mpGeometryShader
Definition eft_CafeWrapper.h:170
VertexFormat
Definition eft_CafeWrapper.h:130
@ FORMAT_32_32_32_FLOAT
Definition eft_CafeWrapper.h:132
@ FORMAT_32_32_32_32_FLOAT
Definition eft_CafeWrapper.h:133
@ FORMAT_32_UINT
Definition eft_CafeWrapper.h:131
void Finalize(Heap *heap)
Definition eft_CafeWrapper.cpp:350
u32 GetAttributeLocation(const char *name)
Definition eft_CafeWrapper.cpp:399
GX2PixelShader * mpPixelShader
Definition eft_CafeWrapper.h:169
bool mInitialized
Definition eft_CafeWrapper.h:176
Definition eft_CafeWrapper.h:47
TextureSampler()
Definition eft_CafeWrapper.cpp:119
~TextureSampler()
Definition eft_CafeWrapper.cpp:124
bool SetupLOD(f32 maxMip, f32 bais)
Definition eft_CafeWrapper.cpp:161
GX2Sampler mTextureSampler
Definition eft_CafeWrapper.h:61
bool Setup(TextureFilterMode textureFilter, TextureWrapMode wrapModeU, TextureWrapMode wrapModeV)
Definition eft_CafeWrapper.cpp:128
const GX2Sampler * GetSampler() const
Definition eft_CafeWrapper.h:55
Definition eft_CafeWrapper.h:92
u32 mVertexBufferSize
Definition eft_CafeWrapper.h:116
u32 mVertexElement
Definition eft_CafeWrapper.h:115
VertexBuffer()
Definition eft_CafeWrapper.cpp:302
void * mVertexBuffer
Definition eft_CafeWrapper.h:117
u32 GetVertexBufferSize()
Definition eft_CafeWrapper.h:108
void * GetVertexBuffer()
Definition eft_CafeWrapper.h:103
void Invalidate()
Definition eft_CafeWrapper.cpp:325
void * AllocateVertexBuffer(Heap *heap, u32 size, u32 element)
Definition eft_CafeWrapper.cpp:308
void BindBuffer(u32 index, u32 size, u32 stride)
Definition eft_CafeWrapper.cpp:330
void Finalize(Heap *heap)
Definition eft_CafeWrapper.cpp:316
static void BindExtBuffer(u32 index, u32 size, u32 element, u32 stride, void *buffer)
Definition eft_CafeWrapper.cpp:335
Heap * mHeap
Definition eft_CafeWrapper.h:114
BOOL _DEMOGFDReadPixelShader(nw::eft::Heap *heap, GX2PixelShader **ppShader, u32 index, const void *pData)
Definition eft_CafeWrapper.cpp:39
BOOL _DEMOGFDReadGeometryShader(nw::eft::Heap *heap, GX2GeometryShader **ppShader, u32 index, const void *pData)
Definition eft_CafeWrapper.cpp:75
BOOL _DEMOGFDReadVertexShader(nw::eft::Heap *heap, GX2VertexShader **ppShader, u32 index, const void *pData)
Definition eft_CafeWrapper.cpp:3
Definition eft_CafeWrapper.cpp:117
const GX2Sampler * Sampler
Definition eft_CafeWrapper.h:66
TextureWrapMode
Definition eft_Data.h:158
const GX2Texture * Texture
Definition eft_CafeWrapper.h:65
DisplaySideType
Definition eft_Data.h:199
BlendType
Definition eft_Data.h:321
TextureFilterMode
Definition eft_Data.h:170
TextureSlot
Definition eft_Data.h:145
ZBufATestType
Definition eft_Data.h:334
Definition eft_Data.h:645
Definition eft_Data.h:743