diff --git a/Runtime/Graphics/CGraphics.hpp b/Runtime/Graphics/CGraphics.hpp index 0c8923f70..483e1d097 100644 --- a/Runtime/Graphics/CGraphics.hpp +++ b/Runtime/Graphics/CGraphics.hpp @@ -356,9 +356,9 @@ public: boo::SWindowRect wrect = {rect.x4_left, rect.x8_top, rect.xc_width, rect.x10_height}; g_BooMainCommandQueue->resolveBindTexture(g_SpareTexture, wrect, true, bindIdx, false, true); } - static void DrawInstances(size_t start, size_t count, size_t instCount) + static void DrawInstances(size_t start, size_t count, size_t instCount, size_t startInst = 0) { - g_BooMainCommandQueue->drawInstances(start, count, instCount); + g_BooMainCommandQueue->drawInstances(start, count, instCount, startInst); } static void DrawArray(size_t start, size_t count) { diff --git a/Runtime/Graphics/Shaders/CEnvFxShaders.cpp b/Runtime/Graphics/Shaders/CEnvFxShaders.cpp index 1457504fb..688229afb 100644 --- a/Runtime/Graphics/Shaders/CEnvFxShaders.cpp +++ b/Runtime/Graphics/Shaders/CEnvFxShaders.cpp @@ -27,7 +27,7 @@ void CEnvFxShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& c boo::ObjToken uniforms[] = {uBufInfo.first.get(), fxMgr.m_fogUniformBuf.get()}; size_t ubufOffsets[] = {uBufInfo.second, 0}; - size_t ubufSizes[] = {256, 256}; + size_t ubufSizes[] = {sizeof(CEnvFxShaders::Uniform), sizeof(CGraphics::g_Fog)}; boo::PipelineStage uniformStages[] = {boo::PipelineStage::Vertex, boo::PipelineStage::Fragment}; boo::ObjToken textures[] = {fxMgr.xb74_txtrSnowFlake->GetBooTexture(), fxMgr.x40_txtrEnvGradient->GetBooTexture()}; diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index b0b8c8b51..061321030 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -1876,6 +1876,9 @@ void CElementGen::RenderParticlesIndirectTexture() g_instIndTexData.clear(); g_instIndTexData.reserve(x30_particles.size()); + if (!x30_particles.empty()) + CGraphics::SetShaderDataBinding(m_normalDataBind); + for (int i=0 ; ix44_28_x30_28_SORT ? sortItems[i].x0_partIdx : i; @@ -1945,13 +1948,14 @@ void CElementGen::RenderParticlesIndirectTexture() inst.sceneUVs = zeus::CVector4f{clipRect.x18_uvXMin, 1.f - clipRect.x24_uvYMax, clipRect.x1c_uvXMax, 1.f - clipRect.x20_uvYMin}; break; } + CGraphics::DrawInstances(0, 4, 1, g_instIndTexData.size() - 1); } if (g_instIndTexData.size()) { m_instBuf->load(g_instIndTexData.data(), g_instIndTexData.size() * sizeof(SParticleInstanceIndTex)); - CGraphics::SetShaderDataBinding(m_normalDataBind); - CGraphics::DrawInstances(0, 4, g_instIndTexData.size()); + //CGraphics::SetShaderDataBinding(m_normalDataBind); + //CGraphics::DrawInstances(0, 4, g_instIndTexData.size()); } } diff --git a/hecl b/hecl index 26541cd2b..75e7dc2e8 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 26541cd2b460592049b75b9612562fa6b7d01cc5 +Subproject commit 75e7dc2e871e4ca41d9691737259455fb337dc15