some housekeeping
This commit is contained in:
@@ -103,8 +103,7 @@ gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gn
|
||||
|
||||
MTLDepthStencilDescriptor* depthStencilDesc = [[MTLDepthStencilDescriptor alloc] init];
|
||||
depthStencilDesc.depthWriteEnabled = info.depthStencil.depthWriteEnable;
|
||||
depthStencilDesc.depthCompareFunction = MTLCompareFunctionLess;
|
||||
|
||||
depthStencilDesc.depthCompareFunction = mtlGrypnCompareOperation(info.depthStencil.operation);
|
||||
graphicsPipeline->graphicsPipeline->depthState = [device->outputDevice->device newDepthStencilStateWithDescriptor:depthStencilDesc];
|
||||
|
||||
[descriptor setVertexDescriptor:vertexDescriptor];
|
||||
|
@@ -31,14 +31,6 @@ gnReturnCode createMetalShaderModule(gnShaderModule module, gnDevice device, gnS
|
||||
|
||||
spvc_compiler_create_shader_resources(compiler, &resources);
|
||||
|
||||
spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER, &list, &count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
uint32_t set = spvc_compiler_get_decoration(compiler, list[i].id, SpvDecorationDescriptorSet),
|
||||
binding = spvc_compiler_get_decoration(compiler, list[i].id, SpvDecorationBinding),
|
||||
mslBinding = spvc_compiler_msl_get_automatic_resource_binding(compiler, list[i].id);
|
||||
printf("%s: set %ui, binding %ui, mslBinding %ui\n", list[i].name, set, binding, mslBinding);
|
||||
}
|
||||
|
||||
spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_UNIFORM_BUFFER, &list, &count);
|
||||
// [[buffer(0)]] is reserved for stage_in, [[buffer(1)]] is reserved for push_constant
|
||||
uint32_t currentBufferBinding = 2, currentTextureBinding = 0;
|
||||
|
@@ -46,7 +46,7 @@ gnReturnCode createMetalTexture(gnTexture texture, gnDevice device, const gnText
|
||||
void metalTextureData(gnTextureHandle texture, void* pixelData) {
|
||||
MTLRegion region = {
|
||||
{ 0, 0, 0 },
|
||||
{texture->info.extent.width, texture->info.extent.width, texture->info.extent.depth}
|
||||
{texture->info.extent.width, texture->info.extent.height, texture->info.extent.depth}
|
||||
};
|
||||
|
||||
NSUInteger bytesPerRow = 4 * texture->info.extent.width; // TODO: fix this should not be set to 4
|
||||
@@ -54,7 +54,6 @@ void metalTextureData(gnTextureHandle texture, void* pixelData) {
|
||||
mipmapLevel:0
|
||||
withBytes:pixelData
|
||||
bytesPerRow:bytesPerRow];
|
||||
|
||||
}
|
||||
|
||||
void metalDestroyTexture(gnTexture texture) {
|
||||
|
Reference in New Issue
Block a user