Skip to content

Commit

Permalink
Dynamic Texture Indexing is indexing the wrong textures :(
Browse files Browse the repository at this point in the history
  • Loading branch information
devshgraphicsprogramming committed Mar 16, 2022
1 parent 4b073e1 commit 862dffc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions examples_tests/21.DynamicTextureIndexing/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ class DynamicTextureIndexingApp : public ApplicationBase
mdiCallParams[i].maxCount = pmbData.mdiParameterCount;
}

//
cpu2gpuParams.beginCommandBuffers();

//create pipeline
IAssetLoader::SAssetLoadParams lp;
auto vertexShaderBundle = assetManager->getAsset("../mesh.vert", lp);
Expand Down Expand Up @@ -417,7 +420,6 @@ class DynamicTextureIndexingApp : public ApplicationBase
}

auto gpuShaders = cpu2gpu.getGPUObjectsFromAssets(shaders, shaders + 2, cpu2gpuParams);
//cpu2gpuParams.waitForCreationToComplete();
IGPUSpecializedShader* shaders[2] = { gpuShaders->operator[](0).get(), gpuShaders->operator[](1).get() };

gpuPipelineLayout = logicalDevice->createGPUPipelineLayout(range, range + 1, core::smart_refctd_ptr(ds0layout), core::smart_refctd_ptr(ds1layout));
Expand Down Expand Up @@ -454,7 +456,6 @@ class DynamicTextureIndexingApp : public ApplicationBase


auto gpuTexture = cpu2gpu.getGPUObjectsFromAssets(&texture, &texture + 1, cpu2gpuParams)->front();
cpu2gpuParams.waitForCreationToComplete();

info[bind].image.imageLayout = asset::EIL_UNDEFINED;
info[bind].image.sampler = core::smart_refctd_ptr(sampler);
Expand Down Expand Up @@ -487,6 +488,8 @@ class DynamicTextureIndexingApp : public ApplicationBase
}
}

cpu2gpuParams.waitForCreationToComplete();

core::vectorSIMDf cameraPosition(-4, 0, 0);
matrix4SIMD projectionMatrix = matrix4SIMD::buildProjectionMatrixPerspectiveFovLH(core::radians(60.0f), float(WIN_W) / WIN_H, 0.1, 100000);
camera = Camera(cameraPosition, core::vectorSIMDf(0, 0, 0), projectionMatrix, 1.f, 1.f);
Expand Down
2 changes: 1 addition & 1 deletion examples_tests/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ N = No support
| 18.MitsubaLoader | S | N | S | S | N | S | N | N | BUILD_MITSUBA_LOADER |
| FREE_SLOT | | | | | | | | | |
| 20.Megatexture | S | S | S | S | S | S | N | S | |
| 21.DynamicTextureIndexing | S | N | S | S | N | S | N | S | |
| 21.DynamicTextureIndexing | B | B | B | S | N | S | N | S | |
| 22.RaytracedAO | N | N | W | N | N | W | N | N | BUILD_MITSUBA_LOADER |
| 23.Autoexposure | Y | Y | Y | S | S | S | N | S | |
| FREE_SLOT | | | | | | | | | |
Expand Down

0 comments on commit 862dffc

Please sign in to comment.