diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/example-base/example-base.cpp | 8 | ||||
| -rw-r--r-- | examples/model-viewer/main.cpp | 8 | ||||
| -rw-r--r-- | examples/ray-tracing-pipeline/main.cpp | 8 | ||||
| -rw-r--r-- | examples/ray-tracing/main.cpp | 8 | ||||
| -rw-r--r-- | examples/shader-toy/main.cpp | 2 | ||||
| -rw-r--r-- | examples/triangle/main.cpp | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/examples/example-base/example-base.cpp b/examples/example-base/example-base.cpp index c45e3cc27..a7a8e7673 100644 --- a/examples/example-base/example-base.cpp +++ b/examples/example-base/example-base.cpp @@ -50,7 +50,7 @@ Slang::Result WindowedAppBase::initializeBase( // Create swapchain and framebuffers. gfx::ISwapchain::Desc swapchainDesc = {}; - swapchainDesc.format = gfx::Format::RGBA_Unorm_UInt8; + swapchainDesc.format = gfx::Format::R8G8B8A8_UNORM; swapchainDesc.width = width; swapchainDesc.height = height; swapchainDesc.imageCount = kSwapchainImageCount; @@ -59,7 +59,7 @@ Slang::Result WindowedAppBase::initializeBase( gSwapchain = gDevice->createSwapchain(swapchainDesc, windowHandle); IFramebufferLayout::AttachmentLayout renderTargetLayout = {gSwapchain->getDesc().format, 1}; - IFramebufferLayout::AttachmentLayout depthLayout = {gfx::Format::D_Float32, 1}; + IFramebufferLayout::AttachmentLayout depthLayout = {gfx::Format::D32_FLOAT, 1}; IFramebufferLayout::Desc framebufferLayoutDesc; framebufferLayoutDesc.renderTargetCount = 1; framebufferLayoutDesc.renderTargets = &renderTargetLayout; @@ -117,7 +117,7 @@ void WindowedAppBase::createSwapchainFramebuffers() depthBufferDesc.size.width = gSwapchain->getDesc().width; depthBufferDesc.size.height = gSwapchain->getDesc().height; depthBufferDesc.size.depth = 1; - depthBufferDesc.format = gfx::Format::D_Float32; + depthBufferDesc.format = gfx::Format::D32_FLOAT; depthBufferDesc.defaultState = ResourceState::DepthWrite; depthBufferDesc.allowedStates = ResourceStateSet(ResourceState::DepthWrite); @@ -136,7 +136,7 @@ void WindowedAppBase::createSwapchainFramebuffers() gfx::IResourceView::Desc depthBufferViewDesc; memset(&depthBufferViewDesc, 0, sizeof(depthBufferViewDesc)); - depthBufferViewDesc.format = gfx::Format::D_Float32; + depthBufferViewDesc.format = gfx::Format::D32_FLOAT; depthBufferViewDesc.renderTarget.shape = gfx::IResource::Type::Texture2D; depthBufferViewDesc.type = gfx::IResourceView::Type::DepthStencil; ComPtr<gfx::IResourceView> dsv = diff --git a/examples/model-viewer/main.cpp b/examples/model-viewer/main.cpp index 6e21f9050..76b8fca05 100644 --- a/examples/model-viewer/main.cpp +++ b/examples/model-viewer/main.cpp @@ -744,9 +744,9 @@ Result initialize() SLANG_RETURN_ON_FAIL(context.init(gDevice)); InputElementDesc inputElements[] = { - {"POSITION", 0, Format::RGB_Float32, offsetof(Model::Vertex, position) }, - {"NORMAL", 0, Format::RGB_Float32, offsetof(Model::Vertex, normal) }, - {"UV", 0, Format::RG_Float32, offsetof(Model::Vertex, uv) }, + {"POSITION", 0, Format::R32G32B32_FLOAT, offsetof(Model::Vertex, position) }, + {"NORMAL", 0, Format::R32G32B32_FLOAT, offsetof(Model::Vertex, normal) }, + {"UV", 0, Format::R32G32_FLOAT, offsetof(Model::Vertex, uv) }, }; auto inputLayout = gDevice->createInputLayout( &inputElements[0], @@ -870,7 +870,7 @@ void renderFrame(int frameIndex) override for(auto& model : gModels) { drawCommandEncoder->setVertexBuffer(0, model->vertexBuffer, sizeof(Model::Vertex)); - drawCommandEncoder->setIndexBuffer(model->indexBuffer, Format::R_UInt32); + drawCommandEncoder->setIndexBuffer(model->indexBuffer, Format::R32_UINT); // For each model we provide a parameter // block that holds the per-model transformation // parameters, corresponding to the `PerModel` type diff --git a/examples/ray-tracing-pipeline/main.cpp b/examples/ray-tracing-pipeline/main.cpp index 3c83447b4..a1539f6a7 100644 --- a/examples/ray-tracing-pipeline/main.cpp +++ b/examples/ray-tracing-pipeline/main.cpp @@ -352,10 +352,10 @@ Slang::Result initialize() geomDesc.type = IAccelerationStructure::GeometryType::Triangles; geomDesc.content.triangles.indexCount = kIndexCount; geomDesc.content.triangles.indexData = gIndexBuffer->getDeviceAddress(); - geomDesc.content.triangles.indexFormat = Format::R_UInt32; + geomDesc.content.triangles.indexFormat = Format::R32_UINT; geomDesc.content.triangles.vertexCount = kVertexCount; geomDesc.content.triangles.vertexData = gVertexBuffer->getDeviceAddress(); - geomDesc.content.triangles.vertexFormat = Format::RGB_Float32; + geomDesc.content.triangles.vertexFormat = Format::R32G32B32_FLOAT; geomDesc.content.triangles.vertexStride = sizeof(Vertex); geomDesc.content.triangles.transform3x4 = gTransformBuffer->getDeviceAddress(); accelerationStructureBuildInputs.geometryDescs = &geomDesc; @@ -505,7 +505,7 @@ Slang::Result initialize() return SLANG_FAIL; InputElementDesc inputElements[] = { - {"POSITION", 0, Format::RG_Float32, offsetof(FullScreenTriangle::Vertex, position)}, + {"POSITION", 0, Format::R32G32_FLOAT, offsetof(FullScreenTriangle::Vertex, position)}, }; auto inputLayout = gDevice->createInputLayout(&inputElements[0], SLANG_COUNT_OF(inputElements)); if (!inputLayout) @@ -554,7 +554,7 @@ void createResultTexture() resultTextureDesc.size.height = windowHeight; resultTextureDesc.size.depth = 1; resultTextureDesc.defaultState = ResourceState::UnorderedAccess; - resultTextureDesc.format = Format::RGBA_Float16; + resultTextureDesc.format = Format::R16G16B16A16_FLOAT; gResultTexture = gDevice->createTextureResource(resultTextureDesc); IResourceView::Desc resultUAVDesc = {}; resultUAVDesc.format = resultTextureDesc.format; diff --git a/examples/ray-tracing/main.cpp b/examples/ray-tracing/main.cpp index bb02e157a..e51a601a2 100644 --- a/examples/ray-tracing/main.cpp +++ b/examples/ray-tracing/main.cpp @@ -344,10 +344,10 @@ Slang::Result initialize() geomDesc.type = IAccelerationStructure::GeometryType::Triangles; geomDesc.content.triangles.indexCount = kIndexCount; geomDesc.content.triangles.indexData = gIndexBuffer->getDeviceAddress(); - geomDesc.content.triangles.indexFormat = Format::R_UInt32; + geomDesc.content.triangles.indexFormat = Format::R32_UINT; geomDesc.content.triangles.vertexCount = kVertexCount; geomDesc.content.triangles.vertexData = gVertexBuffer->getDeviceAddress(); - geomDesc.content.triangles.vertexFormat = Format::RGB_Float32; + geomDesc.content.triangles.vertexFormat = Format::R32G32B32_FLOAT; geomDesc.content.triangles.vertexStride = sizeof(Vertex); geomDesc.content.triangles.transform3x4 = gTransformBuffer->getDeviceAddress(); accelerationStructureBuildInputs.geometryDescs = &geomDesc; @@ -497,7 +497,7 @@ Slang::Result initialize() return SLANG_FAIL; InputElementDesc inputElements[] = { - {"POSITION", 0, Format::RG_Float32, offsetof(FullScreenTriangle::Vertex, position)}, + {"POSITION", 0, Format::R32G32_FLOAT, offsetof(FullScreenTriangle::Vertex, position)}, }; auto inputLayout = gDevice->createInputLayout(&inputElements[0], SLANG_COUNT_OF(inputElements)); if (!inputLayout) @@ -535,7 +535,7 @@ void createResultTexture() resultTextureDesc.size.height = windowHeight; resultTextureDesc.size.depth = 1; resultTextureDesc.defaultState = ResourceState::UnorderedAccess; - resultTextureDesc.format = Format::RGBA_Float16; + resultTextureDesc.format = Format::R16G16B16A16_FLOAT; gResultTexture = gDevice->createTextureResource(resultTextureDesc); IResourceView::Desc resultUAVDesc = {}; resultUAVDesc.format = resultTextureDesc.format; diff --git a/examples/shader-toy/main.cpp b/examples/shader-toy/main.cpp index c41bd71ca..e4e2cafcc 100644 --- a/examples/shader-toy/main.cpp +++ b/examples/shader-toy/main.cpp @@ -282,7 +282,7 @@ Result initialize() gWindow->events.mouseDown = [this](const platform::MouseEventArgs& e) { handleEvent(e); }; InputElementDesc inputElements[] = { - { "POSITION", 0, Format::RG_Float32, offsetof(FullScreenTriangle::Vertex, position) }, + { "POSITION", 0, Format::R32G32_FLOAT, offsetof(FullScreenTriangle::Vertex, position) }, }; auto inputLayout = gDevice->createInputLayout( &inputElements[0], diff --git a/examples/triangle/main.cpp b/examples/triangle/main.cpp index 0f6c31809..f182e0a0a 100644 --- a/examples/triangle/main.cpp +++ b/examples/triangle/main.cpp @@ -224,8 +224,8 @@ Slang::Result initialize() // First, we create an input layout: // InputElementDesc inputElements[] = { - { "POSITION", 0, Format::RGB_Float32, offsetof(Vertex, position) }, - { "COLOR", 0, Format::RGB_Float32, offsetof(Vertex, color) }, + { "POSITION", 0, Format::R32G32B32_FLOAT, offsetof(Vertex, position) }, + { "COLOR", 0, Format::R32G32B32_FLOAT, offsetof(Vertex, color) }, }; auto inputLayout = gDevice->createInputLayout( &inputElements[0], |
