forked from MoonsideGames/Refresh
				
			Compare commits
	
		
			No commits in common. "0555023100072c77a170bd6190dc40cd8cc33d25" and "509bd278c760c132ddfa7da22ba28a3921719377" have entirely different histories. 
		
	
	
		
			0555023100
			...
			509bd278c7
		
	
		|  | @ -465,11 +465,11 @@ static void D3D11_DrawPrimitives( | ||||||
| 	uint32_t vertexParamOffset, | 	uint32_t vertexParamOffset, | ||||||
| 	uint32_t fragmentParamOffset | 	uint32_t fragmentParamOffset | ||||||
| ) { | ) { | ||||||
| 	D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*) commandBuffer; | 	D3D11CommandBuffer *cmdbuf = (D3D11CommandBuffer*) commandBuffer; | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_Draw( | 	ID3D11DeviceContext_Draw( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		PrimitiveVerts(d3d11CommandBuffer->graphicsPipeline->primitiveType, primitiveCount), | 		PrimitiveVerts(cmdbuf->graphicsPipeline->primitiveType, primitiveCount), | ||||||
| 		vertexStart | 		vertexStart | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
|  | @ -789,10 +789,6 @@ static Refresh_GraphicsPipeline* D3D11_CreateGraphicsPipeline( | ||||||
| 
 | 
 | ||||||
| 	if (vertShaderModule->shader == NULL) | 	if (vertShaderModule->shader == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		/* FIXME:
 |  | ||||||
| 		 * Could we store a flag in the shaderc output to mark if a shader is vertex/fragment? |  | ||||||
| 		 * Then we could compile on shader module creation instead of at bind time. |  | ||||||
| 		 */ |  | ||||||
| 		res = renderer->D3DCompileFunc( | 		res = renderer->D3DCompileFunc( | ||||||
| 			vertShaderModule->shaderSource, | 			vertShaderModule->shaderSource, | ||||||
| 			vertShaderModule->shaderSourceLength, | 			vertShaderModule->shaderSourceLength, | ||||||
|  | @ -1316,48 +1312,48 @@ static void D3D11_BindGraphicsPipeline( | ||||||
| 	Refresh_GraphicsPipeline *graphicsPipeline | 	Refresh_GraphicsPipeline *graphicsPipeline | ||||||
| ) { | ) { | ||||||
| 	D3D11Renderer *renderer = (D3D11Renderer*) driverData; | 	D3D11Renderer *renderer = (D3D11Renderer*) driverData; | ||||||
| 	D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*) commandBuffer; | 	D3D11CommandBuffer *cmdbuf = (D3D11CommandBuffer*) commandBuffer; | ||||||
| 	D3D11GraphicsPipeline *pipeline = (D3D11GraphicsPipeline*) graphicsPipeline; | 	D3D11GraphicsPipeline *pipeline = (D3D11GraphicsPipeline*) graphicsPipeline; | ||||||
| 
 | 
 | ||||||
| 	d3d11CommandBuffer->graphicsPipeline = pipeline; | 	cmdbuf->graphicsPipeline = pipeline; | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_OMSetBlendState( | 	ID3D11DeviceContext_OMSetBlendState( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->colorAttachmentBlendState, | 		pipeline->colorAttachmentBlendState, | ||||||
| 		pipeline->blendConstants, | 		pipeline->blendConstants, | ||||||
| 		pipeline->multisampleState.sampleMask | 		pipeline->multisampleState.sampleMask | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_OMSetDepthStencilState( | 	ID3D11DeviceContext_OMSetDepthStencilState( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->depthStencilState, | 		pipeline->depthStencilState, | ||||||
| 		pipeline->stencilRef | 		pipeline->stencilRef | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_IASetPrimitiveTopology( | 	ID3D11DeviceContext_IASetPrimitiveTopology( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		RefreshToD3D11_PrimitiveType[pipeline->primitiveType] | 		RefreshToD3D11_PrimitiveType[pipeline->primitiveType] | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_IASetInputLayout( | 	ID3D11DeviceContext_IASetInputLayout( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->inputLayout | 		pipeline->inputLayout | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_RSSetState( | 	ID3D11DeviceContext_RSSetState( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->rasterizerState | 		pipeline->rasterizerState | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_VSSetShader( | 	ID3D11DeviceContext_VSSetShader( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->vertexShader, | 		pipeline->vertexShader, | ||||||
| 		NULL, | 		NULL, | ||||||
| 		0 | 		0 | ||||||
| 	); | 	); | ||||||
| 
 | 
 | ||||||
| 	ID3D11DeviceContext_PSSetShader( | 	ID3D11DeviceContext_PSSetShader( | ||||||
| 		d3d11CommandBuffer->context, | 		cmdbuf->context, | ||||||
| 		pipeline->fragmentShader, | 		pipeline->fragmentShader, | ||||||
| 		NULL, | 		NULL, | ||||||
| 		0 | 		0 | ||||||
|  | @ -1369,22 +1365,7 @@ static void D3D11_SetViewport( | ||||||
| 	Refresh_CommandBuffer *commandBuffer, | 	Refresh_CommandBuffer *commandBuffer, | ||||||
| 	Refresh_Viewport *viewport | 	Refresh_Viewport *viewport | ||||||
| ) { | ) { | ||||||
| 	D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*) commandBuffer; | 	NOT_IMPLEMENTED | ||||||
| 	D3D11_VIEWPORT vp = |  | ||||||
| 	{ |  | ||||||
| 		viewport->x, |  | ||||||
| 		viewport->y, |  | ||||||
| 		viewport->w, |  | ||||||
| 		viewport->h, |  | ||||||
| 		viewport->minDepth, |  | ||||||
| 		viewport->maxDepth |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	ID3D11DeviceContext_RSSetViewports( |  | ||||||
| 		d3d11CommandBuffer->context, |  | ||||||
| 		1, |  | ||||||
| 		&vp |  | ||||||
| 	); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void D3D11_SetScissor( | static void D3D11_SetScissor( | ||||||
|  | @ -1392,20 +1373,7 @@ static void D3D11_SetScissor( | ||||||
| 	Refresh_CommandBuffer *commandBuffer, | 	Refresh_CommandBuffer *commandBuffer, | ||||||
| 	Refresh_Rect *scissor | 	Refresh_Rect *scissor | ||||||
| ) { | ) { | ||||||
| 	D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*)commandBuffer; | 	NOT_IMPLEMENTED | ||||||
| 	D3D11_RECT rect = |  | ||||||
| 	{ |  | ||||||
| 		scissor->x, |  | ||||||
| 		scissor->y, |  | ||||||
| 		scissor->x + scissor->w, |  | ||||||
| 		scissor->y + scissor->h |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	ID3D11DeviceContext_RSSetScissorRects( |  | ||||||
| 		d3d11CommandBuffer->context, |  | ||||||
| 		1, |  | ||||||
| 		&rect |  | ||||||
| 	); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void D3D11_BindVertexBuffers( | static void D3D11_BindVertexBuffers( | ||||||
|  | @ -1771,7 +1739,7 @@ static Refresh_Texture* D3D11_AcquireSwapchainTexture( | ||||||
| 	uint32_t *pHeight | 	uint32_t *pHeight | ||||||
| ) { | ) { | ||||||
| 	D3D11Renderer *renderer = (D3D11Renderer*) driverData; | 	D3D11Renderer *renderer = (D3D11Renderer*) driverData; | ||||||
| 	D3D11CommandBuffer *d3d11CommandBuffer = (D3D11CommandBuffer*) commandBuffer; | 	D3D11CommandBuffer *cmdbuf = (D3D11CommandBuffer*) commandBuffer; | ||||||
| 	D3D11WindowData *windowData; | 	D3D11WindowData *windowData; | ||||||
| 	D3D11SwapchainData *swapchainData; | 	D3D11SwapchainData *swapchainData; | ||||||
| 	DXGI_SWAP_CHAIN_DESC swapchainDesc; | 	DXGI_SWAP_CHAIN_DESC swapchainDesc; | ||||||
|  | @ -1806,7 +1774,7 @@ static Refresh_Texture* D3D11_AcquireSwapchainTexture( | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/* Let the command buffer know it's associated with this swapchain. */ | 	/* Let the command buffer know it's associated with this swapchain. */ | ||||||
| 	d3d11CommandBuffer->swapchainData = swapchainData; | 	cmdbuf->swapchainData = swapchainData; | ||||||
| 
 | 
 | ||||||
| 	/* Send the dimensions to the out parameters. */ | 	/* Send the dimensions to the out parameters. */ | ||||||
| 	*pWidth = swapchainData->texture.twod.width; | 	*pWidth = swapchainData->texture.twod.width; | ||||||
|  | @ -1814,6 +1782,7 @@ static Refresh_Texture* D3D11_AcquireSwapchainTexture( | ||||||
| 
 | 
 | ||||||
| 	/* Return the swapchain texture */ | 	/* Return the swapchain texture */ | ||||||
| 	return (Refresh_Texture*) &swapchainData->texture; | 	return (Refresh_Texture*) &swapchainData->texture; | ||||||
|  | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static Refresh_TextureFormat D3D11_GetSwapchainFormat( | static Refresh_TextureFormat D3D11_GetSwapchainFormat( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue