Skip to content

Commit eb65aab

Browse files
committed
shader define fixes
1 parent 6d4836b commit eb65aab

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/nbl/asset/utils/IShaderCompiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ void IShaderCompiler::insertExtraDefines(std::string& code, const core::SRange<c
216216
std::ostringstream insertion;
217217
for (auto i = 0u; i < defines.size(); ++i)
218218
{
219-
insertion << "#define " << defines[i] << "\r\n";
219+
insertion << "#define " << defines[i] << "\n";
220220
}
221221
insertIntoStart(code, std::move(insertion));
222222
}

src/nbl/video/ILogicalDevice.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ void ILogicalDevice::addCommonShaderDefines(std::ostringstream& pool, const bool
116116
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_FRAMEBUFFER_WIDTH",limits.maxFramebufferWidth);
117117
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_FRAMEBUFFER_HEIGHT",limits.maxFramebufferHeight);
118118
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_FRAMEBUFFER_LAYERS",limits.maxFramebufferLayers);
119-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_COLOR_SAMPLE_COUNTS",limits.framebufferColorSampleCounts.value);
120-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_DEPTH_SAMPLE_COUNTS",limits.framebufferDepthSampleCounts.value);
121-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_STENCIL_SAMPLE_COUNTS",limits.framebufferStencilSampleCounts.value);
122-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_NO_ATTACHMENTS_SAMPLE_COUNTS",limits.framebufferNoAttachmentsSampleCounts.value);
119+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_COLOR_SAMPLE_COUNTS",static_cast<uint32_t>(limits.framebufferColorSampleCounts.value));
120+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_DEPTH_SAMPLE_COUNTS", static_cast<uint32_t>(limits.framebufferDepthSampleCounts.value));
121+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_STENCIL_SAMPLE_COUNTS", static_cast<uint32_t>(limits.framebufferStencilSampleCounts.value));
122+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_FRAMEBUFFER_NO_ATTACHMENTS_SAMPLE_COUNTS", static_cast<uint32_t>(limits.framebufferNoAttachmentsSampleCounts.value));
123123
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_COLOR_ATTACHMENTS",limits.maxColorAttachments);
124-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_COLOR_SAMPLE_COUNTS",limits.sampledImageColorSampleCounts.value);
125-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_INTEGER_SAMPLE_COUNTS",limits.sampledImageIntegerSampleCounts.value);
126-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_DEPTH_SAMPLE_COUNTS",limits.sampledImageDepthSampleCounts.value);
127-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_STENCIL_SAMPLE_COUNTS",limits.sampledImageStencilSampleCounts.value);
128-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_STORAGE_IMAGE_SAMPLE_COUNTS",limits.storageImageSampleCounts.value);
124+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_COLOR_SAMPLE_COUNTS", static_cast<uint32_t>(limits.sampledImageColorSampleCounts.value));
125+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_INTEGER_SAMPLE_COUNTS", static_cast<uint32_t>(limits.sampledImageIntegerSampleCounts.value));
126+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_DEPTH_SAMPLE_COUNTS", static_cast<uint32_t>(limits.sampledImageDepthSampleCounts.value));
127+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLED_IMAGE_STENCIL_SAMPLE_COUNTS", static_cast<uint32_t>(limits.sampledImageStencilSampleCounts.value));
128+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_STORAGE_IMAGE_SAMPLE_COUNTS", static_cast<uint32_t>(limits.storageImageSampleCounts.value));
129129
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_SAMPLE_MASK_WORDS",limits.maxSampleMaskWords);
130130
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_TIMESTAMP_COMPUTE_AND_GRAPHICS",limits.timestampComputeAndGraphics);
131131
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_TIMESTAMP_PERIOD_IN_NANO_SECONDS",limits.timestampPeriodInNanoSeconds);
@@ -149,7 +149,7 @@ void ILogicalDevice::addCommonShaderDefines(std::ostringstream& pool, const bool
149149
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_VERTEX_OUTPUT_COMPONENTS",limits.maxVertexOutputComponents);
150150

151151
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SUBGROUP_SIZE",limits.subgroupSize);
152-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SUBGROUP_OPS_SHADER_STAGES",limits.subgroupOpsShaderStages.value);
152+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SUBGROUP_OPS_SHADER_STAGES", static_cast<uint32_t>(limits.subgroupOpsShaderStages.value));
153153
if (limits.shaderSubgroupBasic) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_SUBGROUP_BASIC");
154154
if (limits.shaderSubgroupVote) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_SUBGROUP_VOTE");
155155
if (limits.shaderSubgroupArithmetic) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_SUBGROUP_ARITHMETIC");
@@ -213,7 +213,7 @@ void ILogicalDevice::addCommonShaderDefines(std::ostringstream& pool, const bool
213213
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_SUBGROUP_SIZE",limits.maxSubgroupSize);
214214
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_COMPUTE_WORKGROUP_SUBGROUPS",limits.maxComputeWorkgroupSubgroups);
215215

216-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_REQUIRED_SUBGROUP_SIZE_STAGES",limits.requiredSubgroupSizeStages.value);
216+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_REQUIRED_SUBGROUP_SIZE_STAGES", static_cast<uint32_t>(limits.requiredSubgroupSizeStages.value));
217217

218218
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_STORAGE_TEXEL_BUFFER_OFFSET_ALIGNMENT_BYTES",limits.minSubgroupSize);
219219
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_UNIFORM_TEXEL_BUFFER_OFFSET_ALIGNMENT_BYTES",limits.maxSubgroupSize);
@@ -277,7 +277,7 @@ void ILogicalDevice::addCommonShaderDefines(std::ostringstream& pool, const bool
277277

278278
if (limits.variableSampleLocations) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_VARIABLE_SAMPLE_LOCATIONS");
279279
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLE_LOCATION_SUBPIXEL_BITS",limits.sampleLocationSubPixelBits);
280-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLE_LOCATION_SAMPLE_COUNTS",limits.sampleLocationSampleCounts.value);
280+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLE_LOCATION_SAMPLE_COUNTS",static_cast<uint32_t>(limits.sampleLocationSampleCounts.value));
281281
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_SAMPLE_LOCATION_GRID_SIZE_X",limits.maxSampleLocationGridSize.width);
282282
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_SAMPLE_LOCATION_GRID_SIZE_Y",limits.maxSampleLocationGridSize.height);
283283
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SAMPLE_LOCATION_COORDINATE_RANGE_X",limits.sampleLocationCoordinateRange[0]);
@@ -310,7 +310,7 @@ void ILogicalDevice::addCommonShaderDefines(std::ostringstream& pool, const bool
310310
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_RAY_DISPATCH_INVOCATION_COUNT",limits.maxRayDispatchInvocationCount);
311311
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_GROUP_HANDLE_ALIGNMENT",limits.shaderGroupHandleAlignment);
312312
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_RAY_HIT_ATTRIBUTE_SIZE",limits.maxRayHitAttributeSize);
313-
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_COOPERATIVE_MATRIX_SUPPORTED_STAGES",limits.cooperativeMatrixSupportedStages.value);
313+
addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_COOPERATIVE_MATRIX_SUPPORTED_STAGES", static_cast<uint32_t>(limits.cooperativeMatrixSupportedStages.value));
314314

315315
if (limits.shaderOutputViewportIndex) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_OUTPUT_VIEWPORT_INDEX");
316316
if (limits.shaderOutputLayer) addShaderDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_OUTPUT_LAYER");

0 commit comments

Comments
 (0)